avo 3.17.6.tw4 → 3.17.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +0 -1
- data/app/assets/stylesheets/avo.base.css +101 -101
- data/app/assets/stylesheets/css/fields/progress.css +4 -4
- data/app/assets/stylesheets/css/fields/tiptap.css +4 -4
- data/app/assets/stylesheets/css/pagination.css +2 -2
- data/app/assets/stylesheets/css/search.css +4 -4
- data/app/assets/stylesheets/css/tailwindcss/base.css +1 -0
- data/app/assets/stylesheets/css/tailwindcss/components.css +1 -0
- data/app/assets/stylesheets/css/tailwindcss/utilities.css +1 -0
- data/app/assets/stylesheets/css/tooltips.css +1 -1
- data/app/components/avo/actions_component.html.erb +3 -3
- data/app/components/avo/alert_component.html.erb +2 -2
- data/app/components/avo/alert_component.rb +1 -1
- data/app/components/avo/backtrace_alert_component.html.erb +3 -3
- data/app/components/avo/button_component.rb +3 -3
- data/app/components/avo/divider_component.html.erb +2 -2
- data/app/components/avo/empty_state_component.html.erb +1 -1
- data/app/components/avo/field_wrapper_component.html.erb +1 -1
- data/app/components/avo/fields/belongs_to_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/boolean_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/boolean_group_field/edit_component.rb +1 -1
- data/app/components/avo/fields/common/files/view_type/list_item_component.html.erb +3 -3
- data/app/components/avo/fields/common/key_value_component.html.erb +3 -3
- data/app/components/avo/fields/common/status_viewer_component.html.erb +5 -6
- data/app/components/avo/fields/date_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/date_time_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/tags_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/tags_field/tag_component.html.erb +1 -1
- data/app/components/avo/fields/tiptap_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/trix_field/edit_component.html.erb +1 -1
- data/app/components/avo/filters_component.html.erb +3 -3
- data/app/components/avo/index/grid_item_component.html.erb +2 -2
- data/app/components/avo/index/grid_item_component.rb +1 -1
- data/app/components/avo/index/resource_grid_component.html.erb +1 -1
- data/app/components/avo/index/resource_map_component.html.erb +1 -1
- data/app/components/avo/index/resource_table_component.html.erb +1 -1
- data/app/components/avo/index/table_row_component.html.erb +3 -3
- data/app/components/avo/items/panel_component.html.erb +1 -1
- data/app/components/avo/media_library/item_details_component.html.erb +1 -1
- data/app/components/avo/modal_component.html.erb +1 -1
- data/app/components/avo/paginator_component.html.erb +2 -1
- data/app/components/avo/panel_component.html.erb +2 -2
- data/app/components/avo/profile_item_component.rb +1 -1
- data/app/components/avo/resource_sidebar_component.html.erb +1 -1
- data/app/components/avo/row_selector_component.html.erb +1 -1
- data/app/components/avo/sidebar/link_component.rb +1 -1
- data/app/components/avo/sidebar_component.html.erb +3 -3
- data/app/components/avo/sidebar_profile_component.html.erb +4 -4
- data/app/components/avo/tab_group_component.html.erb +1 -1
- data/app/helpers/avo/application_helper.rb +4 -4
- data/app/javascript/js/controllers/fields/key_value_controller.js +1 -1
- data/app/javascript/js/controllers/fields/tags_field_helpers.js +1 -1
- data/app/javascript/js/controllers/search_controller.js +2 -2
- data/app/views/avo/base/preview.html.erb +1 -1
- data/app/views/avo/debug/report.html.erb +1 -1
- data/app/views/avo/debug/status.html.erb +14 -19
- data/app/views/avo/home/_actions.html.erb +1 -1
- data/app/views/avo/home/_dashboards.html.erb +1 -1
- data/app/views/avo/home/_filters.html.erb +1 -1
- data/app/views/avo/home/_resources.html.erb +2 -2
- data/app/views/avo/home/failed_to_load.html.erb +1 -1
- data/app/views/avo/partials/_confirm_dialog.html.erb +4 -4
- data/app/views/avo/partials/_custom_tools_alert.html.erb +6 -6
- data/app/views/avo/partials/_navbar.html.erb +3 -3
- data/app/views/avo/partials/_resource_search.html.erb +1 -1
- data/app/views/avo/partials/_table_header.html.erb +2 -2
- data/app/views/avo/sidebar/_license_warning.html.erb +1 -1
- data/lib/avo/concerns/row_controls_configuration.rb +15 -16
- data/lib/avo/resources/items/holder.rb +1 -1
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/resource_tool_generator.rb +1 -1
- data/lib/generators/avo/templates/cards/partial_card_partial.tt +1 -1
- data/lib/generators/avo/tool_generator.rb +2 -2
- data/lib/tasks/avo_tasks.rake +1 -1
- data/public/avo-assets/avo.base.css +12260 -10320
- data/public/avo-assets/avo.base.js +3 -3
- data/public/avo-assets/avo.base.js.map +2 -2
- data/tailwind.preset.js +20 -0
- metadata +6 -3
@@ -683,7 +683,7 @@ uniform `+$e+" "+Ge+" u_"+Qe+`;
|
|
683
683
|
${this.inputField("key",t,r,e)}
|
684
684
|
${this.inputField("value",t,r,e)}
|
685
685
|
`,this.options.editable&&(n+=this.dndIcon(t),n+=this.deleteButton(t)),n+="</div>",n}inputField(r="key",e,t,n){let i=r==="key"?t:n;return`<input
|
686
|
-
class="${this.options.inputClasses} focus:bg-gray-100 !rounded-none border-gray-600 border-r border-l-0 border-b-0 border-t-0 focus:border-gray-300 w-1/2 focus:outline-
|
686
|
+
class="${this.options.inputClasses} focus:bg-gray-100 !rounded-none border-gray-600 border-r border-l-0 border-b-0 border-t-0 focus:border-gray-300 w-1/2 focus:outline-none outline-none key-value-input-${r}"
|
687
687
|
data-action="input->key-value#${r}FieldUpdated"
|
688
688
|
placeholder="${this.options[`${r}_label`]}"
|
689
689
|
data-index="${e}"
|
@@ -748,7 +748,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
748
748
|
/>
|
749
749
|
</circle>`,n};var pG=function(e){var t=e.environment,n=t.document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("class","aa-SubmitIcon"),n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("width","20"),n.setAttribute("height","20"),n.setAttribute("fill","currentColor");var i=t.document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d","M16.041 15.856c-0.034 0.026-0.067 0.055-0.099 0.087s-0.060 0.064-0.087 0.099c-1.258 1.213-2.969 1.958-4.855 1.958-1.933 0-3.682-0.782-4.95-2.050s-2.050-3.017-2.050-4.95 0.782-3.682 2.050-4.95 3.017-2.050 4.95-2.050 3.682 0.782 4.95 2.050 2.050 3.017 2.050 4.95c0 1.886-0.745 3.597-1.959 4.856zM21.707 20.293l-3.675-3.675c1.231-1.54 1.968-3.493 1.968-5.618 0-2.485-1.008-4.736-2.636-6.364s-3.879-2.636-6.364-2.636-4.736 1.008-6.364 2.636-2.636 3.879-2.636 6.364 1.008 4.736 2.636 6.364 3.879 2.636 6.364 2.636c2.125 0 4.078-0.737 5.618-1.968l3.675 3.675c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414z"),n.appendChild(i),n};function ND(r){"@babel/helpers - typeof";return ND=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ND(r)}function ELe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function b0(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ELe(Object(t),!0).forEach(function(n){pzt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ELe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function pzt(r,e,t){return e=mzt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function mzt(r){var e=gzt(r,"string");return ND(e)==="symbol"?e:String(e)}function gzt(r,e){if(ND(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(ND(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function CLe(r){var e=r.autocomplete,t=r.autocompleteScopeApi,n=r.classNames,i=r.environment,o=r.isDetached,a=r.placeholder,l=a===void 0?"Search":a,f=r.propGetters,p=r.setIsModalOpen,g=r.state,w=r.translations,D=oq(i),I=f.getRootProps(b0({state:g,props:e.getRootProps({})},t)),R=D("div",b0({class:n.root},I)),N=D("div",{class:n.detachedContainer,onMouseDown:function(H){H.stopPropagation()}}),j=D("div",{class:n.detachedOverlay,children:[N],onMouseDown:function(){p(!1),e.setIsOpen(!1)}}),K=f.getLabelProps(b0({state:g,props:e.getLabelProps({})},t)),X=D("button",{class:n.submitButton,type:"submit",title:w.submitButtonTitle,children:[pG({environment:i})]}),le=D("label",b0({class:n.label,children:[X],ariaLabel:w.submitButtonTitle},K)),k=D("button",{class:n.clearButton,type:"reset",title:w.clearButtonTitle,children:[hLe({environment:i})]}),fe=D("div",{class:n.loadingIndicator,children:[TLe({environment:i})]}),oe=kLe({class:n.input,environment:i,state:g,getInputProps:f.getInputProps,getInputPropsCore:e.getInputProps,autocompleteScopeApi:t,isDetached:o}),ve=D("div",{class:n.inputWrapperPrefix,children:[le,fe]}),be=D("div",{class:n.inputWrapperSuffix,children:[k]}),me=D("div",{class:n.inputWrapper,children:[oe]}),ge=f.getFormProps(b0({state:g,props:e.getFormProps({inputElement:oe})},t)),Fe=D("form",b0({class:n.form,children:[ve,me,be]},ge)),B=f.getPanelProps(b0({state:g,props:e.getPanelProps({})},t)),J=D("div",b0({class:n.panel},B)),de=D("div",{class:n.detachedSearchButtonQuery,textContent:g.query}),De=D("div",{class:n.detachedSearchButtonPlaceholder,hidden:!!g.query,textContent:l});if(o){var re=D("div",{class:n.detachedSearchButtonIcon,children:[pG({environment:i})]}),ee=D("button",{type:"button",class:n.detachedSearchButton,title:w.detachedSearchButtonTitle,id:K.id,onClick:function(){p(!0)},children:[re,De,de]}),ie=D("button",{type:"button",class:n.detachedCancelButton,textContent:w.detachedCancelButtonText,onTouchStart:function(H){H.stopPropagation()},onClick:function(){e.setIsOpen(!1),p(!1)}}),Me=D("div",{class:n.detachedFormContainer,children:[Fe,ie]});N.appendChild(Me),R.appendChild(ee)}else R.appendChild(Fe);return{detachedContainer:N,detachedOverlay:j,detachedSearchButtonQuery:de,detachedSearchButtonPlaceholder:De,inputWrapper:me,input:oe,root:R,form:Fe,label:le,submitButton:X,clearButton:k,loadingIndicator:fe,panel:J}}function ALe(){var r=[],e=[];function t(n){r.push(n);var i=n();e.push(i)}return{runEffect:t,cleanupEffects:function(){var i=e;e=[],i.forEach(function(o){o()})},runEffects:function(){var i=r;r=[],i.forEach(function(o){t(o)})}}}function DLe(){var r=[];return{reactive:function(t){var n=t(),i={_fn:t,_ref:{current:n},get value(){return this._ref.current},set value(o){this._ref.current=o}};return r.push(i),i},runReactives:function(){r.forEach(function(t){t._ref.current=t._fn()})}}}var cq,pl,RLe,vzt,E_,OLe,FLe,mG,yzt,qD={},NLe=[],bzt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,vG=Array.isArray;function x0(r,e){for(var t in e)r[t]=e[t];return r}function qLe(r){var e=r.parentNode;e&&e.removeChild(r)}function yG(r,e,t){var n,i,o,a={};for(o in e)o=="key"?n=e[o]:o=="ref"?i=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?cq.call(arguments,2):t),typeof r=="function"&&r.defaultProps!=null)for(o in r.defaultProps)a[o]===void 0&&(a[o]=r.defaultProps[o]);return sq(r,a,n,i,null)}function sq(r,e,t,n,i){var o={type:r,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++RLe,__i:-1,__u:0};return i==null&&pl.vnode!=null&&pl.vnode(o),o}function Sk(r){return r.children}function lq(r,e){this.props=r,this.context=e}function wk(r,e){if(e==null)return r.__?wk(r.__,r.__i+1):null;for(var t;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null)return t.__e;return typeof r.type=="function"?wk(r):null}function BLe(r){var e,t;if((r=r.__)!=null&&r.__c!=null){for(r.__e=r.__c.base=null,e=0;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null){r.__e=r.__c.base=t.__e;break}return BLe(r)}}function ILe(r){(!r.__d&&(r.__d=!0)&&E_.push(r)&&!uq.__r++||OLe!==pl.debounceRendering)&&((OLe=pl.debounceRendering)||FLe)(uq)}function uq(){var r,e,t,n,i,o,a,l,f;for(E_.sort(mG);r=E_.shift();)r.__d&&(e=E_.length,n=void 0,o=(i=(t=r).__v).__e,l=[],f=[],(a=t.__P)&&((n=x0({},i)).__v=i.__v+1,pl.vnode&&pl.vnode(n),bG(a,n,i,t.__n,a.ownerSVGElement!==void 0,32&i.__u?[o]:null,l,o??wk(i),!!(32&i.__u),f),n.__.__k[n.__i]=n,jLe(l,n,f),n.__e!=o&&BLe(n)),E_.length>e&&E_.sort(mG));uq.__r=0}function zLe(r,e,t,n,i,o,a,l,f,p,g){var w,D,I,R,N,j=n&&n.__k||NLe,K=e.length;for(t.__d=f,xzt(t,e,j),f=t.__d,w=0;w<K;w++)(I=t.__k[w])!=null&&typeof I!="boolean"&&typeof I!="function"&&(D=I.__i===-1?qD:j[I.__i]||qD,I.__i=w,bG(r,I,D,i,o,a,l,f,p,g),R=I.__e,I.ref&&D.ref!=I.ref&&(D.ref&&xG(D.ref,null,I),g.push(I.ref,I.__c||R,I)),N==null&&R!=null&&(N=R),65536&I.__u||D.__k===I.__k?f=ULe(I,f,r):typeof I.type=="function"&&I.__d!==void 0?f=I.__d:R&&(f=R.nextSibling),I.__d=void 0,I.__u&=-196609);t.__d=f,t.__e=N}function xzt(r,e,t){var n,i,o,a,l,f=e.length,p=t.length,g=p,w=0;for(r.__k=[],n=0;n<f;n++)(i=r.__k[n]=(i=e[n])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?sq(null,i,null,null,i):vG(i)?sq(Sk,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?sq(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=r,i.__b=r.__b+1,l=_zt(i,t,a=n+w,g),i.__i=l,o=null,l!==-1&&(g--,(o=t[l])&&(o.__u|=131072)),o==null||o.__v===null?(l==-1&&w--,typeof i.type!="function"&&(i.__u|=65536)):l!==a&&(l===a+1?w++:l>a?g>f-a?w+=l-a:w--:w=l<a&&l==a-1?l-a:0,l!==n+w&&(i.__u|=65536))):(o=t[n])&&o.key==null&&o.__e&&(o.__e==r.__d&&(r.__d=wk(o)),gG(o,o,!1),t[n]=null,g--);if(g)for(n=0;n<p;n++)(o=t[n])!=null&&(131072&o.__u)==0&&(o.__e==r.__d&&(r.__d=wk(o)),gG(o,o))}function ULe(r,e,t){var n,i;if(typeof r.type=="function"){for(n=r.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=r,e=ULe(n[i],e,t));return e}return r.__e!=e&&(t.insertBefore(r.__e,e||null),e=r.__e),e&&e.nextSibling}function _zt(r,e,t,n){var i=r.key,o=r.type,a=t-1,l=t+1,f=e[t];if(f===null||f&&i==f.key&&o===f.type)return t;if(n>(f!=null&&(131072&f.__u)==0?1:0))for(;a>=0||l<e.length;){if(a>=0){if((f=e[a])&&(131072&f.__u)==0&&i==f.key&&o===f.type)return a;a--}if(l<e.length){if((f=e[l])&&(131072&f.__u)==0&&i==f.key&&o===f.type)return l;l++}}return-1}function MLe(r,e,t){e[0]==="-"?r.setProperty(e,t??""):r[e]=t==null?"":typeof t!="number"||bzt.test(e)?t:t+"px"}function aq(r,e,t,n,i){var o;e:if(e==="style")if(typeof t=="string")r.style.cssText=t;else{if(typeof n=="string"&&(r.style.cssText=n=""),n)for(e in n)t&&e in t||MLe(r.style,e,"");if(t)for(e in t)n&&t[e]===n[e]||MLe(r.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in r?e.toLowerCase().slice(2):e.slice(2),r.l||(r.l={}),r.l[e+o]=t,t?n?t.u=n.u:(t.u=Date.now(),r.addEventListener(e,o?PLe:LLe,o)):r.removeEventListener(e,o?PLe:LLe,o);else{if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in r)try{r[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?r.removeAttribute(e):r.setAttribute(e,t))}}function LLe(r){var e=this.l[r.type+!1];if(r.t){if(r.t<=e.u)return}else r.t=Date.now();return e(pl.event?pl.event(r):r)}function PLe(r){return this.l[r.type+!0](pl.event?pl.event(r):r)}function bG(r,e,t,n,i,o,a,l,f,p){var g,w,D,I,R,N,j,K,X,le,k,fe,oe,ve,be,me=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(f=!!(32&t.__u),o=[l=e.__e=t.__e]),(g=pl.__b)&&g(e);e:if(typeof me=="function")try{if(K=e.props,X=(g=me.contextType)&&n[g.__c],le=g?X?X.props.value:g.__:n,t.__c?j=(w=e.__c=t.__c).__=w.__E:("prototype"in me&&me.prototype.render?e.__c=w=new me(K,le):(e.__c=w=new lq(K,le),w.constructor=me,w.render=Szt),X&&X.sub(w),w.props=K,w.state||(w.state={}),w.context=le,w.__n=n,D=w.__d=!0,w.__h=[],w._sb=[]),w.__s==null&&(w.__s=w.state),me.getDerivedStateFromProps!=null&&(w.__s==w.state&&(w.__s=x0({},w.__s)),x0(w.__s,me.getDerivedStateFromProps(K,w.__s))),I=w.props,R=w.state,w.__v=e,D)me.getDerivedStateFromProps==null&&w.componentWillMount!=null&&w.componentWillMount(),w.componentDidMount!=null&&w.__h.push(w.componentDidMount);else{if(me.getDerivedStateFromProps==null&&K!==I&&w.componentWillReceiveProps!=null&&w.componentWillReceiveProps(K,le),!w.__e&&(w.shouldComponentUpdate!=null&&w.shouldComponentUpdate(K,w.__s,le)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(w.props=K,w.state=w.__s,w.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(ge){ge&&(ge.__=e)}),k=0;k<w._sb.length;k++)w.__h.push(w._sb[k]);w._sb=[],w.__h.length&&a.push(w);break e}w.componentWillUpdate!=null&&w.componentWillUpdate(K,w.__s,le),w.componentDidUpdate!=null&&w.__h.push(function(){w.componentDidUpdate(I,R,N)})}if(w.context=le,w.props=K,w.__P=r,w.__e=!1,fe=pl.__r,oe=0,"prototype"in me&&me.prototype.render){for(w.state=w.__s,w.__d=!1,fe&&fe(e),g=w.render(w.props,w.state,w.context),ve=0;ve<w._sb.length;ve++)w.__h.push(w._sb[ve]);w._sb=[]}else do w.__d=!1,fe&&fe(e),g=w.render(w.props,w.state,w.context),w.state=w.__s;while(w.__d&&++oe<25);w.state=w.__s,w.getChildContext!=null&&(n=x0(x0({},n),w.getChildContext())),D||w.getSnapshotBeforeUpdate==null||(N=w.getSnapshotBeforeUpdate(I,R)),zLe(r,vG(be=g!=null&&g.type===Sk&&g.key==null?g.props.children:g)?be:[be],e,t,n,i,o,a,l,f,p),w.base=e.__e,e.__u&=-161,w.__h.length&&a.push(w),j&&(w.__E=w.__=null)}catch(ge){e.__v=null,f||o!=null?(e.__e=l,e.__u|=f?160:32,o[o.indexOf(l)]=null):(e.__e=t.__e,e.__k=t.__k),pl.__e(ge,e,t)}else o==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=wzt(t.__e,e,t,n,i,o,a,f,p);(g=pl.diffed)&&g(e)}function jLe(r,e,t){e.__d=void 0;for(var n=0;n<t.length;n++)xG(t[n],t[++n],t[++n]);pl.__c&&pl.__c(e,r),r.some(function(i){try{r=i.__h,i.__h=[],r.some(function(o){o.call(i)})}catch(o){pl.__e(o,i.__v)}})}function wzt(r,e,t,n,i,o,a,l,f){var p,g,w,D,I,R,N,j=t.props,K=e.props,X=e.type;if(X==="svg"&&(i=!0),o!=null){for(p=0;p<o.length;p++)if((I=o[p])&&"setAttribute"in I==!!X&&(X?I.localName===X:I.nodeType===3)){r=I,o[p]=null;break}}if(r==null){if(X===null)return document.createTextNode(K);r=i?document.createElementNS("http://www.w3.org/2000/svg",X):document.createElement(X,K.is&&K),o=null,l=!1}if(X===null)j===K||l&&r.data===K||(r.data=K);else{if(o=o&&cq.call(r.childNodes),j=t.props||qD,!l&&o!=null)for(j={},p=0;p<r.attributes.length;p++)j[(I=r.attributes[p]).name]=I.value;for(p in j)I=j[p],p=="children"||(p=="dangerouslySetInnerHTML"?w=I:p==="key"||p in K||aq(r,p,null,I,i));for(p in K)I=K[p],p=="children"?D=I:p=="dangerouslySetInnerHTML"?g=I:p=="value"?R=I:p=="checked"?N=I:p==="key"||l&&typeof I!="function"||j[p]===I||aq(r,p,I,j[p],i);if(g)l||w&&(g.__html===w.__html||g.__html===r.innerHTML)||(r.innerHTML=g.__html),e.__k=[];else if(w&&(r.innerHTML=""),zLe(r,vG(D)?D:[D],e,t,n,i&&X!=="foreignObject",o,a,o?o[0]:t.__k&&wk(t,0),l,f),o!=null)for(p=o.length;p--;)o[p]!=null&&qLe(o[p]);l||(p="value",R!==void 0&&(R!==r[p]||X==="progress"&&!R||X==="option"&&R!==j[p])&&aq(r,p,R,j[p],!1),p="checked",N!==void 0&&N!==r[p]&&aq(r,p,N,j[p],!1))}return r}function xG(r,e,t){try{typeof r=="function"?r(e):r.current=e}catch(n){pl.__e(n,t)}}function gG(r,e,t){var n,i;if(pl.unmount&&pl.unmount(r),(n=r.ref)&&(n.current&&n.current!==r.__e||xG(n,null,e)),(n=r.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){pl.__e(o,e)}n.base=n.__P=null,r.__c=void 0}if(n=r.__k)for(i=0;i<n.length;i++)n[i]&&gG(n[i],e,t||typeof r.type!="function");t||r.__e==null||qLe(r.__e),r.__=r.__e=r.__d=void 0}function Szt(r,e,t){return this.constructor(r,t)}function HLe(r,e,t){var n,i,o,a;pl.__&&pl.__(r,e),i=(n=typeof t=="function")?null:t&&t.__k||e.__k,o=[],a=[],bG(e,r=(!n&&t||e).__k=yG(Sk,null,[r]),i||qD,qD,e.ownerSVGElement!==void 0,!n&&t?[t]:i?null:e.firstChild?cq.call(e.childNodes):null,o,!n&&t?t:i?i.__e:e.firstChild,n,a),jLe(o,r,a)}cq=NLe.slice,pl={__e:function(r,e,t,n){for(var i,o,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(r)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(r,n||{}),a=i.__d),a)return i.__E=i}catch(l){r=l}throw r}},RLe=0,vzt=function(r){return r!=null&&r.constructor==null},lq.prototype.setState=function(r,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=x0({},this.state),typeof r=="function"&&(r=r(x0({},t),this.props)),r&&x0(t,r),r!=null&&this.__v&&(e&&this._sb.push(e),ILe(this))},lq.prototype.forceUpdate=function(r){this.__v&&(this.__e=!0,r&&this.__h.push(r),ILe(this))},lq.prototype.render=Sk,E_=[],FLe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,mG=function(r,e){return r.__v.__b-e.__v.__b},uq.__r=0,yzt=0;var WLe="__aa-highlight__",VLe="__/aa-highlight__";function kzt(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=r;return{get:function(){return e},add:function(n){var i=e[e.length-1];i?.isHighlighted===n.isHighlighted?e[e.length-1]={value:i.value+n.value,isHighlighted:i.isHighlighted}:e.push(n)}}}function fq(r){var e=r.highlightedValue,t=e.split(WLe),n=t.shift(),i=kzt(n?[{value:n,isHighlighted:!1}]:[]);return t.forEach(function(o){var a=o.split(VLe);i.add({value:a[0],isHighlighted:!0}),a[1]!==""&&i.add({value:a[1],isHighlighted:!1})}),i.get()}function Tzt(r){return Dzt(r)||Azt(r)||Czt(r)||Ezt()}function Ezt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
750
750
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Czt(r,e){if(r){if(typeof r=="string")return _G(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _G(r,e)}}function Azt(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Dzt(r){if(Array.isArray(r))return _G(r)}function _G(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function hq(r){var e=r.hit,t=r.attribute,n=Array.isArray(t)?t:[t],i=dk(e,["_highlightResult"].concat(Tzt(n),["value"]));return typeof i!="string"&&(i=dk(e,n)||""),fq({highlightedValue:i})}var Ozt={"&":"&","<":"<",">":">",""":'"',"'":"'"},Izt=new RegExp(/\w/i),$Le=/&(amp|quot|lt|gt|#39);/g,Mzt=RegExp($Le.source);function Lzt(r){return r&&Mzt.test(r)?r.replace($Le,function(e){return Ozt[e]}):r}function GLe(r,e){var t,n,i=r[e],o=((t=r[e+1])===null||t===void 0?void 0:t.isHighlighted)||!0,a=((n=r[e-1])===null||n===void 0?void 0:n.isHighlighted)||!0;return!Izt.test(Lzt(i.value))&&a===o?a:i.isHighlighted}function BD(r){"@babel/helpers - typeof";return BD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},BD(r)}function KLe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function dq(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?KLe(Object(t),!0).forEach(function(n){Pzt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):KLe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Pzt(r,e,t){return e=Rzt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Rzt(r){var e=Fzt(r,"string");return BD(e)==="symbol"?e:String(e)}function Fzt(r,e){if(BD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(BD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function pq(r){return r.some(function(e){return e.isHighlighted})?r.map(function(e,t){return dq(dq({},e),{},{isHighlighted:!GLe(r,t)})}):r.map(function(e){return dq(dq({},e),{},{isHighlighted:!1})})}function YLe(r){return pq(hq(r))}function Nzt(r){return Uzt(r)||zzt(r)||Bzt(r)||qzt()}function qzt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
751
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bzt(r,e){if(r){if(typeof r=="string")return wG(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return wG(r,e)}}function zzt(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Uzt(r){if(Array.isArray(r))return wG(r)}function wG(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function mq(r){var e=r.hit,t=r.attribute,n=Array.isArray(t)?t:[t],i=dk(e,["_snippetResult"].concat(Nzt(n),["value"]));return typeof i!="string"&&(i=dk(e,n)||""),fq({highlightedValue:i})}function ZLe(r){return pq(mq(r))}function XLe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,l=i.tagName,f=l===void 0?"mark":l;return e(t,{},hq({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(f,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="Highlight",n}function JLe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,l=i.tagName,f=l===void 0?"mark":l;return e(t,{},YLe({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(f,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="ReverseHighlight",n}function QLe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,l=i.tagName,f=l===void 0?"mark":l;return e(t,{},ZLe({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(f,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="ReverseSnippet",n}function ePe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,l=i.tagName,f=l===void 0?"mark":l;return e(t,{},mq({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(f,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="Snippet",n}function zD(r){"@babel/helpers - typeof";return zD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zD(r)}var jzt=["classNames","container","getEnvironmentProps","getFormProps","getInputProps","getItemProps","getLabelProps","getListProps","getPanelProps","getRootProps","panelContainer","panelPlacement","render","renderNoResults","renderer","detachedMediaQuery","components","translations"];function tPe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function _0(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tPe(Object(t),!0).forEach(function(n){Hzt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):tPe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Hzt(r,e,t){return e=Wzt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wzt(r){var e=Vzt(r,"string");return zD(e)==="symbol"?e:String(e)}function Vzt(r,e){if(zD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(zD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function $zt(r,e){if(r==null)return{};var t=Gzt(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Gzt(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}var Kzt={clearButton:"aa-ClearButton",detachedCancelButton:"aa-DetachedCancelButton",detachedContainer:"aa-DetachedContainer",detachedFormContainer:"aa-DetachedFormContainer",detachedOverlay:"aa-DetachedOverlay",detachedSearchButton:"aa-DetachedSearchButton",detachedSearchButtonIcon:"aa-DetachedSearchButtonIcon",detachedSearchButtonPlaceholder:"aa-DetachedSearchButtonPlaceholder",detachedSearchButtonQuery:"aa-DetachedSearchButtonQuery",form:"aa-Form",input:"aa-Input",inputWrapper:"aa-InputWrapper",inputWrapperPrefix:"aa-InputWrapperPrefix",inputWrapperSuffix:"aa-InputWrapperSuffix",item:"aa-Item",label:"aa-Label",list:"aa-List",loadingIndicator:"aa-LoadingIndicator",panel:"aa-Panel",panelLayout:"aa-PanelLayout aa-Panel--scrollable",root:"aa-Autocomplete",source:"aa-Source",sourceFooter:"aa-SourceFooter",sourceHeader:"aa-SourceHeader",sourceNoResults:"aa-SourceNoResults",submitButton:"aa-SubmitButton"},Yzt=function(e,t){var n=e.children,i=e.render;i(n,t)},Zzt={createElement:yG,Fragment:Sk,render:HLe};function rPe(r){var e,t=r.classNames,n=r.container,i=r.getEnvironmentProps,o=r.getFormProps,a=r.getInputProps,l=r.getItemProps,f=r.getLabelProps,p=r.getListProps,g=r.getPanelProps,w=r.getRootProps,D=r.panelContainer,I=r.panelPlacement,R=r.render,N=r.renderNoResults,j=r.renderer,K=r.detachedMediaQuery,X=r.components,le=r.translations,k=$zt(r,jzt),fe=typeof window<"u"?window:{},oe=sG(fe,n);oe.tagName;var ve=_0(_0({},Zzt),j),be={Highlight:XLe(ve),ReverseHighlight:JLe(ve),ReverseSnippet:QLe(ve),Snippet:ePe(ve)},me={clearButtonTitle:"Clear",detachedCancelButtonText:"Cancel",detachedSearchButtonTitle:"Search",submitButtonTitle:"Submit"};return{renderer:{classNames:dLe(Kzt,t??{}),container:oe,getEnvironmentProps:i??function(ge){var Fe=ge.props;return Fe},getFormProps:o??function(ge){var Fe=ge.props;return Fe},getInputProps:a??function(ge){var Fe=ge.props;return Fe},getItemProps:l??function(ge){var Fe=ge.props;return Fe},getLabelProps:f??function(ge){var Fe=ge.props;return Fe},getListProps:p??function(ge){var Fe=ge.props;return Fe},getPanelProps:g??function(ge){var Fe=ge.props;return Fe},getRootProps:w??function(ge){var Fe=ge.props;return Fe},panelContainer:D?sG(fe,D):fe.document.body,panelPlacement:I??"input-wrapper-width",render:R??Yzt,renderNoResults:N,renderer:ve,detachedMediaQuery:K??getComputedStyle(fe.document.documentElement).getPropertyValue("--aa-detached-media-query"),components:_0(_0({},be),X),translations:_0(_0({},me),le)},core:_0(_0({},k),{},{id:(e=k.id)!==null&&e!==void 0?e:XN(),environment:fe})}}function nPe(r){var e=r.panelPlacement,t=r.container,n=r.form,i=r.environment,o=t.getBoundingClientRect(),a=i.pageYOffset||i.document.documentElement.scrollTop||i.document.body.scrollTop||0,l=a+o.top+o.height;switch(e){case"start":return{top:l,left:o.left};case"end":return{top:l,right:i.document.documentElement.clientWidth-(o.left+o.width)};case"full-width":return{top:l,left:0,right:0,width:"unset",maxWidth:"unset"};case"input-wrapper-width":{var f=n.getBoundingClientRect();return{top:l,left:f.left,right:i.document.documentElement.clientWidth-(f.left+f.width),width:"unset",maxWidth:"unset"}}default:throw new Error("[Autocomplete] The `panelPlacement` value ".concat(JSON.stringify(e)," is not valid."))}}function UD(r){"@babel/helpers - typeof";return UD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UD(r)}function gq(){return gq=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},gq.apply(this,arguments)}function iPe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function kk(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?iPe(Object(t),!0).forEach(function(n){Xzt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):iPe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Xzt(r,e,t){return e=Jzt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jzt(r){var e=Qzt(r,"string");return UD(e)==="symbol"?e:String(e)}function Qzt(r,e){if(UD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(UD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function oPe(r){var e=r.autocomplete,t=r.autocompleteScopeApi,n=r.dom,i=r.propGetters,o=r.state;fG(n.root,i.getRootProps(kk({state:o,props:e.getRootProps({})},t))),fG(n.input,i.getInputProps(kk({state:o,props:e.getInputProps({inputElement:n.input}),inputElement:n.input},t))),Nd(n.label,{hidden:o.status==="stalled"}),Nd(n.loadingIndicator,{hidden:o.status!=="stalled"}),Nd(n.clearButton,{hidden:!o.query}),Nd(n.detachedSearchButtonQuery,{textContent:o.query}),Nd(n.detachedSearchButtonPlaceholder,{hidden:!!o.query})}function aPe(r,e){var t=e.autocomplete,n=e.autocompleteScopeApi,i=e.classNames,o=e.html,a=e.dom,l=e.panelContainer,f=e.propGetters,p=e.state,g=e.components,w=e.renderer;if(!p.isOpen){l.contains(a.panel)&&l.removeChild(a.panel);return}!l.contains(a.panel)&&p.status!=="loading"&&l.appendChild(a.panel),a.panel.classList.toggle("aa-Panel--stalled",p.status==="stalled");var D=p.collections.filter(function(N){var j=N.source,K=N.items;return j.templates.noResults||K.length>0}).map(function(N,j){var K=N.source,X=N.items;return w.createElement("section",{key:j,className:i.source,"data-autocomplete-source-id":K.sourceId},K.templates.header&&w.createElement("div",{className:i.sourceHeader},K.templates.header({components:g,createElement:w.createElement,Fragment:w.Fragment,items:X,source:K,state:p,html:o})),K.templates.noResults&&X.length===0?w.createElement("div",{className:i.sourceNoResults},K.templates.noResults({components:g,createElement:w.createElement,Fragment:w.Fragment,source:K,state:p,html:o})):w.createElement("ul",gq({className:i.list},f.getListProps(kk({state:p,props:t.getListProps({source:K})},n))),X.map(function(le){var k=t.getItemProps({item:le,source:K});return w.createElement("li",gq({key:k.id,className:i.item},f.getItemProps(kk({state:p,props:k},n))),K.templates.item({components:g,createElement:w.createElement,Fragment:w.Fragment,item:le,state:p,html:o}))})),K.templates.footer&&w.createElement("div",{className:i.sourceFooter},K.templates.footer({components:g,createElement:w.createElement,Fragment:w.Fragment,items:X,source:K,state:p,html:o})))}),I=w.createElement(w.Fragment,null,w.createElement("div",{className:i.panelLayout},D),w.createElement("div",{className:"aa-GradientBottom"})),R=D.reduce(function(N,j){return N[j.props["data-autocomplete-source-id"]]=j,N},{});r(kk(kk({children:I,state:p,sections:D,elements:R},w),{},{components:g,html:o},n),a.panel)}var sPe=[{segment:"autocomplete-js",version:JN}];var e5t=["components"];function jD(r){"@babel/helpers - typeof";return jD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jD(r)}function t5t(r,e){if(r==null)return{};var t=r5t(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function r5t(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function lPe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function C_(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lPe(Object(t),!0).forEach(function(n){cPe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):lPe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function cPe(r,e,t){return e=n5t(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function n5t(r){var e=i5t(r,"string");return jD(e)==="symbol"?e:String(e)}function i5t(r,e){if(jD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(jD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var uPe=0;function fPe(r){var e=ALe(),t=e.runEffect,n=e.cleanupEffects,i=e.runEffects,o=DLe(),a=o.reactive,l=o.runReactives,f=__(!1),p=__(r),g=__(void 0),w=a(function(){return rPe(p.current)}),D=a(function(){return w.value.core.environment.matchMedia(w.value.renderer.detachedMediaQuery).matches}),I=a(function(){return lLe(C_(C_({},w.value.core),{},{onStateChange:function(me){var ge,Fe,B;f.current=me.state.collections.some(function(J){return J.source.templates.noResults}),(ge=g.current)===null||ge===void 0||ge.call(g,me),(Fe=(B=w.value.core).onStateChange)===null||Fe===void 0||Fe.call(B,me)},shouldPanelOpen:p.current.shouldPanelOpen||function(be){var me=be.state;if(D.value)return!0;var ge=y0(me)>0;if(!w.value.core.openOnFocus&&!me.query)return ge;var Fe=!!(f.current||w.value.renderer.renderNoResults);return!ge&&Fe||ge},__autocomplete_metadata:{userAgents:sPe,options:r}}))}),R=__(C_({collections:[],completion:null,context:{},isOpen:!1,query:"",activeItemId:null,status:"idle"},w.value.core.initialState)),N={getEnvironmentProps:w.value.renderer.getEnvironmentProps,getFormProps:w.value.renderer.getFormProps,getInputProps:w.value.renderer.getInputProps,getItemProps:w.value.renderer.getItemProps,getLabelProps:w.value.renderer.getLabelProps,getListProps:w.value.renderer.getListProps,getPanelProps:w.value.renderer.getPanelProps,getRootProps:w.value.renderer.getRootProps},j={setActiveItemId:I.value.setActiveItemId,setQuery:I.value.setQuery,setCollections:I.value.setCollections,setIsOpen:I.value.setIsOpen,setStatus:I.value.setStatus,setContext:I.value.setContext,refresh:I.value.refresh,navigator:I.value.navigator},K=a(function(){return fLe.bind(w.value.renderer.renderer.createElement)}),X=a(function(){return CLe({autocomplete:I.value,autocompleteScopeApi:j,classNames:w.value.renderer.classNames,environment:w.value.core.environment,isDetached:D.value,placeholder:w.value.core.placeholder,propGetters:N,setIsModalOpen:ve,state:R.current,translations:w.value.renderer.translations})});function le(){Nd(X.value.panel,{style:D.value?{}:nPe({panelPlacement:w.value.renderer.panelPlacement,container:X.value.root,form:X.value.form,environment:w.value.core.environment})})}function k(be){R.current=be;var me={autocomplete:I.value,autocompleteScopeApi:j,classNames:w.value.renderer.classNames,components:w.value.renderer.components,container:w.value.renderer.container,html:K.value,dom:X.value,panelContainer:D.value?X.value.detachedContainer:w.value.renderer.panelContainer,propGetters:N,state:R.current,renderer:w.value.renderer.renderer},ge=!y0(be)&&!f.current&&w.value.renderer.renderNoResults||w.value.renderer.render;oPe(me),aPe(ge,me)}t(function(){var be=I.value.getEnvironmentProps({formElement:X.value.form,panelElement:X.value.panel,inputElement:X.value.input});return Nd(w.value.core.environment,be),function(){Nd(w.value.core.environment,Object.keys(be).reduce(function(me,ge){return C_(C_({},me),{},cPe({},ge,void 0))},{}))}}),t(function(){var be=D.value?w.value.core.environment.document.body:w.value.renderer.panelContainer,me=D.value?X.value.detachedOverlay:X.value.panel;return D.value&&R.current.isOpen&&ve(!0),k(R.current),function(){be.contains(me)&&(be.removeChild(me),be.classList.remove("aa-Detached"))}}),t(function(){var be=w.value.renderer.container;return be.appendChild(X.value.root),function(){be.removeChild(X.value.root)}}),t(function(){var be=fk(function(me){var ge=me.state;k(ge)},0);return g.current=function(me){var ge=me.state,Fe=me.prevState;if(D.value&&Fe.isOpen!==ge.isOpen&&ve(ge.isOpen),!D.value&&ge.isOpen&&!Fe.isOpen&&le(),ge.query!==Fe.query){var B=w.value.core.environment.document.querySelectorAll(".aa-Panel--scrollable");B.forEach(function(J){J.scrollTop!==0&&(J.scrollTop=0)})}be({state:ge})},function(){g.current=void 0}}),t(function(){var be=fk(function(){var me=D.value;D.value=w.value.core.environment.matchMedia(w.value.renderer.detachedMediaQuery).matches,me!==D.value?oe({}):requestAnimationFrame(le)},20);return w.value.core.environment.addEventListener("resize",be),function(){w.value.core.environment.removeEventListener("resize",be)}}),t(function(){if(!D.value)return function(){};function be(B){X.value.detachedContainer.classList.toggle("aa-DetachedContainer--modal",B)}function me(B){be(B.matches)}var ge=w.value.core.environment.matchMedia(getComputedStyle(w.value.core.environment.document.documentElement).getPropertyValue("--aa-detached-modal-media-query"));be(ge.matches);var Fe=!!ge.addEventListener;return Fe?ge.addEventListener("change",me):ge.addListener(me),function(){Fe?ge.removeEventListener("change",me):ge.removeListener(me)}}),t(function(){return requestAnimationFrame(le),function(){}});function fe(){uPe--,n()}function oe(){var be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n();var me=w.value.renderer,ge=me.components,Fe=t5t(me,e5t);p.current=cG(Fe,w.value.core,{components:bLe(ge,function(B){var J=B.value;return!J.hasOwnProperty("__autocomplete_componentName")}),initialState:R.current},be),l(),i(),I.value.refresh().then(function(){k(R.current)})}function ve(be){var me=w.value.core.environment.document.body.contains(X.value.detachedOverlay);be!==me&&(be?(w.value.core.environment.document.body.appendChild(X.value.detachedOverlay),w.value.core.environment.document.body.classList.add("aa-Detached"),X.value.input.focus()):(w.value.core.environment.document.body.removeChild(X.value.detachedOverlay),w.value.core.environment.document.body.classList.remove("aa-Detached")))}return uPe++,C_(C_({},j),{},{update:oe,destroy:fe})}var dPe=Qo(l_());var vq=(r,e)=>{let t;return(...n)=>(t&&clearTimeout(t),new Promise(i=>{t=setTimeout(()=>i(r(...n)),e)}))};var yq=class extends Ar{static targets=["autocomplete","button","hiddenId","visibleLabel","clearValue","clearButton"];static values={extraParams:Object};debouncedFetch=vq(fetch,this.searchDebounce);destroyMethod;get dataset(){return this.autocompleteTarget.dataset}get searchDebounce(){return window.Avo.configuration.search_debounce}get translationKeys(){let r;try{r=JSON.parse(this.dataset.translationKeys)}catch{r={}}return r}get isBelongsToSearch(){return this.dataset.viaAssociation==="belongs_to"}get isHasManySearch(){return this.dataset.viaAssociation==="has_many"}get isGlobalSearch(){return this.dataset.searchResource==="global"}connect(){let r=this;this.buttonTarget.onclick=()=>this.showSearchPanel(),this.clearValueTargets.forEach(t=>{t.getAttribute("value")&&this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")}),this.isGlobalSearch&&hPe.bind(["command+k","ctrl+k"],()=>this.showSearchPanel()),this.autocompleteTarget.innerHTML="";let{destroy:e}=fPe({container:this.autocompleteTarget,placeholder:this.translationKeys.placeholder,translations:{detachedCancelButtonText:this.translationKeys.cancel_button},autoFocus:!0,openOnFocus:!0,detachedMediaQuery:"",onStateChange({prevState:t,state:n}){!n.isOpen&&t.isOpen&&(n.query="")},getSources:({query:t})=>{document.body.classList.add("search-loading");let n=r.searchUrl(t);return r.debouncedFetch(n).then(i=>(document.body.classList.remove("search-loading"),i.json())).then(i=>Object.keys(i).map(o=>r.addSource(o,i[o])))}});this.destroyMethod=e,this.buttonTarget.dataset.shouldBeDisabled!=="true"&&this.buttonTarget.removeAttribute("disabled")}disconnect(){this.destroyMethod&&(this.destroyMethod(),this.destroyMethod=null)}addSource(r,e){let t=this;return{sourceId:r,getItems:()=>e.results,onSelect:t.handleOnSelect.bind(t),templates:{header(){return`${e.header.toUpperCase()} ${e.help}`},item({item:n,createElement:i}){let o=[];if(n._avatar){let f;switch(n._avatar_type){default:case"circle":f="rounded-full";break;case"rounded":f="rounded-sm";break;case"square":f="rounded-none";break}o.push(i("img",{src:n._avatar,alt:n._label,class:`shrink-0 w-8 h-8 my-[2px] inline mr-2 ${f}`}))}let a=QS.sanitize(n._label),l=[i("div",{dangerouslySetInnerHTML:{__html:a}},a)];if(n._description){let f=QS.sanitize(n._description);l.push(i("div",{class:"aa-ItemDescription",dangerouslySetInnerHTML:{__html:f}},f))}return o.push(i("div",null,l)),i("div",{class:"flex"},o)},noResults(){return t.translationKeys.no_item_found.replace("%{item}",r)}}}}handleOnSelect({item:r}){this.isBelongsToSearch&&!r._error?(this.updateFieldAttribute(this.hiddenIdTarget,"value",r._id),this.updateFieldAttribute(this.buttonTarget,"value",this.removeHTMLTags(r._label)),this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")):sv.visit(r._url,{action:"advance"}),document.body.classList.remove("aa-Detached")}searchUrl(r){return(0,dPe.default)().segment([window.Avo.configuration.root_path,...this.searchSegments()]).search(this.searchParams(encodeURIComponent(r))).readable().toString()}searchSegments(){let r=["avo_api",this.dataset.searchResource,"search"];return this.isGlobalSearch&&(r=["avo_api","search"]),r}searchParams(r){let e={...Object.fromEntries(new URLSearchParams(window.location.search)),q:r,global:!1,...this.extraParamsValue};return this.isGlobalSearch&&(e.global=!0),(this.isBelongsToSearch||this.isHasManySearch)&&(e=this.addAssociationParams(e),e=this.addReflectionParams(e),this.isBelongsToSearch&&(e={...e,via_parent_resource_id:this.dataset.viaParentResourceId,via_parent_resource_class:this.dataset.viaParentResourceClass,via_relation:this.dataset.viaRelation})),e}addAssociationParams(r){return r={...r,via_association:this.dataset.viaAssociation,via_association_id:this.dataset.viaAssociationId},r}addReflectionParams(r){return r={...r,via_reflection_class:this.dataset.viaReflectionClass,via_reflection_id:this.dataset.viaReflectionId,via_reflection_view:this.dataset.viaReflectionView},r}showSearchPanel(){this.autocompleteTarget.querySelector("button").click()}clearValue(){this.clearValueTargets.map(r=>this.updateFieldAttribute(r,"value","")),this.clearButtonTarget.classList.add("hidden")}updateFieldAttribute(r,e,t){r.setAttribute(e,t),r.dispatchEvent(new Event("input"))}removeHTMLTags(r){return new DOMParser().parseFromString(r,"text/html").body.textContent||""}};var pPe=Qo(l_()),bq=class extends Ar{static targets=["select"];get parentTurboFrame(){return this.context.scope.element.closest("turbo-frame")}onChange(r){if(!this.parentTurboFrame.src)return;let e=new pPe.default(this.parentTurboFrame.src);e.search({...e.query(!0),range:r.currentTarget.value}),this.parentTurboFrame.src=e.toString(),this.parentTurboFrame.reload()}};var xq=class extends Ad{static targets=["selector"];getFilterValue(){return this.selectorTarget.value===""?null:this.selectorTarget.value}getFilterClass(){let{filterClass:r}=this.selectorTarget.dataset;return r}};var _q=class extends Ar{destroy(){this.context.element.remove()}};function wq(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)r[n]=t[n]}return r}var o5t={read:function(r){return r[0]==='"'&&(r=r.slice(1,-1)),r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(r){return encodeURIComponent(r).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function SG(r,e){function t(i,o,a){if(!(typeof document>"u")){a=wq({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var f in a)a[f]&&(l+="; "+f,a[f]!==!0&&(l+="="+a[f].split(";")[0]));return document.cookie=i+"="+r.write(o,i)+l}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},l=0;l<o.length;l++){var f=o[l].split("="),p=f.slice(1).join("=");try{var g=decodeURIComponent(f[0]);if(a[g]=r.read(p,g),i===g)break}catch{}}return i?a[i]:a}}return Object.create({set:t,get:n,remove:function(i,o){t(i,"",wq({},o,{expires:-1}))},withAttributes:function(i){return SG(this.converter,wq({},this.attributes,i))},withConverter:function(i){return SG(wq({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(r)}})}var HD=SG(o5t,{path:"/"});function a5t(r,e){let t=r.getBoundingClientRect(),n=document.documentElement,i=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(i.height||window.innerHeight||n.clientHeight)&&t.right<=(i.width||window.innerWidth||n.clientWidth)}function s5t(){let r=document.querySelector(".avo-sidebar .mac-styled-scrollbar a.active"),e=document.querySelector(".avo-sidebar .mac-styled-scrollbar");r&&!a5t(r,e)&&r.scrollIntoView({block:"end",inline:"nearest"})}var Sq=class extends Ar{static targets=["sidebar","mobileSidebar","mainArea"];static values={open:Boolean};get cookieKey(){return`${window.Avo.configuration.cookies_key}.sidebar.open`}get sidebarOpen(){return HD.get(this.cookieKey)==="1"}get sidebarScrollPosition(){return window.Avo.localStorage.get("sidebar.sidebarScrollPosition")}set sidebarScrollPosition(r){window.Avo.localStorage.set("sidebar.sidebarScrollPosition",r)}set cookie(r){HD.set(this.cookieKey,r===!0?1:0)}connect(){this.attachScrollVisibilityAnchor(),this.sidebarScrollPosition&&window.Avo.configuration.preserve_sidebar_scroll&&document.querySelector(".avo-sidebar .mac-styled-scrollbar").scrollTo({top:this.sidebarScrollPosition,behavior:"instant"}),this.rememberScrollPosition()}rememberScrollPosition(){let r;document.addEventListener("turbo:visit",r=()=>{this.sidebarScrollPosition=document.querySelector(".avo-sidebar .mac-styled-scrollbar").scrollTop,document.removeEventListener("turbo:visit",r)})}attachScrollVisibilityAnchor(){window.Avo.configuration.focus_sidebar_menu_item&&s5t()}toggleSidebar(){this.sidebarTarget.classList.contains("hidden")&&this.sidebarTarget.classList.remove("hidden"),this.mainAreaTarget.classList.toggle("sidebar-open"),HD.set(this.cookieKey,this.newValue(HD.get(this.cookieKey)))}toggleSidebarOnMobile(){this.mobileSidebarTarget.classList.contains("hidden")&&(this.mainAreaTarget.classList.remove("sidebar-open"),this.mobileSidebarTarget.classList.remove("hidden"),this.mainAreaTarget.offsetHeight),this.mainAreaTarget.classList.toggle("sidebar-open")}newValue(r){return r===void 0||r==="1"?"0":"1"}};var kq=class extends Ar{static targets=["element"];static values={confirm:String};handle(r){r.preventDefault(),window.confirm(this.confirmValue)&&(window.Turbo.cache.clear(),this.element.submit())}};var Tq=class extends Ar{visitRecord(r){if(r.type!=="click")return;let e=r.shiftKey,t=r.target.closest(".item-selector-cell"),n=r.target.closest("a, button"),i=r.target.closest('input[type="checkbox"]');if(e||n||i||t)return;let o=r.target.closest("tr"),a=o.dataset.visitPath;!o||!a||(r.metaKey||r.ctrlKey?this.#t(a):this.#e(a))}#e(r){window.Turbo.visit(r)}#t(r){window.open(r,"_blank").focus()}};var Eq=class extends Ar{static targets=["tabPanel"];static values={view:String,activeTab:String,groupId:String,resourceName:String};connect(){this.selectCurrentTab()}selectCurrentTab(){let r={};Array.from(new URL(window.location).searchParams.entries()).forEach(([i,o])=>{r[i]=o});let e=`resources.${this.resourceNameValue}.tabgroups.${this.groupIdValue}.selectedTab`,t=window.Avo.localStorage.get(e),n=null;r[this.groupParam(this.groupIdValue)]?n=r[this.groupParam(this.groupIdValue)]:t&&(n=t),this.getTabByName(n)&&(this.hideAllTabs(),this.revealTabByName(n))}getTabByName(r){return this.tabPanelTargets.find(e=>e.dataset.tabId===r)}groupParam(r){return encodeURIComponent(`tab-group_${r}`)}async changeTab(r){r.preventDefault();let{params:e}=r,{groupId:t,tabName:n,resourceName:i}=e,o=`resources.${i}.tabgroups.${t}.selectedTab`,a=new URL(window.location);a.searchParams.set(this.groupParam(t),encodeURIComponent(n)),window.Turbo.navigator.history.replace({href:a.pathname+a.search}),window.Avo.localStorage.set(o,n),this.hideAllTabs(),this.revealTabByName(n)}revealTabByName(r){this.getTabByName(r).classList.remove("hidden")}hideAllTabs(){this.tabPanelTargets.map(r=>r.classList.add("hidden"))}};var I_=Qo(O$());var mPe="​";function kG(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function gPe(r){return function(e){if(Array.isArray(e))return kG(e)}(r)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(r)||function(e,t){if(e){if(typeof e=="string")return kG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kG(e,t)}}(r)||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.")}()}var S0={isEnabled:function(){var r;return(r=window.TAGIFY_DEBUG)===null||r===void 0||r},log:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n;this.isEnabled()&&(n=console).log.apply(n,["[Tagify]:"].concat(gPe(e)))},warn:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n;this.isEnabled()&&(n=console).warn.apply(n,["[Tagify]:"].concat(gPe(e)))}},VD=function(r,e,t,n){return r=""+r,e=""+e,n&&(r=r.trim(),e=e.trim()),t?r==e:r.toLowerCase()==e.toLowerCase()},vPe=function(r,e){return r&&Array.isArray(r)&&r.map(function(t){return IG(t,e)})};function IG(r,e){var t,n={};for(t in r)e.indexOf(t)<0&&(n[t]=r[t]);return n}function TG(r){return new DOMParser().parseFromString(r.trim(),"text/html").body.firstElementChild}function yPe(r,e){for(e=e||"previous";r=r[e+"Sibling"];)if(r.nodeType==3)return r}function D_(r){return typeof r=="string"?r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/`|'/g,"'"):r}function Sg(r){var e=Object.prototype.toString.call(r).split(" ")[1].slice(0,-1);return r===Object(r)&&e!="Array"&&e!="Function"&&e!="RegExp"&&e!="HTMLUnknownElement"}function Nc(r,e,t){var n,i;function o(a,l){for(var f in l)if(l.hasOwnProperty(f)){if(Sg(l[f])){Sg(a[f])?o(a[f],l[f]):a[f]=Object.assign({},l[f]);continue}if(Array.isArray(l[f])){a[f]=Object.assign([],l[f]);continue}a[f]=l[f]}}return n=r,((i=Object)!=null&&typeof Symbol<"u"&&i[Symbol.hasInstance]?i[Symbol.hasInstance](n):n instanceof i)||(r={}),o(r,e),t&&o(r,t),r}function bPe(){var r=[],e={},t=!0,n=!1,i=void 0;try{for(var o,a=arguments[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var l=o.value,f=!0,p=!1,g=void 0;try{for(var w,D=l[Symbol.iterator]();!(f=(w=D.next()).done);f=!0){var I=w.value;Sg(I)?e[I.value]||(r.push(I),e[I.value]=1):r.includes(I)||r.push(I)}}catch(R){p=!0,g=R}finally{try{f||D.return==null||D.return()}finally{if(p)throw g}}}}catch(R){n=!0,i=R}finally{try{t||a.return==null||a.return()}finally{if(n)throw i}}return r}function Cq(r){return String.prototype.normalize?typeof r=="string"?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:r}var xPe=function(){return/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent)};function _Pe(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,function(r){return(r^crypto.getRandomValues(new Uint8Array(1))[0]&15>>r/4).toString(16)})}function O_(r){var e;return CPe.call(this,r)&&(r==null||(e=r.classList)===null||e===void 0?void 0:e.contains(this.settings.classNames.tag))}function wPe(r){return CPe.call(this,r)&&r?.closest(this.settings.classNames.tagSelector)}function CPe(r){var e;return(r==null||(e=r.closest)===null||e===void 0?void 0:e.call(r,this.settings.classNames.namespaceSelector))===this.DOM.scope}function APe(r,e){var t=window.getSelection();return e=e||t.getRangeAt(0),typeof r=="string"&&(r=document.createTextNode(r)),e&&(e.deleteContents(),e.insertNode(r)),r}function tl(r,e,t){return r?(e&&(r.__tagifyTagData=t?e:Nc({},r.__tagifyTagData||{},e)),r.__tagifyTagData):(S0.warn("tag element doesn't exist",{tagElm:r,data:e}),e)}function w0(r){if(r&&r.parentNode){var e=r,t=window.getSelection(),n=t.getRangeAt(0);t.rangeCount&&(n.setStartAfter(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n))}}function DPe(r,e){r.forEach(function(t){if(tl(t.previousSibling)||!t.previousSibling){var n=document.createTextNode("\u200B");t.before(n),e&&w0(n)}})}var EG={delimiters:",",pattern:null,tagTextProp:"value",maxTags:1/0,callbacks:{},addTagOnBlur:!0,addTagOn:["blur","tab","enter"],onChangeAfterBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,focusable:!0,keepInvalidTags:!1,createInvalidTags:!0,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:function(){},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:"\xA0"},autoComplete:{enabled:!0,rightKey:!1,tabKey:!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",dropdownItemHidden:"tagify__dropdown__item--hidden",dropdownItemSelected:"tagify__dropdown__item--selected",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,includeSelectedTags:!1,escapeHTML:!0,highlightFirst:!0,closeOnSelect:!0,clearOnSelect:!0,position:"all",appendTarget:null},hooks:{beforeRemoveTag:function(){return Promise.resolve()},beforePaste:function(){return Promise.resolve()},suggestionClick:function(){return Promise.resolve()},beforeKeyDown:function(){return Promise.resolve()}}};function l5t(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function u5t(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){l5t(r,i,t[i])})}return r}function c5t(r,e){return e=e??{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):function(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),i.push.apply(i,o)}return i}(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}),r}function CG(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function f5t(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function h5t(r){return function(e){if(Array.isArray(e))return CG(e)}(r)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(r)||function(e,t){if(e){if(typeof e=="string")return CG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CG(e,t)}}(r)||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 d5t(){for(var r in this.dropdown={},this._dropdown)this.dropdown[r]=typeof this._dropdown[r]=="function"?this._dropdown[r].bind(this):this._dropdown[r];this.dropdown.refs(),this.DOM.dropdown.__tagify=this}var Aq,Tk,p5t=(Aq=function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){f5t(r,i,t[i])})}return r}({},{events:{binding:function(){var r=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],e=this.dropdown.events.callbacks,t=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this,null),onKeyDown:e.onKeyDown.bind(this),onMouseOver:e.onMouseOver.bind(this),onMouseLeave:e.onMouseLeave.bind(this),onClick:e.onClick.bind(this),onScroll:e.onScroll.bind(this)},n=r?"addEventListener":"removeEventListener";this.settings.dropdown.position!="manual"&&(document[n]("scroll",t.position,!0),window[n]("resize",t.position),window[n]("keydown",t.onKeyDown)),this.DOM.dropdown[n]("mouseover",t.onMouseOver),this.DOM.dropdown[n]("mouseleave",t.onMouseLeave),this.DOM.dropdown[n]("mousedown",t.onClick),this.DOM.dropdown.content[n]("scroll",t.onScroll)},callbacks:{onKeyDown:function(r){var e=this;if(this.state.hasFocus&&!this.state.composing){var t=this.settings,n=t.dropdown.includeSelectedTags,i=this.DOM.dropdown.querySelector(t.classNames.dropdownItemActiveSelector),o=this.dropdown.getSuggestionDataByNode(i),a=t.mode=="mix",l=t.mode=="select";t.hooks.beforeKeyDown(r,{tagify:this}).then(function(f){switch(r.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":r.preventDefault();var p=e.dropdown.getAllSuggestionsRefs(),g=r.key=="ArrowUp"||r.key=="Up";i&&(i=e.dropdown.getNextOrPrevOption(i,!g)),i&&i.matches(t.classNames.dropdownItemSelector)||(i=p[g?p.length-1:0]),e.dropdown.highlightOption(i,!0);break;case"PageUp":case"PageDown":var w;r.preventDefault();var D=e.dropdown.getAllSuggestionsRefs(),I=Math.floor(e.DOM.dropdown.content.clientHeight/((w=D[0])===null||w===void 0?void 0:w.offsetHeight))||1,R=r.key==="PageUp";if(i){var N=D.indexOf(i),j=R?Math.max(0,N-I):Math.min(D.length-1,N+I);i=D[j]}else i=D[0];e.dropdown.highlightOption(i,!0);break;case"Home":case"End":r.preventDefault();var K=e.dropdown.getAllSuggestionsRefs();i=K[r.key==="Home"?0:K.length-1],e.dropdown.highlightOption(i,!0);break;case"Escape":case"Esc":e.dropdown.hide();break;case"ArrowRight":if(e.state.actions.ArrowLeft||t.autoComplete.rightKey)return;case"Tab":var X=!t.autoComplete.rightKey||!t.autoComplete.tabKey;if(!a&&!l&&i&&X&&!e.state.editing&&o){r.preventDefault();var le=e.dropdown.getMappedValue(o);return e.state.autoCompleteData=o,e.input.autocomplete.set.call(e,le),!1}return!0;case"Enter":r.preventDefault(),e.state.actions.selectOption=!0,setTimeout(function(){return e.state.actions.selectOption=!1},100),t.hooks.suggestionClick(r,{tagify:e,tagData:o,suggestionElm:i}).then(function(){if(i){var fe=n?i:e.dropdown.getNextOrPrevOption(i,!g);e.dropdown.selectOption(i,r,function(){if(fe){var oe=fe.getAttribute("value");fe=e.dropdown.getSuggestionNodeByValue(oe),e.dropdown.highlightOption(fe)}})}else e.dropdown.hide(),a||e.addTags(e.state.inputText.trim(),!0)}).catch(function(fe){return S0.warn(fe)});break;case"Backspace":if(a||e.state.editing.scope)return;var k=e.input.raw.call(e);k!=""&&k.charCodeAt(0)!=8203||(t.backspace===!0?e.removeTags():t.backspace=="edit"&&setTimeout(e.editTag.bind(e),0))}})}},onMouseOver:function(r){var e=r.target.closest(this.settings.classNames.dropdownItemSelector);this.dropdown.highlightOption(e)},onMouseLeave:function(r){this.dropdown.highlightOption()},onClick:function(r){var e=this;if(r.button==0&&r.target!=this.DOM.dropdown&&r.target!=this.DOM.dropdown.content){var t=r.target.closest(this.settings.classNames.dropdownItemSelector),n=this.dropdown.getSuggestionDataByNode(t);this.state.actions.selectOption=!0,setTimeout(function(){return e.state.actions.selectOption=!1},100),this.settings.hooks.suggestionClick(r,{tagify:this,tagData:n,suggestionElm:t}).then(function(){t?e.dropdown.selectOption(t,r):e.dropdown.hide()}).catch(function(i){return S0.warn(i)})}},onScroll:function(r){var e=r.target,t=e.scrollTop/(e.scrollHeight-e.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(t)})}}},refilter:function(r){r=r||this.state.dropdown.query||"",this.suggestedListItems=this.dropdown.filterListItems(r),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger("dropdown:updated",this.DOM.dropdown)},getSuggestionDataByNode:function(r){for(var e,t=r&&r.getAttribute("value"),n=this.suggestedListItems.length;n--;){if(Sg(e=this.suggestedListItems[n])&&e.value==t)return e;if(e==t)return{value:e}}},getSuggestionNodeByValue:function(r){return this.dropdown.getAllSuggestionsRefs().find(function(e){return e.getAttribute("value")===r})},getNextOrPrevOption:function(r){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],t=this.dropdown.getAllSuggestionsRefs(),n=t.findIndex(function(i){return i===r});return e?t[n+1]:t[n-1]},highlightOption:function(r,e){var t,n=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(n),this.state.ddItemElm.removeAttribute("aria-selected")),!r)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);t=this.dropdown.getSuggestionDataByNode(r),this.state.ddItemData=t,this.state.ddItemElm=r,r.classList.add(n),r.setAttribute("aria-selected",!0),e&&(r.parentNode.scrollTop=r.clientHeight+r.offsetTop-r.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,t),this.dropdown.position())},selectOption:function(r,e,t){var n=this,i=this.settings,o=i.dropdown.includeSelectedTags,a=i.dropdown,l=a.clearOnSelect,f=a.closeOnSelect;if(!r)return this.addTags(this.state.inputText,!0),void(f&&this.dropdown.hide());e=e||{};var p=r.getAttribute("value"),g=p=="noMatch",w=i.mode=="mix",D=this.suggestedListItems.find(function(R){var N;return((N=R.value)!==null&&N!==void 0?N:R)==p});if(this.trigger("dropdown:select",{data:D,elm:r,event:e}),D||g){if(this.state.editing){var I=this.normalizeTags([D])[0];D=i.transformTag.call(this,I)||I,this.onEditTagDone(null,Nc({__isValid:!0},D))}else this[w?"addMixTags":"addTags"]([D||this.input.raw.call(this)],l);(w||this.DOM.input.parentNode)&&(setTimeout(function(){n.DOM.input.focus(),n.toggleFocusClass(!0)}),f&&setTimeout(this.dropdown.hide.bind(this)),o?t&&t():(r.addEventListener("transitionend",function(){n.dropdown.fillHeaderFooter(),setTimeout(function(){r.remove(),n.dropdown.refilter(),t&&t()},100)},{once:!0}),r.classList.add(this.settings.classNames.dropdownItemHidden)))}else f&&setTimeout(this.dropdown.hide.bind(this))},selectAll:function(r){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems("");var e=this.dropdown.filterListItems("");return r||(e=this.state.dropdown.suggestions),this.addTags(e,!0),this},filterListItems:function(r,e){var t,n,i,o,a,l,f=function(){var fe,oe,ve=void 0,be=void 0;fe=R[le],n=((oe=Object)!=null&&typeof Symbol<"u"&&oe[Symbol.hasInstance]?oe[Symbol.hasInstance](fe):fe instanceof oe)?R[le]:{value:R[le]};var me,ge=Object.keys(n).some(function(Fe){return X.includes(Fe)})?X:["value"];w.fuzzySearch&&!e.exact?(o=ge.reduce(function(Fe,B){return Fe+" "+(n[B]||"")},"").toLowerCase().trim(),w.accentedSearch&&(o=Cq(o),l=Cq(l)),ve=o.indexOf(l)==0,be=o===l,me=o,i=l.toLowerCase().split(" ").every(function(Fe){return me.includes(Fe.toLowerCase())})):(ve=!0,i=ge.some(function(Fe){var B=""+(n[Fe]||"");return w.accentedSearch&&(B=Cq(B),l=Cq(l)),w.caseSensitive||(B=B.toLowerCase()),be=B===l,e.exact?B===l:B.indexOf(l)==0})),a=!w.includeSelectedTags&&t.isTagDuplicate(Sg(n)?n.value:n),i&&!a&&(be&&ve?I.push(n):w.sortby=="startsWith"&&ve?D.unshift(n):D.push(n))},p=this,g=this.settings,w=g.dropdown,D=(e=e||{},[]),I=[],R=g.whitelist,N=w.maxItems>=0?w.maxItems:1/0,j=w.includeSelectedTags,K=typeof w.sortby=="function",X=w.searchKeys,le=0;if(!(r=g.mode=="select"&&this.value.length&&this.value[0][g.tagTextProp]==r?"":r)||!X.length){D=j?R:R.filter(function(fe){return!p.isTagDuplicate(Sg(fe)?fe.value:fe)});var k=K?w.sortby(D,l):D.slice(0,N);return this.state.dropdown.suggestions=k,k}for(l=w.caseSensitive?""+r:(""+r).toLowerCase();le<R.length;le++)t=this,f();return this.state.dropdown.suggestions=I.concat(D),k=K?w.sortby(I.concat(D),l):I.concat(D).slice(0,N),this.state.dropdown.suggestions=k,k},getMappedValue:function(r){var e=this.settings.dropdown.mapValueTo;return e?typeof e=="function"?e(r):r[e]||r.value:r.value},createListHTML:function(r){var e=this;return Nc([],r).map(function(t,n){typeof t!="string"&&typeof t!="number"||(t={value:t});var i=e.dropdown.getMappedValue(t);return i=typeof i=="string"&&e.settings.dropdown.escapeHTML?D_(i):i,e.settings.templates.dropdownItem.apply(e,[c5t(u5t({},t),{mappedValue:i}),e])}).join("")}}),Tk=(Tk={refs:function(){this.DOM.dropdown=this.parseTemplate("dropdown",[this.settings]),this.DOM.dropdown.content=this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-wrapper']")},getHeaderRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-header']")},getFooterRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-footer']")},getAllSuggestionsRefs:function(){return h5t(this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector))},show:function(r){var e,t,n,i=this,o=this.settings,a=o.mode=="mix"&&!o.enforceWhitelist,l=!o.whitelist||!o.whitelist.length,f=o.dropdown.position=="manual";if(r=r===void 0?this.state.inputText:r,!(l&&!a&&!o.templates.dropdownItemNoMatch||o.dropdown.enabled===!1||this.state.isLoading||this.settings.readonly)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems(r),r&&!this.suggestedListItems.length&&(this.trigger("dropdown:noMatch",r),o.templates.dropdownItemNoMatch&&(n=o.templates.dropdownItemNoMatch.call(this,{value:r}))),!n){if(this.suggestedListItems.length)r&&a&&!this.state.editing.scope&&!VD(this.suggestedListItems[0].value,r)&&this.suggestedListItems.unshift({value:r});else{if(!r||!a||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide();this.suggestedListItems=[{value:r}]}t=""+(Sg(e=this.suggestedListItems[0])?e.value:e),o.autoComplete&&t&&t.indexOf(r)==0&&this.input.autocomplete.suggest.call(this,e)}this.dropdown.fill(n),o.dropdown.highlightFirst&&this.dropdown.highlightOption(this.DOM.dropdown.content.querySelector(o.classNames.dropdownItemSelector)),this.state.dropdown.visible||setTimeout(this.dropdown.events.binding.bind(this)),this.state.dropdown.visible=r||!0,this.state.dropdown.query=r,this.setStateSelection(),f||setTimeout(function(){i.dropdown.position(),i.dropdown.render()}),setTimeout(function(){i.trigger("dropdown:show",i.DOM.dropdown)})}},hide:function(r){var e=this,t=this.DOM,n=t.scope,i=t.dropdown,o=this.settings.dropdown.position=="manual"&&!r;if(i&&document.body.contains(i)&&!o)return window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),n.setAttribute("aria-expanded",!1),i.parentNode.removeChild(i),setTimeout(function(){e.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:function(r){this.dropdown[this.state.dropdown.visible&&!r?"hide":"show"]()},getAppendTarget:function(){var r=this.settings.dropdown;return typeof r.appendTarget=="function"?r.appendTarget():r.appendTarget},render:function(){var r,e,t,n=this,i=(r=this.DOM.dropdown,(t=r.cloneNode(!0)).style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(t),e=t.clientHeight,t.parentNode.removeChild(t),e),o=this.settings,a=this.dropdown.getAppendTarget();return o.dropdown.enabled===!1||(this.DOM.scope.setAttribute("aria-expanded",!0),document.body.contains(this.DOM.dropdown)||(this.DOM.dropdown.classList.add(o.classNames.dropdownInital),this.dropdown.position(i),a.appendChild(this.DOM.dropdown),setTimeout(function(){return n.DOM.dropdown.classList.remove(o.classNames.dropdownInital)}))),this},fill:function(r){r=typeof r=="string"?r:this.dropdown.createListHTML(r||this.suggestedListItems);var e,t=this.settings.templates.dropdownContent.call(this,r);this.DOM.dropdown.content.innerHTML=(e=t)?e.replace(/\>[\r\n ]+\</g,"><").split(/>\s+</).join("><").trim():""},fillHeaderFooter:function(){var r=this.dropdown.filterListItems(this.state.dropdown.query),e=this.parseTemplate("dropdownHeader",[r]),t=this.parseTemplate("dropdownFooter",[r]),n=this.dropdown.getHeaderRef(),i=this.dropdown.getFooterRef();e&&n?.parentNode.replaceChild(e,n),t&&i?.parentNode.replaceChild(t,i)},position:function(r){var e=this.settings.dropdown,t=this.dropdown.getAppendTarget();if(e.position!="manual"&&t){var n,i,o,a,l,f,p,g,w,D,I=this.DOM.dropdown,R=e.RTL,N=t===document.body,j=t===this.DOM.scope,K=N?window.pageYOffset:t.scrollTop,X=document.fullscreenElement||document.webkitFullscreenElement||document.documentElement,le=X.clientHeight,k=Math.max(X.clientWidth||0,window.innerWidth||0),fe=k>480?e.position:"all",oe=this.DOM[fe=="input"?"input":"scope"];if(r=r||I.clientHeight,this.state.dropdown.visible){if(fe=="text"?(o=(n=function(){var me=document.getSelection();if(me.rangeCount){var ge,Fe,B=me.getRangeAt(0),J=B.startContainer,de=B.startOffset;if(de>0)return(Fe=document.createRange()).setStart(J,de-1),Fe.setEnd(J,de),{left:(ge=Fe.getBoundingClientRect()).right,top:ge.top,bottom:ge.bottom};if(J.getBoundingClientRect)return J.getBoundingClientRect()}return{left:-9999,top:-9999}}()).bottom,i=n.top,a=n.left,l="auto"):(f=function(me){var ge=0,Fe=0;for(me=me.parentNode;me&&me!=X;)ge+=me.offsetTop||0,Fe+=me.offsetLeft||0,me=me.parentNode;return{top:ge,left:Fe}}(t),n=oe.getBoundingClientRect(),i=j?-1:n.top-f.top,o=(j?n.height:n.bottom-f.top)-1,a=j?-1:n.left-f.left,l=n.width+"px"),!N){var ve=function(){for(var me=0,ge=e.appendTarget.parentNode;ge;)me+=ge.scrollTop||0,ge=ge.parentNode;return me}();i+=ve,o+=ve}var be;i=Math.floor(i),o=Math.ceil(o),g=k-a<120,w=((p=(be=e.placeAbove)!==null&&be!==void 0?be:le-n.bottom<r)?i:o)+K,D=a+(R&&n.width||0)+window.pageXOffset,D=fe=="text"&&g?"right: 0;":"left: ".concat(D,"px;"),I.style.cssText="".concat(D," top: ").concat(w,"px; min-width: ").concat(l,"; max-width: ").concat(l),I.setAttribute("placement",p?"top":"bottom"),I.setAttribute("position",fe)}}}})!=null?Tk:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Aq,Object.getOwnPropertyDescriptors(Tk)):function(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}(Object(Tk)).forEach(function(r){Object.defineProperty(Aq,r,Object.getOwnPropertyDescriptor(Tk,r))}),Aq),WD="@yaireo/tagify/",m5t={empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},g5t={wrapper:function(r,e){return'<tags class="'.concat(e.classNames.namespace," ").concat(e.mode?"".concat(e.classNames[e.mode+"Mode"]):""," ").concat(r.className,`"
|
751
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bzt(r,e){if(r){if(typeof r=="string")return wG(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return wG(r,e)}}function zzt(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Uzt(r){if(Array.isArray(r))return wG(r)}function wG(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function mq(r){var e=r.hit,t=r.attribute,n=Array.isArray(t)?t:[t],i=dk(e,["_snippetResult"].concat(Nzt(n),["value"]));return typeof i!="string"&&(i=dk(e,n)||""),fq({highlightedValue:i})}function ZLe(r){return pq(mq(r))}function XLe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,l=i.tagName,f=l===void 0?"mark":l;return e(t,{},hq({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(f,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="Highlight",n}function JLe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,l=i.tagName,f=l===void 0?"mark":l;return e(t,{},YLe({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(f,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="ReverseHighlight",n}function QLe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,l=i.tagName,f=l===void 0?"mark":l;return e(t,{},ZLe({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(f,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="ReverseSnippet",n}function ePe(r){var e=r.createElement,t=r.Fragment;function n(i){var o=i.hit,a=i.attribute,l=i.tagName,f=l===void 0?"mark":l;return e(t,{},mq({hit:o,attribute:a}).map(function(p,g){return p.isHighlighted?e(f,{key:g},p.value):p.value}))}return n.__autocomplete_componentName="Snippet",n}function zD(r){"@babel/helpers - typeof";return zD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zD(r)}var jzt=["classNames","container","getEnvironmentProps","getFormProps","getInputProps","getItemProps","getLabelProps","getListProps","getPanelProps","getRootProps","panelContainer","panelPlacement","render","renderNoResults","renderer","detachedMediaQuery","components","translations"];function tPe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function _0(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tPe(Object(t),!0).forEach(function(n){Hzt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):tPe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Hzt(r,e,t){return e=Wzt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wzt(r){var e=Vzt(r,"string");return zD(e)==="symbol"?e:String(e)}function Vzt(r,e){if(zD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(zD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function $zt(r,e){if(r==null)return{};var t=Gzt(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Gzt(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}var Kzt={clearButton:"aa-ClearButton",detachedCancelButton:"aa-DetachedCancelButton",detachedContainer:"aa-DetachedContainer",detachedFormContainer:"aa-DetachedFormContainer",detachedOverlay:"aa-DetachedOverlay",detachedSearchButton:"aa-DetachedSearchButton",detachedSearchButtonIcon:"aa-DetachedSearchButtonIcon",detachedSearchButtonPlaceholder:"aa-DetachedSearchButtonPlaceholder",detachedSearchButtonQuery:"aa-DetachedSearchButtonQuery",form:"aa-Form",input:"aa-Input",inputWrapper:"aa-InputWrapper",inputWrapperPrefix:"aa-InputWrapperPrefix",inputWrapperSuffix:"aa-InputWrapperSuffix",item:"aa-Item",label:"aa-Label",list:"aa-List",loadingIndicator:"aa-LoadingIndicator",panel:"aa-Panel",panelLayout:"aa-PanelLayout aa-Panel--scrollable",root:"aa-Autocomplete",source:"aa-Source",sourceFooter:"aa-SourceFooter",sourceHeader:"aa-SourceHeader",sourceNoResults:"aa-SourceNoResults",submitButton:"aa-SubmitButton"},Yzt=function(e,t){var n=e.children,i=e.render;i(n,t)},Zzt={createElement:yG,Fragment:Sk,render:HLe};function rPe(r){var e,t=r.classNames,n=r.container,i=r.getEnvironmentProps,o=r.getFormProps,a=r.getInputProps,l=r.getItemProps,f=r.getLabelProps,p=r.getListProps,g=r.getPanelProps,w=r.getRootProps,D=r.panelContainer,I=r.panelPlacement,R=r.render,N=r.renderNoResults,j=r.renderer,K=r.detachedMediaQuery,X=r.components,le=r.translations,k=$zt(r,jzt),fe=typeof window<"u"?window:{},oe=sG(fe,n);oe.tagName;var ve=_0(_0({},Zzt),j),be={Highlight:XLe(ve),ReverseHighlight:JLe(ve),ReverseSnippet:QLe(ve),Snippet:ePe(ve)},me={clearButtonTitle:"Clear",detachedCancelButtonText:"Cancel",detachedSearchButtonTitle:"Search",submitButtonTitle:"Submit"};return{renderer:{classNames:dLe(Kzt,t??{}),container:oe,getEnvironmentProps:i??function(ge){var Fe=ge.props;return Fe},getFormProps:o??function(ge){var Fe=ge.props;return Fe},getInputProps:a??function(ge){var Fe=ge.props;return Fe},getItemProps:l??function(ge){var Fe=ge.props;return Fe},getLabelProps:f??function(ge){var Fe=ge.props;return Fe},getListProps:p??function(ge){var Fe=ge.props;return Fe},getPanelProps:g??function(ge){var Fe=ge.props;return Fe},getRootProps:w??function(ge){var Fe=ge.props;return Fe},panelContainer:D?sG(fe,D):fe.document.body,panelPlacement:I??"input-wrapper-width",render:R??Yzt,renderNoResults:N,renderer:ve,detachedMediaQuery:K??getComputedStyle(fe.document.documentElement).getPropertyValue("--aa-detached-media-query"),components:_0(_0({},be),X),translations:_0(_0({},me),le)},core:_0(_0({},k),{},{id:(e=k.id)!==null&&e!==void 0?e:XN(),environment:fe})}}function nPe(r){var e=r.panelPlacement,t=r.container,n=r.form,i=r.environment,o=t.getBoundingClientRect(),a=i.pageYOffset||i.document.documentElement.scrollTop||i.document.body.scrollTop||0,l=a+o.top+o.height;switch(e){case"start":return{top:l,left:o.left};case"end":return{top:l,right:i.document.documentElement.clientWidth-(o.left+o.width)};case"full-width":return{top:l,left:0,right:0,width:"unset",maxWidth:"unset"};case"input-wrapper-width":{var f=n.getBoundingClientRect();return{top:l,left:f.left,right:i.document.documentElement.clientWidth-(f.left+f.width),width:"unset",maxWidth:"unset"}}default:throw new Error("[Autocomplete] The `panelPlacement` value ".concat(JSON.stringify(e)," is not valid."))}}function UD(r){"@babel/helpers - typeof";return UD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UD(r)}function gq(){return gq=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},gq.apply(this,arguments)}function iPe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function kk(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?iPe(Object(t),!0).forEach(function(n){Xzt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):iPe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Xzt(r,e,t){return e=Jzt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jzt(r){var e=Qzt(r,"string");return UD(e)==="symbol"?e:String(e)}function Qzt(r,e){if(UD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(UD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function oPe(r){var e=r.autocomplete,t=r.autocompleteScopeApi,n=r.dom,i=r.propGetters,o=r.state;fG(n.root,i.getRootProps(kk({state:o,props:e.getRootProps({})},t))),fG(n.input,i.getInputProps(kk({state:o,props:e.getInputProps({inputElement:n.input}),inputElement:n.input},t))),Nd(n.label,{hidden:o.status==="stalled"}),Nd(n.loadingIndicator,{hidden:o.status!=="stalled"}),Nd(n.clearButton,{hidden:!o.query}),Nd(n.detachedSearchButtonQuery,{textContent:o.query}),Nd(n.detachedSearchButtonPlaceholder,{hidden:!!o.query})}function aPe(r,e){var t=e.autocomplete,n=e.autocompleteScopeApi,i=e.classNames,o=e.html,a=e.dom,l=e.panelContainer,f=e.propGetters,p=e.state,g=e.components,w=e.renderer;if(!p.isOpen){l.contains(a.panel)&&l.removeChild(a.panel);return}!l.contains(a.panel)&&p.status!=="loading"&&l.appendChild(a.panel),a.panel.classList.toggle("aa-Panel--stalled",p.status==="stalled");var D=p.collections.filter(function(N){var j=N.source,K=N.items;return j.templates.noResults||K.length>0}).map(function(N,j){var K=N.source,X=N.items;return w.createElement("section",{key:j,className:i.source,"data-autocomplete-source-id":K.sourceId},K.templates.header&&w.createElement("div",{className:i.sourceHeader},K.templates.header({components:g,createElement:w.createElement,Fragment:w.Fragment,items:X,source:K,state:p,html:o})),K.templates.noResults&&X.length===0?w.createElement("div",{className:i.sourceNoResults},K.templates.noResults({components:g,createElement:w.createElement,Fragment:w.Fragment,source:K,state:p,html:o})):w.createElement("ul",gq({className:i.list},f.getListProps(kk({state:p,props:t.getListProps({source:K})},n))),X.map(function(le){var k=t.getItemProps({item:le,source:K});return w.createElement("li",gq({key:k.id,className:i.item},f.getItemProps(kk({state:p,props:k},n))),K.templates.item({components:g,createElement:w.createElement,Fragment:w.Fragment,item:le,state:p,html:o}))})),K.templates.footer&&w.createElement("div",{className:i.sourceFooter},K.templates.footer({components:g,createElement:w.createElement,Fragment:w.Fragment,items:X,source:K,state:p,html:o})))}),I=w.createElement(w.Fragment,null,w.createElement("div",{className:i.panelLayout},D),w.createElement("div",{className:"aa-GradientBottom"})),R=D.reduce(function(N,j){return N[j.props["data-autocomplete-source-id"]]=j,N},{});r(kk(kk({children:I,state:p,sections:D,elements:R},w),{},{components:g,html:o},n),a.panel)}var sPe=[{segment:"autocomplete-js",version:JN}];var e5t=["components"];function jD(r){"@babel/helpers - typeof";return jD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jD(r)}function t5t(r,e){if(r==null)return{};var t=r5t(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function r5t(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function lPe(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function C_(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lPe(Object(t),!0).forEach(function(n){cPe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):lPe(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function cPe(r,e,t){return e=n5t(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function n5t(r){var e=i5t(r,"string");return jD(e)==="symbol"?e:String(e)}function i5t(r,e){if(jD(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(jD(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var uPe=0;function fPe(r){var e=ALe(),t=e.runEffect,n=e.cleanupEffects,i=e.runEffects,o=DLe(),a=o.reactive,l=o.runReactives,f=__(!1),p=__(r),g=__(void 0),w=a(function(){return rPe(p.current)}),D=a(function(){return w.value.core.environment.matchMedia(w.value.renderer.detachedMediaQuery).matches}),I=a(function(){return lLe(C_(C_({},w.value.core),{},{onStateChange:function(me){var ge,Fe,B;f.current=me.state.collections.some(function(J){return J.source.templates.noResults}),(ge=g.current)===null||ge===void 0||ge.call(g,me),(Fe=(B=w.value.core).onStateChange)===null||Fe===void 0||Fe.call(B,me)},shouldPanelOpen:p.current.shouldPanelOpen||function(be){var me=be.state;if(D.value)return!0;var ge=y0(me)>0;if(!w.value.core.openOnFocus&&!me.query)return ge;var Fe=!!(f.current||w.value.renderer.renderNoResults);return!ge&&Fe||ge},__autocomplete_metadata:{userAgents:sPe,options:r}}))}),R=__(C_({collections:[],completion:null,context:{},isOpen:!1,query:"",activeItemId:null,status:"idle"},w.value.core.initialState)),N={getEnvironmentProps:w.value.renderer.getEnvironmentProps,getFormProps:w.value.renderer.getFormProps,getInputProps:w.value.renderer.getInputProps,getItemProps:w.value.renderer.getItemProps,getLabelProps:w.value.renderer.getLabelProps,getListProps:w.value.renderer.getListProps,getPanelProps:w.value.renderer.getPanelProps,getRootProps:w.value.renderer.getRootProps},j={setActiveItemId:I.value.setActiveItemId,setQuery:I.value.setQuery,setCollections:I.value.setCollections,setIsOpen:I.value.setIsOpen,setStatus:I.value.setStatus,setContext:I.value.setContext,refresh:I.value.refresh,navigator:I.value.navigator},K=a(function(){return fLe.bind(w.value.renderer.renderer.createElement)}),X=a(function(){return CLe({autocomplete:I.value,autocompleteScopeApi:j,classNames:w.value.renderer.classNames,environment:w.value.core.environment,isDetached:D.value,placeholder:w.value.core.placeholder,propGetters:N,setIsModalOpen:ve,state:R.current,translations:w.value.renderer.translations})});function le(){Nd(X.value.panel,{style:D.value?{}:nPe({panelPlacement:w.value.renderer.panelPlacement,container:X.value.root,form:X.value.form,environment:w.value.core.environment})})}function k(be){R.current=be;var me={autocomplete:I.value,autocompleteScopeApi:j,classNames:w.value.renderer.classNames,components:w.value.renderer.components,container:w.value.renderer.container,html:K.value,dom:X.value,panelContainer:D.value?X.value.detachedContainer:w.value.renderer.panelContainer,propGetters:N,state:R.current,renderer:w.value.renderer.renderer},ge=!y0(be)&&!f.current&&w.value.renderer.renderNoResults||w.value.renderer.render;oPe(me),aPe(ge,me)}t(function(){var be=I.value.getEnvironmentProps({formElement:X.value.form,panelElement:X.value.panel,inputElement:X.value.input});return Nd(w.value.core.environment,be),function(){Nd(w.value.core.environment,Object.keys(be).reduce(function(me,ge){return C_(C_({},me),{},cPe({},ge,void 0))},{}))}}),t(function(){var be=D.value?w.value.core.environment.document.body:w.value.renderer.panelContainer,me=D.value?X.value.detachedOverlay:X.value.panel;return D.value&&R.current.isOpen&&ve(!0),k(R.current),function(){be.contains(me)&&(be.removeChild(me),be.classList.remove("aa-Detached"))}}),t(function(){var be=w.value.renderer.container;return be.appendChild(X.value.root),function(){be.removeChild(X.value.root)}}),t(function(){var be=fk(function(me){var ge=me.state;k(ge)},0);return g.current=function(me){var ge=me.state,Fe=me.prevState;if(D.value&&Fe.isOpen!==ge.isOpen&&ve(ge.isOpen),!D.value&&ge.isOpen&&!Fe.isOpen&&le(),ge.query!==Fe.query){var B=w.value.core.environment.document.querySelectorAll(".aa-Panel--scrollable");B.forEach(function(J){J.scrollTop!==0&&(J.scrollTop=0)})}be({state:ge})},function(){g.current=void 0}}),t(function(){var be=fk(function(){var me=D.value;D.value=w.value.core.environment.matchMedia(w.value.renderer.detachedMediaQuery).matches,me!==D.value?oe({}):requestAnimationFrame(le)},20);return w.value.core.environment.addEventListener("resize",be),function(){w.value.core.environment.removeEventListener("resize",be)}}),t(function(){if(!D.value)return function(){};function be(B){X.value.detachedContainer.classList.toggle("aa-DetachedContainer--modal",B)}function me(B){be(B.matches)}var ge=w.value.core.environment.matchMedia(getComputedStyle(w.value.core.environment.document.documentElement).getPropertyValue("--aa-detached-modal-media-query"));be(ge.matches);var Fe=!!ge.addEventListener;return Fe?ge.addEventListener("change",me):ge.addListener(me),function(){Fe?ge.removeEventListener("change",me):ge.removeListener(me)}}),t(function(){return requestAnimationFrame(le),function(){}});function fe(){uPe--,n()}function oe(){var be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n();var me=w.value.renderer,ge=me.components,Fe=t5t(me,e5t);p.current=cG(Fe,w.value.core,{components:bLe(ge,function(B){var J=B.value;return!J.hasOwnProperty("__autocomplete_componentName")}),initialState:R.current},be),l(),i(),I.value.refresh().then(function(){k(R.current)})}function ve(be){var me=w.value.core.environment.document.body.contains(X.value.detachedOverlay);be!==me&&(be?(w.value.core.environment.document.body.appendChild(X.value.detachedOverlay),w.value.core.environment.document.body.classList.add("aa-Detached"),X.value.input.focus()):(w.value.core.environment.document.body.removeChild(X.value.detachedOverlay),w.value.core.environment.document.body.classList.remove("aa-Detached")))}return uPe++,C_(C_({},j),{},{update:oe,destroy:fe})}var dPe=Qo(l_());var vq=(r,e)=>{let t;return(...n)=>(t&&clearTimeout(t),new Promise(i=>{t=setTimeout(()=>i(r(...n)),e)}))};var yq=class extends Ar{static targets=["autocomplete","button","hiddenId","visibleLabel","clearValue","clearButton"];static values={extraParams:Object};debouncedFetch=vq(fetch,this.searchDebounce);destroyMethod;get dataset(){return this.autocompleteTarget.dataset}get searchDebounce(){return window.Avo.configuration.search_debounce}get translationKeys(){let r;try{r=JSON.parse(this.dataset.translationKeys)}catch{r={}}return r}get isBelongsToSearch(){return this.dataset.viaAssociation==="belongs_to"}get isHasManySearch(){return this.dataset.viaAssociation==="has_many"}get isGlobalSearch(){return this.dataset.searchResource==="global"}connect(){let r=this;this.buttonTarget.onclick=()=>this.showSearchPanel(),this.clearValueTargets.forEach(t=>{t.getAttribute("value")&&this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")}),this.isGlobalSearch&&hPe.bind(["command+k","ctrl+k"],()=>this.showSearchPanel()),this.autocompleteTarget.innerHTML="";let{destroy:e}=fPe({container:this.autocompleteTarget,placeholder:this.translationKeys.placeholder,translations:{detachedCancelButtonText:this.translationKeys.cancel_button},autoFocus:!0,openOnFocus:!0,detachedMediaQuery:"",onStateChange({prevState:t,state:n}){!n.isOpen&&t.isOpen&&(n.query="")},getSources:({query:t})=>{document.body.classList.add("search-loading");let n=r.searchUrl(t);return r.debouncedFetch(n).then(i=>(document.body.classList.remove("search-loading"),i.json())).then(i=>Object.keys(i).map(o=>r.addSource(o,i[o])))}});this.destroyMethod=e,this.buttonTarget.dataset.shouldBeDisabled!=="true"&&this.buttonTarget.removeAttribute("disabled")}disconnect(){this.destroyMethod&&(this.destroyMethod(),this.destroyMethod=null)}addSource(r,e){let t=this;return{sourceId:r,getItems:()=>e.results,onSelect:t.handleOnSelect.bind(t),templates:{header(){return`${e.header.toUpperCase()} ${e.help}`},item({item:n,createElement:i}){let o=[];if(n._avatar){let f;switch(n._avatar_type){default:case"circle":f="rounded-full";break;case"rounded":f="rounded";break;case"square":f="rounded-none";break}o.push(i("img",{src:n._avatar,alt:n._label,class:`flex-shrink-0 w-8 h-8 my-[2px] inline mr-2 ${f}`}))}let a=QS.sanitize(n._label),l=[i("div",{dangerouslySetInnerHTML:{__html:a}},a)];if(n._description){let f=QS.sanitize(n._description);l.push(i("div",{class:"aa-ItemDescription",dangerouslySetInnerHTML:{__html:f}},f))}return o.push(i("div",null,l)),i("div",{class:"flex"},o)},noResults(){return t.translationKeys.no_item_found.replace("%{item}",r)}}}}handleOnSelect({item:r}){this.isBelongsToSearch&&!r._error?(this.updateFieldAttribute(this.hiddenIdTarget,"value",r._id),this.updateFieldAttribute(this.buttonTarget,"value",this.removeHTMLTags(r._label)),this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")):sv.visit(r._url,{action:"advance"}),document.body.classList.remove("aa-Detached")}searchUrl(r){return(0,dPe.default)().segment([window.Avo.configuration.root_path,...this.searchSegments()]).search(this.searchParams(encodeURIComponent(r))).readable().toString()}searchSegments(){let r=["avo_api",this.dataset.searchResource,"search"];return this.isGlobalSearch&&(r=["avo_api","search"]),r}searchParams(r){let e={...Object.fromEntries(new URLSearchParams(window.location.search)),q:r,global:!1,...this.extraParamsValue};return this.isGlobalSearch&&(e.global=!0),(this.isBelongsToSearch||this.isHasManySearch)&&(e=this.addAssociationParams(e),e=this.addReflectionParams(e),this.isBelongsToSearch&&(e={...e,via_parent_resource_id:this.dataset.viaParentResourceId,via_parent_resource_class:this.dataset.viaParentResourceClass,via_relation:this.dataset.viaRelation})),e}addAssociationParams(r){return r={...r,via_association:this.dataset.viaAssociation,via_association_id:this.dataset.viaAssociationId},r}addReflectionParams(r){return r={...r,via_reflection_class:this.dataset.viaReflectionClass,via_reflection_id:this.dataset.viaReflectionId,via_reflection_view:this.dataset.viaReflectionView},r}showSearchPanel(){this.autocompleteTarget.querySelector("button").click()}clearValue(){this.clearValueTargets.map(r=>this.updateFieldAttribute(r,"value","")),this.clearButtonTarget.classList.add("hidden")}updateFieldAttribute(r,e,t){r.setAttribute(e,t),r.dispatchEvent(new Event("input"))}removeHTMLTags(r){return new DOMParser().parseFromString(r,"text/html").body.textContent||""}};var pPe=Qo(l_()),bq=class extends Ar{static targets=["select"];get parentTurboFrame(){return this.context.scope.element.closest("turbo-frame")}onChange(r){if(!this.parentTurboFrame.src)return;let e=new pPe.default(this.parentTurboFrame.src);e.search({...e.query(!0),range:r.currentTarget.value}),this.parentTurboFrame.src=e.toString(),this.parentTurboFrame.reload()}};var xq=class extends Ad{static targets=["selector"];getFilterValue(){return this.selectorTarget.value===""?null:this.selectorTarget.value}getFilterClass(){let{filterClass:r}=this.selectorTarget.dataset;return r}};var _q=class extends Ar{destroy(){this.context.element.remove()}};function wq(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)r[n]=t[n]}return r}var o5t={read:function(r){return r[0]==='"'&&(r=r.slice(1,-1)),r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(r){return encodeURIComponent(r).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function SG(r,e){function t(i,o,a){if(!(typeof document>"u")){a=wq({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var f in a)a[f]&&(l+="; "+f,a[f]!==!0&&(l+="="+a[f].split(";")[0]));return document.cookie=i+"="+r.write(o,i)+l}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},l=0;l<o.length;l++){var f=o[l].split("="),p=f.slice(1).join("=");try{var g=decodeURIComponent(f[0]);if(a[g]=r.read(p,g),i===g)break}catch{}}return i?a[i]:a}}return Object.create({set:t,get:n,remove:function(i,o){t(i,"",wq({},o,{expires:-1}))},withAttributes:function(i){return SG(this.converter,wq({},this.attributes,i))},withConverter:function(i){return SG(wq({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(r)}})}var HD=SG(o5t,{path:"/"});function a5t(r,e){let t=r.getBoundingClientRect(),n=document.documentElement,i=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(i.height||window.innerHeight||n.clientHeight)&&t.right<=(i.width||window.innerWidth||n.clientWidth)}function s5t(){let r=document.querySelector(".avo-sidebar .mac-styled-scrollbar a.active"),e=document.querySelector(".avo-sidebar .mac-styled-scrollbar");r&&!a5t(r,e)&&r.scrollIntoView({block:"end",inline:"nearest"})}var Sq=class extends Ar{static targets=["sidebar","mobileSidebar","mainArea"];static values={open:Boolean};get cookieKey(){return`${window.Avo.configuration.cookies_key}.sidebar.open`}get sidebarOpen(){return HD.get(this.cookieKey)==="1"}get sidebarScrollPosition(){return window.Avo.localStorage.get("sidebar.sidebarScrollPosition")}set sidebarScrollPosition(r){window.Avo.localStorage.set("sidebar.sidebarScrollPosition",r)}set cookie(r){HD.set(this.cookieKey,r===!0?1:0)}connect(){this.attachScrollVisibilityAnchor(),this.sidebarScrollPosition&&window.Avo.configuration.preserve_sidebar_scroll&&document.querySelector(".avo-sidebar .mac-styled-scrollbar").scrollTo({top:this.sidebarScrollPosition,behavior:"instant"}),this.rememberScrollPosition()}rememberScrollPosition(){let r;document.addEventListener("turbo:visit",r=()=>{this.sidebarScrollPosition=document.querySelector(".avo-sidebar .mac-styled-scrollbar").scrollTop,document.removeEventListener("turbo:visit",r)})}attachScrollVisibilityAnchor(){window.Avo.configuration.focus_sidebar_menu_item&&s5t()}toggleSidebar(){this.sidebarTarget.classList.contains("hidden")&&this.sidebarTarget.classList.remove("hidden"),this.mainAreaTarget.classList.toggle("sidebar-open"),HD.set(this.cookieKey,this.newValue(HD.get(this.cookieKey)))}toggleSidebarOnMobile(){this.mobileSidebarTarget.classList.contains("hidden")&&(this.mainAreaTarget.classList.remove("sidebar-open"),this.mobileSidebarTarget.classList.remove("hidden"),this.mainAreaTarget.offsetHeight),this.mainAreaTarget.classList.toggle("sidebar-open")}newValue(r){return r===void 0||r==="1"?"0":"1"}};var kq=class extends Ar{static targets=["element"];static values={confirm:String};handle(r){r.preventDefault(),window.confirm(this.confirmValue)&&(window.Turbo.cache.clear(),this.element.submit())}};var Tq=class extends Ar{visitRecord(r){if(r.type!=="click")return;let e=r.shiftKey,t=r.target.closest(".item-selector-cell"),n=r.target.closest("a, button"),i=r.target.closest('input[type="checkbox"]');if(e||n||i||t)return;let o=r.target.closest("tr"),a=o.dataset.visitPath;!o||!a||(r.metaKey||r.ctrlKey?this.#t(a):this.#e(a))}#e(r){window.Turbo.visit(r)}#t(r){window.open(r,"_blank").focus()}};var Eq=class extends Ar{static targets=["tabPanel"];static values={view:String,activeTab:String,groupId:String,resourceName:String};connect(){this.selectCurrentTab()}selectCurrentTab(){let r={};Array.from(new URL(window.location).searchParams.entries()).forEach(([i,o])=>{r[i]=o});let e=`resources.${this.resourceNameValue}.tabgroups.${this.groupIdValue}.selectedTab`,t=window.Avo.localStorage.get(e),n=null;r[this.groupParam(this.groupIdValue)]?n=r[this.groupParam(this.groupIdValue)]:t&&(n=t),this.getTabByName(n)&&(this.hideAllTabs(),this.revealTabByName(n))}getTabByName(r){return this.tabPanelTargets.find(e=>e.dataset.tabId===r)}groupParam(r){return encodeURIComponent(`tab-group_${r}`)}async changeTab(r){r.preventDefault();let{params:e}=r,{groupId:t,tabName:n,resourceName:i}=e,o=`resources.${i}.tabgroups.${t}.selectedTab`,a=new URL(window.location);a.searchParams.set(this.groupParam(t),encodeURIComponent(n)),window.Turbo.navigator.history.replace({href:a.pathname+a.search}),window.Avo.localStorage.set(o,n),this.hideAllTabs(),this.revealTabByName(n)}revealTabByName(r){this.getTabByName(r).classList.remove("hidden")}hideAllTabs(){this.tabPanelTargets.map(r=>r.classList.add("hidden"))}};var I_=Qo(O$());var mPe="​";function kG(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function gPe(r){return function(e){if(Array.isArray(e))return kG(e)}(r)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(r)||function(e,t){if(e){if(typeof e=="string")return kG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kG(e,t)}}(r)||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.")}()}var S0={isEnabled:function(){var r;return(r=window.TAGIFY_DEBUG)===null||r===void 0||r},log:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n;this.isEnabled()&&(n=console).log.apply(n,["[Tagify]:"].concat(gPe(e)))},warn:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n;this.isEnabled()&&(n=console).warn.apply(n,["[Tagify]:"].concat(gPe(e)))}},VD=function(r,e,t,n){return r=""+r,e=""+e,n&&(r=r.trim(),e=e.trim()),t?r==e:r.toLowerCase()==e.toLowerCase()},vPe=function(r,e){return r&&Array.isArray(r)&&r.map(function(t){return IG(t,e)})};function IG(r,e){var t,n={};for(t in r)e.indexOf(t)<0&&(n[t]=r[t]);return n}function TG(r){return new DOMParser().parseFromString(r.trim(),"text/html").body.firstElementChild}function yPe(r,e){for(e=e||"previous";r=r[e+"Sibling"];)if(r.nodeType==3)return r}function D_(r){return typeof r=="string"?r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/`|'/g,"'"):r}function Sg(r){var e=Object.prototype.toString.call(r).split(" ")[1].slice(0,-1);return r===Object(r)&&e!="Array"&&e!="Function"&&e!="RegExp"&&e!="HTMLUnknownElement"}function Nc(r,e,t){var n,i;function o(a,l){for(var f in l)if(l.hasOwnProperty(f)){if(Sg(l[f])){Sg(a[f])?o(a[f],l[f]):a[f]=Object.assign({},l[f]);continue}if(Array.isArray(l[f])){a[f]=Object.assign([],l[f]);continue}a[f]=l[f]}}return n=r,((i=Object)!=null&&typeof Symbol<"u"&&i[Symbol.hasInstance]?i[Symbol.hasInstance](n):n instanceof i)||(r={}),o(r,e),t&&o(r,t),r}function bPe(){var r=[],e={},t=!0,n=!1,i=void 0;try{for(var o,a=arguments[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var l=o.value,f=!0,p=!1,g=void 0;try{for(var w,D=l[Symbol.iterator]();!(f=(w=D.next()).done);f=!0){var I=w.value;Sg(I)?e[I.value]||(r.push(I),e[I.value]=1):r.includes(I)||r.push(I)}}catch(R){p=!0,g=R}finally{try{f||D.return==null||D.return()}finally{if(p)throw g}}}}catch(R){n=!0,i=R}finally{try{t||a.return==null||a.return()}finally{if(n)throw i}}return r}function Cq(r){return String.prototype.normalize?typeof r=="string"?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:r}var xPe=function(){return/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent)};function _Pe(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,function(r){return(r^crypto.getRandomValues(new Uint8Array(1))[0]&15>>r/4).toString(16)})}function O_(r){var e;return CPe.call(this,r)&&(r==null||(e=r.classList)===null||e===void 0?void 0:e.contains(this.settings.classNames.tag))}function wPe(r){return CPe.call(this,r)&&r?.closest(this.settings.classNames.tagSelector)}function CPe(r){var e;return(r==null||(e=r.closest)===null||e===void 0?void 0:e.call(r,this.settings.classNames.namespaceSelector))===this.DOM.scope}function APe(r,e){var t=window.getSelection();return e=e||t.getRangeAt(0),typeof r=="string"&&(r=document.createTextNode(r)),e&&(e.deleteContents(),e.insertNode(r)),r}function tl(r,e,t){return r?(e&&(r.__tagifyTagData=t?e:Nc({},r.__tagifyTagData||{},e)),r.__tagifyTagData):(S0.warn("tag element doesn't exist",{tagElm:r,data:e}),e)}function w0(r){if(r&&r.parentNode){var e=r,t=window.getSelection(),n=t.getRangeAt(0);t.rangeCount&&(n.setStartAfter(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n))}}function DPe(r,e){r.forEach(function(t){if(tl(t.previousSibling)||!t.previousSibling){var n=document.createTextNode("\u200B");t.before(n),e&&w0(n)}})}var EG={delimiters:",",pattern:null,tagTextProp:"value",maxTags:1/0,callbacks:{},addTagOnBlur:!0,addTagOn:["blur","tab","enter"],onChangeAfterBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,focusable:!0,keepInvalidTags:!1,createInvalidTags:!0,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:function(){},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:"\xA0"},autoComplete:{enabled:!0,rightKey:!1,tabKey:!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",dropdownItemHidden:"tagify__dropdown__item--hidden",dropdownItemSelected:"tagify__dropdown__item--selected",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,includeSelectedTags:!1,escapeHTML:!0,highlightFirst:!0,closeOnSelect:!0,clearOnSelect:!0,position:"all",appendTarget:null},hooks:{beforeRemoveTag:function(){return Promise.resolve()},beforePaste:function(){return Promise.resolve()},suggestionClick:function(){return Promise.resolve()},beforeKeyDown:function(){return Promise.resolve()}}};function l5t(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function u5t(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){l5t(r,i,t[i])})}return r}function c5t(r,e){return e=e??{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):function(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),i.push.apply(i,o)}return i}(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}),r}function CG(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function f5t(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function h5t(r){return function(e){if(Array.isArray(e))return CG(e)}(r)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(r)||function(e,t){if(e){if(typeof e=="string")return CG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CG(e,t)}}(r)||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 d5t(){for(var r in this.dropdown={},this._dropdown)this.dropdown[r]=typeof this._dropdown[r]=="function"?this._dropdown[r].bind(this):this._dropdown[r];this.dropdown.refs(),this.DOM.dropdown.__tagify=this}var Aq,Tk,p5t=(Aq=function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){f5t(r,i,t[i])})}return r}({},{events:{binding:function(){var r=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],e=this.dropdown.events.callbacks,t=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this,null),onKeyDown:e.onKeyDown.bind(this),onMouseOver:e.onMouseOver.bind(this),onMouseLeave:e.onMouseLeave.bind(this),onClick:e.onClick.bind(this),onScroll:e.onScroll.bind(this)},n=r?"addEventListener":"removeEventListener";this.settings.dropdown.position!="manual"&&(document[n]("scroll",t.position,!0),window[n]("resize",t.position),window[n]("keydown",t.onKeyDown)),this.DOM.dropdown[n]("mouseover",t.onMouseOver),this.DOM.dropdown[n]("mouseleave",t.onMouseLeave),this.DOM.dropdown[n]("mousedown",t.onClick),this.DOM.dropdown.content[n]("scroll",t.onScroll)},callbacks:{onKeyDown:function(r){var e=this;if(this.state.hasFocus&&!this.state.composing){var t=this.settings,n=t.dropdown.includeSelectedTags,i=this.DOM.dropdown.querySelector(t.classNames.dropdownItemActiveSelector),o=this.dropdown.getSuggestionDataByNode(i),a=t.mode=="mix",l=t.mode=="select";t.hooks.beforeKeyDown(r,{tagify:this}).then(function(f){switch(r.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":r.preventDefault();var p=e.dropdown.getAllSuggestionsRefs(),g=r.key=="ArrowUp"||r.key=="Up";i&&(i=e.dropdown.getNextOrPrevOption(i,!g)),i&&i.matches(t.classNames.dropdownItemSelector)||(i=p[g?p.length-1:0]),e.dropdown.highlightOption(i,!0);break;case"PageUp":case"PageDown":var w;r.preventDefault();var D=e.dropdown.getAllSuggestionsRefs(),I=Math.floor(e.DOM.dropdown.content.clientHeight/((w=D[0])===null||w===void 0?void 0:w.offsetHeight))||1,R=r.key==="PageUp";if(i){var N=D.indexOf(i),j=R?Math.max(0,N-I):Math.min(D.length-1,N+I);i=D[j]}else i=D[0];e.dropdown.highlightOption(i,!0);break;case"Home":case"End":r.preventDefault();var K=e.dropdown.getAllSuggestionsRefs();i=K[r.key==="Home"?0:K.length-1],e.dropdown.highlightOption(i,!0);break;case"Escape":case"Esc":e.dropdown.hide();break;case"ArrowRight":if(e.state.actions.ArrowLeft||t.autoComplete.rightKey)return;case"Tab":var X=!t.autoComplete.rightKey||!t.autoComplete.tabKey;if(!a&&!l&&i&&X&&!e.state.editing&&o){r.preventDefault();var le=e.dropdown.getMappedValue(o);return e.state.autoCompleteData=o,e.input.autocomplete.set.call(e,le),!1}return!0;case"Enter":r.preventDefault(),e.state.actions.selectOption=!0,setTimeout(function(){return e.state.actions.selectOption=!1},100),t.hooks.suggestionClick(r,{tagify:e,tagData:o,suggestionElm:i}).then(function(){if(i){var fe=n?i:e.dropdown.getNextOrPrevOption(i,!g);e.dropdown.selectOption(i,r,function(){if(fe){var oe=fe.getAttribute("value");fe=e.dropdown.getSuggestionNodeByValue(oe),e.dropdown.highlightOption(fe)}})}else e.dropdown.hide(),a||e.addTags(e.state.inputText.trim(),!0)}).catch(function(fe){return S0.warn(fe)});break;case"Backspace":if(a||e.state.editing.scope)return;var k=e.input.raw.call(e);k!=""&&k.charCodeAt(0)!=8203||(t.backspace===!0?e.removeTags():t.backspace=="edit"&&setTimeout(e.editTag.bind(e),0))}})}},onMouseOver:function(r){var e=r.target.closest(this.settings.classNames.dropdownItemSelector);this.dropdown.highlightOption(e)},onMouseLeave:function(r){this.dropdown.highlightOption()},onClick:function(r){var e=this;if(r.button==0&&r.target!=this.DOM.dropdown&&r.target!=this.DOM.dropdown.content){var t=r.target.closest(this.settings.classNames.dropdownItemSelector),n=this.dropdown.getSuggestionDataByNode(t);this.state.actions.selectOption=!0,setTimeout(function(){return e.state.actions.selectOption=!1},100),this.settings.hooks.suggestionClick(r,{tagify:this,tagData:n,suggestionElm:t}).then(function(){t?e.dropdown.selectOption(t,r):e.dropdown.hide()}).catch(function(i){return S0.warn(i)})}},onScroll:function(r){var e=r.target,t=e.scrollTop/(e.scrollHeight-e.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(t)})}}},refilter:function(r){r=r||this.state.dropdown.query||"",this.suggestedListItems=this.dropdown.filterListItems(r),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger("dropdown:updated",this.DOM.dropdown)},getSuggestionDataByNode:function(r){for(var e,t=r&&r.getAttribute("value"),n=this.suggestedListItems.length;n--;){if(Sg(e=this.suggestedListItems[n])&&e.value==t)return e;if(e==t)return{value:e}}},getSuggestionNodeByValue:function(r){return this.dropdown.getAllSuggestionsRefs().find(function(e){return e.getAttribute("value")===r})},getNextOrPrevOption:function(r){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],t=this.dropdown.getAllSuggestionsRefs(),n=t.findIndex(function(i){return i===r});return e?t[n+1]:t[n-1]},highlightOption:function(r,e){var t,n=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(n),this.state.ddItemElm.removeAttribute("aria-selected")),!r)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);t=this.dropdown.getSuggestionDataByNode(r),this.state.ddItemData=t,this.state.ddItemElm=r,r.classList.add(n),r.setAttribute("aria-selected",!0),e&&(r.parentNode.scrollTop=r.clientHeight+r.offsetTop-r.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,t),this.dropdown.position())},selectOption:function(r,e,t){var n=this,i=this.settings,o=i.dropdown.includeSelectedTags,a=i.dropdown,l=a.clearOnSelect,f=a.closeOnSelect;if(!r)return this.addTags(this.state.inputText,!0),void(f&&this.dropdown.hide());e=e||{};var p=r.getAttribute("value"),g=p=="noMatch",w=i.mode=="mix",D=this.suggestedListItems.find(function(R){var N;return((N=R.value)!==null&&N!==void 0?N:R)==p});if(this.trigger("dropdown:select",{data:D,elm:r,event:e}),D||g){if(this.state.editing){var I=this.normalizeTags([D])[0];D=i.transformTag.call(this,I)||I,this.onEditTagDone(null,Nc({__isValid:!0},D))}else this[w?"addMixTags":"addTags"]([D||this.input.raw.call(this)],l);(w||this.DOM.input.parentNode)&&(setTimeout(function(){n.DOM.input.focus(),n.toggleFocusClass(!0)}),f&&setTimeout(this.dropdown.hide.bind(this)),o?t&&t():(r.addEventListener("transitionend",function(){n.dropdown.fillHeaderFooter(),setTimeout(function(){r.remove(),n.dropdown.refilter(),t&&t()},100)},{once:!0}),r.classList.add(this.settings.classNames.dropdownItemHidden)))}else f&&setTimeout(this.dropdown.hide.bind(this))},selectAll:function(r){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems("");var e=this.dropdown.filterListItems("");return r||(e=this.state.dropdown.suggestions),this.addTags(e,!0),this},filterListItems:function(r,e){var t,n,i,o,a,l,f=function(){var fe,oe,ve=void 0,be=void 0;fe=R[le],n=((oe=Object)!=null&&typeof Symbol<"u"&&oe[Symbol.hasInstance]?oe[Symbol.hasInstance](fe):fe instanceof oe)?R[le]:{value:R[le]};var me,ge=Object.keys(n).some(function(Fe){return X.includes(Fe)})?X:["value"];w.fuzzySearch&&!e.exact?(o=ge.reduce(function(Fe,B){return Fe+" "+(n[B]||"")},"").toLowerCase().trim(),w.accentedSearch&&(o=Cq(o),l=Cq(l)),ve=o.indexOf(l)==0,be=o===l,me=o,i=l.toLowerCase().split(" ").every(function(Fe){return me.includes(Fe.toLowerCase())})):(ve=!0,i=ge.some(function(Fe){var B=""+(n[Fe]||"");return w.accentedSearch&&(B=Cq(B),l=Cq(l)),w.caseSensitive||(B=B.toLowerCase()),be=B===l,e.exact?B===l:B.indexOf(l)==0})),a=!w.includeSelectedTags&&t.isTagDuplicate(Sg(n)?n.value:n),i&&!a&&(be&&ve?I.push(n):w.sortby=="startsWith"&&ve?D.unshift(n):D.push(n))},p=this,g=this.settings,w=g.dropdown,D=(e=e||{},[]),I=[],R=g.whitelist,N=w.maxItems>=0?w.maxItems:1/0,j=w.includeSelectedTags,K=typeof w.sortby=="function",X=w.searchKeys,le=0;if(!(r=g.mode=="select"&&this.value.length&&this.value[0][g.tagTextProp]==r?"":r)||!X.length){D=j?R:R.filter(function(fe){return!p.isTagDuplicate(Sg(fe)?fe.value:fe)});var k=K?w.sortby(D,l):D.slice(0,N);return this.state.dropdown.suggestions=k,k}for(l=w.caseSensitive?""+r:(""+r).toLowerCase();le<R.length;le++)t=this,f();return this.state.dropdown.suggestions=I.concat(D),k=K?w.sortby(I.concat(D),l):I.concat(D).slice(0,N),this.state.dropdown.suggestions=k,k},getMappedValue:function(r){var e=this.settings.dropdown.mapValueTo;return e?typeof e=="function"?e(r):r[e]||r.value:r.value},createListHTML:function(r){var e=this;return Nc([],r).map(function(t,n){typeof t!="string"&&typeof t!="number"||(t={value:t});var i=e.dropdown.getMappedValue(t);return i=typeof i=="string"&&e.settings.dropdown.escapeHTML?D_(i):i,e.settings.templates.dropdownItem.apply(e,[c5t(u5t({},t),{mappedValue:i}),e])}).join("")}}),Tk=(Tk={refs:function(){this.DOM.dropdown=this.parseTemplate("dropdown",[this.settings]),this.DOM.dropdown.content=this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-wrapper']")},getHeaderRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-header']")},getFooterRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-footer']")},getAllSuggestionsRefs:function(){return h5t(this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector))},show:function(r){var e,t,n,i=this,o=this.settings,a=o.mode=="mix"&&!o.enforceWhitelist,l=!o.whitelist||!o.whitelist.length,f=o.dropdown.position=="manual";if(r=r===void 0?this.state.inputText:r,!(l&&!a&&!o.templates.dropdownItemNoMatch||o.dropdown.enabled===!1||this.state.isLoading||this.settings.readonly)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems(r),r&&!this.suggestedListItems.length&&(this.trigger("dropdown:noMatch",r),o.templates.dropdownItemNoMatch&&(n=o.templates.dropdownItemNoMatch.call(this,{value:r}))),!n){if(this.suggestedListItems.length)r&&a&&!this.state.editing.scope&&!VD(this.suggestedListItems[0].value,r)&&this.suggestedListItems.unshift({value:r});else{if(!r||!a||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide();this.suggestedListItems=[{value:r}]}t=""+(Sg(e=this.suggestedListItems[0])?e.value:e),o.autoComplete&&t&&t.indexOf(r)==0&&this.input.autocomplete.suggest.call(this,e)}this.dropdown.fill(n),o.dropdown.highlightFirst&&this.dropdown.highlightOption(this.DOM.dropdown.content.querySelector(o.classNames.dropdownItemSelector)),this.state.dropdown.visible||setTimeout(this.dropdown.events.binding.bind(this)),this.state.dropdown.visible=r||!0,this.state.dropdown.query=r,this.setStateSelection(),f||setTimeout(function(){i.dropdown.position(),i.dropdown.render()}),setTimeout(function(){i.trigger("dropdown:show",i.DOM.dropdown)})}},hide:function(r){var e=this,t=this.DOM,n=t.scope,i=t.dropdown,o=this.settings.dropdown.position=="manual"&&!r;if(i&&document.body.contains(i)&&!o)return window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),n.setAttribute("aria-expanded",!1),i.parentNode.removeChild(i),setTimeout(function(){e.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:function(r){this.dropdown[this.state.dropdown.visible&&!r?"hide":"show"]()},getAppendTarget:function(){var r=this.settings.dropdown;return typeof r.appendTarget=="function"?r.appendTarget():r.appendTarget},render:function(){var r,e,t,n=this,i=(r=this.DOM.dropdown,(t=r.cloneNode(!0)).style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(t),e=t.clientHeight,t.parentNode.removeChild(t),e),o=this.settings,a=this.dropdown.getAppendTarget();return o.dropdown.enabled===!1||(this.DOM.scope.setAttribute("aria-expanded",!0),document.body.contains(this.DOM.dropdown)||(this.DOM.dropdown.classList.add(o.classNames.dropdownInital),this.dropdown.position(i),a.appendChild(this.DOM.dropdown),setTimeout(function(){return n.DOM.dropdown.classList.remove(o.classNames.dropdownInital)}))),this},fill:function(r){r=typeof r=="string"?r:this.dropdown.createListHTML(r||this.suggestedListItems);var e,t=this.settings.templates.dropdownContent.call(this,r);this.DOM.dropdown.content.innerHTML=(e=t)?e.replace(/\>[\r\n ]+\</g,"><").split(/>\s+</).join("><").trim():""},fillHeaderFooter:function(){var r=this.dropdown.filterListItems(this.state.dropdown.query),e=this.parseTemplate("dropdownHeader",[r]),t=this.parseTemplate("dropdownFooter",[r]),n=this.dropdown.getHeaderRef(),i=this.dropdown.getFooterRef();e&&n?.parentNode.replaceChild(e,n),t&&i?.parentNode.replaceChild(t,i)},position:function(r){var e=this.settings.dropdown,t=this.dropdown.getAppendTarget();if(e.position!="manual"&&t){var n,i,o,a,l,f,p,g,w,D,I=this.DOM.dropdown,R=e.RTL,N=t===document.body,j=t===this.DOM.scope,K=N?window.pageYOffset:t.scrollTop,X=document.fullscreenElement||document.webkitFullscreenElement||document.documentElement,le=X.clientHeight,k=Math.max(X.clientWidth||0,window.innerWidth||0),fe=k>480?e.position:"all",oe=this.DOM[fe=="input"?"input":"scope"];if(r=r||I.clientHeight,this.state.dropdown.visible){if(fe=="text"?(o=(n=function(){var me=document.getSelection();if(me.rangeCount){var ge,Fe,B=me.getRangeAt(0),J=B.startContainer,de=B.startOffset;if(de>0)return(Fe=document.createRange()).setStart(J,de-1),Fe.setEnd(J,de),{left:(ge=Fe.getBoundingClientRect()).right,top:ge.top,bottom:ge.bottom};if(J.getBoundingClientRect)return J.getBoundingClientRect()}return{left:-9999,top:-9999}}()).bottom,i=n.top,a=n.left,l="auto"):(f=function(me){var ge=0,Fe=0;for(me=me.parentNode;me&&me!=X;)ge+=me.offsetTop||0,Fe+=me.offsetLeft||0,me=me.parentNode;return{top:ge,left:Fe}}(t),n=oe.getBoundingClientRect(),i=j?-1:n.top-f.top,o=(j?n.height:n.bottom-f.top)-1,a=j?-1:n.left-f.left,l=n.width+"px"),!N){var ve=function(){for(var me=0,ge=e.appendTarget.parentNode;ge;)me+=ge.scrollTop||0,ge=ge.parentNode;return me}();i+=ve,o+=ve}var be;i=Math.floor(i),o=Math.ceil(o),g=k-a<120,w=((p=(be=e.placeAbove)!==null&&be!==void 0?be:le-n.bottom<r)?i:o)+K,D=a+(R&&n.width||0)+window.pageXOffset,D=fe=="text"&&g?"right: 0;":"left: ".concat(D,"px;"),I.style.cssText="".concat(D," top: ").concat(w,"px; min-width: ").concat(l,"; max-width: ").concat(l),I.setAttribute("placement",p?"top":"bottom"),I.setAttribute("position",fe)}}}})!=null?Tk:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Aq,Object.getOwnPropertyDescriptors(Tk)):function(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}(Object(Tk)).forEach(function(r){Object.defineProperty(Aq,r,Object.getOwnPropertyDescriptor(Tk,r))}),Aq),WD="@yaireo/tagify/",m5t={empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},g5t={wrapper:function(r,e){return'<tags class="'.concat(e.classNames.namespace," ").concat(e.mode?"".concat(e.classNames[e.mode+"Mode"]):""," ").concat(r.className,`"
|
752
752
|
`).concat(e.readonly?"readonly":"",`
|
753
753
|
`).concat(e.disabled?"disabled":"",`
|
754
754
|
`).concat(e.required?"required":"",`
|
@@ -806,7 +806,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
806
806
|
tabindex="0"
|
807
807
|
role="option">
|
808
808
|
${r.avatar?`
|
809
|
-
<div class='rounded
|
809
|
+
<div class='rounded w-8 h-8 block mr-2'>
|
810
810
|
<img onerror="this.style.visibility='hidden'" class="w-full" src="${r.avatar}">
|
811
811
|
</div>`:""}
|
812
812
|
<span>${r.label}</span>
|