/home/silvwabw/www/wp-content/plugins/gutenverse-form/assets/js/frontend/input-multiselect.js
(()=>{"use strict";var e,t,r,n,o={},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,c),r.exports}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function a(e){var t=function(e){if("object"!=u(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:t+""}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}c.m=o,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var o=Object.create(null);c.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var u=2&n&&r;("object"==typeof u||"function"==typeof u)&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach(e=>i[e]=()=>r[e]);return i.default=()=>r,c.d(o,i),o},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce((t,r)=>(c.f[r](e,t),t),[])),c.u=e=>"chunk-choices.js",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},n="gutenverse-form:",c.l=(e,t,o,i)=>{if(r[e])r[e].push(t);else{var u,a;if(void 0!==o)for(var l=document.getElementsByTagName("script"),f=0;f<l.length;f++){var s=l[f];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==n+o){u=s;break}}u||(a=!0,(u=document.createElement("script")).charset="utf-8",c.nc&&u.setAttribute("nonce",c.nc),u.setAttribute("data-webpack",n+o),u.src=e),r[e]=[t];var p=(t,n)=>{u.onerror=u.onload=null,clearTimeout(d);var o=r[e];if(delete r[e],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(n)),t)return t(n)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=p.bind(null,u.onerror),u.onload=p.bind(null,u.onload),a&&document.head.appendChild(u)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;c.g.importScripts&&(e=c.g.location+"");var t=c.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=e})(),(()=>{var e={561:0};c.f.j=(t,r)=>{var n=c.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise((r,o)=>n=e[t]=[r,o]);r.push(n[2]=o);var i=c.p+c.u(t),u=new Error;c.l(i,r=>{if(c.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;u.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,n[1](u)}},"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[i,u,a]=r,l=0;if(i.some(t=>0!==e[t])){for(n in u)c.o(u,n)&&(c.m[n]=u[n]);a&&a(c)}for(t&&t(r);l<i.length;l++)o=i[l],c.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=self.webpackChunkgutenverse_form=self.webpackChunkgutenverse_form||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();const p=gutenverseCoreFrontend;function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}var b=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=arguments,r=f(r=t),function(e,t){if(t&&("object"==u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,d()?Reflect.construct(r,n||[],f(e).constructor):r.apply(e,n));var e,r,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(t,e),r=t,(n=[{key:"init",value:function(){var e=this;this.choiceInstance=null,this._elements.map(function(t){e._selectItems(t)}),this.placeholder=""}},{key:"_choiceFunc",value:function(e){return c.e(317).then(c.t.bind(c,374,23)).then(function(t){return new(0,t.default)(e,{removeItemButton:!0,shouldSort:!1,placeholder:!1})})}},{key:"_selectItems",value:function(e){var t=this;(0,p.u)(e).find(".gutenverse-input-multiselect").map(function(r){t.choiceInstance=t._choiceFunc(r),r.addEventListener("change",function(t){if(t.target.length>0){var r=(0,p.u)(e).find(".choices__input.choices__input--cloned");this.placeholder=r.nodes[0].placeholder,r.nodes[0].placeholder=""}})})}},{key:"destroy",value:function(){this.choiceInstance.destroy()}}])&&l(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(p.Default),h=(0,p.u)(".guten-form-input-multiselect");h&&new b(h)})();