(()=>{function t(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var a,i,r=[],l=!0,o=!1;try{for(n=n.call(t);!(l=(a=n.next()).done)&&(r.push(a.value),!e||r.length!==e);l=!0);}catch(t){o=!0,i=t}finally{try{l||null==n.return||n.return()}finally{if(o)throw i}}return r}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return e(t,n);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return e(t,n)}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}function n(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}var a=function(){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e)}var a,i,r;return a=e,(i=[{key:"init",value:function(){$(document).find(".tags").each((function(t,e){if(!$(e).hasClass("tagify")){var n=new Tagify(e,{keepInvalidTags:void 0===$(e).data("keep-invalid-tags")||$(e).data("keep-invalid-tags"),enforceWhitelist:void 0!==$(e).data("enforce-whitelist")&&$(e).data("enforce-whitelist"),delimiters:void 0!==$(e).data("delimiters")?$(e).data("delimiters"):",",whitelist:e.value?e.value.trim().split(/\s*,\s*/):[],userInput:void 0===$(e).data("user-input")||$(e).data("user-input")});$(e).data("url")&&n.on("input",(function(t){n.settings.whitelist.length=0,n.loading(!0).dropdown.hide.call(n),$httpClient.make().get($(e).data("url")).then((function(e){var a=e.data;n.settings.whitelist=a,n.loading(!1).dropdown.show.call(n,t.detail.value)}))}))}})),document.querySelectorAll(".list-tagify").forEach((function(e){if(e.dataset.list&&!$(e).hasClass("tagify")){for(var n=JSON.parse(e.dataset.list),a=[],i=0,r=Object.entries(n);i<r.length;i++){var l=t(r[i],2),o=l[0],s=l[1];a.push({value:o,name:s})}var c=String(e.value).split(","),u=a.filter((function(t){if(c.includes(String(t.value)))return{value:t.id,name:t.name}}));new Tagify(e,{tagTextProp:"name",enforceWhitelist:!0,skipInvalid:!0,dropdown:{closeOnSelect:!1,enabled:0,classname:"users-list",searchKeys:["value","name"]},templates:{tag:function(t){return'\n                <tag title="'.concat(t.title||t.name,"\"\n                        contenteditable='false'\n                        spellcheck='false'\n                        tabIndex=\"-1\"\n                        class=\"").concat(this.settings.classNames.tag," ").concat(t.class?t.class:"",'"\n                        ').concat(this.getAttributes(t),">\n                    <x title='' class='tagify__tag__removeBtn' role='button' aria-label='remove tag'></x>\n                    <div class=\"d-flex align-items-center\">\n                        <span class='tagify__tag-text'>").concat(t.name,"</span>\n                    </div>\n                </tag>\n            ")},dropdownItem:function(t){return"\n                <div ".concat(this.getAttributes(t),'\n                    class="tagify__dropdown__item d-flex align-items-center ').concat(t.class?t.class:"",'"\n                    tabindex="0"\n                    role="option">\n\n                    <div class="d-flex flex-column">\n                        <strong>').concat(t.name,"</strong>\n                    </div>\n                </div>\n            ")}},whitelist:a,originalInputValueFormat:function(t){return t.map((function(t){return t.value})).join(",")}}).loadOriginalValues(u)}}))}}])&&n(a.prototype,i),r&&n(a,r),Object.defineProperty(a,"prototype",{writable:!1}),e}();$((function(){(new a).init()}))})();