From 313cc21af1253abf44dbe205c1fe8952b48bed2b Mon Sep 17 00:00:00 2001 From: Andreas Fernandez Date: Thu, 23 Jun 2022 15:40:09 +0200 Subject: [PATCH] [BUGFIX] Use more precise relative time --- assets/js/app.js | 15 +++++++++++++-- src/Resources/public/app.133bae85.js | 2 ++ ...js.LICENSE.txt => app.133bae85.js.LICENSE.txt} | 0 src/Resources/public/app.9aaea0d2.js | 2 -- src/Resources/public/entrypoints.json | 2 +- src/Resources/public/manifest.json | 2 +- 6 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 src/Resources/public/app.133bae85.js rename src/Resources/public/{app.9aaea0d2.js.LICENSE.txt => app.133bae85.js.LICENSE.txt} (100%) delete mode 100644 src/Resources/public/app.9aaea0d2.js diff --git a/assets/js/app.js b/assets/js/app.js index 7c8dff03..96c92093 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -32,7 +32,7 @@ import 'prismjs/components/prism-rest'; import 'prismjs/plugins/command-line/prism-command-line'; import 'prismjs/plugins/keep-markup/prism-keep-markup'; -import {DateTime} from 'luxon'; +import {DateTime, Duration} from 'luxon'; function convertDateTimes() { Array.from(document.querySelectorAll('[data-processor="localdatetime"]')).forEach(function (element) { @@ -62,7 +62,18 @@ function convertDates() { function convertRelativeTime() { Array.from(document.querySelectorAll('[data-processor="relativetime"]')).forEach(function (element) { let value = element.dataset.value; - let text = DateTime.fromISO(value).toRelative(); + const dtTarget = DateTime.fromISO(value); + const diff = dtTarget.diffNow(['years', 'months', 'days', 'hours', 'minutes', 'seconds']); + const configPrototype = { + years: diff.years, + months: diff.months, + days: diff.days, + hours: diff.hours, + minutes: diff.minutes, + }; + // Remove "0" values + const durationConfig = Object.fromEntries(Object.entries(configPrototype).filter(([_, v]) => v !== 0)); + let text = Duration.fromObject(durationConfig).toHuman(); element.textContent = text; }); } diff --git a/src/Resources/public/app.133bae85.js b/src/Resources/public/app.133bae85.js new file mode 100644 index 00000000..0fa50a12 --- /dev/null +++ b/src/Resources/public/app.133bae85.js @@ -0,0 +1,2 @@ +/*! For license information please see app.133bae85.js.LICENSE.txt */ +!function(){var t={18634:function(t,e,n){var i=n(19755);t.exports=function(){"use strict";function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function e(e){for(var i=1;i(t=""+t,e=""+e,i&&(t=t.trim(),e=e.trim()),n?t==e:t.toLowerCase()==e.toLowerCase()),o=(t,e)=>t&&Array.isArray(t)&&t.map((t=>s(t,e)));function s(t,e){var n,i={};for(n in t)e.indexOf(n)<0&&(i[n]=t[n]);return i}function a(t){var e=document.createElement("div");return t.replace(/\&#?[0-9a-z]+;/gi,(function(t){return e.innerHTML=t,e.innerText}))}function l(t){return(new DOMParser).parseFromString(t.trim(),"text/html").body.firstElementChild}function c(t,e){for(e=e||"previous";t=t[e+"Sibling"];)if(3==t.nodeType)return t}function u(t){return"string"==typeof t?t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/`|'/g,"'"):t}function h(t){var e=Object.prototype.toString.call(t).split(" ")[1].slice(0,-1);return t===Object(t)&&"Array"!=e&&"Function"!=e&&"RegExp"!=e&&"HTMLUnknownElement"!=e}function d(t,e,n){function i(t,e){for(var n in e)if(e.hasOwnProperty(n)){if(h(e[n])){h(t[n])?i(t[n],e[n]):t[n]=Object.assign({},e[n]);continue}if(Array.isArray(e[n])){t[n]=Object.assign([],e[n]);continue}t[n]=e[n]}}return t instanceof Object||(t={}),i(t,e),n&&i(t,n),t}function f(){const t=[],e={};for(let n of arguments)for(let i of n)h(i)?e[i.value]||(t.push(i),e[i.value]=1):t.includes(i)||t.push(i);return t}function p(t){return String.prototype.normalize?"string"==typeof t?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:t}var g=()=>/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent);function m(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)))}function v(t){return t&&t.classList&&t.classList.contains(this.settings.classNames.tag)}var y={delimiters:",",pattern:null,tagTextProp:"value",maxTags:1/0,callbacks:{},addTagOnBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,keepInvalidTags:!1,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:()=>{},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:" "},autoComplete:{enabled:!0,rightKey:!1},classNames:{namespace:"tagify",mixMode:"tagify--mix",selectMode:"tagify--select",input:"tagify__input",focus:"tagify--focus",tagNoAnimation:"tagify--noAnim",tagInvalid:"tagify--invalid",tagNotAllowed:"tagify--notAllowed",scopeLoading:"tagify--loading",hasMaxTags:"tagify--hasMaxTags",hasNoTags:"tagify--noTags",empty:"tagify--empty",inputInvalid:"tagify__input--invalid",dropdown:"tagify__dropdown",dropdownWrapper:"tagify__dropdown__wrapper",dropdownHeader:"tagify__dropdown__header",dropdownFooter:"tagify__dropdown__footer",dropdownItem:"tagify__dropdown__item",dropdownItemActive:"tagify__dropdown__item--active",dropdownInital:"tagify__dropdown--initial",tag:"tagify__tag",tagText:"tagify__tag-text",tagX:"tagify__tag__removeBtn",tagLoading:"tagify__tag--loading",tagEditing:"tagify__tag--editable",tagFlash:"tagify__tag--flash",tagHide:"tagify__tag--hide"},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:["value","searchBy"],fuzzySearch:!0,caseSensitive:!1,accentedSearch:!0,highlightFirst:!1,closeOnSelect:!0,clearOnSelect:!0,position:"all",appendTarget:null},hooks:{beforeRemoveTag:()=>Promise.resolve(),beforePaste:()=>Promise.resolve(),suggestionClick:()=>Promise.resolve()}};function b(){this.dropdown={};for(let t in this._dropdown)this.dropdown[t]="function"==typeof this._dropdown[t]?this._dropdown[t].bind(this):this._dropdown[t];this.dropdown.refs()}var _={refs(){this.DOM.dropdown=this.parseTemplate("dropdown",[this.settings]),this.DOM.dropdown.content=this.DOM.dropdown.querySelector("[data-selector='tagify-dropdown-wrapper']")},show(t){var e,n,i,o=this.settings,s="mix"==o.mode&&!o.enforceWhitelist,a=!o.whitelist||!o.whitelist.length,l="manual"==o.dropdown.position;if(t=void 0===t?this.state.inputText:t,(!a||s||o.templates.dropdownItemNoMatch)&&!1!==o.dropdown.enable&&!this.state.isLoading){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems(t),t&&!this.suggestedListItems.length&&(this.trigger("dropdown:noMatch",t),o.templates.dropdownItemNoMatch&&(i=o.templates.dropdownItemNoMatch.call(this,{value:t}))),!i){if(this.suggestedListItems.length)t&&s&&!this.state.editing.scope&&!r(this.suggestedListItems[0].value,t)&&this.suggestedListItems.unshift({value:t});else{if(!t||!s||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide();this.suggestedListItems=[{value:t}]}n=""+(h(e=this.suggestedListItems[0])?e.value:e),o.autoComplete&&n&&0==n.indexOf(t)&&this.input.autocomplete.suggest.call(this,e)}this.dropdown.fill(i),o.dropdown.highlightFirst&&this.dropdown.highlightOption(this.DOM.dropdown.content.children[0]),this.state.dropdown.visible||setTimeout(this.dropdown.events.binding.bind(this)),this.state.dropdown.visible=t||!0,this.state.dropdown.query=t,this.setStateSelection(),l||setTimeout((()=>{this.dropdown.position(),this.dropdown.render()})),setTimeout((()=>{this.trigger("dropdown:show",this.DOM.dropdown)}))}},hide(t){var e=this.DOM,n=e.scope,i=e.dropdown,r="manual"==this.settings.dropdown.position&&!t;if(i&&document.body.contains(i)&&!r)return window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),n.setAttribute("aria-expanded",!1),i.parentNode.removeChild(i),setTimeout((()=>{this.state.dropdown.visible=!1}),100),this.state.dropdown.query=this.state.ddItemData=this.state.ddItemElm=this.state.selection=null,this.state.tag&&this.state.tag.value.length&&(this.state.flaggedTags[this.state.tag.baseOffset]=this.state.tag),this.trigger("dropdown:hide",i),this},toggle(t){this.dropdown[this.state.dropdown.visible&&!t?"hide":"show"]()},render(){var t,e,n=((e=this.DOM.dropdown.cloneNode(!0)).style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(e),t=e.clientHeight,e.parentNode.removeChild(e),t),i=this.settings;return"number"==typeof i.dropdown.enabled&&i.dropdown.enabled>=0?(this.DOM.scope.setAttribute("aria-expanded",!0),document.body.contains(this.DOM.dropdown)||(this.DOM.dropdown.classList.add(i.classNames.dropdownInital),this.dropdown.position(n),i.dropdown.appendTarget.appendChild(this.DOM.dropdown),setTimeout((()=>this.DOM.dropdown.classList.remove(i.classNames.dropdownInital)))),this):this},fill(t){t="string"==typeof t?t:this.dropdown.createListHTML(t||this.suggestedListItems);var e,n=this.settings.templates.dropdownContent.call(this,t);this.DOM.dropdown.content.innerHTML=(e=n)?e.replace(/\>[\r\n ]+\<").replace(/(<.*?>)|\s+/g,((t,e)=>e||" ")):""},refilter(t){t=t||this.state.dropdown.query||"",this.suggestedListItems=this.dropdown.filterListItems(t),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger("dropdown:updated",this.DOM.dropdown)},position(t){var e=this.settings.dropdown;if("manual"!=e.position){var n,i,r,o,s,a,l=this.DOM.dropdown,c=e.placeAbove,u=document.documentElement.clientHeight,h=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)>480?e.position:"all",d=this.DOM["input"==h?"input":"scope"];t=t||l.clientHeight,this.state.dropdown.visible&&("text"==h?(r=(n=this.getCaretGlobalPosition()).bottom,i=n.top,o=n.left,s="auto"):(a=function(t){for(var e=0,n=0;t;)e+=t.offsetLeft||0,n+=t.offsetTop||0,t=t.parentNode;return{left:e,top:n}}(this.settings.dropdown.appendTarget),i=(n=d.getBoundingClientRect()).top-a.top,r=n.bottom-1-a.top,o=n.left-a.left,s=n.width+"px"),i=Math.floor(i),r=Math.ceil(r),c=void 0===c?u-n.bottom{if(e)return this.dropdown.selectOption(e);this.dropdown.hide(),"mix"!=this.settings.mode&&this.addTags(this.state.inputText.trim(),!0)})).catch((t=>t));break;case"Backspace":{if("mix"==this.settings.mode||this.state.editing.scope)return;const t=this.input.raw.call(this);""!=t&&8203!=t.charCodeAt(0)||(!0===this.settings.backspace?this.removeTags():"edit"==this.settings.backspace&&setTimeout(this.editTag.bind(this),0))}}},onMouseOver(t){var e=t.target.closest(this.settings.classNames.dropdownItemSelector);e&&this.dropdown.highlightOption(e)},onMouseLeave(t){this.dropdown.highlightOption()},onClick(t){if(0==t.button&&t.target!=this.DOM.dropdown&&t.target!=this.DOM.dropdown.content){var e=t.target.closest(this.settings.classNames.dropdownItemSelector),n=this.dropdown.getSuggestionDataByNode(e);this.state.actions.selectOption=!0,setTimeout((()=>this.state.actions.selectOption=!1),50),this.settings.hooks.suggestionClick(t,{tagify:this,tagData:n,suggestionElm:e}).then((()=>{e?this.dropdown.selectOption(e):this.dropdown.hide()})).catch((t=>console.warn(t)))}},onScroll(t){var e=t.target,n=e.scrollTop/(e.scrollHeight-e.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(n)})}}},getSuggestionDataByNode(t){var e=t?+t.getAttribute("tagifySuggestionIdx"):-1;return this.suggestedListItems[e]||null},highlightOption(t,e){var n,i=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(i),this.state.ddItemElm.removeAttribute("aria-selected")),!t)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);n=this.suggestedListItems[this.getNodeIndex(t)],this.state.ddItemData=n,this.state.ddItemElm=t,t.classList.add(i),t.setAttribute("aria-selected",!0),e&&(t.parentNode.scrollTop=t.clientHeight+t.offsetTop-t.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,n),this.dropdown.position())},selectOption(t){var e=this.settings.dropdown,n=e.clearOnSelect,i=e.closeOnSelect;if(!t)return this.addTags(this.state.inputText,!0),void(i&&this.dropdown.hide());var r=t.getAttribute("tagifySuggestionIdx"),o=this.suggestedListItems[+r];this.trigger("dropdown:select",{data:o,elm:t}),r&&o?(this.state.editing?this.onEditTagDone(null,d({__isValid:!0},this.normalizeTags([o])[0])):this["mix"==this.settings.mode?"addMixTags":"addTags"]([o],n),this.DOM.input.parentNode&&(setTimeout((()=>{this.DOM.input.focus(),this.toggleFocusClass(!0)})),i?setTimeout(this.dropdown.hide.bind(this)):this.dropdown.refilter())):this.dropdown.hide()},selectAll(t){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems("");var e=this.dropdown.filterListItems("");return t||(e=this.state.dropdown.suggestions),this.addTags(e,!0),this},filterListItems(t,e){var n,i,r,o,s,a=this.settings,l=a.dropdown,c=(e=e||{},t="select"==a.mode&&this.value.length&&this.value[0][a.tagTextProp]==t?"":t,[]),u=[],d=a.whitelist,f=l.maxItems>=0?l.maxItems:1/0,g=l.searchKeys,m=0;if(!t||!g.length)return c=a.duplicates?d:d.filter((t=>!this.isTagDuplicate(h(t)?t.value:t))),this.state.dropdown.suggestions=c,c.slice(0,f);function v(t,e){return e.toLowerCase().split(" ").every((e=>t.includes(e.toLowerCase())))}for(s=l.caseSensitive?""+t:(""+t).toLowerCase();mg.includes(t)))?g:["value"];l.fuzzySearch&&!e.exact?(r=y.reduce(((t,e)=>t+" "+(n[e]||"")),"").toLowerCase().trim(),l.accentedSearch&&(r=p(r),s=p(s)),t=0==r.indexOf(s),f=r===s,i=v(r,s)):(t=!0,i=y.some((t=>{var i=""+(n[t]||"");return l.accentedSearch&&(i=p(i),s=p(s)),l.caseSensitive||(i=i.toLowerCase()),f=i===s,e.exact?i===s:0==i.indexOf(s)}))),o=!a.duplicates&&this.isTagDuplicate(h(n)?n.value:n),i&&!o&&(f&&t?u.push(n):"startsWith"==l.sortby&&t?c.unshift(n):c.push(n))}return this.state.dropdown.suggestions=u.concat(c),"function"==typeof l.sortby?l.sortby(u.concat(c),s):u.concat(c).slice(0,f)},getMappedValue(t){var e=this.settings.dropdown.mapValueTo;return e?"function"==typeof e?e(t):t[e]||t.value:t.value},createListHTML(t){return d([],t).map(((t,e)=>{"string"!=typeof t&&"number"!=typeof t||(t={value:t});var n=this.dropdown.getMappedValue(t);t.value="string"==typeof n?u(n):n;var i=this.settings.templates.dropdownItem.apply(this,[t,this]);return i.replace(/\s*tagifySuggestionIdx=(["'])(.*?)\1/gim,"").replace(">",` tagifySuggestionIdx="${e}">`)})).join("")}};const x="@yaireo/tagify/";var w,E={empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},S={wrapper:(t,e)=>`\n \n ​\n `,tag(t,e){var n=this.settings;return`\n \n
\n ${t[n.tagTextProp]||t.value}\n
\n
`},dropdown(t){var e=t.dropdown,n="manual"==e.position,i=`${t.classNames.dropdown}`;return`
\n
\n
`},dropdownContent(t){var e=this.settings,n=this.state.dropdown.suggestions;return`\n ${e.templates.dropdownHeader.call(this,n)}\n ${t}\n ${e.templates.dropdownFooter.call(this,n)}\n `},dropdownItem(t,e){return`
${t.value}
`},dropdownHeader:t=>"",dropdownFooter(t){var e=t.length-this.settings.dropdown.maxItems;return e>0?`
\n ${e} more items. Refine your search.\n
`:""},dropdownItemNoMatch:null},T={customBinding(){this.customEventsList.forEach((t=>{this.on(t,this.settings.callbacks[t])}))},binding(t=!0){var e,n=this.events.callbacks,r=t?"addEventListener":"removeEventListener";if(!this.state.mainEvents||!t){for(var o in this.state.mainEvents=t,t&&!this.listeners.main&&(this.events.bindGlobal.call(this),this.settings.isJQueryPlugin&&i(this.DOM.originalInput).on("tagify.removeAllTags",this.removeAllTags.bind(this))),e=this.listeners.main=this.listeners.main||{focus:["input",n.onFocusBlur.bind(this)],keydown:["input",n.onKeydown.bind(this)],click:["scope",n.onClickScope.bind(this)],dblclick:["scope",n.onDoubleClickScope.bind(this)],paste:["input",n.onPaste.bind(this)],drop:["input",n.onDrop.bind(this)]})this.DOM[e[o][0]][r](o,e[o][1]);clearInterval(this.listeners.main.originalInputValueObserverInterval),this.listeners.main.originalInputValueObserverInterval=setInterval(n.observeOriginalInputValue.bind(this),500);var s=this.listeners.main.inputMutationObserver||new MutationObserver(n.onInputDOMChange.bind(this));s&&s.disconnect(),"mix"==this.settings.mode&&s.observe(this.DOM.input,{childList:!0})}},bindGlobal(t){var e,n=this.events.callbacks,i=t?"removeEventListener":"addEventListener";if(t||!this.listeners.global)for(e of(this.listeners.global=this.listeners&&this.listeners.global||[{type:this.isIE?"keydown":"input",target:this.DOM.input,cb:n[this.isIE?"onInputIE":"onInput"].bind(this)},{type:"keydown",target:window,cb:n.onWindowKeyDown.bind(this)},{type:"blur",target:this.DOM.input,cb:n.onFocusBlur.bind(this)}],this.listeners.global))e.target[i](e.type,e.cb)},unbindGlobal(){this.events.bindGlobal.call(this,!0)},callbacks:{onFocusBlur(t){var e=t.target?this.trim(t.target.textContent):"",n=this.settings,i=t.type,r=n.dropdown.enabled>=0,o={relatedTarget:t.relatedTarget},s=this.state.actions.selectOption&&(r||!n.dropdown.closeOnSelect),a=this.state.actions.addNew&&r,l=t.relatedTarget&&v.call(this,t.relatedTarget)&&this.DOM.scope.contains(t.relatedTarget);if("blur"==i){if(t.relatedTarget===this.DOM.scope)return this.dropdown.hide(),void this.DOM.input.focus();this.postUpdate(),this.triggerChangeEvent()}if(!s&&!a)if(this.state.hasFocus="focus"==i&&+new Date,this.toggleFocusClass(this.state.hasFocus),"mix"!=n.mode){if("focus"==i)return this.trigger("focus",o),void(0!==n.dropdown.enabled&&n.userInput||this.dropdown.show(this.value.length?"":void 0));if("blur"==i){var c,u;this.trigger("blur",o),this.loading(!1);let t=n.enforceWhitelist?!!this.getWhitelistItem(null===(c=this.value)||void 0===c||null===(u=c[0])||void 0===u?void 0:u.value):n.keepInvalidTags;"select"==this.settings.mode&&l&&(e=""),"select"!==this.settings.mode&&e&&!this.state.actions.selectOption&&n.addTagOnBlur&&this.addTags(e,!0),"select"!=this.settings.mode||e&&t||this.removeTags()}this.DOM.input.removeAttribute("style"),this.dropdown.hide()}else"focus"==i?this.trigger("focus",o):"blur"==t.type&&(this.trigger("blur",o),this.loading(!1),this.dropdown.hide(),this.state.dropdown.visible=void 0,this.setStateSelection())},onWindowKeyDown(t){var e,n=document.activeElement;if(v.call(this,n)&&this.DOM.scope.contains(document.activeElement))switch(e=n.nextElementSibling,t.key){case"Backspace":this.settings.readonly||(this.removeTags(n),(e||this.DOM.input).focus());break;case"Enter":setTimeout(this.editTag.bind(this),0,n)}},onKeydown(t){var e=this.settings;"select"==e.mode&&e.enforceWhitelist&&this.value.length&&"Tab"!=t.key&&t.preventDefault();var n=this.trim(t.target.textContent);if(this.trigger("keydown",{originalEvent:this.cloneEvent(t)}),"mix"==e.mode){switch(t.key){case"Left":case"ArrowLeft":this.state.actions.ArrowLeft=!0;break;case"Delete":case"Backspace":if(this.state.editing)return;var i,r,o,s=document.getSelection(),l="Delete"==t.key&&s.anchorOffset==(s.anchorNode.length||0),u=s.anchorNode.previousSibling,h=1==s.anchorNode.nodeType||!s.anchorOffset&&u&&1==u.nodeType&&s.anchorNode.previousSibling,d=a(this.DOM.input.innerHTML),f=this.getTagElms();if("edit"==e.backspace&&h)return i=1==s.anchorNode.nodeType?null:s.anchorNode.previousElementSibling,setTimeout(this.editTag.bind(this),0,i),void t.preventDefault();if(g()&&h)return o=c(h),h.hasAttribute("readonly")||h.remove(),this.DOM.input.focus(),void setTimeout((()=>{this.placeCaretAfterNode(o),this.DOM.input.click()}));if("BR"==s.anchorNode.nodeName)return;if((l||h)&&1==s.anchorNode.nodeType?r=0==s.anchorOffset?l?f[0]:null:f[s.anchorOffset-1]:l?r=s.anchorNode.nextElementSibling:h&&(r=h),3==s.anchorNode.nodeType&&!s.anchorNode.nodeValue&&s.anchorNode.previousElementSibling&&t.preventDefault(),(h||l)&&!e.backspace)return void t.preventDefault();if("Range"!=s.type&&!s.anchorOffset&&s.anchorNode==this.DOM.input&&"Delete"!=t.key)return void t.preventDefault();if("Range"!=s.type&&r&&r.hasAttribute("readonly"))return void this.placeCaretAfterNode(c(r));clearTimeout(w),w=setTimeout((()=>{var t=document.getSelection(),e=a(this.DOM.input.innerHTML),n=!l&&t.anchorNode.previousSibling;if(e.length>=d.length&&n)if(v.call(this,n)&&!n.hasAttribute("readonly")){if(this.removeTags(n),this.fixFirefoxLastTagNoCaret(),2==this.DOM.input.children.length&&"BR"==this.DOM.input.children[1].tagName)return this.DOM.input.innerHTML="",this.value.length=0,!0}else n.remove();this.value=[].map.call(f,((t,e)=>{var n=this.tagData(t);if(t.parentNode||n.readonly)return n;this.trigger("remove",{tag:t,index:e,data:n})})).filter((t=>t))}),20)}return!0}switch(t.key){case"Backspace":"select"==e.mode&&e.enforceWhitelist&&this.value.length?this.removeTags():this.state.dropdown.visible&&"manual"!=e.dropdown.position||""!=t.target.textContent&&8203!=n.charCodeAt(0)||(!0===e.backspace?this.removeTags():"edit"==e.backspace&&setTimeout(this.editTag.bind(this),0));break;case"Esc":case"Escape":if(this.state.dropdown.visible)return;t.target.blur();break;case"Down":case"ArrowDown":this.state.dropdown.visible||this.dropdown.show();break;case"ArrowRight":{let t=this.state.inputSuggestion||this.state.ddItemData;if(t&&e.autoComplete.rightKey)return void this.addTags([t],!0);break}case"Tab":{let i="select"==e.mode;if(!n||i)return!0;t.preventDefault()}case"Enter":if(this.state.dropdown.visible||229==t.keyCode)return;t.preventDefault(),setTimeout((()=>{this.state.actions.selectOption||this.addTags(n,!0)}))}},onInput(t){if(this.postUpdate(),"mix"==this.settings.mode)return this.events.callbacks.onMixTagsInput.call(this,t);var e=this.input.normalize.call(this),n=e.length>=this.settings.dropdown.enabled,i={value:e,inputElm:this.DOM.input};i.isValid=this.validateTag({value:e}),this.state.inputText!=e&&(this.input.set.call(this,e,!1),-1!=e.search(this.settings.delimiters)?this.addTags(e)&&this.input.set.call(this):this.settings.dropdown.enabled>=0&&this.dropdown[n?"show":"hide"](e),this.trigger("input",i))},onMixTagsInput(t){var e,n,i,r,o,s,a,l,c=this.settings,u=this.value.length,h=this.getTagElms(),f=document.createDocumentFragment(),p=window.getSelection().getRangeAt(0),m=[].map.call(h,(t=>this.tagData(t).value));if("deleteContentBackward"==t.inputType&&g()&&this.events.callbacks.onKeydown.call(this,{target:t.target,key:"Backspace"}),this.value.slice().forEach((t=>{t.readonly&&!m.includes(t.value)&&f.appendChild(this.createTagElem(t))})),f.childNodes.length&&(p.insertNode(f),this.setRangeAtStartEnd(!1,f.lastChild)),h.length!=u)return this.value=[].map.call(this.getTagElms(),(t=>this.tagData(t))),void this.update({withoutChangeEvent:!0});if(this.hasMaxTags())return!0;if(window.getSelection&&(s=window.getSelection()).rangeCount>0&&3==s.anchorNode.nodeType){if((p=s.getRangeAt(0).cloneRange()).collapse(!0),p.setStart(s.focusNode,0),i=(e=p.toString().slice(0,p.endOffset)).split(c.pattern).length-1,(n=e.match(c.pattern))&&(r=e.slice(e.lastIndexOf(n[n.length-1]))),r){if(this.state.actions.ArrowLeft=!1,this.state.tag={prefix:r.match(c.pattern)[0],value:r.replace(c.pattern,"")},this.state.tag.baseOffset=s.baseOffset-this.state.tag.value.length,l=this.state.tag.value.match(c.delimiters))return this.state.tag.value=this.state.tag.value.replace(c.delimiters,""),this.state.tag.delimiters=l[0],this.addTags(this.state.tag.value,c.dropdown.clearOnSelect),void this.dropdown.hide();o=this.state.tag.value.length>=c.dropdown.enabled;try{a=(a=this.state.flaggedTags[this.state.tag.baseOffset]).prefix==this.state.tag.prefix&&a.value[0]==this.state.tag.value[0],this.state.flaggedTags[this.state.tag.baseOffset]&&!this.state.tag.value&&delete this.state.flaggedTags[this.state.tag.baseOffset]}catch(t){}(a||i{this.update({withoutChangeEvent:!0}),this.trigger("input",d({},this.state.tag,{textContent:this.DOM.input.textContent})),this.state.tag&&this.dropdown[o?"show":"hide"](this.state.tag.value)}),10)},onInputIE(t){var e=this;setTimeout((function(){e.events.callbacks.onInput.call(e,t)}))},observeOriginalInputValue(){this.DOM.originalInput.value!=this.DOM.originalInput.tagifyValue&&this.loadOriginalValues()},onClickScope(t){var e=this.settings,n=t.target.closest("."+e.classNames.tag),i=+new Date-this.state.hasFocus;if(t.target!=this.DOM.scope){if(!t.target.classList.contains(e.classNames.tagX))return n?(this.trigger("click",{tag:n,index:this.getNodeIndex(n),data:this.tagData(n),originalEvent:this.cloneEvent(t)}),void(1!==e.editTags&&1!==e.editTags.clicks||this.events.callbacks.onDoubleClickScope.call(this,t))):void(t.target==this.DOM.input&&("mix"==e.mode&&this.fixFirefoxLastTagNoCaret(),i>500)?this.state.dropdown.visible?this.dropdown.hide():0===e.dropdown.enabled&&"mix"!=e.mode&&this.dropdown.show(this.value.length?"":void 0):"select"==e.mode&&!this.state.dropdown.visible&&this.dropdown.show());this.removeTags(t.target.parentNode)}else this.state.hasFocus||this.DOM.input.focus()},onPaste(t){t.preventDefault();var e,n,i=this.settings;if("select"==i.mode&&i.enforceWhitelist||!i.userInput)return!1;i.readonly||(e=t.clipboardData||window.clipboardData,n=e.getData("Text"),i.hooks.beforePaste(t,{tagify:this,pastedText:n,clipboardData:e}).then((e=>{void 0===e&&(e=n),e&&(this.injectAtCaret(e,window.getSelection().getRangeAt(0)),"mix"==this.settings.mode?this.events.callbacks.onMixTagsInput.call(this,t):this.settings.pasteAsTags?this.addTags(this.state.inputText+e,!0):this.state.inputText=e)})).catch((t=>t)))},onDrop(t){t.preventDefault()},onEditTagInput(t,e){var n=t.closest("."+this.settings.classNames.tag),i=this.getNodeIndex(n),r=this.tagData(n),o=this.input.normalize.call(this,t),s=n.innerHTML!=n.__tagifyTagData.__originalHTML,a=this.validateTag(d(n.__tagifyTagData,{[this.settings.tagTextProp]:o}));s||!0!==t.originalIsValid||(a=!0),n.classList.toggle(this.settings.classNames.tagInvalid,!0!==a),r.__isValid=a,n.title=!0===a?r.title||r.value:a,o.length>=this.settings.dropdown.enabled&&(this.state.editing&&(this.state.editing.value=o),this.dropdown.show(o)),this.trigger("edit:input",{tag:n,index:i,data:d({},this.value[i],{newValue:o}),originalEvent:this.cloneEvent(e)})},onEditTagFocus(t){this.state.editing={scope:t,input:t.querySelector("[contenteditable]")}},onEditTagBlur(t){if(this.state.hasFocus||this.toggleFocusClass(),this.DOM.scope.contains(t)){var e,n,i=this.settings,r=t.closest("."+i.classNames.tag),o=this.input.normalize.call(this,t),s=this.tagData(r).__originalData,a=r.innerHTML!=r.__tagifyTagData.__originalHTML,l=this.validateTag({[i.tagTextProp]:o});if(o)if(a){if(e=this.hasMaxTags(),n=d({},s,{[i.tagTextProp]:this.trim(o),value:o,__isValid:l}),i.transformTag.call(this,n,s),!0!==(l=(!e||!0===s.__isValid)&&this.validateTag(n))){if(this.trigger("invalid",{data:n,tag:r,message:l}),i.editTags.keepInvalid)return;i.keepInvalidTags?n.__isValid=l:n=s}else i.keepInvalidTags&&(delete n.title,delete n["aria-invalid"],delete n.class);this.onEditTagDone(r,n)}else this.onEditTagDone(r,s);else this.onEditTagDone(r)}},onEditTagkeydown(t,e){switch(this.trigger("edit:keydown",{originalEvent:this.cloneEvent(t)}),t.key){case"Esc":case"Escape":e.innerHTML=e.__tagifyTagData.__originalHTML;case"Enter":case"Tab":t.preventDefault(),t.target.blur()}},onDoubleClickScope(t){var e,n,i=t.target.closest("."+this.settings.classNames.tag),r=this.settings;i&&r.userInput&&(e=i.classList.contains(this.settings.classNames.tagEditing),n=i.hasAttribute("readonly"),"select"==r.mode||r.readonly||e||n||!this.settings.editTags||this.editTag(i),this.toggleFocusClass(!0),this.trigger("dblclick",{tag:i,index:this.getNodeIndex(i),data:this.tagData(i)}))},onInputDOMChange(t){t.forEach((t=>{t.addedNodes.forEach((t=>{if(t)if("

"==t.outerHTML)t.replaceWith(document.createElement("br"));else if(1==t.nodeType&&t.querySelector(this.settings.classNames.tagSelector)){let e=document.createTextNode("");3==t.childNodes[0].nodeType&&"BR"!=t.previousSibling.nodeName&&(e=document.createTextNode("\n")),t.replaceWith(e,...[...t.childNodes].slice(0,-1)),this.placeCaretAfterNode(e.previousSibling)}else v.call(this,t)&&t.previousSibling&&"BR"==t.previousSibling.nodeName&&(t.previousSibling.replaceWith("\n​"),this.placeCaretAfterNode(t.previousSibling.previousSibling))})),t.removedNodes.forEach((t=>{t&&"BR"==t.nodeName&&v.call(this,e)&&(this.removeTags(e),this.fixFirefoxLastTagNoCaret())}))}));var e=this.DOM.input.lastChild;e&&""==e.nodeValue&&e.remove(),e&&"BR"==e.nodeName||this.DOM.input.appendChild(document.createElement("br"))}}};function k(t,e){if(!t){console.warn("Tagify:","input element not found",t);const e=new Proxy(this,{get:()=>()=>e});return e}if(t.previousElementSibling&&t.previousElementSibling.classList.contains("tagify"))return console.warn("Tagify: ","input element is already Tagified",t),this;var n;d(this,function(t){var e=document.createTextNode("");function n(t,n,i){i&&n.split(/\s+/g).forEach((n=>e[t+"EventListener"].call(e,n,i)))}return{off(t,e){return n("remove",t,e),this},on(t,e){return e&&"function"==typeof e&&n("add",t,e),this},trigger(n,r,o){var s;if(o=o||{cloneData:!0},n)if(t.settings.isJQueryPlugin)"remove"==n&&(n="removeTag"),i(t.DOM.originalInput).triggerHandler(n,[r]);else{try{var a="object"==typeof r?r:{value:r};if((a=o.cloneData?d({},a):a).tagify=this,r instanceof Object)for(var l in r)r[l]instanceof HTMLElement&&(a[l]=r[l]);s=new CustomEvent(n,{detail:a})}catch(t){console.warn(t)}e.dispatchEvent(s)}}}}(this)),this.isFirefox="undefined"!=typeof InstallTrigger,this.isIE=window.document.documentMode,e=e||{},this.getPersistedData=(n=e.id,t=>{let e,i="/"+t;if(1==localStorage.getItem(x+n+"/v",1))try{e=JSON.parse(localStorage[x+n+i])}catch(t){}return e}),this.setPersistedData=(t=>t?(localStorage.setItem(x+t+"/v",1),(e,n)=>{let i="/"+n,r=JSON.stringify(e);e&&n&&(localStorage.setItem(x+t+i,r),dispatchEvent(new Event("storage")))}):()=>{})(e.id),this.clearPersistedData=(t=>e=>{const n=x+"/"+t+"/";if(e)localStorage.removeItem(n+e);else for(let t in localStorage)t.includes(n)&&localStorage.removeItem(t)})(e.id),this.applySettings(t,e),this.state={inputText:"",editing:!1,actions:{},mixMode:{},dropdown:{},flaggedTags:{}},this.value=[],this.listeners={},this.DOM={},this.build(t),b.call(this),this.getCSSVars(),this.loadOriginalValues(),this.events.customBinding.call(this),this.events.binding.call(this),t.autofocus&&this.DOM.input.focus()}return k.prototype={_dropdown:_,helpers:{sameStr:r,removeCollectionProp:o,omit:s,isObject:h,parseHTML:l,escapeHTML:u,extend:d,concatWithoutDups:f,getUID:m,isNodeTag:v},customEventsList:["change","add","remove","invalid","input","click","keydown","focus","blur","edit:input","edit:beforeUpdate","edit:updated","edit:start","edit:keydown","dropdown:show","dropdown:hide","dropdown:select","dropdown:updated","dropdown:noMatch","dropdown:scroll"],dataProps:["__isValid","__removed","__originalData","__originalHTML","__tagId"],trim(t){return this.settings.trim&&t&&"string"==typeof t?t.trim():t},parseHTML:l,templates:S,parseTemplate(t,e){return t=this.settings.templates[t]||t,this.parseHTML(t.apply(this,e))},set whitelist(t){const e=t&&Array.isArray(t);this.settings.whitelist=e?t:[],this.setPersistedData(e?t:[],"whitelist")},get whitelist(){return this.settings.whitelist},applySettings(t,n){y.templates=this.templates;var i=this.settings=d({},y,n);i.disabled=t.hasAttribute("disabled"),i.readonly=i.readonly||t.hasAttribute("readonly"),i.placeholder=u(t.getAttribute("placeholder")||i.placeholder||""),i.required=t.hasAttribute("required");for(let t in i.classNames)Object.defineProperty(i.classNames,t+"Selector",{get(){return"."+this[t].split(" ")[0]}});if(this.isIE&&(i.autoComplete=!1),["whitelist","blacklist"].forEach((e=>{var n=t.getAttribute("data-"+e);n&&(n=n.split(i.delimiters))instanceof Array&&(i[e]=n)})),"autoComplete"in n&&!h(n.autoComplete)&&(i.autoComplete=y.autoComplete,i.autoComplete.enabled=n.autoComplete),"mix"==i.mode&&(i.autoComplete.rightKey=!0,i.delimiters=n.delimiters||null,i.tagTextProp&&!i.dropdown.searchKeys.includes(i.tagTextProp)&&i.dropdown.searchKeys.push(i.tagTextProp)),t.pattern)try{i.pattern=new RegExp(t.pattern)}catch(t){}if(this.settings.delimiters)try{i.delimiters=new RegExp(this.settings.delimiters,"g")}catch(t){}i.disabled&&(i.userInput=!1),this.TEXTS=e(e({},E),i.texts||{}),"select"!=i.mode&&i.userInput||(i.dropdown.enabled=0),i.dropdown.appendTarget=n.dropdown&&n.dropdown.appendTarget?n.dropdown.appendTarget:document.body;let r=this.getPersistedData("whitelist");Array.isArray(r)&&(this.whitelist=Array.isArray(i.whitelist)?f(i.whitelist,r):r)},getAttributes(t){var e,n=this.getCustomAttributes(t),i="";for(e in n)i+=" "+e+(void 0!==t[e]?`="${n[e]}"`:"");return i},getCustomAttributes(t){if(!h(t))return"";var e,n={};for(e in t)"__"!=e.slice(0,2)&&"class"!=e&&t.hasOwnProperty(e)&&void 0!==t[e]&&(n[e]=u(t[e]));return n},setStateSelection(){var t=window.getSelection(),e={anchorOffset:t.anchorOffset,anchorNode:t.anchorNode,range:t.getRangeAt&&t.rangeCount&&t.getRangeAt(0)};return this.state.selection=e,e},getCaretGlobalPosition(){const t=document.getSelection();if(t.rangeCount){const e=t.getRangeAt(0),n=e.startContainer,i=e.startOffset;let r,o;if(i>0)return o=document.createRange(),o.setStart(n,i-1),o.setEnd(n,i),r=o.getBoundingClientRect(),{left:r.right,top:r.top,bottom:r.bottom};if(n.getBoundingClientRect)return n.getBoundingClientRect()}return{left:-9999,top:-9999}},getCSSVars(){var t,e=getComputedStyle(this.DOM.scope,null);this.CSSVars={tagHideTransition:(({value:t,unit:e})=>"s"==e?1e3*t:t)(function(t){if(!t)return{};var e=(t=t.trim().split(" ")[0]).split(/\d+/g).filter((t=>t)).pop().trim();return{value:+t.split(e).filter((t=>t))[0].trim(),unit:e}}((t="tag-hide-transition",e.getPropertyValue("--"+t))))}},build(t){var e=this.DOM;this.settings.mixMode.integrated?(e.originalInput=null,e.scope=t,e.input=t):(e.originalInput=t,e.originalInput_tabIndex=t.tabIndex,e.scope=this.parseTemplate("wrapper",[t,this.settings]),e.input=e.scope.querySelector(this.settings.classNames.inputSelector),t.parentNode.insertBefore(e.scope,t),t.tabIndex=-1)},destroy(){this.events.unbindGlobal.call(this),this.DOM.scope.parentNode.removeChild(this.DOM.scope),this.DOM.originalInput.tabIndex=this.DOM.originalInput_tabIndex,this.dropdown.hide(!0),clearTimeout(this.dropdownHide__bindEventsTimeout)},loadOriginalValues(t){var e,n=this.settings;if(this.state.blockChangeEvent=!0,void 0===t){const e=this.getPersistedData("value");t=e&&!this.DOM.originalInput.value?e:n.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value}if(this.removeAllTags(),t)if("mix"==n.mode)this.parseMixTags(this.trim(t)),(e=this.DOM.input.lastChild)&&"BR"==e.tagName||this.DOM.input.insertAdjacentHTML("beforeend","
");else{try{JSON.parse(t)instanceof Array&&(t=JSON.parse(t))}catch(t){}this.addTags(t).forEach((t=>t&&t.classList.add(n.classNames.tagNoAnimation)))}else this.postUpdate();this.state.lastOriginalValueReported=n.mixMode.integrated?"":this.DOM.originalInput.value,this.state.blockChangeEvent=!1},cloneEvent(t){var e={};for(var n in t)e[n]=t[n];return e},loading(t){return this.state.isLoading=t,this.DOM.scope.classList[t?"add":"remove"](this.settings.classNames.scopeLoading),this},tagLoading(t,e){return t&&t.classList[e?"add":"remove"](this.settings.classNames.tagLoading),this},toggleClass(t,e){"string"==typeof t&&this.DOM.scope.classList.toggle(t,e)},toggleFocusClass(t){this.toggleClass(this.settings.classNames.focus,!!t)},triggerChangeEvent:function(){if(!this.settings.mixMode.integrated){var t=this.DOM.originalInput,e=this.state.lastOriginalValueReported!==t.value,n=new CustomEvent("change",{bubbles:!0});e&&(this.state.lastOriginalValueReported=t.value,n.simulated=!0,t._valueTracker&&t._valueTracker.setValue(Math.random()),t.dispatchEvent(n),this.trigger("change",this.state.lastOriginalValueReported),t.value=this.state.lastOriginalValueReported)}},events:T,fixFirefoxLastTagNoCaret(){},placeCaretAfterNode(t){if(t&&t.parentNode){var e=t.nextSibling,n=window.getSelection(),i=n.getRangeAt(0);n.rangeCount&&(i.setStartAfter(e||t),i.collapse(!0),n.removeAllRanges(),n.addRange(i))}},insertAfterTag(t,e){if(e=e||this.settings.mixMode.insertAfterTag,t&&t.parentNode&&e)return e="string"==typeof e?document.createTextNode(e):e,t.parentNode.insertBefore(e,t.nextSibling),e},editTag(t,e){t=t||this.getLastTag(),e=e||{},this.dropdown.hide();var n=this.settings;function i(){return t.querySelector(n.classNames.tagTextSelector)}var r=i(),o=this.getNodeIndex(t),s=this.tagData(t),a=this.events.callbacks,l=this,c=!0;if(r){if(!(s instanceof Object&&"editable"in s)||s.editable)return r.setAttribute("contenteditable",!0),t.classList.add(n.classNames.tagEditing),this.tagData(t,{__originalData:d({},s),__originalHTML:t.innerHTML}),r.addEventListener("focus",a.onEditTagFocus.bind(this,t)),r.addEventListener("blur",(function(){setTimeout((()=>a.onEditTagBlur.call(l,i())))})),r.addEventListener("input",a.onEditTagInput.bind(this,r)),r.addEventListener("keydown",(e=>a.onEditTagkeydown.call(this,e,t))),r.focus(),this.setRangeAtStartEnd(!1,r),e.skipValidation||(c=this.editTagToggleValidity(t)),r.originalIsValid=c,this.trigger("edit:start",{tag:t,index:o,data:s,isValid:c}),this}else console.warn("Cannot find element in Tag template: .",n.classNames.tagTextSelector)},editTagToggleValidity(t,e){var n;if(e=e||this.tagData(t))return(n=!("__isValid"in e)||!0===e.__isValid)||this.removeTagsFromValue(t),this.update(),t.classList.toggle(this.settings.classNames.tagNotAllowed,!n),e.__isValid;console.warn("tag has no data: ",t,e)},onEditTagDone(t,e){e=e||{};var n={tag:t=t||this.state.editing.scope,index:this.getNodeIndex(t),previousData:this.tagData(t),data:e};this.trigger("edit:beforeUpdate",n,{cloneData:!1}),this.state.editing=!1,delete e.__originalData,delete e.__originalHTML,t&&e[this.settings.tagTextProp]?(t=this.replaceTag(t,e),this.editTagToggleValidity(t,e),this.settings.a11y.focusableTags?t.focus():this.placeCaretAfterNode(t.previousSibling)):t&&this.removeTags(t),this.trigger("edit:updated",n),this.dropdown.hide(),this.settings.keepInvalidTags&&this.reCheckInvalidTags()},replaceTag(t,e){e&&e.value||(e=t.__tagifyTagData),e.__isValid&&1!=e.__isValid&&d(e,this.getInvalidTagAttrs(e,e.__isValid));var n=this.createTagElem(e);return t.parentNode.replaceChild(n,t),this.updateValueByDOMTags(),n},updateValueByDOMTags(){this.value.length=0,[].forEach.call(this.getTagElms(),(t=>{t.classList.contains(this.settings.classNames.tagNotAllowed.split(" ")[0])||this.value.push(this.tagData(t))})),this.update()},setRangeAtStartEnd(t,e){t="number"==typeof t?t:!!t,e=(e=e||this.DOM.input).lastChild||e;var n=document.getSelection();try{n.rangeCount>=1&&["Start","End"].forEach((i=>n.getRangeAt(0)["set"+i](e,t||e.length)))}catch(t){}},injectAtCaret(t,e){if(e=e||this.state.selection.range)return"string"==typeof t&&(t=document.createTextNode(t)),e.deleteContents(),e.insertNode(t),this.setRangeAtStartEnd(!1,t),this.updateValueByDOMTags(),this.update(),this},input:{set(t="",e=!0){var n=this.settings.dropdown.closeOnSelect;this.state.inputText=t,e&&(this.DOM.input.innerHTML=u(""+t)),!t&&n&&this.dropdown.hide.bind(this),this.input.autocomplete.suggest.call(this),this.input.validate.call(this)},raw(){return this.DOM.input.textContent},validate(){var t=!this.state.inputText||!0===this.validateTag({value:this.state.inputText});return this.DOM.input.classList.toggle(this.settings.classNames.inputInvalid,!t),t},normalize(t){var e=t||this.DOM.input,n=[];e.childNodes.forEach((t=>3==t.nodeType&&n.push(t.nodeValue))),n=n.join("\n");try{n=n.replace(/(?:\r\n|\r|\n)/g,this.settings.delimiters.source.charAt(0))}catch(t){}return n=n.replace(/\s/g," "),this.settings.trim&&(n=n.replace(/^\s+/,"")),this.trim(n)},autocomplete:{suggest(t){if(this.settings.autoComplete.enabled){"string"==typeof(t=t||{})&&(t={value:t});var e=t.value?""+t.value:"",n=e.substr(0,this.state.inputText.length).toLowerCase(),i=e.substring(this.state.inputText.length);e&&this.state.inputText&&n==this.state.inputText.toLowerCase()?(this.DOM.input.setAttribute("data-suggest",i),this.state.inputSuggestion=t):(this.DOM.input.removeAttribute("data-suggest"),delete this.state.inputSuggestion)}},set(t){var e=this.DOM.input.getAttribute("data-suggest"),n=t||(e?this.state.inputText+e:null);return!!n&&("mix"==this.settings.mode?this.replaceTextWithNode(document.createTextNode(this.state.tag.prefix+n)):(this.input.set.call(this,n),this.setRangeAtStartEnd()),this.input.autocomplete.suggest.call(this),this.dropdown.hide(),!0)}}},getTagIdx(t){return this.value.findIndex((e=>e.__tagId==(t||{}).__tagId))},getNodeIndex(t){var e=0;if(t)for(;t=t.previousElementSibling;)e++;return e},getTagElms(...t){var e="."+[...this.settings.classNames.tag.split(" "),...t].join(".");return[].slice.call(this.DOM.scope.querySelectorAll(e))},getLastTag(){var t=this.DOM.scope.querySelectorAll(`${this.settings.classNames.tagSelector}:not(.${this.settings.classNames.tagHide}):not([readonly])`);return t[t.length-1]},tagData:(t,e,n)=>t?(e&&(t.__tagifyTagData=n?e:d({},t.__tagifyTagData||{},e)),t.__tagifyTagData):(console.warn("tag element doesn't exist",t,e),e),isTagDuplicate(t,e,n){var i=this.settings;return"select"!=i.mode&&this.value.reduce(((o,s)=>r(this.trim(""+t),s.value,e||i.dropdown.caseSensitive)&&n!=s.__tagId?o+1:o),0)},getTagIndexByValue(t){var e=[];return this.getTagElms().forEach(((n,i)=>{r(this.trim(n.textContent),t,this.settings.dropdown.caseSensitive)&&e.push(i)})),e},getTagElmByValue(t){var e=this.getTagIndexByValue(t)[0];return this.getTagElms()[e]},flashTag(t){t&&(t.classList.add(this.settings.classNames.tagFlash),setTimeout((()=>{t.classList.remove(this.settings.classNames.tagFlash)}),100))},isTagBlacklisted(t){return t=this.trim(t.toLowerCase()),this.settings.blacklist.filter((e=>(""+e).toLowerCase()==t)).length},isTagWhitelisted(t){return!!this.getWhitelistItem(t)},getWhitelistItem(t,e,n){e=e||"value";var i,o=this.settings;return(n=n||o.whitelist).some((n=>{var s="string"==typeof n?n:n[e]||n.value;if(r(s,t,o.dropdown.caseSensitive,o.trim))return i="string"==typeof n?{value:n}:n,!0})),i||"value"!=e||"value"==o.tagTextProp||(i=this.getWhitelistItem(t,o.tagTextProp,n)),i},validateTag(t){var e=this.settings,n="value"in t?"value":e.tagTextProp,i=this.trim(t[n]+"");return(t[n]+"").trim()?e.pattern&&e.pattern instanceof RegExp&&!e.pattern.test(i)?this.TEXTS.pattern:!e.duplicates&&this.isTagDuplicate(i,this.state.editing,t.__tagId)?this.TEXTS.duplicate:this.isTagBlacklisted(i)||e.enforceWhitelist&&!this.isTagWhitelisted(i)?this.TEXTS.notAllowed:!e.validate||e.validate(t):this.TEXTS.empty},getInvalidTagAttrs(t,e){return{"aria-invalid":!0,class:`${t.class||""} ${this.settings.classNames.tagNotAllowed}`.trim(),title:e}},hasMaxTags(){return this.value.length>=this.settings.maxTags&&this.TEXTS.exceed},setReadonly(t,e){var n=this.settings;document.activeElement.blur(),n[e||"readonly"]=t,this.DOM.scope[(t?"set":"remove")+"Attribute"](e||"readonly",!0),this.setContentEditable(!t)},setContentEditable(t){!this.settings.readonly&&this.settings.userInput&&(this.DOM.input.contentEditable=t,this.DOM.input.tabIndex=t?0:-1)},setDisabled(t){this.setReadonly(t,"disabled")},normalizeTags(t){var e=this.settings,n=e.whitelist,i=e.delimiters,r=e.mode,o=e.tagTextProp;e.enforceWhitelist;var s=[],a=!!n&&n[0]instanceof Object,l=t instanceof Array,c=t=>(t+"").split(i).filter((t=>t)).map((t=>({[o]:this.trim(t),value:this.trim(t)})));if("number"==typeof t&&(t=t.toString()),"string"==typeof t){if(!t.trim())return[];t=c(t)}else l&&(t=[].concat(...t.map((t=>t.value?t:c(t)))));return a&&(t.forEach((t=>{var e=s.map((t=>t.value)),n=this.dropdown.filterListItems.call(this,t[o],{exact:!0});this.settings.duplicates||(n=n.filter((t=>!e.includes(t.value))));var i=n.length>1?this.getWhitelistItem(t[o],o,n):n[0];i&&i instanceof Object?s.push(i):"mix"!=r&&(null==t.value&&(t.value=t[o]),s.push(t))})),s.length&&(t=s)),t},parseMixTags(t){var e=this.settings,n=e.mixTagsInterpolator,i=e.duplicates,r=e.transformTag,o=e.enforceWhitelist,s=e.maxTags,a=e.tagTextProp,l=[];return t=t.split(n[0]).map(((t,e)=>{var c,u,h,d=t.split(n[1]),f=d[0],p=l.length==s;try{if(f==+f)throw Error;u=JSON.parse(f)}catch(t){u=this.normalizeTags(f)[0]||{value:f}}if(r.call(this,u),p||!(d.length>1)||o&&!this.isTagWhitelisted(u.value)||!i&&this.isTagDuplicate(u.value)){if(t)return e?n[0]+t:t}else u[c=u[a]?a:"value"]=this.trim(u[c]),h=this.createTagElem(u),l.push(u),h.classList.add(this.settings.classNames.tagNoAnimation),d[0]=h.outerHTML,this.value.push(u);return d.join("")})).join(""),this.DOM.input.innerHTML=t,this.DOM.input.appendChild(document.createTextNode("")),this.DOM.input.normalize(),this.getTagElms().forEach(((t,e)=>this.tagData(t,l[e]))),this.update({withoutChangeEvent:!0}),t},replaceTextWithNode(t,e){if(this.state.tag||e){e=e||this.state.tag.prefix+this.state.tag.value;var n,i,r=window.getSelection(),o=r.anchorNode,s=this.state.tag.delimiters?this.state.tag.delimiters.length:0;return o.splitText(r.anchorOffset-s),-1==(n=o.nodeValue.lastIndexOf(e))||(i=o.splitText(n),t&&o.parentNode.replaceChild(t,i)),!0}},selectTag(t,e){var n=this.settings;if(!n.enforceWhitelist||this.isTagWhitelisted(e.value)){this.input.set.call(this,e[n.tagTextProp]||e.value,!0),this.state.actions.selectOption&&setTimeout(this.setRangeAtStartEnd.bind(this));var i=this.getLastTag();return i?this.replaceTag(i,e):this.appendTag(t),this.value[0]=e,this.update(),this.trigger("add",{tag:t,data:e}),[t]}},addEmptyTag(t){var e=d({value:""},t||{}),n=this.createTagElem(e);this.tagData(n,e),this.appendTag(n),this.editTag(n,{skipValidation:!0})},addTags(t,e,n){var i=[],r=this.settings,o=document.createDocumentFragment();return n=n||r.skipInvalid,t&&0!=t.length?(t=this.normalizeTags(t),"mix"==r.mode?this.addMixTags(t):("select"==r.mode&&(e=!1),this.DOM.input.removeAttribute("style"),t.forEach((t=>{var e,s={},a=Object.assign({},t,{value:t.value+""});if(t=Object.assign({},a),r.transformTag.call(this,t),t.__isValid=this.hasMaxTags()||this.validateTag(t),!0!==t.__isValid){if(n)return;d(s,this.getInvalidTagAttrs(t,t.__isValid),{__preInvalidData:a}),t.__isValid==this.TEXTS.duplicate&&this.flashTag(this.getTagElmByValue(t.value))}if("readonly"in t&&(t.readonly?s["aria-readonly"]=!0:delete t.readonly),e=this.createTagElem(t,s),i.push(e),"select"==r.mode)return this.selectTag(e,t);o.appendChild(e),t.__isValid&&!0===t.__isValid?(this.value.push(t),this.trigger("add",{tag:e,index:this.value.length-1,data:t})):(this.trigger("invalid",{data:t,index:this.value.length,tag:e,message:t.__isValid}),r.keepInvalidTags||setTimeout((()=>this.removeTags(e,!0)),1e3)),this.dropdown.position()})),this.appendTag(o),this.update(),t.length&&e&&this.input.set.call(this),this.dropdown.refilter(),i)):("select"==r.mode&&this.removeAllTags(),i)},addMixTags(t){if((t=this.normalizeTags(t))[0].prefix||this.state.tag)return this.prefixedTextToTag(t[0]);"string"==typeof t&&(t=[{value:t}]);var e=!!this.state.selection,n=document.createDocumentFragment();return t.forEach((t=>{var e=this.createTagElem(t);n.appendChild(e),this.insertAfterTag(e)})),e?this.injectAtCaret(n):(this.DOM.input.focus(),(e=this.setStateSelection()).range.setStart(this.DOM.input,e.range.endOffset),e.range.setEnd(this.DOM.input,e.range.endOffset),this.DOM.input.appendChild(n),this.updateValueByDOMTags(),this.update()),n},prefixedTextToTag(t){var e,n=this.settings,i=this.state.tag.delimiters;if(n.transformTag.call(this,t),t.prefix=t.prefix||this.state.tag?this.state.tag.prefix:(n.pattern.source||n.pattern)[0],e=this.createTagElem(t),this.replaceTextWithNode(e)||this.DOM.input.appendChild(e),setTimeout((()=>e.classList.add(this.settings.classNames.tagNoAnimation)),300),this.value.push(t),this.update(),!i){var r=this.insertAfterTag(e)||e;this.placeCaretAfterNode(r)}return this.state.tag=null,this.trigger("add",d({},{tag:e},{data:t})),e},appendTag(t){var e=this.DOM,n=e.input;n===e.input?e.scope.insertBefore(t,n):e.scope.appendChild(t)},createTagElem(t,n){t.__tagId=m();var i,r=d({},t,e({value:u(t.value+"")},n));return function(t){for(var e,n=document.createNodeIterator(t,NodeFilter.SHOW_TEXT,null,!1);e=n.nextNode();)e.textContent.trim()||e.parentNode.removeChild(e)}(i=this.parseTemplate("tag",[r])),this.tagData(i,t),i},reCheckInvalidTags(){var t=this.settings;this.getTagElms(t.classNames.tagNotAllowed).forEach(((t,e)=>{var n=this.tagData(t),i=this.hasMaxTags(),r=this.validateTag(n);if(!0===r&&!i)return n=n.__preInvalidData?n.__preInvalidData:{value:n.value},this.replaceTag(t,n);t.title=i||r}))},removeTags(t,e,n){var i;if(t=t&&t instanceof HTMLElement?[t]:t instanceof Array?t:t?[t]:[this.getLastTag()],i=t.reduce(((t,e)=>{e&&"string"==typeof e&&(e=this.getTagElmByValue(e));var n=this.tagData(e);return e&&n&&!n.readonly&&t.push({node:e,idx:this.getTagIdx(n),data:this.tagData(e,{__removed:!0})}),t}),[]),n="number"==typeof n?n:this.CSSVars.tagHideTransition,"select"==this.settings.mode&&(n=0,this.input.set.call(this)),1==i.length&&i[0].node.classList.contains(this.settings.classNames.tagNotAllowed)&&(e=!0),i.length)return this.settings.hooks.beforeRemoveTag(i,{tagify:this}).then((()=>{function t(t){t.node.parentNode&&(t.node.parentNode.removeChild(t.node),e?this.settings.keepInvalidTags&&this.trigger("remove",{tag:t.node,index:t.idx}):(this.trigger("remove",{tag:t.node,index:t.idx,data:t.data}),this.dropdown.refilter(),this.dropdown.position(),this.DOM.input.normalize(),this.settings.keepInvalidTags&&this.reCheckInvalidTags()))}n&&n>10&&1==i.length?function(e){e.node.style.width=parseFloat(window.getComputedStyle(e.node).width)+"px",document.body.clientTop,e.node.classList.add(this.settings.classNames.tagHide),setTimeout(t.bind(this),n,e)}.call(this,i[0]):i.forEach(t.bind(this)),e||(this.removeTagsFromValue(i.map((t=>t.node))),this.update(),"select"==this.settings.mode&&this.setContentEditable(!0))})).catch((t=>{}))},removeTagsFromDOM(){[].slice.call(this.getTagElms()).forEach((t=>t.parentNode.removeChild(t)))},removeTagsFromValue(t){(t=Array.isArray(t)?t:[t]).forEach((t=>{var e=this.tagData(t),n=this.getTagIdx(e);n>-1&&this.value.splice(n,1)}))},removeAllTags(t){t=t||{},this.value=[],"mix"==this.settings.mode?this.DOM.input.innerHTML="":this.removeTagsFromDOM(),this.dropdown.position(),"select"==this.settings.mode&&(this.input.set.call(this),this.setContentEditable(!0)),this.update(t)},postUpdate(){var t=this.settings.classNames,e="mix"==this.settings.mode?this.settings.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value.trim():this.value.length+this.input.raw.call(this).length;this.toggleClass(t.hasMaxTags,this.value.length>=this.settings.maxTags),this.toggleClass(t.hasNoTags,!this.value.length),this.toggleClass(t.empty,!e)},setOriginalInputValue(t){var e=this.DOM.originalInput;this.settings.mixMode.integrated||(e.value=t,e.tagifyValue=e.value,this.setPersistedData(t,"value"))},update(t){var e=this.getInputValue();this.setOriginalInputValue(e),this.postUpdate(),(t||{}).withoutChangeEvent||this.state.blockChangeEvent||this.triggerChangeEvent()},getInputValue(){var t=this.getCleanValue();return"mix"==this.settings.mode?this.getMixedTagsAsString(t):t.length?this.settings.originalInputValueFormat?this.settings.originalInputValueFormat(t):JSON.stringify(t):""},getCleanValue(t){return o(t||this.value,this.dataProps)},getMixedTagsAsString(){var t="",e=this,n=this.settings.mixTagsInterpolator;return function i(r){r.childNodes.forEach((r=>{if(1==r.nodeType){const o=e.tagData(r);if("BR"==r.tagName&&(t+="\r\n"),r.getAttribute("style")||["B","I","U"].includes(r.tagName))t+=r.textContent;else if("DIV"==r.tagName||"P"==r.tagName)t+="\r\n",i(r);else if(v.call(e,r)&&o){if(o.__removed)return;t+=n[0]+JSON.stringify(s(o,e.dataProps))+n[1]}}else t+=r.textContent}))}(this.DOM.input),t}},k.prototype.removeTag=k.prototype.removeTags,k}()},465:function(t,e,n){n(41539),n(54747),function(){var t=document.querySelectorAll("[data-choicesjs]");if(t.length>=1){var e=n(64529);t.forEach((function(t){var n=t.dataset.choicesjs?JSON.parse(t.dataset.choicesjs):{},i=new e(t,n);t.addEventListener("set-choices-value",(function(t){var e=t.detail.value;i.setChoiceByValue(e)}))}))}}()},24989:function(t,e,n){function i(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);nNew '.concat(e)).replace(/__name__/g,e);return n.innerHTML=i.trim(),n.content}};t.initialize()}()},66294:function(t,e,n){function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,s=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw s}}}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,s=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n0){for(var o in t)if(t.hasOwnProperty(o)&&o.indexOf(e)>-1){var s=t[o],a="#"+o.substring(e.length);i(a).collapse(s?"show":"hide")}}else i(n).find('[data-parent="'+n+'"]:first').collapse("show")},getStorage:function(){return JSON.parse(localStorage.getItem(t)||"{}")},setStorage:function(e,n){var i=r.getStorage();i[e]=n,localStorage.setItem(t,JSON.stringify(i))}}}()},31168:function(t,e,n){n(41539),n(54747),function(){"use strict";var t=document.querySelectorAll('.alert-pagegroup-container [role="alert"]');t.length>=1&&t.forEach((function(t){"danger"!==t.dataset.severity&&setTimeout((function(){var e=t.querySelector('button[data-dismiss="alert"]');e&&(console.log("click"),e.click())}),5e3)}))}()},67369:function(t,e,n){var i=n(19755);n(69826),n(41539),n(74916),i((function(){function t(t){i(".navbar-toggler").is(":hidden")&&!t.hasClass("open")&&(t.parent().parent().find("li").removeClass("show"),t.addClass("show"),t.find("> .dropdown-toggle").attr("aria-expanded","true"),t.find("> .dropdown-menu").addClass("show"))}function e(t){i(".navbar-toggler").is(":hidden")&&(t.removeClass("show"),t.find("> .dropdown-toggle").attr("aria-expanded","false"),t.find("> .dropdown-menu").removeClass("show"))}i(".navbar-collapse").on("show.bs.collapse",(function(){i(".navbar-toggle").removeClass("collapsed")})).on("hide.bs.collapse",(function(){i(".navbar-toggle").addClass("collapsed")})),i(document).on("pointerover","li.dropdown-hover",(function(e){"mouse"===e.originalEvent.pointerType&&t(i(this))})),i(document).on("mouseenter","li.dropdown-hover",(function(){/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&t(i(this))})),i(document).on("pointerleave","li.dropdown-hover",(function(t){"mouse"===t.originalEvent.pointerType&&e(i(this))})),i(document).on("mouseleave","li.dropdown-hover",(function(){/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&e(i(this))})),i(document).on("click",".nav-link",(function(t){if(i(this).parent().hasClass("dropdown-hover")&&!i(this).parent().hasClass("show"))return i(this).parent().parent().find(".dropdown-hover").removeClass("show"),i(this).parent().parent().find(".dropdown-hover").find("> .dropdown-toggle").attr("aria-expanded","false"),i(this).parent().parent().find(".dropdown-hover").find("> .dropdown-menu").removeClass("show"),i(this).parent().addClass("show"),i(this).parent().find("> .dropdown-toggle").attr("aria-expanded","true"),i(this).parent().find("> .dropdown-menu").addClass("show"),t.stopImmediatePropagation(),t.preventDefault(),!1}))}))},72665:function(t,e,n){!function(t){"use strict";var e={tagClass:function(t){return"label label-info"},itemValue:function(t){return t?t.toString():t},itemText:function(t){return this.itemValue(t)},itemTitle:function(t){return null},freeInput:!0,addOnBlur:!0,maxTags:void 0,maxChars:void 0,confirmKeys:[13,44],delimiter:",",delimiterRegex:null,cancelConfirmKeysOnEmpty:!1,onTagExists:function(t,e){e.hide().fadeIn()},trimValue:!1,allowDuplicates:!1};function n(e,n){this.isInit=!0,this.itemsArray=[],this.$element=t(e),this.$element.hide(),this.isSelect="SELECT"===e.tagName,this.multiple=this.isSelect&&e.hasAttribute("multiple"),this.objectItems=n&&n.itemValue,this.placeholderText=e.hasAttribute("placeholder")?this.$element.attr("placeholder"):"",this.inputSize=Math.max(1,this.placeholderText.length),this.$container=t('
'),this.$input=t('').appendTo(this.$container),this.$element.before(this.$container),this.build(n),this.isInit=!1}function i(t,e){if("function"!=typeof t[e]){var n=t[e];t[e]=function(t){return t[n]}}}function r(t,e){if("function"!=typeof t[e]){var n=t[e];t[e]=function(){return n}}}n.prototype={constructor:n,add:function(e,n,i){var r=this;if(!(r.options.maxTags&&r.itemsArray.length>=r.options.maxTags)&&(!1===e||e)){if("string"==typeof e&&r.options.trimValue&&(e=t.trim(e)),"object"==typeof e&&!r.objectItems)throw"Can't add objects when itemValue option is not set";if(!e.toString().match(/^\s*$/)){if(r.isSelect&&!r.multiple&&r.itemsArray.length>0&&r.remove(r.itemsArray[0]),"string"==typeof e&&"INPUT"===this.$element[0].tagName){var o=r.options.delimiterRegex?r.options.delimiterRegex:r.options.delimiter,a=e.split(o);if(a.length>1){for(var l=0;lr.options.maxInputLength)){var p=t.Event("beforeItemAdd",{item:e,cancel:!1,options:i});if(r.$element.trigger(p),!p.cancel){r.itemsArray.push(e);var g=t(''+s(u)+'');g.data("item",e),r.findInputWrapper().before(g),g.after(" ");var m=t('option[value="'+encodeURIComponent(c)+'"]',r.$element).length||t('option[value="'+s(c)+'"]',r.$element).length;if(r.isSelect&&!m){var v=t("");v.data("item",e),v.attr("value",c),r.$element.append(v)}n||r.pushVal(),r.options.maxTags!==r.itemsArray.length&&r.items().toString().length!==r.options.maxInputLength||r.$container.addClass("bootstrap-tagsinput-max"),t(".typeahead, .twitter-typeahead",r.$container).length&&r.$input.typeahead("val",""),this.isInit?r.$element.trigger(t.Event("itemAddedOnInit",{item:e,options:i})):r.$element.trigger(t.Event("itemAdded",{item:e,options:i}))}}}else if(r.options.onTagExists){var y=t(".tag",r.$container).filter((function(){return t(this).data("item")===f}));r.options.onTagExists(e,y)}}}},remove:function(e,n,i){var r=this;if(r.objectItems&&(e=(e="object"==typeof e?t.grep(r.itemsArray,(function(t){return r.options.itemValue(t)==r.options.itemValue(e)})):t.grep(r.itemsArray,(function(t){return r.options.itemValue(t)==e})))[e.length-1]),e){var o=t.Event("beforeItemRemove",{item:e,cancel:!1,options:i});if(r.$element.trigger(o),o.cancel)return;t(".tag",r.$container).filter((function(){return t(this).data("item")===e})).remove(),t("option",r.$element).filter((function(){return t(this).data("item")===e})).remove(),-1!==t.inArray(e,r.itemsArray)&&r.itemsArray.splice(t.inArray(e,r.itemsArray),1)}n||r.pushVal(),r.options.maxTags>r.itemsArray.length&&r.$container.removeClass("bootstrap-tagsinput-max"),r.$element.trigger(t.Event("itemRemoved",{item:e,options:i}))},removeAll:function(){var e=this;for(t(".tag",e.$container).remove(),t("option",e.$element).remove();e.itemsArray.length>0;)e.itemsArray.pop();e.pushVal()},refresh:function(){var e=this;t(".tag",e.$container).each((function(){var n=t(this),i=n.data("item"),r=e.options.itemValue(i),o=e.options.itemText(i),a=e.options.tagClass(i);(n.attr("class",null),n.addClass("tag "+s(a)),n.contents().filter((function(){return 3==this.nodeType}))[0].nodeValue=s(o),e.isSelect)&&t("option",e.$element).filter((function(){return t(this).data("item")===i})).attr("value",r)}))},items:function(){return this.itemsArray},pushVal:function(){var e=this,n=t.map(e.items(),(function(t){return e.options.itemValue(t).toString()}));e.$element.val(n,!0).trigger("change")},build:function(n){var o=this;if(o.options=t.extend({},e,n),o.objectItems&&(o.options.freeInput=!1),i(o.options,"itemValue"),i(o.options,"itemText"),r(o.options,"tagClass"),o.options.typeahead){var s=o.options.typeahead||{};r(s,"source"),o.$input.typeahead(t.extend({},s,{source:function(e,n){function i(t){for(var e=[],i=0;i$1")}}))}if(o.options.typeaheadjs){var l=null,c={},u=o.options.typeaheadjs;t.isArray(u)?(l=u[0],c=u[1]):c=u,o.$input.typeahead(l,c).on("typeahead:selected",t.proxy((function(t,e){c.valueKey?o.add(e[c.valueKey]):o.add(e),o.$input.typeahead("val","")}),o))}o.$container.on("click",t.proxy((function(t){o.$element.attr("disabled")||o.$input.removeAttr("disabled"),o.$input.focus()}),o)),o.options.addOnBlur&&o.options.freeInput&&o.$input.on("focusout",t.proxy((function(e){0===t(".typeahead, .twitter-typeahead",o.$container).length&&(o.add(o.$input.val()),o.$input.val(""))}),o)),o.$container.on("keydown","input",t.proxy((function(e){var n=t(e.target),i=o.findInputWrapper();if(o.$element.attr("disabled"))o.$input.attr("disabled","disabled");else{switch(e.which){case 8:if(0===a(n[0])){var r=i.prev();r.length&&o.remove(r.data("item"))}break;case 46:if(0===a(n[0])){var s=i.next();s.length&&o.remove(s.data("item"))}break;case 37:var l=i.prev();0===n.val().length&&l[0]&&(l.before(i),n.focus());break;case 39:var c=i.next();0===n.val().length&&c[0]&&(c.after(i),n.focus())}var u=n.val().length;Math.ceil(u/5);n.attr("size",Math.max(this.inputSize,n.val().length))}}),o)),o.$container.on("keypress","input",t.proxy((function(e){var n=t(e.target);if(o.$element.attr("disabled"))o.$input.attr("disabled","disabled");else{var i,r,s,a=n.val(),l=o.options.maxChars&&a.length>=o.options.maxChars;o.options.freeInput&&(i=e,r=o.options.confirmKeys,s=!1,t.each(r,(function(t,e){if("number"==typeof e&&i.which===e)return s=!0,!1;if(i.which===e.which){var n=!e.hasOwnProperty("altKey")||i.altKey===e.altKey,r=!e.hasOwnProperty("shiftKey")||i.shiftKey===e.shiftKey,o=!e.hasOwnProperty("ctrlKey")||i.ctrlKey===e.ctrlKey;if(n&&r&&o)return s=!0,!1}})),s||l)&&(0!==a.length&&(o.add(l?a.substr(0,o.options.maxChars):a),n.val("")),!1===o.options.cancelConfirmKeysOnEmpty&&e.preventDefault());var c=n.val().length;Math.ceil(c/5);n.attr("size",Math.max(this.inputSize,n.val().length))}}),o)),o.$container.on("click","[data-role=remove]",t.proxy((function(e){o.$element.attr("disabled")||o.remove(t(e.target).closest(".tag").data("item"))}),o)),o.options.itemValue===e.itemValue&&("INPUT"===o.$element[0].tagName?o.add(o.$element.val()):t("option",o.$element).each((function(){o.add(t(this).attr("value"),!0)})))},destroy:function(){var t=this;t.$container.off("keypress","input"),t.$container.off("click","[role=remove]"),t.$container.remove(),t.$element.removeData("tagsinput"),t.$element.show()},focus:function(){this.$input.focus()},input:function(){return this.$input},findInputWrapper:function(){for(var e=this.$input[0],n=this.$container[0];e&&e.parentNode!==n;)e=e.parentNode;return t(e)}},t.fn.tagsinput=function(e,i,r){var o=[];return this.each((function(){var s=t(this).data("tagsinput");if(s)if(e||i){if(void 0!==s[e]){if(3===s[e].length&&void 0!==r)var a=s[e](i,null,r);else a=s[e](i);void 0!==a&&o.push(a)}}else o.push(s);else s=new n(this,e),t(this).data("tagsinput",s),o.push(s),"SELECT"===this.tagName&&t("option",t(this)).attr("selected","selected"),t(this).val(t(this).val())})),"string"==typeof e?o.length>1?o:o[0]:o},t.fn.tagsinput.Constructor=n;var o=t("
");function s(t){return t?o.text(t).html():""}function a(t){var e=0;if(document.selection){t.focus();var n=document.selection.createRange();n.moveStart("character",-t.value.length),e=n.text.length}else(t.selectionStart||"0"==t.selectionStart)&&(e=t.selectionStart);return e}t((function(){t("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput()}))}(n(19755))},64529:function(t){var e;window,e=function(){return function(){"use strict";var t={282:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.clearChoices=e.activateChoices=e.filterChoices=e.addChoice=void 0;var i=n(883);e.addChoice=function(t){var e=t.value,n=t.label,r=t.id,o=t.groupId,s=t.disabled,a=t.elementId,l=t.customProperties,c=t.placeholder,u=t.keyCode;return{type:i.ACTION_TYPES.ADD_CHOICE,value:e,label:n,id:r,groupId:o,disabled:s,elementId:a,customProperties:l,placeholder:c,keyCode:u}},e.filterChoices=function(t){return{type:i.ACTION_TYPES.FILTER_CHOICES,results:t}},e.activateChoices=function(t){return void 0===t&&(t=!0),{type:i.ACTION_TYPES.ACTIVATE_CHOICES,active:t}},e.clearChoices=function(){return{type:i.ACTION_TYPES.CLEAR_CHOICES}}},783:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.addGroup=void 0;var i=n(883);e.addGroup=function(t){var e=t.value,n=t.id,r=t.active,o=t.disabled;return{type:i.ACTION_TYPES.ADD_GROUP,value:e,id:n,active:r,disabled:o}}},464:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.highlightItem=e.removeItem=e.addItem=void 0;var i=n(883);e.addItem=function(t){var e=t.value,n=t.label,r=t.id,o=t.choiceId,s=t.groupId,a=t.customProperties,l=t.placeholder,c=t.keyCode;return{type:i.ACTION_TYPES.ADD_ITEM,value:e,label:n,id:r,choiceId:o,groupId:s,customProperties:a,placeholder:l,keyCode:c}},e.removeItem=function(t,e){return{type:i.ACTION_TYPES.REMOVE_ITEM,id:t,choiceId:e}},e.highlightItem=function(t,e){return{type:i.ACTION_TYPES.HIGHLIGHT_ITEM,id:t,highlighted:e}}},137:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.setIsLoading=e.resetTo=e.clearAll=void 0;var i=n(883);e.clearAll=function(){return{type:i.ACTION_TYPES.CLEAR_ALL}},e.resetTo=function(t){return{type:i.ACTION_TYPES.RESET_TO,state:t}},e.setIsLoading=function(t){return{type:i.ACTION_TYPES.SET_IS_LOADING,isLoading:t}}},373:function(t,e,n){var i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r=0?this._store.getGroupById(r):null;return this._store.dispatch((0,c.highlightItem)(n,!0)),e&&this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:n,value:s,label:l,groupValue:u&&u.value?u.value:null}),this},t.prototype.unhighlightItem=function(t){if(!t||!t.id)return this;var e=t.id,n=t.groupId,i=void 0===n?-1:n,r=t.value,o=void 0===r?"":r,s=t.label,a=void 0===s?"":s,l=i>=0?this._store.getGroupById(i):null;return this._store.dispatch((0,c.highlightItem)(e,!1)),this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:e,value:o,label:a,groupValue:l&&l.value?l.value:null}),this},t.prototype.highlightAll=function(){var t=this;return this._store.items.forEach((function(e){return t.highlightItem(e)})),this},t.prototype.unhighlightAll=function(){var t=this;return this._store.items.forEach((function(e){return t.unhighlightItem(e)})),this},t.prototype.removeActiveItemsByValue=function(t){var e=this;return this._store.activeItems.filter((function(e){return e.value===t})).forEach((function(t){return e._removeItem(t)})),this},t.prototype.removeActiveItems=function(t){var e=this;return this._store.activeItems.filter((function(e){return e.id!==t})).forEach((function(t){return e._removeItem(t)})),this},t.prototype.removeHighlightedItems=function(t){var e=this;return void 0===t&&(t=!1),this._store.highlightedActiveItems.forEach((function(n){e._removeItem(n),t&&e._triggerChange(n.value)})),this},t.prototype.showDropdown=function(t){var e=this;return this.dropdown.isActive||requestAnimationFrame((function(){e.dropdown.show(),e.containerOuter.open(e.dropdown.distanceFromTopWindow),!t&&e._canSearch&&e.input.focus(),e.passedElement.triggerEvent(d.EVENTS.showDropdown,{})})),this},t.prototype.hideDropdown=function(t){var e=this;return this.dropdown.isActive?(requestAnimationFrame((function(){e.dropdown.hide(),e.containerOuter.close(),!t&&e._canSearch&&(e.input.removeActiveDescendant(),e.input.blur()),e.passedElement.triggerEvent(d.EVENTS.hideDropdown,{})})),this):this},t.prototype.getValue=function(t){void 0===t&&(t=!1);var e=this._store.activeItems.reduce((function(e,n){var i=t?n.value:n;return e.push(i),e}),[]);return this._isSelectOneElement?e[0]:e},t.prototype.setValue=function(t){var e=this;return this.initialised?(t.forEach((function(t){return e._setChoiceOrItem(t)})),this):this},t.prototype.setChoiceByValue=function(t){var e=this;return!this.initialised||this._isTextElement||(Array.isArray(t)?t:[t]).forEach((function(t){return e._findAndSelectChoiceByValue(t)})),this},t.prototype.setChoices=function(t,e,n,i){var r=this;if(void 0===t&&(t=[]),void 0===e&&(e="value"),void 0===n&&(n="label"),void 0===i&&(i=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof e||!e)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(i&&this.clearChoices(),"function"==typeof t){var o=t(this);if("function"==typeof Promise&&o instanceof Promise)return new Promise((function(t){return requestAnimationFrame(t)})).then((function(){return r._handleLoadingState(!0)})).then((function(){return o})).then((function(t){return r.setChoices(t,e,n,i)})).catch((function(t){r.config.silent||console.error(t)})).then((function(){return r._handleLoadingState(!1)})).then((function(){return r}));if(!Array.isArray(o))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof o));return this.setChoices(o,e,n,!1)}if(!Array.isArray(t))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),t.forEach((function(t){if(t.choices)r._addGroup({id:t.id?parseInt("".concat(t.id),10):null,group:t,valueKey:e,labelKey:n});else{var i=t;r._addChoice({value:i[e],label:i[n],isSelected:!!i.selected,isDisabled:!!i.disabled,placeholder:!!i.placeholder,customProperties:i.customProperties})}})),this._stopLoading(),this},t.prototype.clearChoices=function(){return this._store.dispatch((0,a.clearChoices)()),this},t.prototype.clearStore=function(){return this._store.dispatch((0,u.clearAll)()),this},t.prototype.clearInput=function(){var t=!this._isSelectOneElement;return this.input.clear(t),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0))),this},t.prototype._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var t=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,e=this._isSelectElement,n=this._currentState.items!==this._prevState.items;t&&(e&&this._renderChoices(),n&&this._renderItems(),this._prevState=this._currentState)}},t.prototype._renderChoices=function(){var t=this,e=this._store,n=e.activeGroups,i=e.activeChoices,r=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame((function(){return t.choiceList.scrollToTop()})),n.length>=1&&!this._isSearching){var o=i.filter((function(t){return!0===t.placeholder&&-1===t.groupId}));o.length>=1&&(r=this._createChoicesFragment(o,r)),r=this._createGroupsFragment(n,i,r)}else i.length>=1&&(r=this._createChoicesFragment(i,r));if(r.childNodes&&r.childNodes.length>0){var s=this._store.activeItems,a=this._canAddItem(s,this.input.value);if(a.response)this.choiceList.append(r),this._highlightChoice();else{var l=this._getTemplate("notice",a.notice);this.choiceList.append(l)}}else{var c=void 0;l=void 0,this._isSearching?(l="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,c=this._getTemplate("notice",l,"no-results")):(l="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,c=this._getTemplate("notice",l,"no-choices")),this.choiceList.append(c)}},t.prototype._renderItems=function(){var t=this._store.activeItems||[];this.itemList.clear();var e=this._createItemsFragment(t);e.childNodes&&this.itemList.append(e)},t.prototype._createGroupsFragment=function(t,e,n){var i=this;return void 0===n&&(n=document.createDocumentFragment()),this.config.shouldSort&&t.sort(this.config.sorter),t.forEach((function(t){var r=function(t){return e.filter((function(e){return i._isSelectOneElement?e.groupId===t.id:e.groupId===t.id&&("always"===i.config.renderSelectedChoices||!e.selected)}))}(t);if(r.length>=1){var o=i._getTemplate("choiceGroup",t);n.appendChild(o),i._createChoicesFragment(r,n,!0)}})),n},t.prototype._createChoicesFragment=function(t,e,n){var r=this;void 0===e&&(e=document.createDocumentFragment()),void 0===n&&(n=!1);var o=this.config,s=o.renderSelectedChoices,a=o.searchResultLimit,l=o.renderChoiceLimit,c=this._isSearching?p.sortByScore:this.config.sorter,u=function(t){if("auto"!==s||r._isSelectOneElement||!t.selected){var n=r._getTemplate("choice",t,r.config.itemSelectText);e.appendChild(n)}},h=t;"auto"!==s||this._isSelectOneElement||(h=t.filter((function(t){return!t.selected})));var d=h.reduce((function(t,e){return e.placeholder?t.placeholderChoices.push(e):t.normalChoices.push(e),t}),{placeholderChoices:[],normalChoices:[]}),f=d.placeholderChoices,g=d.normalChoices;(this.config.shouldSort||this._isSearching)&&g.sort(c);var m=h.length,v=this._isSelectOneElement?i(i([],f,!0),g,!0):g;this._isSearching?m=a:l&&l>0&&!n&&(m=l);for(var y=0;y=i){var s=r?this._searchChoices(t):0;this.passedElement.triggerEvent(d.EVENTS.search,{value:t,resultCount:s})}else o&&(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0)))}},t.prototype._canAddItem=function(t,e){var n=!0,i="function"==typeof this.config.addItemText?this.config.addItemText(e):this.config.addItemText;if(!this._isSelectOneElement){var r=(0,p.existsInArray)(t,e);this.config.maxItemCount>0&&this.config.maxItemCount<=t.length&&(n=!1,i="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&r&&n&&(n=!1,i="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText(e):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&n&&"function"==typeof this.config.addItemFilter&&!this.config.addItemFilter(e)&&(n=!1,i="function"==typeof this.config.customAddItemText?this.config.customAddItemText(e):this.config.customAddItemText)}return{response:n,notice:i}},t.prototype._searchChoices=function(t){var e="string"==typeof t?t.trim():t,n="string"==typeof this._currentValue?this._currentValue.trim():this._currentValue;if(e.length<1&&e==="".concat(n," "))return 0;var r=this._store.searchableChoices,o=e,l=Object.assign(this.config.fuseOptions,{keys:i([],this.config.searchFields,!0),includeMatches:!0}),c=new s.default(r,l).search(o);return this._currentValue=e,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch((0,a.filterChoices)(c)),c.length},t.prototype._addEventListeners=function(){var t=document.documentElement;t.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),t.addEventListener("click",this._onClick,{passive:!0}),t.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},t.prototype._removeEventListeners=function(){var t=document.documentElement;t.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),t.removeEventListener("click",this._onClick),t.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},t.prototype._onKeyDown=function(t){var e=t.keyCode,n=this._store.activeItems,i=this.input.isFocussed,r=this.dropdown.isActive,o=this.itemList.hasChildren(),s=String.fromCharCode(e),a=/[a-zA-Z0-9-_ ]/.test(s),l=d.KEY_CODES.BACK_KEY,c=d.KEY_CODES.DELETE_KEY,u=d.KEY_CODES.ENTER_KEY,h=d.KEY_CODES.A_KEY,f=d.KEY_CODES.ESC_KEY,p=d.KEY_CODES.UP_KEY,g=d.KEY_CODES.DOWN_KEY,m=d.KEY_CODES.PAGE_UP_KEY,v=d.KEY_CODES.PAGE_DOWN_KEY;switch(this._isTextElement||r||!a||(this.showDropdown(),this.input.isFocussed||(this.input.value+=s.toLowerCase())),e){case h:return this._onSelectKey(t,o);case u:return this._onEnterKey(t,n,r);case f:return this._onEscapeKey(r);case p:case m:case g:case v:return this._onDirectionKey(t,r);case c:case l:return this._onDeleteKey(t,n,i)}},t.prototype._onKeyUp=function(t){var e=t.target,n=t.keyCode,i=this.input.value,r=this._store.activeItems,o=this._canAddItem(r,i),s=d.KEY_CODES.BACK_KEY,l=d.KEY_CODES.DELETE_KEY;if(this._isTextElement)if(o.notice&&i){var c=this._getTemplate("notice",o.notice);this.dropdown.element.innerHTML=c.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0);else{var u=(n===s||n===l)&&e&&!e.value,h=!this._isTextElement&&this._isSearching,f=this._canSearch&&o.response;u&&h?(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0))):f&&this._handleSearch(this.input.rawValue)}this._canSearch=this.config.searchEnabled},t.prototype._onSelectKey=function(t,e){var n=t.ctrlKey,i=t.metaKey;(n||i)&&e&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},t.prototype._onEnterKey=function(t,e,n){var i=t.target,r=d.KEY_CODES.ENTER_KEY,o=i&&i.hasAttribute("data-button");if(this._isTextElement&&i&&i.value){var s=this.input.value;this._canAddItem(e,s).response&&(this.hideDropdown(!0),this._addItem({value:s}),this._triggerChange(s),this.clearInput())}if(o&&(this._handleButtonAction(e,i),t.preventDefault()),n){var a=this.dropdown.getChild(".".concat(this.config.classNames.highlightedState));a&&(e[0]&&(e[0].keyCode=r),this._handleChoiceAction(e,a)),t.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),t.preventDefault())},t.prototype._onEscapeKey=function(t){t&&(this.hideDropdown(!0),this.containerOuter.focus())},t.prototype._onDirectionKey=function(t,e){var n=t.keyCode,i=t.metaKey,r=d.KEY_CODES.DOWN_KEY,o=d.KEY_CODES.PAGE_UP_KEY,s=d.KEY_CODES.PAGE_DOWN_KEY;if(e||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var a=n===r||n===s?1:-1,l="[data-choice-selectable]",c=void 0;if(i||n===s||n===o)c=a>0?this.dropdown.element.querySelector("".concat(l,":last-of-type")):this.dropdown.element.querySelector(l);else{var u=this.dropdown.element.querySelector(".".concat(this.config.classNames.highlightedState));c=u?(0,p.getAdjacentEl)(u,l,a):this.dropdown.element.querySelector(l)}c&&((0,p.isScrolledIntoView)(c,this.choiceList.element,a)||this.choiceList.scrollToChildElement(c,a),this._highlightChoice(c)),t.preventDefault()}},t.prototype._onDeleteKey=function(t,e,n){var i=t.target;this._isSelectOneElement||i.value||!n||(this._handleBackspace(e),t.preventDefault())},t.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},t.prototype._onTouchEnd=function(t){var e=(t||t.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(e)&&((e===this.containerOuter.element||e===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),t.stopPropagation()),this._wasTap=!0},t.prototype._onMouseDown=function(t){var e=t.target;if(e instanceof HTMLElement){if(y&&this.choiceList.element.contains(e)){var n=this.choiceList.element.firstElementChild,i="ltr"===this._direction?t.offsetX>=n.offsetWidth:t.offsetX0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},t.prototype._onFocus=function(t){var e,n=this,i=t.target;i&&this.containerOuter.element.contains(i)&&((e={})[d.TEXT_TYPE]=function(){i===n.input.element&&n.containerOuter.addFocusState()},e[d.SELECT_ONE_TYPE]=function(){n.containerOuter.addFocusState(),i===n.input.element&&n.showDropdown(!0)},e[d.SELECT_MULTIPLE_TYPE]=function(){i===n.input.element&&(n.showDropdown(!0),n.containerOuter.addFocusState())},e)[this.passedElement.element.type]()},t.prototype._onBlur=function(t){var e,n=this,i=t.target;if(i&&this.containerOuter.element.contains(i)&&!this._isScrollingOnIe){var r=this._store.activeItems.some((function(t){return t.highlighted}));((e={})[d.TEXT_TYPE]=function(){i===n.input.element&&(n.containerOuter.removeFocusState(),r&&n.unhighlightAll(),n.hideDropdown(!0))},e[d.SELECT_ONE_TYPE]=function(){n.containerOuter.removeFocusState(),(i===n.input.element||i===n.containerOuter.element&&!n._canSearch)&&n.hideDropdown(!0)},e[d.SELECT_MULTIPLE_TYPE]=function(){i===n.input.element&&(n.containerOuter.removeFocusState(),n.hideDropdown(!0),r&&n.unhighlightAll())},e)[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},t.prototype._onFormReset=function(){this._store.dispatch((0,u.resetTo)(this._initialState))},t.prototype._highlightChoice=function(t){var e=this;void 0===t&&(t=null);var n=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(n.length){var i=t;Array.from(this.dropdown.element.querySelectorAll(".".concat(this.config.classNames.highlightedState))).forEach((function(t){t.classList.remove(e.config.classNames.highlightedState),t.setAttribute("aria-selected","false")})),i?this._highlightPosition=n.indexOf(i):(i=n.length>this._highlightPosition?n[this._highlightPosition]:n[n.length-1])||(i=n[0]),i.classList.add(this.config.classNames.highlightedState),i.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(d.EVENTS.highlightChoice,{el:i}),this.dropdown.isActive&&(this.input.setActiveDescendant(i.id),this.containerOuter.setActiveDescendant(i.id))}},t.prototype._addItem=function(t){var e=t.value,n=t.label,i=void 0===n?null:n,r=t.choiceId,o=void 0===r?-1:r,s=t.groupId,a=void 0===s?-1:s,l=t.customProperties,u=void 0===l?{}:l,h=t.placeholder,f=void 0!==h&&h,p=t.keyCode,g=void 0===p?-1:p,m="string"==typeof e?e.trim():e,v=this._store.items,y=i||m,b=o||-1,_=a>=0?this._store.getGroupById(a):null,x=v?v.length+1:1;this.config.prependValue&&(m=this.config.prependValue+m.toString()),this.config.appendValue&&(m+=this.config.appendValue.toString()),this._store.dispatch((0,c.addItem)({value:m,label:y,id:x,choiceId:b,groupId:a,customProperties:u,placeholder:f,keyCode:g})),this._isSelectOneElement&&this.removeActiveItems(x),this.passedElement.triggerEvent(d.EVENTS.addItem,{id:x,value:m,label:y,customProperties:u,groupValue:_&&_.value?_.value:null,keyCode:g})},t.prototype._removeItem=function(t){var e=t.id,n=t.value,i=t.label,r=t.customProperties,o=t.choiceId,s=t.groupId,a=s&&s>=0?this._store.getGroupById(s):null;e&&o&&(this._store.dispatch((0,c.removeItem)(e,o)),this.passedElement.triggerEvent(d.EVENTS.removeItem,{id:e,value:n,label:i,customProperties:r,groupValue:a&&a.value?a.value:null}))},t.prototype._addChoice=function(t){var e=t.value,n=t.label,i=void 0===n?null:n,r=t.isSelected,o=void 0!==r&&r,s=t.isDisabled,l=void 0!==s&&s,c=t.groupId,u=void 0===c?-1:c,h=t.customProperties,d=void 0===h?{}:h,f=t.placeholder,p=void 0!==f&&f,g=t.keyCode,m=void 0===g?-1:g;if(null!=e){var v=this._store.choices,y=i||e,b=v?v.length+1:1,_="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(b);this._store.dispatch((0,a.addChoice)({id:b,groupId:u,elementId:_,value:e,label:y,disabled:l,customProperties:d,placeholder:p,keyCode:m})),o&&this._addItem({value:e,label:y,choiceId:b,customProperties:d,placeholder:p,keyCode:m})}},t.prototype._addGroup=function(t){var e=this,n=t.group,i=t.id,r=t.valueKey,o=void 0===r?"value":r,s=t.labelKey,a=void 0===s?"label":s,c=(0,p.isType)("Object",n)?n.choices:Array.from(n.getElementsByTagName("OPTION")),u=i||Math.floor((new Date).valueOf()*Math.random()),h=!!n.disabled&&n.disabled;c?(this._store.dispatch((0,l.addGroup)({value:n.label,id:u,active:!0,disabled:h})),c.forEach((function(t){var n=t.disabled||t.parentNode&&t.parentNode.disabled;e._addChoice({value:t[o],label:(0,p.isType)("Object",t)?t[a]:t.innerHTML,isSelected:t.selected,isDisabled:n,groupId:u,customProperties:t.customProperties,placeholder:t.placeholder})}))):this._store.dispatch((0,l.addGroup)({value:n.label,id:n.id,active:!1,disabled:n.disabled}))},t.prototype._getTemplate=function(t){for(var e,n=[],r=1;r0?this.element.scrollTop+s-r:t.offsetTop;requestAnimationFrame((function(){n._animateScroll(a,e)}))}},t.prototype._scrollDown=function(t,e,n){var i=(n-t)/e,r=i>1?i:1;this.element.scrollTop=t+r},t.prototype._scrollUp=function(t,e,n){var i=(t-n)/e,r=i>1?i:1;this.element.scrollTop=t-r},t.prototype._animateScroll=function(t,e){var n=this,r=i.SCROLLING_SPEED,o=this.element.scrollTop,s=!1;e>0?(this._scrollDown(o,r,t),ot&&(s=!0)),s&&requestAnimationFrame((function(){n._animateScroll(t,e)}))},t}();e.default=r},730:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var i=n(799),r=function(){function t(t){var e=t.element,n=t.classNames;if(this.element=e,this.classNames=n,!(e instanceof HTMLInputElement||e instanceof HTMLSelectElement))throw new TypeError("Invalid element passed");this.isDisabled=!1}return Object.defineProperty(t.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.element.value},set:function(t){this.element.value=t},enumerable:!1,configurable:!0}),t.prototype.conceal=function(){this.element.classList.add(this.classNames.input),this.element.hidden=!0,this.element.tabIndex=-1;var t=this.element.getAttribute("style");t&&this.element.setAttribute("data-choice-orig-style",t),this.element.setAttribute("data-choice","active")},t.prototype.reveal=function(){this.element.classList.remove(this.classNames.input),this.element.hidden=!1,this.element.removeAttribute("tabindex");var t=this.element.getAttribute("data-choice-orig-style");t?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",t)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},t.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},t.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},t.prototype.triggerEvent=function(t,e){(0,i.dispatchEvent)(this.element,t,e)},t}();e.default=r},541:function(t,e,n){var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){function e(e){var n=e.element,i=e.classNames,r=e.delimiter,o=t.call(this,{element:n,classNames:i})||this;return o.delimiter=r,o}return r(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(t){this.element.setAttribute("value",t),this.element.value=t},enumerable:!1,configurable:!0}),e}(o(n(730)).default);e.default=s},982:function(t,e,n){var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){function e(e){var n=e.element,i=e.classNames,r=e.template,o=t.call(this,{element:n,classNames:i})||this;return o.template=r,o}return r(e,t),Object.defineProperty(e.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"optionGroups",{get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return Array.from(this.element.options)},set:function(t){var e=this,n=document.createDocumentFragment();t.forEach((function(t){return i=t,r=e.template(i),void n.appendChild(r);var i,r})),this.appendDocFragment(n)},enumerable:!1,configurable:!0}),e.prototype.appendDocFragment=function(t){this.element.innerHTML="",this.element.appendChild(t)},e}(o(n(730)).default);e.default=s},883:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.SCROLLING_SPEED=e.SELECT_MULTIPLE_TYPE=e.SELECT_ONE_TYPE=e.TEXT_TYPE=e.KEY_CODES=e.ACTION_TYPES=e.EVENTS=void 0,e.EVENTS={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice",unhighlightItem:"unhighlightItem"},e.ACTION_TYPES={ADD_CHOICE:"ADD_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM",CLEAR_ALL:"CLEAR_ALL",RESET_TO:"RESET_TO",SET_IS_LOADING:"SET_IS_LOADING"},e.KEY_CODES={BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},e.TEXT_TYPE="text",e.SELECT_ONE_TYPE="select-one",e.SELECT_MULTIPLE_TYPE="select-multiple",e.SCROLLING_SPEED=4},789:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_CONFIG=e.DEFAULT_CLASSNAMES=void 0;var i=n(799);e.DEFAULT_CLASSNAMES={containerOuter:"choices",containerInner:"choices__inner",input:"choices__input",inputCloned:"choices__input--cloned",list:"choices__list",listItems:"choices__list--multiple",listSingle:"choices__list--single",listDropdown:"choices__list--dropdown",item:"choices__item",itemSelectable:"choices__item--selectable",itemDisabled:"choices__item--disabled",itemChoice:"choices__item--choice",placeholder:"choices__placeholder",group:"choices__group",groupHeading:"choices__heading",button:"choices__button",activeState:"is-active",focusState:"is-focused",openState:"is-open",disabledState:"is-disabled",highlightedState:"is-highlighted",selectedState:"is-selected",flippedState:"is-flipped",loadingState:"is-loading",noResults:"has-no-results",noChoices:"has-no-choices"},e.DEFAULT_CONFIG={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,allowHTML:!0,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:i.sortByAlpha,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(t){return'Press Enter to add "'.concat((0,i.sanitise)(t),'"')},maxItemText:function(t){return"Only ".concat(t," values can be added")},valueComparer:function(t,e){return t===e},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:e.DEFAULT_CLASSNAMES}},18:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},978:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},948:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},359:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},285:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},533:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},187:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(18),e),r(n(978),e),r(n(948),e),r(n(359),e),r(n(285),e),r(n(533),e),r(n(287),e),r(n(132),e),r(n(837),e),r(n(598),e),r(n(369),e),r(n(37),e),r(n(47),e),r(n(923),e),r(n(876),e)},287:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},132:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},837:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},598:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},37:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},369:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},47:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},923:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},876:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},799:function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.diff=e.cloneObject=e.existsInArray=e.dispatchEvent=e.sortByScore=e.sortByAlpha=e.strToEl=e.sanitise=e.isScrolledIntoView=e.getAdjacentEl=e.wrap=e.isType=e.getType=e.generateId=e.generateChars=e.getRandomNumber=void 0,e.getRandomNumber=function(t,e){return Math.floor(Math.random()*(e-t)+t)},e.generateChars=function(t){return Array.from({length:t},(function(){return(0,e.getRandomNumber)(0,36).toString(36)})).join("")},e.generateId=function(t,n){var i=t.id||t.name&&"".concat(t.name,"-").concat((0,e.generateChars)(2))||(0,e.generateChars)(4);return i=i.replace(/(:|\.|\[|\]|,)/g,""),i="".concat(n,"-").concat(i)},e.getType=function(t){return Object.prototype.toString.call(t).slice(8,-1)},e.isType=function(t,n){return null!=n&&(0,e.getType)(n)===t},e.wrap=function(t,e){return void 0===e&&(e=document.createElement("div")),t.parentNode&&(t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e)),e.appendChild(t)},e.getAdjacentEl=function(t,e,n){void 0===n&&(n=1);for(var i="".concat(n>0?"next":"previous","ElementSibling"),r=t[i];r;){if(r.matches(e))return r;r=r[i]}return r},e.isScrolledIntoView=function(t,e,n){return void 0===n&&(n=1),!!t&&(n>0?e.scrollTop+e.offsetHeight>=t.offsetTop+t.offsetHeight:t.offsetTop>=e.scrollTop)},e.sanitise=function(t){return"string"!=typeof t?t:t.replace(/&/g,"&").replace(/>/g,">").replace(/-1?t.map((function(t){var e=t;return e.id===parseInt("".concat(s.choiceId),10)&&(e.selected=!0),e})):t;case"REMOVE_ITEM":var a=i;return a.choiceId&&a.choiceId>-1?t.map((function(t){var e=t;return e.id===parseInt("".concat(a.choiceId),10)&&(e.selected=!1),e})):t;case"FILTER_CHOICES":var l=i;return t.map((function(t){var e=t;return e.active=l.results.some((function(t){var n=t.item,i=t.score;return n.id===e.id&&(e.score=i,!0)})),e}));case"ACTIVATE_CHOICES":var c=i;return t.map((function(t){var e=t;return e.active=c.active,e}));case"CLEAR_CHOICES":return e.defaultState;default:return t}}},871:function(t,e){var n=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r0?"treeitem":"option"),Object.assign(_.dataset,{choice:"",id:d,value:f,selectText:n}),v?(_.classList.add(u),_.dataset.choiceDisabled="",_.setAttribute("aria-disabled","true")):(_.classList.add(l),_.dataset.choiceSelectable=""),_},input:function(t,e){var n=t.classNames,i=n.input,r=n.inputCloned,o=Object.assign(document.createElement("input"),{type:"search",name:"search_terms",className:"".concat(i," ").concat(r),autocomplete:"off",autocapitalize:"off",spellcheck:!1});return o.setAttribute("role","textbox"),o.setAttribute("aria-autocomplete","list"),o.setAttribute("aria-label",e),o},dropdown:function(t){var e=t.classNames,n=e.list,i=e.listDropdown,r=document.createElement("div");return r.classList.add(n,i),r.setAttribute("aria-expanded","false"),r},notice:function(t,e,n){var i,r=t.allowHTML,o=t.classNames,s=o.item,a=o.itemChoice,l=o.noResults,c=o.noChoices;void 0===n&&(n="");var u=[s,a];return"no-choices"===n?u.push(c):"no-results"===n&&u.push(l),Object.assign(document.createElement("div"),((i={})[r?"innerHTML":"innerText"]=e,i.className=u.join(" "),i))},option:function(t){var e=t.label,n=t.value,i=t.customProperties,r=t.active,o=t.disabled,s=new Option(e,n,!1,r);return i&&(s.dataset.customProperties="".concat(i)),s.disabled=!!o,s}};e.default=n},996:function(t){var e=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===n}(t)}(t)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(t,e){return!1!==e.clone&&e.isMergeableObject(t)?l((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function r(t,e,n){return t.concat(e).map((function(t){return i(t,n)}))}function o(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return t.propertyIsEnumerable(e)})):[]}(t))}function s(t,e){try{return e in t}catch(t){return!1}}function a(t,e,n){var r={};return n.isMergeableObject(t)&&o(t).forEach((function(e){r[e]=i(t[e],n)})),o(e).forEach((function(o){(function(t,e){return s(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,o)||(s(t,o)&&n.isMergeableObject(e[o])?r[o]=function(t,e){if(!e.customMerge)return l;var n=e.customMerge(t);return"function"==typeof n?n:l}(o,n)(t[o],e[o],n):r[o]=i(e[o],n))})),r}function l(t,n,o){(o=o||{}).arrayMerge=o.arrayMerge||r,o.isMergeableObject=o.isMergeableObject||e,o.cloneUnlessOtherwiseSpecified=i;var s=Array.isArray(n);return s===Array.isArray(t)?s?o.arrayMerge(t,n,o):a(t,n,o):i(n,o)}l.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,n){return l(t,n,e)}),{})};var c=l;t.exports=c},221:function(t,e,n){function i(t){return Array.isArray?Array.isArray(t):"[object Array]"===u(t)}function r(t){return"string"==typeof t}function o(t){return"number"==typeof t}function s(t){return!0===t||!1===t||function(t){return a(t)&&null!==t}(t)&&"[object Boolean]"==u(t)}function a(t){return"object"==typeof t}function l(t){return null!=t}function c(t){return!t.trim().length}function u(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}n.r(e),n.d(e,{default:function(){return q}});const h=Object.prototype.hasOwnProperty;class d{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach((t=>{let n=f(t);e+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,e+=n.weight})),this._keys.forEach((t=>{t.weight/=e}))}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function f(t){let e=null,n=null,o=null,s=1;if(r(t)||i(t))o=t,e=p(t),n=g(t);else{if(!h.call(t,"name"))throw new Error((t=>`Missing ${t} property in key`)("name"));const i=t.name;if(o=i,h.call(t,"weight")&&(s=t.weight,s<=0))throw new Error((t=>`Property 'weight' in key '${t}' must be a positive integer`)(i));e=p(i),n=g(i)}return{path:e,id:n,weight:s,src:o}}function p(t){return i(t)?t:t.split(".")}function g(t){return i(t)?t.join("."):t}var m={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx{if(l(t))if(e[u]){const h=t[e[u]];if(!l(h))return;if(u===e.length-1&&(r(h)||o(h)||s(h)))n.push(function(t){return null==t?"":function(t){if("string"==typeof t)return t;let e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}(h));else if(i(h)){a=!0;for(let t=0,n=h.length;t{this._keysMap[t.id]=e}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,r(this.docs[0])?this.docs.forEach(((t,e)=>{this._addString(t,e)})):this.docs.forEach(((t,e)=>{this._addObject(t,e)})),this.norm.clear())}add(t){const e=this.size();r(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,n=this.size();e{let s=this.getFn(t,e.path);if(l(s))if(i(s)){let t=[];const e=[{nestedArrIndex:-1,value:s}];for(;e.length;){const{nestedArrIndex:n,value:o}=e.pop();if(l(o))if(r(o)&&!c(o)){let e={v:o,i:n,n:this.norm.get(o)};t.push(e)}else i(o)&&o.forEach(((t,n)=>{e.push({nestedArrIndex:n,value:t})}))}n.$[o]=t}else if(!c(s)){let t={v:s,n:this.norm.get(s)};n.$[o]=t}})),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function b(t,e,{getFn:n=m.getFn,fieldNormWeight:i=m.fieldNormWeight}={}){const r=new y({getFn:n,fieldNormWeight:i});return r.setKeys(t.map(f)),r.setSources(e),r.create(),r}function _(t,{errors:e=0,currentLocation:n=0,expectedLocation:i=0,distance:r=m.distance,ignoreLocation:o=m.ignoreLocation}={}){const s=e/t.length;if(o)return s;const a=Math.abs(i-n);return r?s+a/r:a?1:s}const x=32;function w(t,e,n,{location:i=m.location,distance:r=m.distance,threshold:o=m.threshold,findAllMatches:s=m.findAllMatches,minMatchCharLength:a=m.minMatchCharLength,includeMatches:l=m.includeMatches,ignoreLocation:c=m.ignoreLocation}={}){if(e.length>x)throw new Error("Pattern length exceeds max of 32.");const u=e.length,h=t.length,d=Math.max(0,Math.min(i,h));let f=o,p=d;const g=a>1||l,v=g?Array(h):[];let y;for(;(y=t.indexOf(e,p))>-1;){let t=_(e,{currentLocation:y,expectedLocation:d,distance:r,ignoreLocation:c});if(f=Math.min(t,f),p=y+u,g){let t=0;for(;t=l;o-=1){let s=o-1,a=n[t.charAt(s)];if(g&&(v[s]=+!!a),y[o]=(y[o+1]<<1|1)&a,i&&(y[o]|=(b[o+1]|b[o])<<1|1|b[o+1]),y[o]&S&&(w=_(e,{errors:i,currentLocation:s,expectedLocation:d,distance:r,ignoreLocation:c}),w<=f)){if(f=w,p=s,p<=d)break;l=Math.max(1,2*d-p)}}if(_(e,{errors:i+1,currentLocation:d,expectedLocation:d,distance:r,ignoreLocation:c})>f)break;b=y}const T={isMatch:p>=0,score:Math.max(.001,w)};if(g){const t=function(t=[],e=m.minMatchCharLength){let n=[],i=-1,r=-1,o=0;for(let s=t.length;o=e&&n.push([i,r]),i=-1)}return t[o-1]&&o-i>=e&&n.push([i,o-1]),n}(v,a);t.length?l&&(T.indices=t):T.isMatch=!1}return T}function E(t){let e={};for(let n=0,i=t.length;n{this.chunks.push({pattern:t,alphabet:E(t),startIndex:e})},u=this.pattern.length;if(u>x){let t=0;const e=u%x,n=u-e;for(;t{const{isMatch:p,score:g,indices:m}=w(t,e,d,{location:i+f,distance:r,threshold:o,findAllMatches:s,minMatchCharLength:a,includeMatches:n,ignoreLocation:l});p&&(h=!0),u+=g,p&&m&&(c=[...c,...m])}));let d={isMatch:h,score:h?u/this.chunks.length:1};return h&&n&&(d.indices=c),d}}class T{constructor(t){this.pattern=t}static isMultiMatch(t){return k(t,this.multiRegex)}static isSingleMatch(t){return k(t,this.singleRegex)}search(){}}function k(t,e){const n=t.match(e);return n?n[1]:null}class O extends T{constructor(t,{location:e=m.location,threshold:n=m.threshold,distance:i=m.distance,includeMatches:r=m.includeMatches,findAllMatches:o=m.findAllMatches,minMatchCharLength:s=m.minMatchCharLength,isCaseSensitive:a=m.isCaseSensitive,ignoreLocation:l=m.ignoreLocation}={}){super(t),this._bitapSearch=new S(t,{location:e,threshold:n,distance:i,includeMatches:r,findAllMatches:o,minMatchCharLength:s,isCaseSensitive:a,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class C extends T{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e,n=0;const i=[],r=this.pattern.length;for(;(e=t.indexOf(this.pattern,n))>-1;)n=e+r,i.push([e,n-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const M=[class extends T{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},C,class extends T{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends T{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends T{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends T{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class extends T{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=-1===t.indexOf(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},O],D=M.length,A=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/,I=new Set([O.type,C.type]);class L{constructor(t,{isCaseSensitive:e=m.isCaseSensitive,includeMatches:n=m.includeMatches,minMatchCharLength:i=m.minMatchCharLength,ignoreLocation:r=m.ignoreLocation,findAllMatches:o=m.findAllMatches,location:s=m.location,threshold:a=m.threshold,distance:l=m.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:n,minMatchCharLength:i,findAllMatches:o,ignoreLocation:r,location:s,threshold:a,distance:l},this.pattern=e?t:t.toLowerCase(),this.query=function(t,e={}){return t.split("|").map((t=>{let n=t.trim().split(A).filter((t=>t&&!!t.trim())),i=[];for(let t=0,r=n.length;t!(!t[j]&&!t[F]),$=t=>({[j]:Object.keys(t).map((e=>({[e]:t[e]})))});function z(t,e,{auto:n=!0}={}){const o=t=>{let s=Object.keys(t);const l=(t=>!!t[R])(t);if(!l&&s.length>1&&!V(t))return o($(t));if((t=>!i(t)&&a(t)&&!V(t))(t)){const i=l?t[R]:s[0],o=l?t[H]:t[i];if(!r(o))throw new Error((t=>`Invalid value for key ${t}`)(i));const a={keyId:g(i),pattern:o};return n&&(a.searcher=P(o,e)),a}let c={children:[],operator:s[0]};return s.forEach((e=>{const n=t[e];i(n)&&n.forEach((t=>{c.children.push(o(t))}))})),c};return V(t)||(t=$(t)),o(t)}function B(t,e){const n=t.matches;e.matches=[],l(n)&&n.forEach((t=>{if(!l(t.indices)||!t.indices.length)return;const{indices:n,value:i}=t;let r={indices:n,value:i};t.key&&(r.key=t.key.src),t.idx>-1&&(r.refIndex=t.idx),e.matches.push(r)}))}function W(t,e){e.score=t.score}class q{constructor(t,e={},n){this.options={...m,...e},this.options.useExtendedSearch,this._keyStore=new d(this.options.keys),this.setCollection(t,n)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof y))throw new Error("Incorrect 'index' type");this._myIndex=e||b(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){l(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=(()=>!1)){const e=[];for(let n=0,i=this._docs.length;n{let n=1;t.matches.forEach((({key:t,norm:i,score:r})=>{const o=t?t.weight:null;n*=Math.pow(0===r&&o?Number.EPSILON:r,(o||1)*(e?1:i))})),t.score=n}))}(c,{ignoreFieldNorm:l}),s&&c.sort(a),o(e)&&e>-1&&(c=c.slice(0,e)),function(t,e,{includeMatches:n=m.includeMatches,includeScore:i=m.includeScore}={}){const r=[];return n&&r.push(B),i&&r.push(W),t.map((t=>{const{idx:n}=t,i={item:e[n],refIndex:n};return r.length&&r.forEach((e=>{e(t,i)})),i}))}(c,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(t){const e=P(t,this.options),{records:n}=this._myIndex,i=[];return n.forEach((({v:t,i:n,n:r})=>{if(!l(t))return;const{isMatch:o,score:s,indices:a}=e.searchIn(t);o&&i.push({item:t,idx:n,matches:[{score:s,value:t,norm:r,indices:a}]})})),i}_searchLogical(t){const e=z(t,this.options),n=(t,e,i)=>{if(!t.children){const{keyId:n,searcher:r}=t,o=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(e,n),searcher:r});return o&&o.length?[{idx:i,item:e,matches:o}]:[]}const r=[];for(let o=0,s=t.children.length;o{if(l(t)){let s=n(e,t,i);s.length&&(r[i]||(r[i]={idx:i,item:t,matches:[]},o.push(r[i])),s.forEach((({matches:t})=>{r[i].matches.push(...t)})))}})),o}_searchObjectList(t){const e=P(t,this.options),{keys:n,records:i}=this._myIndex,r=[];return i.forEach((({$:t,i:i})=>{if(!l(t))return;let o=[];n.forEach(((n,i)=>{o.push(...this._findMatches({key:n,value:t[i],searcher:e}))})),o.length&&r.push({idx:i,item:t,matches:o})})),r}_findMatches({key:t,value:e,searcher:n}){if(!l(e))return[];let r=[];if(i(e))e.forEach((({v:e,i:i,n:o})=>{if(!l(e))return;const{isMatch:s,score:a,indices:c}=n.searchIn(e);s&&r.push({score:a,key:t,value:e,idx:i,norm:o,indices:c})}));else{const{v:i,n:o}=e,{isMatch:s,score:a,indices:l}=n.searchIn(i);s&&r.push({score:a,key:t,value:i,norm:o,indices:l})}return r}}q.version="6.5.3",q.createIndex=b,q.parseIndex=function(t,{getFn:e=m.getFn,fieldNormWeight:n=m.fieldNormWeight}={}){const{keys:i,records:r}=t,o=new y({getFn:e,fieldNormWeight:n});return o.setKeys(i),o.setIndexRecords(r),o},q.config=m,q.parseQuery=z,function(...t){N.push(...t)}(L)},857:function(t,e,n){function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function o(t){for(var e=1;e1?arguments[1]:void 0)}},48457:function(t,e,n){"use strict";var i=n(49974),r=n(46916),o=n(47908),s=n(53411),a=n(97659),l=n(4411),c=n(26244),u=n(86135),h=n(18554),d=n(71246),f=Array;t.exports=function(t){var e=o(t),n=l(this),p=arguments.length,g=p>1?arguments[1]:void 0,m=void 0!==g;m&&(g=i(g,p>2?arguments[2]:void 0));var v,y,b,_,x,w,E=d(e),S=0;if(!E||this===f&&a(E))for(v=c(e),y=n?new this(v):f(v);v>S;S++)w=m?g(e[S],S):e[S],u(y,S,w);else for(x=(_=h(e,E)).next,y=n?new this:[];!(b=r(x,_)).done;S++)w=m?s(_,g,[b.value,S],!0):b.value,u(y,S,w);return y.length=S,y}},41318:function(t,e,n){var i=n(45656),r=n(51400),o=n(26244),s=function(t){return function(e,n,s){var a,l=i(e),c=o(l),u=r(s,c);if(t&&n!=n){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===n)return t||u||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},42092:function(t,e,n){var i=n(49974),r=n(1702),o=n(68361),s=n(47908),a=n(26244),l=n(65417),c=r([].push),u=function(t){var e=1==t,n=2==t,r=3==t,u=4==t,h=6==t,d=7==t,f=5==t||h;return function(p,g,m,v){for(var y,b,_=s(p),x=o(_),w=i(g,m),E=a(x),S=0,T=v||l,k=e?T(p,E):n||d?T(p,0):void 0;E>S;S++)if((f||S in x)&&(b=w(y=x[S],S,_),t))if(e)k[S]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return S;case 2:c(k,y)}else switch(t){case 4:return!1;case 7:c(k,y)}return h?-1:r||u?u:k}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},81194:function(t,e,n){var i=n(47293),r=n(5112),o=n(7392),s=r("species");t.exports=function(t){return o>=51||!i((function(){var e=[];return(e.constructor={})[s]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},9341:function(t,e,n){"use strict";var i=n(47293);t.exports=function(t,e){var n=[][t];return!!n&&i((function(){n.call(null,e||function(){return 1},1)}))}},41589:function(t,e,n){var i=n(51400),r=n(26244),o=n(86135),s=Array,a=Math.max;t.exports=function(t,e,n){for(var l=r(t),c=i(e,l),u=i(void 0===n?l:n,l),h=s(a(u-c,0)),d=0;c0;)t[i]=t[--i];i!==o++&&(t[i]=n)}return t},a=function(t,e,n,i){for(var r=e.length,o=n.length,s=0,a=0;s9007199254740991)throw e("Maximum allowed index exceeded");return t}},48324:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},98509:function(t,e,n){var i=n(80317)("span").classList,r=i&&i.constructor&&i.constructor.prototype;t.exports=r===Object.prototype?void 0:r},7871:function(t){t.exports="object"==typeof window&&"object"!=typeof Deno},71528:function(t,e,n){var i=n(88113),r=n(17854);t.exports=/ipad|iphone|ipod/i.test(i)&&void 0!==r.Pebble},6833:function(t,e,n){var i=n(88113);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},35268:function(t,e,n){var i=n(84326),r=n(17854);t.exports="process"==i(r.process)},71036:function(t,e,n){var i=n(88113);t.exports=/web0s(?!.*chrome)/i.test(i)},88113:function(t,e,n){var i=n(35005);t.exports=i("navigator","userAgent")||""},7392:function(t,e,n){var i,r,o=n(17854),s=n(88113),a=o.process,l=o.Deno,c=a&&a.versions||l&&l.version,u=c&&c.v8;u&&(r=(i=u.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!r&&s&&(!(i=s.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=s.match(/Chrome\/(\d+)/))&&(r=+i[1]),t.exports=r},80748:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},82109:function(t,e,n){var i=n(17854),r=n(31236).f,o=n(68880),s=n(98052),a=n(13072),l=n(99920),c=n(54705);t.exports=function(t,e){var n,u,h,d,f,p=t.target,g=t.global,m=t.stat;if(n=g?i:m?i[p]||a(p,{}):(i[p]||{}).prototype)for(u in e){if(d=e[u],h=t.dontCallGetSet?(f=r(n,u))&&f.value:n[u],!c(g?u:p+(m?".":"#")+u,t.forced)&&void 0!==h){if(typeof d==typeof h)continue;l(d,h)}(t.sham||h&&h.sham)&&o(d,"sham",!0),s(n,u,d,t)}}},47293:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},27007:function(t,e,n){"use strict";n(74916);var i=n(1702),r=n(98052),o=n(22261),s=n(47293),a=n(5112),l=n(68880),c=a("species"),u=RegExp.prototype;t.exports=function(t,e,n,h){var d=a(t),f=!s((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),p=f&&!s((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return e=!0,null},n[d](""),!e}));if(!f||!p||n){var g=i(/./[d]),m=e(d,""[t],(function(t,e,n,r,s){var a=i(t),l=e.exec;return l===o||l===u.exec?f&&!s?{done:!0,value:g(e,n,r)}:{done:!0,value:a(n,e,r)}:{done:!1}}));r(String.prototype,t,m[0]),r(u,d,m[1])}h&&l(u[d],"sham",!0)}},22104:function(t,e,n){var i=n(34374),r=Function.prototype,o=r.apply,s=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?s.bind(o):function(){return s.apply(o,arguments)})},49974:function(t,e,n){var i=n(1702),r=n(19662),o=n(34374),s=i(i.bind);t.exports=function(t,e){return r(t),void 0===e?t:o?s(t,e):function(){return t.apply(e,arguments)}}},34374:function(t,e,n){var i=n(47293);t.exports=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},46916:function(t,e,n){var i=n(34374),r=Function.prototype.call;t.exports=i?r.bind(r):function(){return r.apply(r,arguments)}},76530:function(t,e,n){var i=n(19781),r=n(92597),o=Function.prototype,s=i&&Object.getOwnPropertyDescriptor,a=r(o,"name"),l=a&&"something"===function(){}.name,c=a&&(!i||i&&s(o,"name").configurable);t.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},1702:function(t,e,n){var i=n(34374),r=Function.prototype,o=r.bind,s=r.call,a=i&&o.bind(s,s);t.exports=i?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},35005:function(t,e,n){var i=n(17854),r=n(60614),o=function(t){return r(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?o(i[t]):i[t]&&i[t][e]}},71246:function(t,e,n){var i=n(70648),r=n(58173),o=n(97497),s=n(5112)("iterator");t.exports=function(t){if(null!=t)return r(t,s)||r(t,"@@iterator")||o[i(t)]}},18554:function(t,e,n){var i=n(46916),r=n(19662),o=n(19670),s=n(66330),a=n(71246),l=TypeError;t.exports=function(t,e){var n=arguments.length<2?a(t):e;if(r(n))return o(i(n,t));throw l(s(t)+" is not iterable")}},58173:function(t,e,n){var i=n(19662);t.exports=function(t,e){var n=t[e];return null==n?void 0:i(n)}},10647:function(t,e,n){var i=n(1702),r=n(47908),o=Math.floor,s=i("".charAt),a=i("".replace),l=i("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,i,h,d){var f=n+t.length,p=i.length,g=u;return void 0!==h&&(h=r(h),g=c),a(d,g,(function(r,a){var c;switch(s(a,0)){case"$":return"$";case"&":return t;case"`":return l(e,0,n);case"'":return l(e,f);case"<":c=h[l(a,1,-1)];break;default:var u=+a;if(0===u)return r;if(u>p){var d=o(u/10);return 0===d?r:d<=p?void 0===i[d-1]?s(a,1):i[d-1]+s(a,1):r}c=i[u-1]}return void 0===c?"":c}))}},17854:function(t,e,n){var i=function(t){return t&&t.Math==Math&&t};t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},92597:function(t,e,n){var i=n(1702),r=n(47908),o=i({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(r(t),e)}},3501:function(t){t.exports={}},842:function(t,e,n){var i=n(17854);t.exports=function(t,e){var n=i.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,e))}},60490:function(t,e,n){var i=n(35005);t.exports=i("document","documentElement")},64664:function(t,e,n){var i=n(19781),r=n(47293),o=n(80317);t.exports=!i&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},68361:function(t,e,n){var i=n(1702),r=n(47293),o=n(84326),s=Object,a=i("".split);t.exports=r((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?a(t,""):s(t)}:s},42788:function(t,e,n){var i=n(1702),r=n(60614),o=n(5465),s=i(Function.toString);r(o.inspectSource)||(o.inspectSource=function(t){return s(t)}),t.exports=o.inspectSource},29909:function(t,e,n){var i,r,o,s=n(68536),a=n(17854),l=n(1702),c=n(70111),u=n(68880),h=n(92597),d=n(5465),f=n(6200),p=n(3501),g="Object already initialized",m=a.TypeError,v=a.WeakMap;if(s||d.state){var y=d.state||(d.state=new v),b=l(y.get),_=l(y.has),x=l(y.set);i=function(t,e){if(_(y,t))throw new m(g);return e.facade=t,x(y,t,e),e},r=function(t){return b(y,t)||{}},o=function(t){return _(y,t)}}else{var w=f("state");p[w]=!0,i=function(t,e){if(h(t,w))throw new m(g);return e.facade=t,u(t,w,e),e},r=function(t){return h(t,w)?t[w]:{}},o=function(t){return h(t,w)}}t.exports={set:i,get:r,has:o,enforce:function(t){return o(t)?r(t):i(t,{})},getterFor:function(t){return function(e){var n;if(!c(e)||(n=r(e)).type!==t)throw m("Incompatible receiver, "+t+" required");return n}}}},97659:function(t,e,n){var i=n(5112),r=n(97497),o=i("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||s[o]===t)}},43157:function(t,e,n){var i=n(84326);t.exports=Array.isArray||function(t){return"Array"==i(t)}},60614:function(t){t.exports=function(t){return"function"==typeof t}},4411:function(t,e,n){var i=n(1702),r=n(47293),o=n(60614),s=n(70648),a=n(35005),l=n(42788),c=function(){},u=[],h=a("Reflect","construct"),d=/^\s*(?:class|function)\b/,f=i(d.exec),p=!d.exec(c),g=function(t){if(!o(t))return!1;try{return h(c,u,t),!0}catch(t){return!1}},m=function(t){if(!o(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!f(d,l(t))}catch(t){return!0}};m.sham=!0,t.exports=!h||r((function(){var t;return g(g.call)||!g(Object)||!g((function(){t=!0}))||t}))?m:g},54705:function(t,e,n){var i=n(47293),r=n(60614),o=/#|\.prototype\./,s=function(t,e){var n=l[a(t)];return n==u||n!=c&&(r(e)?i(e):!!e)},a=s.normalize=function(t){return String(t).replace(o,".").toLowerCase()},l=s.data={},c=s.NATIVE="N",u=s.POLYFILL="P";t.exports=s},70111:function(t,e,n){var i=n(60614);t.exports=function(t){return"object"==typeof t?null!==t:i(t)}},31913:function(t){t.exports=!1},47850:function(t,e,n){var i=n(70111),r=n(84326),o=n(5112)("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==r(t))}},52190:function(t,e,n){var i=n(35005),r=n(60614),o=n(47976),s=n(43307),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return r(e)&&o(e.prototype,a(t))}},20408:function(t,e,n){var i=n(49974),r=n(46916),o=n(19670),s=n(66330),a=n(97659),l=n(26244),c=n(47976),u=n(18554),h=n(71246),d=n(99212),f=TypeError,p=function(t,e){this.stopped=t,this.result=e},g=p.prototype;t.exports=function(t,e,n){var m,v,y,b,_,x,w,E=n&&n.that,S=!(!n||!n.AS_ENTRIES),T=!(!n||!n.IS_ITERATOR),k=!(!n||!n.INTERRUPTED),O=i(e,E),C=function(t){return m&&d(m,"normal",t),new p(!0,t)},M=function(t){return S?(o(t),k?O(t[0],t[1],C):O(t[0],t[1])):k?O(t,C):O(t)};if(T)m=t;else{if(!(v=h(t)))throw f(s(t)+" is not iterable");if(a(v)){for(y=0,b=l(t);b>y;y++)if((_=M(t[y]))&&c(g,_))return _;return new p(!1)}m=u(t,v)}for(x=m.next;!(w=r(x,m)).done;){try{_=M(w.value)}catch(t){d(m,"throw",t)}if("object"==typeof _&&_&&c(g,_))return _}return new p(!1)}},99212:function(t,e,n){var i=n(46916),r=n(19670),o=n(58173);t.exports=function(t,e,n){var s,a;r(t);try{if(!(s=o(t,"return"))){if("throw"===e)throw n;return n}s=i(s,t)}catch(t){a=!0,s=t}if("throw"===e)throw n;if(a)throw s;return r(s),n}},13383:function(t,e,n){"use strict";var i,r,o,s=n(47293),a=n(60614),l=n(70030),c=n(79518),u=n(98052),h=n(5112),d=n(31913),f=h("iterator"),p=!1;[].keys&&("next"in(o=[].keys())?(r=c(c(o)))!==Object.prototype&&(i=r):p=!0),null==i||s((function(){var t={};return i[f].call(t)!==t}))?i={}:d&&(i=l(i)),a(i[f])||u(i,f,(function(){return this})),t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:p}},97497:function(t){t.exports={}},26244:function(t,e,n){var i=n(17466);t.exports=function(t){return i(t.length)}},56339:function(t,e,n){var i=n(47293),r=n(60614),o=n(92597),s=n(19781),a=n(76530).CONFIGURABLE,l=n(42788),c=n(29909),u=c.enforce,h=c.get,d=Object.defineProperty,f=s&&!i((function(){return 8!==d((function(){}),"length",{value:8}).length})),p=String(String).split("String"),g=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!o(t,"name")||a&&t.name!==e)&&d(t,"name",{value:e,configurable:!0}),f&&n&&o(n,"arity")&&t.length!==n.arity&&d(t,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=u(t);return o(i,"source")||(i.source=p.join("string"==typeof e?e:"")),t};Function.prototype.toString=g((function(){return r(this)&&h(this).source||l(this)}),"toString")},74758:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var i=+t;return(i>0?n:e)(i)}},95948:function(t,e,n){var i,r,o,s,a,l,c,u,h=n(17854),d=n(49974),f=n(31236).f,p=n(20261).set,g=n(6833),m=n(71528),v=n(71036),y=n(35268),b=h.MutationObserver||h.WebKitMutationObserver,_=h.document,x=h.process,w=h.Promise,E=f(h,"queueMicrotask"),S=E&&E.value;S||(i=function(){var t,e;for(y&&(t=x.domain)&&t.exit();r;){e=r.fn,r=r.next;try{e()}catch(t){throw r?s():o=void 0,t}}o=void 0,t&&t.enter()},g||y||v||!b||!_?!m&&w&&w.resolve?((c=w.resolve(void 0)).constructor=w,u=d(c.then,c),s=function(){u(i)}):y?s=function(){x.nextTick(i)}:(p=d(p,h),s=function(){p(i)}):(a=!0,l=_.createTextNode(""),new b(i).observe(l,{characterData:!0}),s=function(){l.data=a=!a})),t.exports=S||function(t){var e={fn:t,next:void 0};o&&(o.next=e),r||(r=e,s()),o=e}},30735:function(t,e,n){var i=n(30133);t.exports=i&&!!Symbol.for&&!!Symbol.keyFor},30133:function(t,e,n){var i=n(7392),r=n(47293);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},590:function(t,e,n){var i=n(47293),r=n(5112),o=n(31913),s=r("iterator");t.exports=!i((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,n="";return t.pathname="c%20d",e.forEach((function(t,i){e.delete("b"),n+=i+t})),o&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},68536:function(t,e,n){var i=n(17854),r=n(60614),o=n(42788),s=i.WeakMap;t.exports=r(s)&&/native code/.test(o(s))},78523:function(t,e,n){"use strict";var i=n(19662),r=function(t){var e,n;this.promise=new t((function(t,i){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=i})),this.resolve=i(e),this.reject=i(n)};t.exports.f=function(t){return new r(t)}},3929:function(t,e,n){var i=n(47850),r=TypeError;t.exports=function(t){if(i(t))throw r("The method doesn't accept regular expressions");return t}},21574:function(t,e,n){"use strict";var i=n(19781),r=n(1702),o=n(46916),s=n(47293),a=n(81956),l=n(25181),c=n(55296),u=n(47908),h=n(68361),d=Object.assign,f=Object.defineProperty,p=r([].concat);t.exports=!d||s((function(){if(i&&1!==d({b:1},d(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=d({},t)[n]||a(d({},e)).join("")!=r}))?function(t,e){for(var n=u(t),r=arguments.length,s=1,d=l.f,f=c.f;r>s;)for(var g,m=h(arguments[s++]),v=d?p(a(m),d(m)):a(m),y=v.length,b=0;y>b;)g=v[b++],i&&!o(f,m,g)||(n[g]=m[g]);return n}:d},70030:function(t,e,n){var i,r=n(19670),o=n(36048),s=n(80748),a=n(3501),l=n(60490),c=n(80317),u=n(6200),h=u("IE_PROTO"),d=function(){},f=function(t){return"