var $t=Math.min,St=Math.max,zt=Math.round;var rt=n=>({x:n,y:n}),on={left:"right",right:"left",bottom:"top",top:"bottom"};function Te(n,t,e){return St(n,$t(t,e))}function Xt(n,t){return typeof n=="function"?n(t):n}function Ot(n){return n.split("-")[0]}function Yt(n){return n.split("-")[1]}function Ie(n){return n==="x"?"y":"x"}function Re(n){return n==="y"?"height":"width"}function mt(n){let t=n[0];return t==="t"||t==="b"?"y":"x"}function Me(n){return Ie(mt(n))}function ei(n,t,e){e===void 0&&(e=!1);let i=Yt(n),s=Me(n),o=Re(s),r=s==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=Wt(r)),[r,Wt(r)]}function ii(n){let t=Wt(n);return[re(n),t,re(t)]}function re(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}var Ze=["left","right"],ti=["right","left"],rn=["top","bottom"],an=["bottom","top"];function ln(n,t,e){switch(n){case"top":case"bottom":return e?t?ti:Ze:t?Ze:ti;case"left":case"right":return t?rn:an;default:return[]}}function ni(n,t,e,i){let s=Yt(n),o=ln(Ot(n),e==="start",i);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(re)))),o}function Wt(n){let t=Ot(n);return on[t]+n.slice(t.length)}function cn(n){return{top:0,right:0,bottom:0,left:0,...n}}function si(n){return typeof n!="number"?cn(n):{top:n,right:n,bottom:n,left:n}}function At(n){let{x:t,y:e,width:i,height:s}=n;return{width:i,height:s,top:e,left:t,right:t+i,bottom:e+s,x:t,y:e}}function oi(n,t,e){let{reference:i,floating:s}=n,o=mt(t),r=Me(t),a=Re(r),l=Ot(t),c=o==="y",h=i.x+i.width/2-s.width/2,u=i.y+i.height/2-s.height/2,p=i[a]/2-s[a]/2,f;switch(l){case"top":f={x:h,y:i.y-s.height};break;case"bottom":f={x:h,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:u};break;case"left":f={x:i.x-s.width,y:u};break;default:f={x:i.x,y:i.y}}switch(Yt(t)){case"start":f[r]-=p*(e&&c?-1:1);break;case"end":f[r]+=p*(e&&c?-1:1);break}return f}async function ri(n,t){var e;t===void 0&&(t={});let{x:i,y:s,platform:o,rects:r,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=Xt(t,n),m=si(f),S=a[p?u==="floating"?"reference":"floating":u],O=At(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(S)))==null||e?S:S.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),w=u==="floating"?{x:i,y:s,width:r.floating.width,height:r.floating.height}:r.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),A=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},M=At(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:l}):w);return{top:(O.top-M.top+m.top)/A.y,bottom:(M.bottom-O.bottom+m.bottom)/A.y,left:(O.left-M.left+m.left)/A.x,right:(M.right-O.right+m.right)/A.x}}var un=50,ai=async(n,t,e)=>{let{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:ri},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:n,floating:t,strategy:s}),{x:h,y:u}=oi(c,i,l),p=i,f=0,m={};for(let g=0;gB<=0)){var X,it;let B=(((X=o.flip)==null?void 0:X.index)||0)+1,Z=J[B];if(Z&&(!(u==="alignment"?w!==mt(Z):!1)||V.every(_=>mt(_.placement)===w?_.overflows[0]>0:!0)))return{data:{index:B,overflows:V},reset:{placement:Z}};let k=(it=V.filter($=>$.overflows[0]<=0).sort(($,_)=>$.overflows[1]-_.overflows[1])[0])==null?void 0:it.placement;if(!k)switch(f){case"bestFit":{var W;let $=(W=V.filter(_=>{if(C){let j=mt(_.placement);return j===w||j==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(j=>j>0).reduce((j,wt)=>j+wt,0)]).sort((_,j)=>_[1]-j[1])[0])==null?void 0:W[0];$&&(k=$);break}case"initialPlacement":k=a;break}if(s!==k)return{reset:{placement:k}}}return{}}}};var hn=new Set(["left","top"]);async function dn(n,t){let{placement:e,platform:i,elements:s}=n,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),r=Ot(e),a=Yt(e),l=mt(e)==="y",c=hn.has(r)?-1:1,h=o&&l?-1:1,u=Xt(t,n),{mainAxis:p,crossAxis:f,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof m=="number"&&(f=a==="end"?m*-1:m),l?{x:f*h,y:p*c}:{x:p*c,y:f*h}}var ci=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,i;let{x:s,y:o,placement:r,middlewareData:a}=t,l=await dn(t,n);return r===((e=a.offset)==null?void 0:e.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:r}}}}},ui=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){let{x:e,y:i,placement:s,platform:o}=t,{mainAxis:r=!0,crossAxis:a=!1,limiter:l={fn:O=>{let{x:w,y:x}=O;return{x:w,y:x}}},...c}=Xt(n,t),h={x:e,y:i},u=await o.detectOverflow(t,c),p=mt(Ot(s)),f=Ie(p),m=h[f],g=h[p];if(r){let O=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=m+u[O],A=m-u[w];m=Te(x,m,A)}if(a){let O=p==="y"?"top":"left",w=p==="y"?"bottom":"right",x=g+u[O],A=g-u[w];g=Te(x,g,A)}let S=l.fn({...t,[f]:m,[p]:g});return{...S,data:{x:S.x-e,y:S.y-i,enabled:{[f]:r,[p]:a}}}}}};function le(){return typeof window<"u"}function Lt(n){return di(n)?(n.nodeName||"").toLowerCase():"#document"}function U(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function ct(n){var t;return(t=(di(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function di(n){return le()?n instanceof Node||n instanceof U(n).Node:!1}function nt(n){return le()?n instanceof Element||n instanceof U(n).Element:!1}function ut(n){return le()?n instanceof HTMLElement||n instanceof U(n).HTMLElement:!1}function hi(n){return!le()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof U(n).ShadowRoot}function _t(n){let{overflow:t,overflowX:e,overflowY:i,display:s}=st(n);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&s!=="inline"&&s!=="contents"}function fi(n){return/^(table|td|th)$/.test(Lt(n))}function Kt(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}var fn=/transform|translate|scale|rotate|perspective|filter/,pn=/paint|layout|strict|content/,Ct=n=>!!n&&n!=="none",_e;function ce(n){let t=nt(n)?st(n):n;return Ct(t.transform)||Ct(t.translate)||Ct(t.scale)||Ct(t.rotate)||Ct(t.perspective)||!ue()&&(Ct(t.backdropFilter)||Ct(t.filter))||fn.test(t.willChange||"")||pn.test(t.contain||"")}function pi(n){let t=gt(n);for(;ut(t)&&!Tt(t);){if(ce(t))return t;if(Kt(t))return null;t=gt(t)}return null}function ue(){return _e==null&&(_e=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_e}function Tt(n){return/^(html|body|#document)$/.test(Lt(n))}function st(n){return U(n).getComputedStyle(n)}function jt(n){return nt(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function gt(n){if(Lt(n)==="html")return n;let t=n.assignedSlot||n.parentNode||hi(n)&&n.host||ct(n);return hi(t)?t.host:t}function mi(n){let t=gt(n);return Tt(t)?n.ownerDocument?n.ownerDocument.body:n.body:ut(t)&&_t(t)?t:mi(t)}function ae(n,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);let s=mi(n),o=s===((i=n.ownerDocument)==null?void 0:i.body),r=U(s);if(o){let a=he(r);return t.concat(r,r.visualViewport||[],_t(s)?s:[],a&&e?ae(a):[])}else return t.concat(s,ae(s,[],e))}function he(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function yi(n){let t=st(n),e=parseFloat(t.width)||0,i=parseFloat(t.height)||0,s=ut(n),o=s?n.offsetWidth:e,r=s?n.offsetHeight:i,a=zt(e)!==o||zt(i)!==r;return a&&(e=o,i=r),{width:e,height:i,$:a}}function wi(n){return nt(n)?n:n.contextElement}function Pt(n){let t=wi(n);if(!ut(t))return rt(1);let e=t.getBoundingClientRect(),{width:i,height:s,$:o}=yi(t),r=(o?zt(e.width):e.width)/i,a=(o?zt(e.height):e.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}var mn=rt(0);function Si(n){let t=U(n);return!ue()||!t.visualViewport?mn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gn(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==U(n)?!1:t}function Ut(n,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);let s=n.getBoundingClientRect(),o=wi(n),r=rt(1);t&&(i?nt(i)&&(r=Pt(i)):r=Pt(n));let a=gn(o,e,i)?Si(o):rt(0),l=(s.left+a.x)/r.x,c=(s.top+a.y)/r.y,h=s.width/r.x,u=s.height/r.y;if(o){let p=U(o),f=i&&nt(i)?U(i):i,m=p,g=he(m);for(;g&&i&&f!==m;){let S=Pt(g),O=g.getBoundingClientRect(),w=st(g),x=O.left+(g.clientLeft+parseFloat(w.paddingLeft))*S.x,A=O.top+(g.clientTop+parseFloat(w.paddingTop))*S.y;l*=S.x,c*=S.y,h*=S.x,u*=S.y,l+=x,c+=A,m=U(g),g=he(m)}}return At({width:h,height:u,x:l,y:c})}function de(n,t){let e=jt(n).scrollLeft;return t?t.left+e:Ut(ct(n)).left+e}function Oi(n,t){let e=n.getBoundingClientRect(),i=e.left+t.scrollLeft-de(n,e),s=e.top+t.scrollTop;return{x:i,y:s}}function bn(n){let{elements:t,rect:e,offsetParent:i,strategy:s}=n,o=s==="fixed",r=ct(i),a=t?Kt(t.floating):!1;if(i===r||a&&o)return e;let l={scrollLeft:0,scrollTop:0},c=rt(1),h=rt(0),u=ut(i);if((u||!u&&!o)&&((Lt(i)!=="body"||_t(r))&&(l=jt(i)),u)){let f=Ut(i);c=Pt(i),h.x=f.x+i.clientLeft,h.y=f.y+i.clientTop}let p=r&&!u&&!o?Oi(r,l):rt(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+h.x+p.x,y:e.y*c.y-l.scrollTop*c.y+h.y+p.y}}function vn(n){return Array.from(n.getClientRects())}function yn(n){let t=ct(n),e=jt(n),i=n.ownerDocument.body,s=St(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=St(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),r=-e.scrollLeft+de(n),a=-e.scrollTop;return st(i).direction==="rtl"&&(r+=St(t.clientWidth,i.clientWidth)-s),{width:s,height:o,x:r,y:a}}var gi=25;function wn(n,t){let e=U(n),i=ct(n),s=e.visualViewport,o=i.clientWidth,r=i.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;let h=ue();(!h||h&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}let c=de(i);if(c<=0){let h=i.ownerDocument,u=h.body,p=getComputedStyle(u),f=h.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(i.clientWidth-u.clientWidth-f);m<=gi&&(o-=m)}else c<=gi&&(o+=c);return{width:o,height:r,x:a,y:l}}function Sn(n,t){let e=Ut(n,!0,t==="fixed"),i=e.top+n.clientTop,s=e.left+n.clientLeft,o=ut(n)?Pt(n):rt(1),r=n.clientWidth*o.x,a=n.clientHeight*o.y,l=s*o.x,c=i*o.y;return{width:r,height:a,x:l,y:c}}function bi(n,t,e){let i;if(t==="viewport")i=wn(n,e);else if(t==="document")i=yn(ct(n));else if(nt(t))i=Sn(t,e);else{let s=Si(n);i={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return At(i)}function Ei(n,t){let e=gt(n);return e===t||!nt(e)||Tt(e)?!1:st(e).position==="fixed"||Ei(e,t)}function On(n,t){let e=t.get(n);if(e)return e;let i=ae(n,[],!1).filter(a=>nt(a)&&Lt(a)!=="body"),s=null,o=st(n).position==="fixed",r=o?gt(n):n;for(;nt(r)&&!Tt(r);){let a=st(r),l=ce(r);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||_t(r)&&!l&&Ei(n,r))?i=i.filter(h=>h!==r):s=a,r=gt(r)}return t.set(n,i),i}function En(n){let{element:t,boundary:e,rootBoundary:i,strategy:s}=n,r=[...e==="clippingAncestors"?Kt(t)?[]:On(t,this._c):[].concat(e),i],a=bi(t,r[0],s),l=a.top,c=a.right,h=a.bottom,u=a.left;for(let p=1;p{let i=new Map,s={platform:Ln,...e},o={...s.platform,_c:i};return ai(n,t,{...s,platform:o})};function Tn(n,t,e){return(t=_n(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function vt(){return vt=Object.assign?Object.assign.bind():function(n){for(var t=1;t"&&(t=t.substring(1)),n)try{if(n.matches)return n.matches(t);if(n.msMatchesSelector)return n.msMatchesSelector(t);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(t)}catch{return!1}return!1}}function Vi(n){return n.host&&n!==document&&n.host.nodeType&&n.host!==n?n.host:n.parentNode}function lt(n,t,e,i){if(n){e=e||document;do{if(t!=null&&(t[0]===">"?n.parentNode===e&&Se(n,t):Se(n,t))||i&&n===e)return n;if(n===e)break}while(n=Vi(n))}return null}var Ri=/\s+/g;function tt(n,t,e){if(n&&t)if(n.classList)n.classList[e?"add":"remove"](t);else{var i=(" "+n.className+" ").replace(Ri," ").replace(" "+t+" "," ");n.className=(i+(e?" "+t:"")).replace(Ri," ")}}function b(n,t,e){var i=n&&n.style;if(i){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(e=n.currentStyle),t===void 0?e:e[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=e+(typeof e=="string"?"":"px")}}function Ht(n,t){var e="";if(typeof n=="string")e=n;else do{var i=b(n,"transform");i&&i!=="none"&&(e=i+" "+e)}while(!t&&(n=n.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(e)}function Wi(n,t,e){if(n){var i=n.getElementsByTagName(t),s=0,o=i.length;if(e)for(;s=o:r=s<=o,!r)return i;if(i===ht())break;i=xt(i,!1)}return!1}function Vt(n,t,e,i){for(var s=0,o=0,r=n.children;o2&&arguments[2]!==void 0?arguments[2]:{},s=i.evt,o=In(i,$n);se.pluginEvent.bind(v)(t,e,dt({dragEl:d,parentEl:R,ghostEl:y,rootEl:L,nextEl:Mt,lastDownEl:be,cloneEl:T,cloneHidden:Dt,dragStarted:Gt,putSortable:H,activeSortable:v.active,originalEvent:s,oldIndex:Ft,oldDraggableIndex:te,newIndex:et,newDraggableIndex:Et,hideGhostForTarget:Gi,unhideGhostForTarget:qi,cloneNowHidden:function(){Dt=!0},cloneNowShown:function(){Dt=!1},dispatchSortableEvent:function(a){K({sortable:e,name:a,originalEvent:s})}},o))};function K(n){Wn(dt({putSortable:H,cloneEl:T,targetEl:d,rootEl:L,oldIndex:Ft,oldDraggableIndex:te,newIndex:et,newDraggableIndex:Et},n))}var d,R,y,L,Mt,be,T,Dt,Ft,et,te,Et,fe,H,kt=!1,Oe=!1,Ee=[],It,at,ke,Fe,Pi,Ni,Gt,Bt,ee,ie=!1,pe=!1,ve,z,He=[],Ye=!1,De=[],Ae=typeof document<"u",me=Ge,Bi=ne||yt?"cssFloat":"float",zn=Ae&&!Fi&&!Ge&&"draggable"in document.createElement("div"),Ki=(function(){if(Ae){if(yt)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}})(),ji=function(t,e){var i=b(t),s=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),o=Vt(t,0,e),r=Vt(t,1,e),a=o&&b(o),l=r&&b(r),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+N(o).width,h=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+N(r).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&a.float!=="none"){var u=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===u)?"vertical":"horizontal"}return o&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=s&&i[Bi]==="none"||r&&i[Bi]==="none"&&c+h>s)?"vertical":"horizontal"},Xn=function(t,e,i){var s=i?t.left:t.top,o=i?t.right:t.bottom,r=i?t.width:t.height,a=i?e.left:e.top,l=i?e.right:e.bottom,c=i?e.width:e.height;return s===a||o===l||s+r/2===a+c/2},Yn=function(t,e){var i;return Ee.some(function(s){var o=s[q].options.emptyInsertThreshold;if(!(!o||qe(s))){var r=N(s),a=t>=r.left-o&&t<=r.right+o,l=e>=r.top-o&&e<=r.bottom+o;if(a&&l)return i=s}}),i},Ui=function(t){function e(o,r){return function(a,l,c,h){var u=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(o==null&&(r||u))return!0;if(o==null||o===!1)return!1;if(r&&o==="clone")return o;if(typeof o=="function")return e(o(a,l,c,h),r)(a,l,c,h);var p=(r?a:l).options.group.name;return o===!0||typeof o=="string"&&o===p||o.join&&o.indexOf(p)>-1}}var i={},s=t.group;(!s||Xe(s)!="object")&&(s={name:s}),i.name=s.name,i.checkPull=e(s.pull,!0),i.checkPut=e(s.put),i.revertClone=s.revertClone,t.group=i},Gi=function(){!Ki&&y&&b(y,"display","none")},qi=function(){!Ki&&y&&b(y,"display","")};Ae&&!Fi&&document.addEventListener("click",function(n){if(Oe)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),Oe=!1,!1},!0);var Rt=function(t){if(d){t=t.touches?t.touches[0]:t;var e=Yn(t.clientX,t.clientY);if(e){var i={};for(var s in t)t.hasOwnProperty(s)&&(i[s]=t[s]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[q]._onDragOver(i)}}},Kn=function(t){d&&d.parentNode[q]._isOutsideThisEl(t.target)};function v(n,t){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=t=vt({},t),n[q]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ji(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,a){r.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:v.supportPointer!==!1&&"PointerEvent"in window&&(!Qt||Ge),emptyInsertThreshold:5};se.initializePlugins(this,n,e);for(var i in e)!(i in t)&&(t[i]=e[i]);Ui(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:zn,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?D(n,"pointerdown",this._onTapStart):(D(n,"mousedown",this._onTapStart),D(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(D(n,"dragover",this),D(n,"dragenter",this)),Ee.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),vt(this,Fn())}v.prototype={constructor:v,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Bt=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,d):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,s=this.options,o=s.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,h=s.filter;if(ts(i),!d&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||s.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Qt&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=lt(l,s.draggable,i,!1),!(l&&l.animated)&&be!==l)){if(Ft=ot(l),te=ot(l,s.draggable),typeof h=="function"){if(h.call(this,t,l,this)){K({sortable:e,rootEl:c,name:"filter",targetEl:l,toEl:i,fromEl:i}),G("filter",e,{evt:t}),o&&t.preventDefault();return}}else if(h&&(h=h.split(",").some(function(u){if(u=lt(c,u.trim(),i,!1),u)return K({sortable:e,rootEl:u,name:"filter",targetEl:l,fromEl:i,toEl:i}),G("filter",e,{evt:t}),!0}),h)){o&&t.preventDefault();return}s.handle&&!lt(c,s.handle,i,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,i){var s=this,o=s.el,r=s.options,a=o.ownerDocument,l;if(i&&!d&&i.parentNode===o){var c=N(i);if(L=o,d=i,R=d.parentNode,Mt=d.nextSibling,be=i,fe=r.group,v.dragged=d,It={target:d,clientX:(e||t).clientX,clientY:(e||t).clientY},Pi=It.clientX-c.left,Ni=It.clientY-c.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,d.style["will-change"]="all",l=function(){if(G("delayEnded",s,{evt:t}),v.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!Ii&&s.nativeDraggable&&(d.draggable=!0),s._triggerDragStart(t,e),K({sortable:s,name:"choose",originalEvent:t}),tt(d,r.chosenClass,!0)},r.ignore.split(",").forEach(function(h){Wi(d,h.trim(),Ve)}),D(a,"dragover",Rt),D(a,"mousemove",Rt),D(a,"touchmove",Rt),r.supportPointer?(D(a,"pointerup",s._onDrop),!this.nativeDraggable&&D(a,"pointercancel",s._onDrop)):(D(a,"mouseup",s._onDrop),D(a,"touchend",s._onDrop),D(a,"touchcancel",s._onDrop)),Ii&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),G("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(ne||yt))){if(v.eventCanceled){this._onDrop();return}r.supportPointer?(D(a,"pointerup",s._disableDelayedDrag),D(a,"pointercancel",s._disableDelayedDrag)):(D(a,"mouseup",s._disableDelayedDrag),D(a,"touchend",s._disableDelayedDrag),D(a,"touchcancel",s._disableDelayedDrag)),D(a,"mousemove",s._delayedDragTouchMoveHandler),D(a,"touchmove",s._delayedDragTouchMoveHandler),r.supportPointer&&D(a,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(l,r.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&Ve(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;E(t,"mouseup",this._disableDelayedDrag),E(t,"touchend",this._disableDelayedDrag),E(t,"touchcancel",this._disableDelayedDrag),E(t,"pointerup",this._disableDelayedDrag),E(t,"pointercancel",this._disableDelayedDrag),E(t,"mousemove",this._delayedDragTouchMoveHandler),E(t,"touchmove",this._delayedDragTouchMoveHandler),E(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?D(document,"pointermove",this._onTouchMove):e?D(document,"touchmove",this._onTouchMove):D(document,"mousemove",this._onTouchMove):(D(d,"dragend",this),D(L,"dragstart",this._onDragStart));try{document.selection?ye(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(kt=!1,L&&d){G("dragStarted",this,{evt:e}),this.nativeDraggable&&D(document,"dragover",Kn);var i=this.options;!t&&tt(d,i.dragClass,!1),tt(d,i.ghostClass,!0),v.active=this,t&&this._appendGhost(),K({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(at){this._lastX=at.clientX,this._lastY=at.clientY,Gi();for(var t=document.elementFromPoint(at.clientX,at.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(at.clientX,at.clientY),t!==e);)e=t;if(d.parentNode[q]._isOutsideThisEl(t),e)do{if(e[q]){var i=void 0;if(i=e[q]._onDragOver({clientX:at.clientX,clientY:at.clientY,target:t,rootEl:e}),i&&!this.options.dragoverBubble)break}t=e}while(e=Vi(e));qi()}},_onTouchMove:function(t){if(It){var e=this.options,i=e.fallbackTolerance,s=e.fallbackOffset,o=t.touches?t.touches[0]:t,r=y&&Ht(y,!0),a=y&&r&&r.a,l=y&&r&&r.d,c=me&&z&&_i(z),h=(o.clientX-It.clientX+s.x)/(a||1)+(c?c[0]-He[0]:0)/(a||1),u=(o.clientY-It.clientY+s.y)/(l||1)+(c?c[1]-He[1]:0)/(l||1);if(!v.active&&!kt){if(i&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(K({rootEl:R,name:"add",toEl:R,fromEl:L,originalEvent:t}),K({sortable:this,name:"remove",toEl:R,originalEvent:t}),K({rootEl:R,name:"sort",toEl:R,fromEl:L,originalEvent:t}),K({sortable:this,name:"sort",toEl:R,originalEvent:t})),H&&H.save()):et!==Ft&&et>=0&&(K({sortable:this,name:"update",toEl:R,originalEvent:t}),K({sortable:this,name:"sort",toEl:R,originalEvent:t})),v.active&&((et==null||et===-1)&&(et=Ft,Et=te),K({sortable:this,name:"end",toEl:R,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){G("nulling",this),L=d=R=y=Mt=T=be=Dt=It=at=Gt=et=Et=Ft=te=Bt=ee=H=fe=v.dragged=v.ghost=v.clone=v.active=null;var t=this.el;De.forEach(function(e){t.contains(e)&&(e.checked=!0)}),De.length=ke=Fe=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":d&&(this._onDragOver(t),jn(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,i=this.el.children,s=0,o=i.length,r=this.options;ss.right+o||n.clientY>i.bottom&&n.clientX>i.left:n.clientY>s.bottom+o||n.clientX>i.right&&n.clientY>i.top}function Jn(n,t,e,i,s,o,r,a){var l=i?n.clientY:n.clientX,c=i?e.height:e.width,h=i?e.top:e.left,u=i?e.bottom:e.right,p=!1;if(!r){if(a&&veh+c*o/2:lu-ve)return-ee}else if(l>h+c*(1-s)/2&&lu-c*o/2)?l>h+c/2?1:-1:0}function Qn(n){return ot(d){},options:k,optionsLimit:$=null,placeholder:_,position:j=null,removeButtonLabel:wt="Remove :label",searchableOptionFields:pt=["label"],searchDebounce:Y=1e3,searchingMessage:Le="Searching...",searchLabel:tn="Search",searchPrompt:en="Search...",state:nn,statePath:sn=null}){this.accessibilityAttributes=t,this.ariaLabel=e,this.canOptionLabelsWrap=i,this.canSelectPlaceholder=s,this.clearButtonLabel=o,this.element=r,this.errorMessage=a,this.getOptionLabelUsing=l,this.getOptionLabelsUsing=c,this.getOptionsUsing=h,this.getSearchResultsUsing=u,this.hasDynamicOptions=p,this.hasDynamicSearchResults=f&&typeof u=="function",this.hasInitialNoOptionsMessage=m,this.id=g,this.initialOptionLabel=S,this.initialOptionLabels=O,this.initialState=w,this.isAutofocused=x,this.isDisabled=A,this.isHtmlAllowed=M,this.isMultiple=C,this.isReorderable=J,this.isSearchable=Q,this.livewireId=I,this.loadingMessage=V,this.maxItems=X,this.maxItemsMessage=it,this.noOptionsMessage=W,this.noSearchResultsMessage=B,this.onStateChange=Z,this.options=k,this.optionsLimit=$,this.originalOptions=JSON.parse(JSON.stringify(k)),this.placeholder=_,this.position=j,this.removeButtonLabel=wt,this.searchableOptionFields=Array.isArray(pt)?pt:["label"],this.searchDebounce=Y,this.searchingMessage=Le,this.searchLabel=tn,this.searchPrompt=en,this.state=nn,this.statePath=sn,this.activeSearchId=0,this.openId=0,this.isDestroyed=!1,this.labelRepository={},this.isOpen=!1,this.activeValue=null,this.typeahead="",this.typeaheadTime=0,this.searchQuery="",this.searchTimeout=null,this.isSearching=!1,this.isLoadingOptions=!1,this.hasOptionsError=!1,this.maxItemsMessageElement=null,this.badgesSortable=null,this.selectedDisplayVersion=0,this.render(),this.setUpEventListeners(),this.isAutofocused&&this.selectButton.focus()}populateLabelRepositoryFromOptions(t){if(!(!t||!Array.isArray(t)))for(let e of t)e.options&&Array.isArray(e.options)?this.populateLabelRepositoryFromOptions(e.options):e.value!==void 0&&e.label!==void 0&&(this.labelRepository[e.value]=e.label)}render(){this.populateLabelRepositoryFromOptions(this.options),this.container=document.createElement("div"),this.container.className="fi-select-input-ctn",this.canOptionLabelsWrap||this.container.classList.add("fi-select-input-ctn-option-labels-not-wrapped"),this.selectButton=document.createElement("button"),this.selectButton.className="fi-select-input-btn",this.selectButton.type="button",this.isSearchable||this.selectButton.setAttribute("role","combobox"),this.selectButton.setAttribute("aria-haspopup","listbox"),this.selectButton.setAttribute("aria-expanded","false"),F(this.id)&&(this.selectButton.id=this.id),F(this.ariaLabel)&&this.selectButton.setAttribute("aria-label",this.ariaLabel),this.selectedDisplay=document.createElement("div"),this.selectedDisplay.className="fi-select-input-value-ctn",this.isMultiple?(this.container.classList.add("fi-select-input-ctn-multiple"),this.isReorderable&&this.container.classList.add("fi-select-input-ctn-reorderable"),this.selectionSummary=document.createElement("span"),this.selectionSummary.className="fi-sr-only",this.selectButton.appendChild(this.selectionSummary)):this.selectButton.appendChild(this.selectedDisplay),this.dropdown=document.createElement("div"),this.dropdown.className="fi-dropdown-panel fi-scrollable",this.dropdown.style.display="none",this.dropdownId=`fi-select-input-dropdown-${Math.random().toString(36).substring(2,11)}`,this.selectButton.setAttribute("aria-controls",this.dropdownId),this.selectionSummary||(this.selectionSummary=document.createElement("span"),this.selectionSummary.className="fi-sr-only",this.container.appendChild(this.selectionSummary)),this.selectionSummary.id=`${this.dropdownId}-value`,this.isSearchable&&(this.searchContainer=document.createElement("div"),this.searchContainer.className="fi-select-input-search-ctn",this.searchInput=document.createElement("input"),this.searchInput.className="fi-input",this.searchInput.type="text",this.searchInput.placeholder=this.searchPrompt,this.searchInput.setAttribute("role","combobox"),this.searchInput.setAttribute("aria-autocomplete","list"),this.searchInput.setAttribute("aria-expanded","false"),this.searchInput.setAttribute("aria-controls",this.dropdownId),this.searchContainer.appendChild(this.searchInput),this.dropdown.appendChild(this.searchContainer),this.searchInput.addEventListener("input",t=>{this.isDisabled||this.handleSearch(t)})),this.optionsList=document.createElement("ul"),this.optionsList.id=this.dropdownId,this.optionsList.setAttribute("role","listbox"),this.isMultiple&&this.optionsList.setAttribute("aria-multiselectable","true"),this.optionsList.addEventListener("mousedown",t=>t.preventDefault()),this.dropdown.addEventListener("mousedown",t=>{t.target===this.dropdown&&t.preventDefault()}),this.statusRegion=document.createElement("div"),this.statusRegion.className="fi-sr-only",this.statusRegion.setAttribute("role","status"),this.statusRegion.setAttribute("aria-live","polite"),this.statusRegion.setAttribute("aria-atomic","true"),this.renderOptions(),this.container.appendChild(this.selectButton),this.isMultiple&&this.container.appendChild(this.selectedDisplay),this.container.appendChild(this.dropdown),this.container.appendChild(this.statusRegion),this.element.appendChild(this.container),this.setAccessibilityAttributes(this.accessibilityAttributes),this.updateSelectedDisplay(),this.applyDisabledState()}renderOptions(){if(this.isSearching||this.hasOptionsError||this.isLoadingOptions&&(!this.searchQuery||!this.hasDynamicSearchResults))return;let t=this.activeValue;this.setActiveOption(null),this.optionsList.innerHTML="";let e=0,i=this.options,s=0,o=!1;this.options.forEach(l=>{l.options&&Array.isArray(l.options)?(s+=l.options.length,o=!0):s++}),o?this.optionsList.className="fi-select-input-options-ctn":s>0&&(this.optionsList.className="fi-dropdown-list");let r=o?null:this.optionsList,a=0;for(let l of i){if(this.optionsLimit>0&&a>=this.optionsLimit)break;if(l.options&&Array.isArray(l.options)){let c=l.options;if(this.isMultiple&&Array.isArray(this.state)&&this.state.length>0&&(c=l.options.filter(h=>!this.state.includes(h.value))),c.length>0){if(this.optionsLimit>0){let h=this.optionsLimit-a;hc.dataset.value===t)??(t!==null||!this.isSearchable?l.find(c=>this.typeahead&&ft(c.textContent.trim()).startsWith(this.typeahead))??l.find(c=>c.dataset.value===this.state)??l[0]:null))}}renderOptionGroup(t,e){if(e.length===0)return;let i=document.createElement("li");i.className="fi-select-input-option-group",i.setAttribute("role","presentation");let s=document.createElement("div");s.className="fi-dropdown-header",s.textContent=t;let o=document.createElement("ul");o.className="fi-dropdown-list",o.setAttribute("role","group"),o.setAttribute("aria-label",t),e.forEach(r=>{let a=this.createOptionElement(r.value,r);o.appendChild(a)}),i.appendChild(s),i.appendChild(o),this.optionsList.appendChild(i)}createOptionElement(t,e){let i=t,s=e,o=!1;typeof e=="object"&&e!==null&&"label"in e&&"value"in e&&(i=e.value,s=e.label,o=e.isDisabled||!1);let r=document.createElement("li");r.className="fi-dropdown-list-item fi-select-input-option",o&&r.classList.add("fi-disabled");let a=`fi-select-input-option-${Math.random().toString(36).substring(2,11)}`;if(r.id=a,r.setAttribute("role","option"),r.setAttribute("data-value",i),o&&r.setAttribute("aria-disabled","true"),this.isHtmlAllowed&&typeof s=="string"){let h=document.createElement("div");h.innerHTML=s;let u=h.textContent||h.innerText||s;r.setAttribute("aria-label",u)}let l=this.isMultiple?Array.isArray(this.state)&&this.state.includes(i):this.state===i;r.setAttribute("aria-selected",l?"true":"false");let c=document.createElement("span");return this.isHtmlAllowed?c.innerHTML=s:c.textContent=s,r.appendChild(c),o||r.addEventListener("click",h=>{h.preventDefault(),h.stopPropagation(),this.selectOption(i)}),r}async updateSelectedDisplay(){if(this.isDestroyed)return;this.selectedDisplayVersion=this.selectedDisplayVersion+1;let t=this.selectedDisplayVersion,e=document.createDocumentFragment();if(this.isMultiple){if(!Array.isArray(this.state)||this.state.length===0){let s=document.createElement("span");s.textContent=this.placeholder,s.classList.add("fi-select-input-placeholder"),e.appendChild(s)}else{let s=await this.getLabelsForMultipleSelection();if(t!==this.selectedDisplayVersion)return;this.addBadgesForSelectedOptions(s,e)}t===this.selectedDisplayVersion&&(e.querySelector(".fi-select-input-value-badges-ctn")||this.destroyBadgesSortable(),this.commitSelectedDisplay(e),this.isOpen&&this.positionDropdown());return}if(this.state===null||this.state===""){let s=document.createElement("span");if(s.textContent=this.placeholder,s.classList.add("fi-select-input-placeholder"),e.appendChild(s),t===this.selectedDisplayVersion){this.destroyBadgesSortable(),this.commitSelectedDisplay(e);let o=this.container.querySelector(".fi-select-input-value-remove-btn");o&&o.remove(),this.container.classList.remove("fi-select-input-ctn-clearable")}return}let i=await this.getLabelForSingleSelection();t===this.selectedDisplayVersion&&(this.addSingleSelectionDisplay(i,e),t===this.selectedDisplayVersion&&(this.destroyBadgesSortable(),this.commitSelectedDisplay(e)))}commitSelectedDisplay(t){let e=this.selectedDisplay.contains(document.activeElement)?document.activeElement:null,i=e?.closest("[data-value]")?.dataset.value;this.selectedDisplay.replaceChildren(t),this.updateSelectionSummary(),e&&(this.isOpen?this.getFocusOwner():this.selectedDisplay.querySelector(`[data-value="${CSS.escape(i??"")}"] button`)??this.selectButton).focus()}updateSelectionSummary(){this.selectionSummary.textContent=Array.from(this.selectedDisplay.querySelectorAll(".fi-badge-label, .fi-select-input-value-label, .fi-select-input-placeholder"),t=>t.textContent).join(", ")}async getLabelsForMultipleSelection(){let t=this.selectedDisplayVersion,e=this.getSelectedOptionLabels(),i=[];if(Array.isArray(this.state)){for(let o of this.state)if(!F(this.labelRepository[o])){if(F(e[o])){this.labelRepository[o]=e[o];continue}i.push(o.toString())}}if(i.length>0&&F(this.initialOptionLabels)&&JSON.stringify(this.state)===JSON.stringify(this.initialState)){if(Array.isArray(this.initialOptionLabels))for(let o of this.initialOptionLabels)F(o)&&o.value!==void 0&&o.label!==void 0&&i.includes(o.value)&&(this.labelRepository[o.value]=o.label)}else if(i.length>0&&this.getOptionLabelsUsing)try{let o=await this.getOptionLabelsUsing();if(this.isDestroyed||t!==this.selectedDisplayVersion)return[];for(let r of o)F(r)&&r.value!==void 0&&r.label!==void 0&&(this.labelRepository[r.value]=r.label)}catch(o){console.error("Error fetching option labels:",o)}let s=[];if(Array.isArray(this.state))for(let o of this.state)F(this.labelRepository[o])?s.push(this.labelRepository[o]):F(e[o])?s.push(e[o]):s.push(o);return s}createBadgeElement(t,e){let i=document.createElement("span");i.className="fi-badge fi-size-md fi-color fi-color-primary fi-text-color-700 dark:fi-text-color-200",F(t)&&i.setAttribute("data-value",t);let s=document.createElement("span");s.className="fi-badge-label-ctn";let o=document.createElement("span");o.className="fi-badge-label",this.canOptionLabelsWrap&&o.classList.add("fi-wrapped"),this.isHtmlAllowed?o.innerHTML=e:o.textContent=e,s.appendChild(o),i.appendChild(s);let r=this.createRemoveButton(t,e);return i.appendChild(r),i}createRemoveButton(t,e){let i=document.createElement("button");i.type="button",i.className="fi-badge-delete-btn",i.setAttribute("aria-label",this.removeButtonLabel.replace(":label",this.isHtmlAllowed?e.replace(/<[^>]*>/g,""):e));let s=document.createElement("span");return s.className="fi-badge-delete-btn-icon",s.setAttribute("aria-hidden","true"),i.appendChild(s),this.isDisabled&&(i.setAttribute("disabled","disabled"),i.classList.add("fi-disabled")),i.addEventListener("click",o=>{if(o.stopPropagation(),F(t)){let r=Array.from(this.selectedDisplay.querySelectorAll(".fi-badge-delete-btn")),a=r.indexOf(i),l=this.isOpen?this.getFocusOwner():r[a+1]??r[a-1]??this.selectButton;this.selectOption(t),this.isDisabled||l.focus()}}),i.addEventListener("keydown",o=>{(o.key===" "||o.key==="Enter")&&(o.preventDefault(),o.stopPropagation(),i.click())}),i}addBadgesForSelectedOptions(t,e=this.selectedDisplay){let i=document.createElement("div");i.className="fi-select-input-value-badges-ctn",t.forEach((s,o)=>{let r=Array.isArray(this.state)?this.state[o]:null,a=this.createBadgeElement(r,s);i.appendChild(a)}),e.appendChild(i),this.isReorderable&&(i.addEventListener("click",s=>{s.stopPropagation()}),i.addEventListener("mousedown",s=>{s.stopPropagation()}),this.destroyBadgesSortable(),this.badgesSortable=new Qi(i,{animation:150,disabled:this.isDisabled,onEnd:()=>{let s=[];i.querySelectorAll("[data-value]").forEach(o=>{s.push(o.getAttribute("data-value"))}),this.state=s,this.updateSelectionSummary(),this.onStateChange(this.state)}}))}destroyBadgesSortable(){this.badgesSortable?.destroy(),this.badgesSortable=null}async getLabelForSingleSelection(){let t=this.state,e=this.selectedDisplayVersion,i=this.labelRepository[this.state];if(oe(i)&&(i=this.getSelectedOptionLabel(this.state)),oe(i)&&F(this.initialOptionLabel)&&this.state===this.initialState)i=this.initialOptionLabel,F(this.state)&&(this.labelRepository[this.state]=i);else if(oe(i)&&this.getOptionLabelUsing)try{if(i=await this.getOptionLabelUsing(),this.isDestroyed||e!==this.selectedDisplayVersion||t!==this.state)return null;F(i)&&F(this.state)&&(this.labelRepository[t]=i)}catch(s){console.error("Error fetching option label:",s),i=this.state}else oe(i)&&(i=this.state);return i}addSingleSelectionDisplay(t,e=this.selectedDisplay){let i=document.createElement("span");if(i.className="fi-select-input-value-label",this.isHtmlAllowed?i.innerHTML=t:i.textContent=t,e.appendChild(i),!this.canSelectPlaceholder||this.container.querySelector(".fi-select-input-value-remove-btn"))return;let s=document.createElement("button");s.type="button",s.className="fi-select-input-value-remove-btn",s.setAttribute("aria-label",this.clearButtonLabel),this.isDisabled&&(s.setAttribute("disabled","disabled"),s.classList.add("fi-disabled")),s.addEventListener("click",o=>{o.stopPropagation(),this.selectOption("")}),s.addEventListener("keydown",o=>{(o.key===" "||o.key==="Enter")&&(o.preventDefault(),o.stopPropagation(),this.selectOption(""))}),this.container.appendChild(s),this.container.classList.add("fi-select-input-ctn-clearable")}getSelectedOptionLabel(t){if(F(this.labelRepository[t]))return this.labelRepository[t];let e="";for(let i of this.options)if(i.options&&Array.isArray(i.options)){for(let s of i.options)if(s.value===t){e=s.label,this.labelRepository[t]=e;break}}else if(i.value===t){e=i.label,this.labelRepository[t]=e;break}return e}setUpEventListeners(){this.buttonClickListener=()=>{this.toggleDropdown()},this.documentClickListener=t=>{!this.container.contains(t.target)&&this.isOpen&&this.closeDropdown()},this.buttonKeydownListener=t=>{this.isDisabled||this.handleSelectButtonKeydown(t)},this.dropdownKeydownListener=t=>{this.isDisabled||this.handleDropdownKeydown(t)},this.focusinListener=()=>this.syncActiveDescendant(),this.focusoutListener=t=>{this.selectButton.removeAttribute("aria-activedescendant"),this.searchInput?.removeAttribute("aria-activedescendant"),queueMicrotask(()=>{this.isDestroyed||!this.isOpen||(this.isTabbing||!this.container.contains(t.relatedTarget))&&(this.isTabbing=!1,this.closeDropdown())})},this.dropdownEscapeListener=t=>{this.isOpen&&(this.closeDropdown(),this.selectButton.focus(),t.preventDefault(),t.stopPropagation())},this.selectButton.addEventListener("click",this.buttonClickListener),document.addEventListener("click",this.documentClickListener),this.selectButton.addEventListener("keydown",this.buttonKeydownListener),this.dropdown.addEventListener("keydown",this.dropdownKeydownListener),this.container.addEventListener("focusin",this.focusinListener),this.container.addEventListener("focusout",this.focusoutListener),this.element.addEventListener("dropdown-escape",this.dropdownEscapeListener),!this.isMultiple&&this.livewireId&&this.statePath&&this.getOptionLabelUsing&&(this.refreshOptionLabelListener=async t=>{if(t.detail.livewireId===this.livewireId&&t.detail.statePath===this.statePath&&F(this.state))try{let e=this.state,i=++this.selectedDisplayVersion;delete this.labelRepository[this.state];let s=await this.getOptionLabelUsing();if(this.isDestroyed||e!==this.state||i!==this.selectedDisplayVersion)return;this.updateOptionLabelInList(this.state,s),this.updateSelectedDisplay()}catch(e){console.error("Error refreshing option label:",e)}},window.addEventListener("filament-forms::select.refreshSelectedOptionLabel",this.refreshOptionLabelListener))}updateOptionLabelInList(t,e){this.labelRepository[t]=e;let i=this.getVisibleOptions();for(let s of i)if(s.getAttribute("data-value")===String(t)){if(s.innerHTML="",this.isHtmlAllowed){let o=document.createElement("span");o.innerHTML=e,s.appendChild(o),s.setAttribute("aria-label",o.textContent||o.innerText||e)}else s.appendChild(document.createTextNode(e));break}for(let s of this.options)if(s.options&&Array.isArray(s.options)){for(let o of s.options)if(o.value===t){o.label=e;break}}else if(s.value===t){s.label=e;break}for(let s of this.originalOptions)if(s.options&&Array.isArray(s.options)){for(let o of s.options)if(o.value===t){o.label=e;break}}else if(s.value===t){s.label=e;break}}handleSelectButtonKeydown(t){if(!t.isComposing){if((!this.isOpen||this.isSearchable)&&["Enter"," ","ArrowDown","ArrowUp"].includes(t.key)){t.preventDefault(),t.stopPropagation(),this.openDropdown();return}this.handleDropdownKeydown(t)}}handleDropdownKeydown(t){if(t.isComposing)return;let e=t.target===this.searchInput,i=this.getEnabledOptions();switch(t.key){case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.focusNextOption();break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),this.focusPreviousOption();break;case" ":if(e)return;case"Enter":if(!this.isOpen)return;t.preventDefault(),t.stopPropagation();let s=i.find(o=>o.dataset.value===this.activeValue)??(e?i[0]:null);s&&this.selectOption(s.dataset.value);break;case"Escape":if(!this.isOpen)return;t.preventDefault(),t.stopPropagation(),this.closeDropdown(),this.selectButton.focus();break;case"Tab":this.isTabbing=this.isOpen;break;case"Home":case"End":if(e||!this.isOpen)return;t.preventDefault(),t.stopPropagation(),this.setActiveOption(t.key==="Home"?i[0]:i.at(-1));break;default:if(!e&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&typeof t.key=="string"&&t.key.length===1)if(t.preventDefault(),this.isOpen||this.openDropdown(),this.isSearchable)this.searchInput.value=(this.searchInput.value||"")+t.key,this.searchInput.dispatchEvent(new Event("input",{bubbles:!0}));else{let o=Date.now();this.typeahead=(o-this.typeaheadTime<1e3?this.typeahead:"")+ft(t.key),this.typeaheadTime=o;let r=this.getEnabledOptions().find(a=>ft(a.textContent.trim()).startsWith(this.typeahead));r&&this.setActiveOption(r)}break}}toggleDropdown(){if(!this.isDisabled){if(this.isOpen){this.closeDropdown();return}this.openDropdown()}}async openDropdown(){if(this.isDestroyed||this.isDisabled)return;if(this.isOpen){this.getFocusOwner().focus();return}let t=++this.openId,e=++this.activeSearchId;this.typeahead="",this.hasOptionsError=!1;let i=`${this.selectButton.offsetWidth}px`;this.dropdown.style.display="block",this.dropdown.style.opacity="0";let s=this.selectButton.closest(".fi-fixed-positioning-context")!==null&&this.selectButton.closest(".fi-absolute-positioning-context")===null;if(this.dropdown.style.position=s?"fixed":"absolute",this.dropdown.style.width=i,this.selectButton.setAttribute("aria-expanded","true"),this.searchInput?.setAttribute("aria-expanded","true"),this.isOpen=!0,this.isTabbing=!1,this.getFocusOwner().focus(),this.positionDropdown(),this.resizeListener||(this.resizeListener=()=>{this.dropdown.style.width=`${this.selectButton.offsetWidth}px`,this.positionDropdown()},window.addEventListener("resize",this.resizeListener)),this.scrollListener||(this.scrollListener=()=>this.positionDropdown(),window.addEventListener("scroll",this.scrollListener,!0)),this.dropdown.style.opacity="1",this.isSearchable&&this.searchInput&&(this.searchInput.value="",this.searchQuery=""),this.hasDynamicOptions||(this.options=JSON.parse(JSON.stringify(this.originalOptions)),this.renderOptions()),this.hasDynamicOptions&&this.getOptionsUsing){this.isLoadingOptions=!0,this.showLoadingState(!1);try{let o=await this.getOptionsUsing();if(this.isDestroyed||!this.isOpen||t!==this.openId)return;this.isLoadingOptions=!1;let r=Array.isArray(o)?o:o&&Array.isArray(o.options)?o.options:[];this.originalOptions=JSON.parse(JSON.stringify(r)),(!this.searchQuery||!this.hasDynamicSearchResults)&&(this.populateLabelRepositoryFromOptions(r),this.searchQuery?this.filterOptions(this.searchQuery):(this.options=r,this.renderOptions(),this.positionDropdown()))}catch(o){if(this.isDestroyed||!this.isOpen||t!==this.openId||(this.isLoadingOptions=!1,this.searchQuery&&this.hasDynamicSearchResults&&e!==this.activeSearchId))return;console.error("Error fetching options:",o),this.showErrorMessage()}}else(!this.hasInitialNoOptionsMessage||this.searchQuery)&&this.hideLoadingState()}positionDropdown(){if(this.isDestroyed||!this.isOpen)return;let t=this.openId,e=this.position==="top"?"top-start":"bottom-start",i=[xi(4),Ai({padding:5})];this.position!=="top"&&this.position!=="bottom"&&i.push(Ci());let s=this.selectButton.closest(".fi-fixed-positioning-context")!==null&&this.selectButton.closest(".fi-absolute-positioning-context")===null;Li(this.selectButton,this.dropdown,{placement:e,middleware:i,strategy:s?"fixed":"absolute"}).then(({x:o,y:r})=>{this.isDestroyed||!this.isOpen||t!==this.openId||Object.assign(this.dropdown.style,{left:`${o}px`,top:`${r}px`})})}closeDropdown(){this.dropdown.style.display="none",this.selectButton.setAttribute("aria-expanded","false"),this.searchInput?.setAttribute("aria-expanded","false"),this.isOpen=!1,this.openId++,this.searchTimeout&&(clearTimeout(this.searchTimeout),this.searchTimeout=null),this.activeSearchId++,this.isSearching=!1,this.isLoadingOptions=!1,this.hideLoadingState(),this.hideMaxItemsMessage(),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener,!0),this.scrollListener=null),this.setActiveOption(null)}focusNextOption(){let t=this.getEnabledOptions();if(t.length===0)return;let e=t.findIndex(i=>i.dataset.value===this.activeValue);this.setActiveOption(t[Math.min(e+1,t.length-1)])}focusPreviousOption(){let t=this.getEnabledOptions();if(t.length===0)return;let e=t.findIndex(i=>i.dataset.value===this.activeValue);this.setActiveOption(t[e<0?t.length-1:Math.max(e-1,0)])}scrollOptionIntoView(t){if(!t)return;let e=this.dropdown.getBoundingClientRect(),i=t.getBoundingClientRect();i.bottom>e.bottom?this.dropdown.scrollTop+=i.bottom-e.bottom:i.topt.getAttribute("aria-disabled")!=="true")}getFocusOwner(){return this.searchInput??this.selectButton}setActiveOption(t){this.activeValue=t?.dataset.value??null,this.getVisibleOptions().forEach(e=>e.classList.toggle("fi-selected",e===t)),this.syncActiveDescendant(),t&&this.isOpen&&this.scrollOptionIntoView(t)}syncActiveDescendant(){this.selectButton.removeAttribute("aria-activedescendant"),this.searchInput?.removeAttribute("aria-activedescendant");let t=this.getFocusOwner();if(!this.isOpen||document.activeElement!==t)return;let e=this.getEnabledOptions().find(i=>i.dataset.value===this.activeValue);e&&t.setAttribute("aria-activedescendant",e.id)}setAccessibilityAttributes(t){this.accessibilityAttributes=t;for(let s of["aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-busy","aria-required"]){let o=t[s];for(let r of[this.selectButton,this.searchInput].filter(Boolean))F(o)?r.setAttribute(s,o):r.removeAttribute(s)}!this.selectButton.hasAttribute("aria-label")&&!this.selectButton.hasAttribute("aria-labelledby")&&F(this.ariaLabel)&&this.selectButton.setAttribute("aria-label",this.ariaLabel);let e=(this.selectButton.getAttribute("aria-labelledby")??"").split(/\s+/).map(s=>document.getElementById(s)?.textContent??"").join(" ").trim()||this.selectButton.getAttribute("aria-label")||Array.from(this.selectButton.labels??[],s=>s.textContent).join(" ").trim();this.optionsList.setAttribute("aria-label",e),this.isSearchable&&(this.searchInput.removeAttribute("aria-labelledby"),this.searchInput.setAttribute("aria-label",`${e}: ${this.searchLabel}`),this.selectButton.removeAttribute("aria-required"));let i=[t["aria-describedby"],this.selectionSummary.id].filter(Boolean).join(" ").split(/\s+/);this.selectButton.setAttribute("aria-describedby",[...new Set(i)].join(" "))}getSelectedOptionLabels(){if(!Array.isArray(this.state)||this.state.length===0)return{};let t={};for(let e of this.state){let i=!1;for(let s of this.options)if(s.options&&Array.isArray(s.options)){for(let o of s.options)if(o.value===e){t[e]=o.label,i=!0;break}if(i)break}else if(s.value===e){t[e]=s.label;break}}return t}handleSearch(t){if(this.isDestroyed||!this.isOpen)return;let e=t.target.value.trim();this.searchQuery=e,this.hasOptionsError=!1;let i=++this.activeSearchId;if(this.setActiveOption(null),this.searchTimeout&&clearTimeout(this.searchTimeout),e===""){if(this.isSearching=!1,this.isLoadingOptions){this.showLoadingState();return}this.hideLoadingState(),this.options=JSON.parse(JSON.stringify(this.originalOptions)),this.renderOptions(),this.positionDropdown();return}if(!this.getSearchResultsUsing||typeof this.getSearchResultsUsing!="function"||!this.hasDynamicSearchResults){this.isSearching=!1,this.filterOptions(e);return}this.isSearching=!0,this.showLoadingState(!0),this.searchTimeout=setTimeout(async()=>{this.searchTimeout=null;try{let s=await this.getSearchResultsUsing(e);if(this.isDestroyed||i!==this.activeSearchId||!this.isOpen)return;let o=Array.isArray(s)?s:s&&Array.isArray(s.options)?s.options:[];this.options=o,this.populateLabelRepositoryFromOptions(o),this.isSearching=!1,this.hideLoadingState(),this.renderOptions(),this.isOpen&&this.positionDropdown(),this.options.length===0&&this.showNoResultsMessage()}catch(s){!this.isDestroyed&&this.isOpen&&i===this.activeSearchId&&(console.error("Error fetching search results:",s),this.showErrorMessage())}finally{i===this.activeSearchId&&(this.isSearching=!1)}},this.searchDebounce)}showLoadingState(t=!1){this.setActiveOption(null),this.optionsList.hidden=!0,this.hideLoadingState(),this.optionsList.setAttribute("aria-busy","true");let e=document.createElement("div");e.className="fi-select-input-message",e.textContent=t?this.searchingMessage:this.loadingMessage,this.dropdown.appendChild(e),this.isOpen&&(this.statusRegion.textContent=e.textContent),this.positionDropdown()}hideLoadingState(){this.optionsList.removeAttribute("aria-busy");let t=this.dropdown.querySelector(".fi-select-input-message");t&&(t.remove(),this.statusRegion.textContent="")}showNoOptionsMessage(){this.setActiveOption(null),this.optionsList.hidden=!0,this.hideLoadingState();let t=document.createElement("div");t.className="fi-select-input-message",t.textContent=this.noOptionsMessage,this.dropdown.appendChild(t),this.isOpen&&(this.statusRegion.textContent=this.noOptionsMessage)}showNoResultsMessage(){this.setActiveOption(null),this.optionsList.hidden=!0,this.hideLoadingState();let t=document.createElement("div");t.className="fi-select-input-message",t.textContent=this.noSearchResultsMessage,this.dropdown.appendChild(t),this.isOpen&&(this.statusRegion.textContent=this.noSearchResultsMessage)}showErrorMessage(){this.hasOptionsError=!0,this.showLoadingState(),this.optionsList.removeAttribute("aria-busy"),this.dropdown.querySelector(".fi-select-input-message").textContent=this.errorMessage,this.statusRegion.textContent=this.errorMessage,this.positionDropdown()}showMaxItemsMessage(){this.hideMaxItemsMessage(),this.maxItemsMessageElement=document.createElement("div"),this.maxItemsMessageElement.className="fi-select-input-max-items-message",this.maxItemsMessageElement.textContent=this.maxItemsMessage,this.optionsList.parentNode===this.dropdown?this.dropdown.insertBefore(this.maxItemsMessageElement,this.optionsList):this.dropdown.appendChild(this.maxItemsMessageElement),this.statusRegion.textContent=this.maxItemsMessage}hideMaxItemsMessage(){this.maxItemsMessageElement&&(this.maxItemsMessageElement.remove(),this.maxItemsMessageElement=null,this.statusRegion.textContent===this.maxItemsMessage&&(this.statusRegion.textContent=""))}filterOptions(t){let e=this.searchableOptionFields.includes("label"),i=this.searchableOptionFields.includes("value");t=ft(t);let s=[];for(let o of this.originalOptions)if(o.options&&Array.isArray(o.options)){let r=o.options.filter(a=>e&&ft(a.label).includes(t)||i&&ft(String(a.value)).includes(t));r.length>0&&s.push({label:o.label,options:r})}else(e&&ft(o.label).includes(t)||i&&ft(String(o.value)).includes(t))&&s.push(o);this.options=s,this.renderOptions(),this.isOpen&&this.positionDropdown()}selectOption(t){if(this.isDisabled)return;if(!this.isMultiple){let i=this.container.contains(document.activeElement);this.state=t,this.updateSelectedDisplay(),this.renderOptions(),this.closeDropdown(),i&&this.selectButton.focus(),this.onStateChange(this.state);return}let e=Array.isArray(this.state)?[...this.state]:[];if(e.includes(t)){this.state=e.filter(i=>i!==t),this.updateSelectedDisplay(),this.hideMaxItemsMessage(),this.renderOptions(),this.isOpen&&this.positionDropdown(),this.maintainFocusInMultipleMode(),this.updateSelectionSummary(),this.onStateChange(this.state);return}if(this.maxItems&&e.length>=this.maxItems){this.maxItemsMessage&&this.showMaxItemsMessage();return}this.hideMaxItemsMessage(),e.push(t),this.state=e,this.updateSelectedDisplay(),this.renderOptions(),this.isOpen&&this.positionDropdown(),this.maintainFocusInMultipleMode(),this.onStateChange(this.state)}maintainFocusInMultipleMode(){this.isOpen&&this.container.contains(document.activeElement)&&this.getFocusOwner().focus()}disable(){this.isDisabled||(this.isDisabled=!0,this.applyDisabledState(),this.isOpen&&this.closeDropdown())}enable(){this.isDisabled&&(this.isDisabled=!1,this.applyDisabledState())}applyDisabledState(){if(this.badgesSortable?.option("disabled",this.isDisabled),this.isDisabled){if(this.selectButton.setAttribute("disabled","disabled"),this.selectButton.setAttribute("aria-disabled","true"),this.selectButton.classList.add("fi-disabled"),this.isMultiple&&this.container.querySelectorAll(".fi-badge-delete-btn").forEach(e=>{e.setAttribute("disabled","disabled"),e.classList.add("fi-disabled")}),!this.isMultiple&&this.canSelectPlaceholder){let t=this.container.querySelector(".fi-select-input-value-remove-btn");t&&(t.setAttribute("disabled","disabled"),t.classList.add("fi-disabled"))}this.isSearchable&&this.searchInput&&(this.searchInput.setAttribute("disabled","disabled"),this.searchInput.classList.add("fi-disabled"))}else{if(this.selectButton.removeAttribute("disabled"),this.selectButton.removeAttribute("aria-disabled"),this.selectButton.classList.remove("fi-disabled"),this.isMultiple&&this.container.querySelectorAll(".fi-badge-delete-btn").forEach(e=>{e.removeAttribute("disabled"),e.classList.remove("fi-disabled")}),!this.isMultiple&&this.canSelectPlaceholder){let t=this.container.querySelector(".fi-select-input-value-remove-btn");t&&(t.removeAttribute("disabled"),t.classList.remove("fi-disabled"))}this.isSearchable&&this.searchInput&&(this.searchInput.removeAttribute("disabled"),this.searchInput.classList.remove("fi-disabled"))}}destroy(){this.isDestroyed=!0,this.openId++,this.activeSearchId++,this.selectedDisplayVersion++,this.destroyBadgesSortable(),this.selectButton&&this.buttonClickListener&&this.selectButton.removeEventListener("click",this.buttonClickListener),this.documentClickListener&&document.removeEventListener("click",this.documentClickListener),this.selectButton&&this.buttonKeydownListener&&this.selectButton.removeEventListener("keydown",this.buttonKeydownListener),this.dropdown&&this.dropdownKeydownListener&&this.dropdown.removeEventListener("keydown",this.dropdownKeydownListener),this.dropdownEscapeListener&&this.element.removeEventListener("dropdown-escape",this.dropdownEscapeListener),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener,!0),this.scrollListener=null),this.refreshOptionLabelListener&&window.removeEventListener("filament-forms::select.refreshSelectedOptionLabel",this.refreshOptionLabelListener),this.isOpen&&this.closeDropdown(),this.searchTimeout&&(clearTimeout(this.searchTimeout),this.searchTimeout=null),this.container&&this.container.remove()}};function Zi(){let n=!1,t=new Set,e=(i,s,o,r={})=>{let a=[...o,{...r}],l=null,c;return new Promise((h,u)=>{let p=!1,f=(m,g)=>{p||(p=!0,l?.(),l=null,t.delete(c),m(g))};if(c=()=>f(u,new Error("Select option request was cancelled.")),t.add(c),n){c();return}l=Livewire.hook("commit",({component:m,commit:g,fail:S})=>{m.id!==i.$id||!g.calls.some(O=>O.method===s&&O.params.length===a.length&&O.params.every((w,x)=>w===a[x]))||(l?.(),l=null,S(()=>f(u,new Error("Select option request failed."))))});try{Promise.resolve(i[s](...a)).then(m=>f(h,m),m=>f(u,m))}catch(m){f(u,m)}})};return{wrap:i=>typeof i=="function"?(...s)=>i(...s,e):i,destroy(){n=!0;for(let i of t)i()}}}function is({canOptionLabelsWrap:n,canSelectPlaceholder:t,clearButtonLabel:e,errorMessage:i,hasDynamicOptions:s,hasDynamicSearchResults:o,hasInitialNoOptionsMessage:r,id:a,initialOptionLabel:l,initialOptionLabels:c,initialState:h,isAutofocused:u,isDisabled:p,isHtmlAllowed:f,isMultiple:m,isReorderable:g,isSearchable:S,key:O,livewireId:w,loadingMessage:x,maxItems:A,maxItemsMessage:M,noOptionsMessage:C,noSearchResultsMessage:J,options:Q,optionsLimit:I,placeholder:V,position:X,removeButtonLabel:it,searchDebounce:W,searchingMessage:B,searchLabel:Z,searchPrompt:k,searchableOptionFields:$,state:_,statePath:j}){let wt=Zi();return{select:null,accessibilityObserver:null,state:_,init(){this.select=new Ce({canOptionLabelsWrap:n,canSelectPlaceholder:t,clearButtonLabel:e,element:this.$refs.select,errorMessage:i,getOptionLabelUsing:()=>this.$getOptionLabel(),getOptionLabelsUsing:()=>this.$getOptionLabelsForJs(),getOptionsUsing:wt.wrap(Y=>Y(this.$wire,"callSchemaComponentMethod",[O,"getOptionsForJs"])),getSearchResultsUsing:wt.wrap((Y,Le)=>Le(this.$wire,"callSchemaComponentMethod",[O,"getSearchResultsForJs"],{search:Y})),hasDynamicOptions:s,hasDynamicSearchResults:o,hasInitialNoOptionsMessage:r,id:a,initialOptionLabel:l,initialOptionLabels:c,initialState:h,isAutofocused:u,isDisabled:p,isHtmlAllowed:f,isMultiple:m,isReorderable:g,isSearchable:S,livewireId:w,loadingMessage:x,maxItems:A,maxItemsMessage:M,noOptionsMessage:C,noSearchResultsMessage:J,onStateChange:Y=>{this.state=Y},options:Q,optionsLimit:I,placeholder:V,position:X,removeButtonLabel:it,searchableOptionFields:$,searchDebounce:W,searchingMessage:B,searchLabel:Z,searchPrompt:k,state:this.state,statePath:j});let pt=this.$el.previousElementSibling;if(pt?.hasAttribute("data-select-accessibility")){let Y=()=>this.select?.setAccessibilityAttributes(JSON.parse(pt.dataset.selectAccessibility));Y(),this.accessibilityObserver=new MutationObserver(Y),this.accessibilityObserver.observe(pt,{attributes:!0,attributeFilter:["data-select-accessibility"]})}this.$watch("state",Y=>{this.$nextTick(()=>{this.select&&this.select.state!==Y&&(this.select.state=Y,this.select.updateSelectedDisplay(),this.select.renderOptions())})})},destroy(){this.accessibilityObserver?.disconnect(),this.select&&(this.select.destroy(),this.select=null),wt.destroy()}}}export{is as default}; /*! Bundled license information: sortablejs/modular/sortable.esm.js: (**! * Sortable 1.15.7 * @author RubaXa * @author owenm * @license MIT *) */