sestek-component 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
50
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const Kh=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Jh=Sg("LoaderCircle",Kh),Sr=w.createContext(null);Sr.displayName="PanelGroupContext";const he={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Zs=10,Kt=w.useLayoutEffect,Ya=C.useId,_h=typeof Ya=="function"?Ya:()=>null;let $h=0;function qs(e=null){const t=_h(),A=w.useRef(e||t||null);return A.current===null&&(A.current=""+$h++),e??A.current}function Og({children:e,className:t="",collapsedSize:A,collapsible:n,defaultSize:r,forwardedRef:o,id:s,maxSize:i,minSize:a,onCollapse:u,onExpand:c,onResize:g,order:d,style:f,tagName:E="div",...B}){const h=w.useContext(Sr);if(h===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:Q,expandPanel:m,getPanelSize:x,getPanelStyle:b,groupId:I,isPanelCollapsed:v,reevaluatePanelConstraints:p,registerPanel:D,resizePanel:F,unregisterPanel:k}=h,T=qs(s),z=w.useRef({callbacks:{onCollapse:u,onExpand:c,onResize:g},constraints:{collapsedSize:A,collapsible:n,defaultSize:r,maxSize:i,minSize:a},id:T,idIsFromProps:s!==void 0,order:d});w.useRef({didLogMissingDefaultSizeWarning:!1}),Kt(()=>{const{callbacks:y,constraints:R}=z.current,H={...R};z.current.id=T,z.current.idIsFromProps=s!==void 0,z.current.order=d,y.onCollapse=u,y.onExpand=c,y.onResize=g,R.collapsedSize=A,R.collapsible=n,R.defaultSize=r,R.maxSize=i,R.minSize=a,(H.collapsedSize!==R.collapsedSize||H.collapsible!==R.collapsible||H.maxSize!==R.maxSize||H.minSize!==R.minSize)&&p(z.current,H)}),Kt(()=>{const y=z.current;return D(y),()=>{k(y)}},[d,T,D,k]),w.useImperativeHandle(o,()=>({collapse:()=>{Q(z.current)},expand:y=>{m(z.current,y)},getId(){return T},getSize(){return x(z.current)},isCollapsed(){return v(z.current)},isExpanded(){return!v(z.current)},resize:y=>{F(z.current,y)}}),[Q,m,x,v,T,F]);const P=b(z.current,r);return w.createElement(E,{...B,children:e,className:t,id:T,style:{...P,...f},[he.groupId]:I,[he.panel]:"",[he.panelCollapsible]:n||void 0,[he.panelId]:T,[he.panelSize]:parseFloat(""+P.flexGrow).toFixed(1)})}const zg=w.forwardRef((e,t)=>w.createElement(Og,{...e,forwardedRef:t}));Og.displayName="Panel";zg.displayName="forwardRef(Panel)";let Jo=null,er=-1,yt=null;function em(e,t){if(t){const A=(t&Ug)!==0,n=(t&Wg)!==0,r=(t&Xg)!==0,o=(t&Zg)!==0;if(A)return r?"se-resize":o?"ne-resize":"e-resize";if(n)return r?"sw-resize":o?"nw-resize":"w-resize";if(r)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function tm(){yt!==null&&(document.head.removeChild(yt),Jo=null,yt=null,er=-1)}function so(e,t){var A,n;const r=em(e,t);if(Jo!==r){if(Jo=r,yt===null&&(yt=document.createElement("style"),document.head.appendChild(yt)),er>=0){var o;(o=yt.sheet)===null||o===void 0||o.removeRule(er)}er=(A=(n=yt.sheet)===null||n===void 0?void 0:n.insertRule(`*{cursor: ${r} !important;}`))!==null&&A!==void 0?A:-1}}function Hg(e){return e.type==="keydown"}function Vg(e){return e.type.startsWith("pointer")}function Gg(e){return e.type.startsWith("mouse")}function Or(e){if(Vg(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Gg(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function Am(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function nm(e,t,A){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function rm(e,t){if(e===t)throw new Error("Cannot compare node with itself");const A={a:Xa(e),b:Xa(t)};let n;for(;A.a.at(-1)===A.b.at(-1);)e=A.a.pop(),t=A.b.pop(),n=e;oe(n,"Stacking order can only be calculated for elements with a common ancestor");const r={a:Wa(Ua(A.a)),b:Wa(Ua(A.b))};if(r.a===r.b){const o=n.childNodes,s={a:A.a.at(-1),b:A.b.at(-1)};let i=o.length;for(;i--;){const a=o[i];if(a===s.a)return 1;if(a===s.b)return-1}}return Math.sign(r.a-r.b)}const om=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function sm(e){var t;const A=getComputedStyle((t=Yg(e))!==null&&t!==void 0?t:e).display;return A==="flex"||A==="inline-flex"}function im(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||sm(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||om.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Ua(e){let t=e.length;for(;t--;){const A=e[t];if(oe(A,"Missing node"),im(A))return A}return null}function Wa(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Xa(e){const t=[];for(;e;)t.push(e),e=Yg(e);return t}function Yg(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const Ug=1,Wg=2,Xg=4,Zg=8,am=Am()==="coarse";let Je=[],mA=!1,Wt=new Map,zr=new Map;const sn=new Set;function um(e,t,A,n,r){var o;const{ownerDocument:s}=t,i={direction:A,element:t,hitAreaMargins:n,setResizeHandlerState:r},a=(o=Wt.get(s))!==null&&o!==void 0?o:0;return Wt.set(s,a+1),sn.add(i),cr(),function(){var c;zr.delete(e),sn.delete(i);const g=(c=Wt.get(s))!==null&&c!==void 0?c:1;if(Wt.set(s,g-1),cr(),g===1&&Wt.delete(s),Je.includes(i)){const d=Je.indexOf(i);d>=0&&Je.splice(d,1),Js(),r("up",!0,null)}}}function lm(e){const{target:t}=e,{x:A,y:n}=Or(e);mA=!0,Ks({target:t,x:A,y:n}),cr(),Je.length>0&&(gr("down",e),e.preventDefault(),qg(t)||e.stopImmediatePropagation())}function io(e){const{x:t,y:A}=Or(e);if(mA&&e.buttons===0&&(mA=!1,gr("up",e)),!mA){const{target:n}=e;Ks({target:n,x:t,y:A})}gr("move",e),Js(),Je.length>0&&e.preventDefault()}function ao(e){const{target:t}=e,{x:A,y:n}=Or(e);zr.clear(),mA=!1,Je.length>0&&(e.preventDefault(),qg(t)||e.stopImmediatePropagation()),gr("up",e),Ks({target:t,x:A,y:n}),Js(),cr()}function qg(e){let t=e;for(;t;){if(t.hasAttribute(he.resizeHandle))return!0;t=t.parentElement}return!1}function Ks({target:e,x:t,y:A}){Je.splice(0);let n=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(n=e),sn.forEach(r=>{const{element:o,hitAreaMargins:s}=r,i=o.getBoundingClientRect(),{bottom:a,left:u,right:c,top:g}=i,d=am?s.coarse:s.fine;if(t>=u-d&&t<=c+d&&A>=g-d&&A<=a+d){if(n!==null&&document.contains(n)&&o!==n&&!o.contains(n)&&!n.contains(o)&&rm(n,o)>0){let E=n,B=!1;for(;E&&!E.contains(o);){if(nm(E.getBoundingClientRect(),i)){B=!0;break}E=E.parentElement}if(B)return}Je.push(r)}})}function uo(e,t){zr.set(e,t)}function Js(){let e=!1,t=!1;Je.forEach(n=>{const{direction:r}=n;r==="horizontal"?e=!0:t=!0});let A=0;zr.forEach(n=>{A|=n}),e&&t?so("intersection",A):e?so("horizontal",A):t?so("vertical",A):tm()}let lo=new AbortController;function cr(){lo.abort(),lo=new AbortController;const e={capture:!0,signal:lo.signal};sn.size&&(mA?(Je.length>0&&Wt.forEach((t,A)=>{const{body:n}=A;t>0&&(n.addEventListener("contextmenu",ao,e),n.addEventListener("pointerleave",io,e),n.addEventListener("pointermove",io,e))}),window.addEventListener("pointerup",ao,e),window.addEventListener("pointercancel",ao,e)):Wt.forEach((t,A)=>{const{body:n}=A;t>0&&(n.addEventListener("pointerdown",lm,e),n.addEventListener("pointermove",io,e))}))}function gr(e,t){sn.forEach(A=>{const{setResizeHandlerState:n}=A,r=Je.includes(A);n(e,r,t)})}function cm(){const[e,t]=w.useState(0);return w.useCallback(()=>t(A=>A+1),[])}function oe(e,t){if(!e)throw console.error(t),Error(t)}function eA(e,t,A=Zs){return e.toFixed(A)===t.toFixed(A)?0:e>t?1:-1}function Ct(e,t,A=Zs){return eA(e,t,A)===0}function Le(e,t,A){return eA(e,t,A)===0}function gm(e,t,A){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=e[n],o=t[n];if(!Le(r,o,A))return!1}return!0}function dA({panelConstraints:e,panelIndex:t,size:A}){const n=e[t];oe(n!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:r=0,collapsible:o,maxSize:s=100,minSize:i=0}=n;if(eA(A,i)<0)if(o){const a=(r+i)/2;eA(A,a)<0?A=r:A=i}else A=i;return A=Math.min(s,A),A=parseFloat(A.toFixed(Zs)),A}function qA({delta:e,initialLayout:t,panelConstraints:A,pivotIndices:n,prevLayout:r,trigger:o}){if(Le(e,0))return t;const s=[...t],[i,a]=n;oe(i!=null,"Invalid first pivot index"),oe(a!=null,"Invalid second pivot index");let u=0;if(o==="keyboard"){{const g=e<0?a:i,d=A[g];oe(d,`Panel constraints not found for index ${g}`);const{collapsedSize:f=0,collapsible:E,minSize:B=0}=d;if(E){const h=t[g];if(oe(h!=null,`Previous layout not found for panel index ${g}`),Le(h,f)){const Q=B-h;eA(Q,Math.abs(e))>0&&(e=e<0?0-Q:Q)}}}{const g=e<0?i:a,d=A[g];oe(d,`No panel constraints found for index ${g}`);const{collapsedSize:f=0,collapsible:E,minSize:B=0}=d;if(E){const h=t[g];if(oe(h!=null,`Previous layout not found for panel index ${g}`),Le(h,B)){const Q=h-f;eA(Q,Math.abs(e))>0&&(e=e<0?0-Q:Q)}}}}{const g=e<0?1:-1;let d=e<0?a:i,f=0;for(;;){const B=t[d];oe(B!=null,`Previous layout not found for panel index ${d}`);const Q=dA({panelConstraints:A,panelIndex:d,size:100})-B;if(f+=Q,d+=g,d<0||d>=A.length)break}const E=Math.min(Math.abs(e),Math.abs(f));e=e<0?0-E:E}{let d=e<0?i:a;for(;d>=0&&d<A.length;){const f=Math.abs(e)-Math.abs(u),E=t[d];oe(E!=null,`Previous layout not found for panel index ${d}`);const B=E-f,h=dA({panelConstraints:A,panelIndex:d,size:B});if(!Le(E,h)&&(u+=E-h,s[d]=h,u.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?d--:d++}}if(gm(r,s))return r;{const g=e<0?a:i,d=t[g];oe(d!=null,`Previous layout not found for panel index ${g}`);const f=d+u,E=dA({panelConstraints:A,panelIndex:g,size:f});if(s[g]=E,!Le(E,f)){let B=f-E,Q=e<0?a:i;for(;Q>=0&&Q<A.length;){const m=s[Q];oe(m!=null,`Previous layout not found for panel index ${Q}`);const x=m+B,b=dA({panelConstraints:A,panelIndex:Q,size:x});if(Le(m,b)||(B-=b-m,s[Q]=b),Le(B,0))break;e>0?Q--:Q++}}}const c=s.reduce((g,d)=>d+g,0);return Le(c,100)?s:r}function dm({layout:e,panelsArray:t,pivotIndices:A}){let n=0,r=100,o=0,s=0;const i=A[0];oe(i!=null,"No pivot index found"),t.forEach((g,d)=>{const{constraints:f}=g,{maxSize:E=100,minSize:B=0}=f;d===i?(n=B,r=E):(o+=B,s+=E)});const a=Math.min(r,100-o),u=Math.max(n,100-s),c=e[i];return{valueMax:a,valueMin:u,valueNow:c}}function an(e,t=document){return Array.from(t.querySelectorAll(`[${he.resizeHandleId}][data-panel-group-id="${e}"]`))}function Kg(e,t,A=document){const r=an(e,A).findIndex(o=>o.getAttribute(he.resizeHandleId)===t);return r??null}function Jg(e,t,A){const n=Kg(e,t,A);return n!=null?[n,n+1]:[-1,-1]}function _g(e,t=document){var A;if(t instanceof HTMLElement&&(t==null||(A=t.dataset)===null||A===void 0?void 0:A.panelGroupId)==e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function Hr(e,t=document){const A=t.querySelector(`[${he.resizeHandleId}="${e}"]`);return A||null}function Cm(e,t,A,n=document){var r,o,s,i;const a=Hr(t,n),u=an(e,n),c=a?u.indexOf(a):-1,g=(r=(o=A[c])===null||o===void 0?void 0:o.id)!==null&&r!==void 0?r:null,d=(s=(i=A[c+1])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null;return[g,d]}function fm({committedValuesRef:e,eagerValuesRef:t,groupId:A,layout:n,panelDataArray:r,panelGroupElement:o,setLayout:s}){w.useRef({didWarnAboutMissingResizeHandle:!1}),Kt(()=>{if(!o)return;const i=an(A,o);for(let a=0;a<r.length-1;a++){const{valueMax:u,valueMin:c,valueNow:g}=dm({layout:n,panelsArray:r,pivotIndices:[a,a+1]}),d=i[a];if(d!=null){const f=r[a];oe(f,`No panel data found for index "${a}"`),d.setAttribute("aria-controls",f.id),d.setAttribute("aria-valuemax",""+Math.round(u)),d.setAttribute("aria-valuemin",""+Math.round(c)),d.setAttribute("aria-valuenow",g!=null?""+Math.round(g):"")}}return()=>{i.forEach((a,u)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[A,n,r,o]),w.useEffect(()=>{if(!o)return;const i=t.current;oe(i,"Eager values not found");const{panelDataArray:a}=i,u=_g(A,o);oe(u!=null,`No group found for id "${A}"`);const c=an(A,o);oe(c,`No resize handles found for group id "${A}"`);const g=c.map(d=>{const f=d.getAttribute(he.resizeHandleId);oe(f,"Resize handle element has no handle id attribute");const[E,B]=Cm(A,f,a,o);if(E==null||B==null)return()=>{};const h=Q=>{if(!Q.defaultPrevented)switch(Q.key){case"Enter":{Q.preventDefault();const m=a.findIndex(x=>x.id===E);if(m>=0){const x=a[m];oe(x,`No panel data found for index ${m}`);const b=n[m],{collapsedSize:I=0,collapsible:v,minSize:p=0}=x.constraints;if(b!=null&&v){const D=qA({delta:Le(b,I)?p-I:I-b,initialLayout:n,panelConstraints:a.map(F=>F.constraints),pivotIndices:Jg(A,f,o),prevLayout:n,trigger:"keyboard"});n!==D&&s(D)}}break}}};return d.addEventListener("keydown",h),()=>{d.removeEventListener("keydown",h)}});return()=>{g.forEach(d=>d())}},[o,e,t,A,n,r,s])}function Za(e,t){if(e.length!==t.length)return!1;for(let A=0;A<e.length;A++)if(e[A]!==t[A])return!1;return!0}function $g(e,t){const A=e==="horizontal",{x:n,y:r}=Or(t);return A?n:r}function Bm(e,t,A,n,r){const o=A==="horizontal",s=Hr(t,r);oe(s,`No resize handle element found for id "${t}"`);const i=s.getAttribute(he.groupId);oe(i,"Resize handle element has no group id attribute");let{initialCursorPosition:a}=n;const u=$g(A,e),c=_g(i,r);oe(c,`No group element found for id "${i}"`);const g=c.getBoundingClientRect(),d=o?g.width:g.height;return(u-a)/d*100}function Em(e,t,A,n,r,o){if(Hg(e)){const s=A==="horizontal";let i=0;e.shiftKey?i=100:r!=null?i=r:i=10;let a=0;switch(e.key){case"ArrowDown":a=s?0:i;break;case"ArrowLeft":a=s?-i:0;break;case"ArrowRight":a=s?i:0;break;case"ArrowUp":a=s?0:-i;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return n==null?0:Bm(e,t,A,n,o)}function Im({panelDataArray:e}){const t=Array(e.length),A=e.map(o=>o.constraints);let n=0,r=100;for(let o=0;o<e.length;o++){const s=A[o];oe(s,`Panel constraints not found for index ${o}`);const{defaultSize:i}=s;i!=null&&(n++,t[o]=i,r-=i)}for(let o=0;o<e.length;o++){const s=A[o];oe(s,`Panel constraints not found for index ${o}`);const{defaultSize:i}=s;if(i!=null)continue;const a=e.length-n,u=r/a;n++,t[o]=u,r-=u}return t}function aA(e,t,A){t.forEach((n,r)=>{const o=e[r];oe(o,`Panel data not found for index ${r}`);const{callbacks:s,constraints:i,id:a}=o,{collapsedSize:u=0,collapsible:c}=i,g=A[a];if(g==null||n!==g){A[a]=n;const{onCollapse:d,onExpand:f,onResize:E}=s;E&&E(n,g),c&&(d||f)&&(f&&(g==null||Ct(g,u))&&!Ct(n,u)&&f(),d&&(g==null||!Ct(g,u))&&Ct(n,u)&&d())}})}function Vn(e,t){if(e.length!==t.length)return!1;for(let A=0;A<e.length;A++)if(e[A]!=t[A])return!1;return!0}function Qm({defaultSize:e,dragState:t,layout:A,panelData:n,panelIndex:r,precision:o=3}){const s=A[r];let i;return s==null?i=e!=null?e.toPrecision(o):"1":n.length===1?i="1":i=s.toPrecision(o),{flexBasis:0,flexGrow:i,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function hm(e,t=10){let A=null;return(...r)=>{A!==null&&clearTimeout(A),A=setTimeout(()=>{e(...r)},t)}}function qa(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,A)=>{localStorage.setItem(t,A)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function ed(e){return`react-resizable-panels:${e}`}function td(e){return e.map(t=>{const{constraints:A,id:n,idIsFromProps:r,order:o}=t;return r?n:o?`${o}:${JSON.stringify(A)}`:JSON.stringify(A)}).sort((t,A)=>t.localeCompare(A)).join(",")}function Ad(e,t){try{const A=ed(e),n=t.getItem(A);if(n){const r=JSON.parse(n);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function mm(e,t,A){var n,r;const o=(n=Ad(e,A))!==null&&n!==void 0?n:{},s=td(t);return(r=o[s])!==null&&r!==void 0?r:null}function pm(e,t,A,n,r){var o;const s=ed(e),i=td(t),a=(o=Ad(e,r))!==null&&o!==void 0?o:{};a[i]={expandToSizes:Object.fromEntries(A.entries()),layout:n};try{r.setItem(s,JSON.stringify(a))}catch(u){console.error(u)}}function Ka({layout:e,panelConstraints:t}){const A=[...e],n=A.reduce((o,s)=>o+s,0);if(A.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${A.map(o=>`${o}%`).join(", ")}`);if(!Le(n,100)&&A.length>0)for(let o=0;o<t.length;o++){const s=A[o];oe(s!=null,`No layout data found for index ${o}`);const i=100/n*s;A[o]=i}let r=0;for(let o=0;o<t.length;o++){const s=A[o];oe(s!=null,`No layout data found for index ${o}`);const i=dA({panelConstraints:t,panelIndex:o,size:s});s!=i&&(r+=s-i,A[o]=i)}if(!Le(r,0))for(let o=0;o<t.length;o++){const s=A[o];oe(s!=null,`No layout data found for index ${o}`);const i=s+r,a=dA({panelConstraints:t,panelIndex:o,size:i});if(s!==a&&(r-=a-s,A[o]=a,Le(r,0)))break}return A}const vm=100,KA={getItem:e=>(qa(KA),KA.getItem(e)),setItem:(e,t)=>{qa(KA),KA.setItem(e,t)}},Ja={};function nd({autoSaveId:e=null,children:t,className:A="",direction:n,forwardedRef:r,id:o=null,onLayout:s=null,keyboardResizeBy:i=null,storage:a=KA,style:u,tagName:c="div",...g}){const d=qs(o),f=w.useRef(null),[E,B]=w.useState(null),[h,Q]=w.useState([]),m=cm(),x=w.useRef({}),b=w.useRef(new Map),I=w.useRef(0),v=w.useRef({autoSaveId:e,direction:n,dragState:E,id:d,keyboardResizeBy:i,onLayout:s,storage:a}),p=w.useRef({layout:h,panelDataArray:[],panelDataArrayChanged:!1});w.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),w.useImperativeHandle(r,()=>({getId:()=>v.current.id,getLayout:()=>{const{layout:S}=p.current;return S},setLayout:S=>{const{onLayout:j}=v.current,{layout:Y,panelDataArray:V}=p.current,L=Ka({layout:S,panelConstraints:V.map(W=>W.constraints)});Za(Y,L)||(Q(L),p.current.layout=L,j&&j(L),aA(V,L,x.current))}}),[]),Kt(()=>{v.current.autoSaveId=e,v.current.direction=n,v.current.dragState=E,v.current.id=d,v.current.onLayout=s,v.current.storage=a}),fm({committedValuesRef:v,eagerValuesRef:p,groupId:d,layout:h,panelDataArray:p.current.panelDataArray,setLayout:Q,panelGroupElement:f.current}),w.useEffect(()=>{const{panelDataArray:S}=p.current;if(e){if(h.length===0||h.length!==S.length)return;let j=Ja[e];j==null&&(j=hm(pm,vm),Ja[e]=j);const Y=[...S],V=new Map(b.current);j(e,Y,V,h,a)}},[e,h,a]),w.useEffect(()=>{});const D=w.useCallback(S=>{const{onLayout:j}=v.current,{layout:Y,panelDataArray:V}=p.current;if(S.constraints.collapsible){const L=V.map(le=>le.constraints),{collapsedSize:W=0,panelSize:X,pivotIndices:Ae}=Vt(V,S,Y);if(oe(X!=null,`Panel size not found for panel "${S.id}"`),!Ct(X,W)){b.current.set(S.id,X);const ge=gA(V,S)===V.length-1?X-W:W-X,ae=qA({delta:ge,initialLayout:Y,panelConstraints:L,pivotIndices:Ae,prevLayout:Y,trigger:"imperative-api"});Vn(Y,ae)||(Q(ae),p.current.layout=ae,j&&j(ae),aA(V,ae,x.current))}}},[]),F=w.useCallback((S,j)=>{const{onLayout:Y}=v.current,{layout:V,panelDataArray:L}=p.current;if(S.constraints.collapsible){const W=L.map(K=>K.constraints),{collapsedSize:X=0,panelSize:Ae=0,minSize:le=0,pivotIndices:ge}=Vt(L,S,V),ae=j??le;if(Ct(Ae,X)){const K=b.current.get(S.id),Pe=K!=null&&K>=ae?K:ae,ct=gA(L,S)===L.length-1?Ae-Pe:Pe-Ae,De=qA({delta:ct,initialLayout:V,panelConstraints:W,pivotIndices:ge,prevLayout:V,trigger:"imperative-api"});Vn(V,De)||(Q(De),p.current.layout=De,Y&&Y(De),aA(L,De,x.current))}}},[]),k=w.useCallback(S=>{const{layout:j,panelDataArray:Y}=p.current,{panelSize:V}=Vt(Y,S,j);return oe(V!=null,`Panel size not found for panel "${S.id}"`),V},[]),T=w.useCallback((S,j)=>{const{panelDataArray:Y}=p.current,V=gA(Y,S);return Qm({defaultSize:j,dragState:E,layout:h,panelData:Y,panelIndex:V})},[E,h]),z=w.useCallback(S=>{const{layout:j,panelDataArray:Y}=p.current,{collapsedSize:V=0,collapsible:L,panelSize:W}=Vt(Y,S,j);return oe(W!=null,`Panel size not found for panel "${S.id}"`),L===!0&&Ct(W,V)},[]),P=w.useCallback(S=>{const{layout:j,panelDataArray:Y}=p.current,{collapsedSize:V=0,collapsible:L,panelSize:W}=Vt(Y,S,j);return oe(W!=null,`Panel size not found for panel "${S.id}"`),!L||eA(W,V)>0},[]),y=w.useCallback(S=>{const{panelDataArray:j}=p.current;j.push(S),j.sort((Y,V)=>{const L=Y.order,W=V.order;return L==null&&W==null?0:L==null?-1:W==null?1:L-W}),p.current.panelDataArrayChanged=!0,m()},[m]);Kt(()=>{if(p.current.panelDataArrayChanged){p.current.panelDataArrayChanged=!1;const{autoSaveId:S,onLayout:j,storage:Y}=v.current,{layout:V,panelDataArray:L}=p.current;let W=null;if(S){const Ae=mm(S,L,Y);Ae&&(b.current=new Map(Object.entries(Ae.expandToSizes)),W=Ae.layout)}W==null&&(W=Im({panelDataArray:L}));const X=Ka({layout:W,panelConstraints:L.map(Ae=>Ae.constraints)});Za(V,X)||(Q(X),p.current.layout=X,j&&j(X),aA(L,X,x.current))}}),Kt(()=>{const S=p.current;return()=>{S.layout=[]}},[]);const R=w.useCallback(S=>{let j=!1;const Y=f.current;return Y&&window.getComputedStyle(Y,null).getPropertyValue("direction")==="rtl"&&(j=!0),function(L){L.preventDefault();const W=f.current;if(!W)return()=>null;const{direction:X,dragState:Ae,id:le,keyboardResizeBy:ge,onLayout:ae}=v.current,{layout:K,panelDataArray:Pe}=p.current,{initialLayout:je}=Ae??{},ct=Jg(le,S,W);let De=Em(L,S,X,Ae,ge,W);const gt=X==="horizontal";gt&&j&&(De=-De);const ht=Pe.map(Lt=>Lt.constraints),mt=qA({delta:De,initialLayout:je??K,panelConstraints:ht,pivotIndices:ct,prevLayout:K,trigger:Hg(L)?"keyboard":"mouse-or-touch"}),Mn=!Vn(K,mt);(Vg(L)||Gg(L))&&I.current!=De&&(I.current=De,!Mn&&De!==0?gt?uo(S,De<0?Ug:Wg):uo(S,De<0?Xg:Zg):uo(S,0)),Mn&&(Q(mt),p.current.layout=mt,ae&&ae(mt),aA(Pe,mt,x.current))}},[]),H=w.useCallback((S,j)=>{const{onLayout:Y}=v.current,{layout:V,panelDataArray:L}=p.current,W=L.map(K=>K.constraints),{panelSize:X,pivotIndices:Ae}=Vt(L,S,V);oe(X!=null,`Panel size not found for panel "${S.id}"`);const ge=gA(L,S)===L.length-1?X-j:j-X,ae=qA({delta:ge,initialLayout:V,panelConstraints:W,pivotIndices:Ae,prevLayout:V,trigger:"imperative-api"});Vn(V,ae)||(Q(ae),p.current.layout=ae,Y&&Y(ae),aA(L,ae,x.current))},[]),O=w.useCallback((S,j)=>{const{layout:Y,panelDataArray:V}=p.current,{collapsedSize:L=0,collapsible:W}=j,{collapsedSize:X=0,collapsible:Ae,maxSize:le=100,minSize:ge=0}=S.constraints,{panelSize:ae}=Vt(V,S,Y);ae!=null&&(W&&Ae&&Ct(ae,L)?Ct(L,X)||H(S,X):ae<ge?H(S,ge):ae>le&&H(S,le))},[H]),M=w.useCallback((S,j)=>{const{direction:Y}=v.current,{layout:V}=p.current;if(!f.current)return;const L=Hr(S,f.current);oe(L,`Drag handle element not found for id "${S}"`);const W=$g(Y,j);B({dragHandleId:S,dragHandleRect:L.getBoundingClientRect(),initialCursorPosition:W,initialLayout:V})},[]),N=w.useCallback(()=>{B(null)},[]),G=w.useCallback(S=>{const{panelDataArray:j}=p.current,Y=gA(j,S);Y>=0&&(j.splice(Y,1),delete x.current[S.id],p.current.panelDataArrayChanged=!0,m())},[m]),_=w.useMemo(()=>({collapsePanel:D,direction:n,dragState:E,expandPanel:F,getPanelSize:k,getPanelStyle:T,groupId:d,isPanelCollapsed:z,isPanelExpanded:P,reevaluatePanelConstraints:O,registerPanel:y,registerResizeHandle:R,resizePanel:H,startDragging:M,stopDragging:N,unregisterPanel:G,panelGroupElement:f.current}),[D,E,n,F,k,T,d,z,P,O,y,R,H,M,N,G]),ne={display:"flex",flexDirection:n==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return w.createElement(Sr.Provider,{value:_},w.createElement(c,{...g,children:t,className:A,id:o,ref:f,style:{...ne,...u},[he.group]:"",[he.groupDirection]:n,[he.groupId]:d}))}const rd=w.forwardRef((e,t)=>w.createElement(nd,{...e,forwardedRef:t}));nd.displayName="PanelGroup";rd.displayName="forwardRef(PanelGroup)";function gA(e,t){return e.findIndex(A=>A===t||A.id===t.id)}function Vt(e,t,A){const n=gA(e,t),o=n===e.length-1?[n-1,n]:[n,n+1],s=A[n];return{...t.constraints,panelSize:s,pivotIndices:o}}function wm({disabled:e,handleId:t,resizeHandler:A,panelGroupElement:n}){w.useEffect(()=>{if(e||A==null||n==null)return;const r=Hr(t,n);if(r==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),A(s);break}case"F6":{s.preventDefault();const i=r.getAttribute(he.groupId);oe(i,`No group element found for id "${i}"`);const a=an(i,n),u=Kg(i,t,n);oe(u!==null,`No resize element found for id "${t}"`);const c=s.shiftKey?u>0?u-1:a.length-1:u+1<a.length?u+1:0;a[c].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[n,e,t,A])}function od({children:e=null,className:t="",disabled:A=!1,hitAreaMargins:n,id:r,onBlur:o,onClick:s,onDragging:i,onFocus:a,onPointerDown:u,onPointerUp:c,style:g={},tabIndex:d=0,tagName:f="div",...E}){var B,h;const Q=w.useRef(null),m=w.useRef({onClick:s,onDragging:i,onPointerDown:u,onPointerUp:c});w.useEffect(()=>{m.current.onClick=s,m.current.onDragging=i,m.current.onPointerDown=u,m.current.onPointerUp=c});const x=w.useContext(Sr);if(x===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:b,groupId:I,registerResizeHandle:v,startDragging:p,stopDragging:D,panelGroupElement:F}=x,k=qs(r),[T,z]=w.useState("inactive"),[P,y]=w.useState(!1),[R,H]=w.useState(null),O=w.useRef({state:T});Kt(()=>{O.current.state=T}),w.useEffect(()=>{if(A)H(null);else{const _=v(k);H(()=>_)}},[A,k,v]);const M=(B=n==null?void 0:n.coarse)!==null&&B!==void 0?B:15,N=(h=n==null?void 0:n.fine)!==null&&h!==void 0?h:5;w.useEffect(()=>{if(A||R==null)return;const _=Q.current;oe(_,"Element ref not attached");let ne=!1;return um(k,_,b,{coarse:M,fine:N},(j,Y,V)=>{if(!Y){z("inactive");return}switch(j){case"down":{z("drag"),ne=!1,oe(V,'Expected event to be defined for "down" action'),p(k,V);const{onDragging:L,onPointerDown:W}=m.current;L==null||L(!0),W==null||W();break}case"move":{const{state:L}=O.current;ne=!0,L!=="drag"&&z("hover"),oe(V,'Expected event to be defined for "move" action'),R(V);break}case"up":{z("hover"),D();const{onClick:L,onDragging:W,onPointerUp:X}=m.current;W==null||W(!1),X==null||X(),ne||L==null||L();break}}})},[M,b,A,N,v,k,R,p,D]),wm({disabled:A,handleId:k,resizeHandler:R,panelGroupElement:F});const G={touchAction:"none",userSelect:"none"};return w.createElement(f,{...E,children:e,className:t,id:r,onBlur:()=>{y(!1),o==null||o()},onFocus:()=>{y(!0),a==null||a()},ref:Q,role:"separator",style:{...G,...g},tabIndex:d,[he.groupDirection]:b,[he.groupId]:I,[he.resizeHandle]:"",[he.resizeHandleActive]:T==="drag"?"pointer":P?"keyboard":void 0,[he.resizeHandleEnabled]:!A,[he.resizeHandleId]:k,[he.resizeHandleState]:T})}od.displayName="PanelResizeHandle";function sd({className:e,...t}){return l.jsx(rd,{"data-slot":"resizable-panel-group",className:$("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function dr({...e}){return l.jsx(zg,{"data-slot":"resizable-panel",...e})}function id({withHandle:e,className:t,...A}){return l.jsx(od,{"data-slot":"resizable-handle",className:$("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...A,children:e&&l.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:l.jsx(qh,{className:"size-2.5"})})})}const pn=()=>{const[e,t]=w.useState(!1);return w.useEffect(()=>{const A=()=>{t(window.innerWidth<768)};return A(),window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}},[]),e},xm=({items:e,isDefaultOpen:t=!1,isStandalone:A=!1,resizableContent:n,title:r="Moments",feddbackTitle:o,feedbackHelpfullButtonTitle:s,feedbackNotHelpfullButtonTitle:i,feedbackCommentPlaceholder:a,feedbackSubmitText:u,feedbackThankYouMessage:c,feedbackCancelButtonTitle:g,feedbackSubmitButtonHoverTitle:d})=>{const[f,E]=w.useState(t),B=w.useRef(null),h=w.useRef(null),Q=w.useRef([]),[m,x]=w.useState([]),[b,I]=w.useState(!1),[v,p]=w.useState(null),D=pn(),F=w.useMemo(()=>[...e].reverse(),[e]);w.useEffect(()=>{Q.current=Array(F.length).fill(null)},[F.length]);const k=()=>{if(!h.current)return;const y=h.current.getBoundingClientRect(),R=[];Q.current.forEach((H,O)=>{if(!H)return;const M=H.getBoundingClientRect();M.top<y.bottom&&M.bottom>y.top&&R.push(O)}),x(R)};w.useEffect(()=>{if(t&&!b){const y=setTimeout(()=>{k(),I(!0)},200);return()=>clearTimeout(y)}},[b,t]),w.useEffect(()=>{const y=h.current;if(y&&f){const R=setTimeout(()=>{k()},100);return y.addEventListener("scroll",k),()=>{clearTimeout(R),y.removeEventListener("scroll",k)}}},[f]),w.useEffect(()=>{const y=()=>{f&&k()};return window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[f]);const T=y=>{if(v===y||D||m.length<=5||!m.includes(y))return 1;const H=[...m].sort((M,N)=>M-N).indexOf(y);return H<5?1:Math.max(0,.6-(H-5)*.1)},z=y=>{switch(y.type){case"task-done":return l.jsx(jg,{id:y.id,title:r,message:y.message,timestamp:y.timestamp,completedTaskCount:y.completedTaskCount??0,taskCount:y.taskCount??0});case"good-job":return l.jsx(Mg,{id:y.id,title:r,message:y.message,timestamp:y.timestamp});case"legal-thread":return l.jsx(Tg,{id:y.id,title:r,message:y.message,timestamp:y.timestamp,onClickAskGenAI:()=>{var R;return(R=y.onClickAskGenAI)==null?void 0:R.call(y)},onClickAskManager:()=>{var R;return(R=y.onClickAskManager)==null?void 0:R.call(y)}});case"unhappy-customer":return l.jsx(kg,{id:y.id,title:r,message:y.message,timestamp:y.timestamp});case"genai-support":return l.jsx(Ng,{id:y.id,title:r,message:y.message,timestamp:y.timestamp});case"default":return l.jsx(Rg,{id:y.id,title:y.title??y.type,message:y.message,timestamp:y.timestamp,icon:y.icon,scenarioId:y.scenarioId,showFeedbackArea:y.showFeedbackArea,feedbackSubmitButtonHoverTitle:d??"",feedbackCancelButtonTitle:g??"",feddbackTitle:o,feedbackHelpfullButtonTitle:s,feedbackNotHelpfullButtonTitle:i,feedbackCommentPlaceholder:a,feedbackSubmitText:u,feedbackThankYouMessage:c,matchId:(y==null?void 0:y.matchId)??"",sendFeedback:y==null?void 0:y.sendFeedback,showThankYou:y==null?void 0:y.showThankYou,feedbackLoading:y==null?void 0:y.feedbackLoading})}},P=(y,R)=>l.jsx("div",{ref:H=>{Q.current[R]=H},onMouseEnter:()=>p(R),onMouseLeave:()=>p(null),children:y});return l.jsx("div",{ref:B,className:$("relative",!A&&!n?"max-h-[500px]":"h-full"),children:!A&&n?l.jsxs(sd,{direction:"vertical",className:"h-full md:pb-2",children:[l.jsx(dr,{defaultSize:D?60:35,children:e.length==1?l.jsxs("div",{className:"w-full flex flex-col gap-2 md:px-6 md:py-4 px-3 py-3",children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-start h-10",children:[l.jsx("span",{className:"text-lg font-medium text-foreground",children:r}),l.jsx("div",{className:"w-6 h-6 flex items-center justify-center bg-foreground-08 text-secondary-foreground rounded-full",children:e.length})]}),F.map((y,R)=>l.jsx("div",{children:P(z(y),R)},`item-${y.id||R}`))]}):l.jsx("div",{className:"h-full flex flex-col md:px-6 md:py-4 px-3 py-3",children:l.jsxs(Zo,{defaultOpen:t,open:f,onOpenChange:y=>{E(y),y&&setTimeout(k,100)},className:"h-full flex flex-col",children:[l.jsxs(qo,{className:"w-full flex flex-row items-center justify-between mb-2",children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-center",children:[l.jsx("span",{className:"text-lg font-medium text-foreground",children:r}),l.jsx("div",{className:"w-6 h-6 flex items-center justify-center bg-foreground-08 text-secondary-foreground rounded-full",children:e.length})]}),l.jsx("div",{className:"h-10 w-10 p-2 flex items-center justify-center",children:l.jsx(U,{name:"ChevronDown",width:16,height:9,className:"text-foreground"})})]}),!f&&F.length>0&&l.jsxs("div",{className:"w-full relative flex items-center justify-center rounded-xl md:rounded-3xl",children:[l.jsx("div",{className:"z-[3] w-full shadow-[0_4px_6px_1px_rgba(0,0,0,0.25)] rounded-xl md:rounded-3xl",ref:y=>{Q.current[0]=y},children:z(F[0])}),!D&&e.length>1&&l.jsx("div",{className:"z-[2] absolute -bottom-2 w-[calc(100%-16px)] h-12 shadow-[0_4px_6px_1px_rgba(0,0,0,0.25)] rounded-3xl bg-background-08"}),!D&&e.length>2&&l.jsx("div",{className:"z-[1] absolute -bottom-4 w-[calc(100%-32px)] h-12 shadow-[0_4px_6px_1px_rgba(0,0,0,0.25)] rounded-3xl bg-background-08"})]}),l.jsx(Ko,{className:"flex-1 overflow-y-auto flex flex-col gap-2 max-h-[calc(100vh-68px)]",id:"moments-content",ref:h,children:F.map((y,R)=>l.jsx("div",{style:{opacity:T(R),transition:"opacity 0.2s ease-in-out"},children:P(z(y),R)},`item-${y.id||R}`))})]})})},`panel-1-${D}`),l.jsx(id,{}),l.jsx(dr,{defaultSize:D?40:65,children:l.jsx("div",{className:"h-full overflow-y-auto no-scrollbar",children:n})},`panel-2-${D}`)]},`panel-group-${D}`):l.jsx(l.Fragment,{children:e.length==1?l.jsxs("div",{className:"w-full flex flex-col gap-2 px-6 py-4",children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-start h-10",children:[l.jsx("span",{className:"text-lg font-medium text-foreground",children:r}),l.jsx("div",{className:"w-6 h-6 flex items-center justify-center bg-foreground-08 text-secondary-foreground rounded-full",children:e.length})]}),F.map((y,R)=>l.jsx("div",{children:P(z(y),R)},`item-${y.id||R}`))]}):l.jsx("div",{className:"h-full flex flex-col px-6 py-4",children:l.jsxs(Zo,{defaultOpen:t,open:f,onOpenChange:y=>{E(y),y&&setTimeout(k,100)},className:"h-full flex flex-col",children:[l.jsxs(qo,{className:"w-full flex flex-row items-center justify-between mb-2",children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-center",children:[l.jsx("span",{className:"text-lg font-medium text-foreground",children:r}),l.jsx("div",{className:"w-6 h-6 flex items-center justify-center bg-foreground-08 text-secondary-foreground rounded-full",children:e.length})]}),l.jsx("div",{className:"h-10 w-10 p-2 flex items-center justify-center",children:f?l.jsx(U,{name:"ChevronUp",width:24,height:24,className:"text-foreground"}):l.jsx(U,{name:"ChevronDown",width:24,height:24,className:"text-foreground"})})]}),!f&&F.length>0&&l.jsxs("div",{className:"w-full relative flex items-center justify-center rounded-xl md:rounded-3xl",children:[l.jsx("div",{className:"z-[3] w-full shadow-[0_4px_6px_1px_rgba(0,0,0,0.25)] rounded-xl md:rounded-3xl",ref:y=>{Q.current[0]=y},children:z(F[0])}),!D&&e.length>1&&l.jsx("div",{className:"z-[2] absolute -bottom-2 w-[calc(100%-16px)] h-12 shadow-[0_4px_6px_1px_rgba(0,0,0,0.25)] rounded-3xl bg-background-08"}),!D&&e.length>2&&l.jsx("div",{className:"z-[1] absolute -bottom-4 w-[calc(100%-32px)] h-12 shadow-[0_4px_6px_1px_rgba(0,0,0,0.25)] rounded-3xl bg-background-08"})]}),l.jsx(Ko,{className:"flex-1 overflow-y-auto flex flex-col gap-2 max-h-[calc(100vh-68px)]",id:"moments-content",ref:h,children:F.map((y,R)=>l.jsx("div",{style:{opacity:T(R),transition:"opacity 0.2s ease-in-out"},children:P(z(y),R)},`item-${y.id||R}`))})]})})})})};function bm({className:e,...t}){return l.jsx("textarea",{"data-slot":"textarea",className:$("border-input text-sm placeholder:text-muted-foreground focus-visible:border-primary focus-visible:border-2 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}const _s=({value:e,onChange:t,onSendClick:A,placeholder:n="Type something...",...r})=>{const o=w.useRef(null);w.useEffect(()=>{const i=o.current;if(!i)return;i.style.height="0px";const u=24*5,g=Math.min(Math.max(i.scrollHeight,52),u);i.style.height=`${g}px`,i.style.overflowY=i.scrollHeight>u?"auto":"hidden"},[e]);const s=i=>{i.key==="Enter"&&(i.preventDefault(),A())};return l.jsxs("div",{className:"relative w-full",children:[l.jsx(bm,{ref:o,value:e,onChange:t,onKeyDown:s,className:"!py-4 resize-none box-border !pl-4 min-h-[52px] h-auto !pr-[71px] !w-full",placeholder:n,...r}),l.jsx(Qe,{size:"sm",className:"bg-primary absolute top-2 right-2 px-[15.5px] rounded-full",onClick:A,children:l.jsx(U,{name:"Send",width:16,height:16,className:"text-background"})})]})},Dm=({isShown:e,personList:t,onClick:A})=>e?l.jsx("div",{className:"flex flex-col items-center justify-center gap-3",children:t.map(n=>l.jsxs("div",{className:`w-fit cursor-pointer h-fit relative${n.isDisable?" opacity-50":""}`,onClick:()=>A(n.id),children:[l.jsx(qt,{type:"secondary",fullName:n.fullName}),n.isActive&&l.jsx("div",{className:"w-2.5 h-2.5 bg-success rounded-full absolute bottom-0 right-0"})]},n.id))}):null,ym=({suggestion:e={items:[],messages:[]},messages:t,input:A,showInput:n=!0,onInputChange:r,onSend:o,onSuggestionClick:s,onSearchDocClick:i,placeholder:a="Type something...",searchDocText:u="Search in Doc",searchDocLoadingText:c="Searching...",showSearchDocButton:g=!0})=>{var h;const[d,f]=w.useState(!1),E=()=>{A.trim()&&(o(A.trim()),r(""))},B=async()=>{if(i){f(!0);try{await i()}finally{f(!1)}}};return l.jsxs("div",{className:"flex flex-col h-full w-full bg-background gap-6 rounded-b-xl rounded-t-4xl",children:[l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsx("div",{className:"flex flex-col gap-2 ",id:"ai-chat-messages-container",children:t==null?void 0:t.map(Q=>w.createElement(xA,{...Q,key:Q.id}))})}),e&&l.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.messages&&e.messages.length>0&&((h=e.messages)==null?void 0:h.map(Q=>l.jsx("div",{className:"border-t pt-4",children:l.jsx(xA,{...Q})},Q.id))),e.items&&e.items.length>0&&l.jsx("div",{className:"flex flex-wrap gap-2 items-start justify-end",children:e.items.map((Q,m)=>l.jsx(Qe,{className:"rounded-lg text-primary text-sm font-medium px-3 py-1.5 bg-secondary hover:bg-secondary/70",onClick:()=>s==null?void 0:s(Q),children:Q},m))})]}),l.jsxs("div",{className:"border-t p-4 flex flex-col gap-2",children:[g&&l.jsx(Qe,{className:"flex rounded-lg text-primary py-1 px-3 bg-secondary hover:bg-secondary/70 items-center justify-center",onClick:B,disabled:d,id:"search-doc-button",children:d?l.jsxs(l.Fragment,{children:[l.jsx(Jh,{className:"animate-spin mr-2 h-4 w-4"}),c]}):u}),n&&l.jsx(_s,{value:A,onChange:Q=>r(Q.target.value),onSendClick:E,placeholder:a,id:"message-send-box"})]})]})},Fm=({suggestion:e={items:[],messages:[]},messages:t,input:A,showInput:n=!0,supervisors:r=[],onSupervisorSelect:o,onInputChange:s,onSend:i,onSuggestionClick:a,placeholder:u="Type something...",supervisorSearchPlaceholder:c="Ara...",selectedSupervisorPlaceholder:g="Supervisor seç",emptySupervisorResultMessage:d="Sonuç bulunamadı"})=>{var k;const[f,E]=w.useState(""),[B,h]=w.useState(!1),[Q,m]=w.useState(null),x=w.useRef(null);w.useEffect(()=>{if(!B)return;const T=z=>{x.current&&!x.current.contains(z.target)&&(h(!1),E(""))};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[B]);const b=w.useMemo(()=>r.filter(T=>T.name.toLowerCase().includes(f.toLowerCase())),[r,f]),I=T=>{m(T),o==null||o(T),h(!1),E("")},v=w.useMemo(()=>r.reduce((T,z)=>T+(z.unreadCount??0),0),[r]),p=T=>{a==null||a(T)},D=()=>{A.trim()&&(i(A.trim()),s(""))},F=r.length>0;return l.jsxs("div",{className:"flex flex-col h-full w-full bg-background gap-6 rounded-b-xl rounded-t-4xl",children:[F&&l.jsxs("div",{ref:x,className:"relative shrink-0",children:[l.jsxs("button",{type:"button",onClick:()=>h(T=>!T),className:$("flex items-center justify-between gap-2 w-full px-3 py-2.5 rounded-md border border-input bg-background text-sm text-left transition-colors hover:bg-secondary/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),"aria-expanded":B,children:[l.jsx("span",{className:"truncate flex-1 text-muted-foreground",children:Q?Q.name:g}),!B&&v>0&&l.jsx("span",{className:"shrink-0 min-w-5 h-5 flex items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-medium px-1.5",children:v>99?"99+":v}),l.jsx(U,{name:B?"ChevronUp":"ChevronDown",width:16,height:16,className:"shrink-0 text-muted-foreground"})]}),B&&l.jsxs("div",{className:"absolute top-full left-0 right-0 z-10 mt-2 flex flex-col gap-2 rounded-md border border-input bg-background p-2 shadow-md",children:[l.jsx(Fs,{type:"search",value:f,onChange:T=>E(T.target.value),placeholder:c,className:"w-full","aria-label":c}),l.jsx("div",{className:"flex flex-col max-h-48 overflow-y-auto rounded-md border border-input bg-background",children:b.length===0?l.jsx("div",{className:"px-3 py-4 text-sm text-muted-foreground text-center",children:d}):b.map(T=>l.jsxs("button",{type:"button",onClick:()=>I(T),className:$("flex items-center justify-between gap-2 w-full px-3 py-2.5 text-left text-sm transition-colors hover:bg-secondary/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",(Q==null?void 0:Q.id)===T.id&&"bg-secondary"),children:[l.jsx("span",{className:"truncate flex-1",children:T.name}),typeof T.unreadCount=="number"&&T.unreadCount>0&&l.jsx("span",{className:"shrink-0 min-w-5 h-5 flex items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-medium px-1.5",children:T.unreadCount>99?"99+":T.unreadCount})]},T.id))})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:l.jsx("div",{className:"flex flex-col gap-2.5",id:"supervisor-chat-container",children:t==null?void 0:t.map(T=>w.createElement(xA,{...T,key:T.id}))})}),e&&l.jsxs("div",{className:"flex flex-col gap-2.5 ",children:[e.messages&&e.messages.length>0&&((k=e.messages)==null?void 0:k.map(T=>l.jsx("div",{className:"border-t pt-4",children:l.jsx(xA,{...T})},T.id))),e.items&&e.items.length>0&&l.jsx("div",{className:"flex flex-wrap gap-2 items-start justify-end",children:e.items.map((T,z)=>l.jsx(Qe,{className:"rounded-lg whitespace-pre-wrap text-left text-primary text-sm font-medium px-3 py-1.8 bg-secondary hover:bg-secondary/70",onClick:()=>p(T),children:T},z))})]}),n&&l.jsx("div",{className:"border-t p-4",children:l.jsx(_s,{value:A,onChange:T=>s(T.target.value),onSendClick:D,placeholder:u})})]})},$s=w.createContext({});function ei(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const ti=typeof window<"u",ad=ti?w.useLayoutEffect:w.useEffect,Vr=w.createContext(null);function Ai(e,t){e.indexOf(t)===-1&&e.push(t)}function ni(e,t){const A=e.indexOf(t);A>-1&&e.splice(A,1)}const Et=(e,t,A)=>A>t?t:A<e?e:A;function _o(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let jA=()=>{},It=()=>{};process.env.NODE_ENV!=="production"&&(jA=(e,t,A)=>{!e&&typeof console<"u"&&console.warn(_o(t,A))},It=(e,t,A)=>{if(!e)throw new Error(_o(t,A))});const Qt={},ud=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function ld(e){return typeof e=="object"&&e!==null}const cd=e=>/^0[^.\s]+$/u.test(e);function ri(e){let t;return()=>(t===void 0&&(t=e()),t)}const We=e=>e,Pm=(e,t)=>A=>t(e(A)),vn=(...e)=>e.reduce(Pm),un=(e,t,A)=>{const n=t-e;return n===0?1:(A-e)/n};class oi{constructor(){this.subscriptions=[]}add(t){return Ai(this.subscriptions,t),()=>ni(this.subscriptions,t)}notify(t,A,n){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,A,n);else for(let o=0;o<r;o++){const s=this.subscriptions[o];s&&s(t,A,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const _e=e=>e*1e3,Ue=e=>e/1e3;function gd(e,t){return t?e*(1e3/t):0}const _a=new Set;function si(e,t,A){e||_a.has(t)||(console.warn(_o(t,A)),_a.add(t))}const dd=(e,t,A)=>(((1-3*A+3*t)*e+(3*A-6*t))*e+3*t)*e,Nm=1e-7,Mm=12;function Tm(e,t,A,n,r){let o,s,i=0;do s=t+(A-t)/2,o=dd(s,n,r)-e,o>0?A=s:t=s;while(Math.abs(o)>Nm&&++i<Mm);return s}function wn(e,t,A,n){if(e===t&&A===n)return We;const r=o=>Tm(o,0,1,e,A);return o=>o===0||o===1?o:dd(r(o),t,n)}const Cd=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,fd=e=>t=>1-e(1-t),Bd=wn(.33,1.53,.69,.99),ii=fd(Bd),Ed=Cd(ii),Id=e=>(e*=2)<1?.5*ii(e):.5*(2-Math.pow(2,-10*(e-1))),ai=e=>1-Math.sin(Math.acos(e)),Qd=fd(ai),hd=Cd(ai),jm=wn(.42,0,1,1),km=wn(0,0,.58,1),md=wn(.42,0,.58,1),Rm=e=>Array.isArray(e)&&typeof e[0]!="number",pd=e=>Array.isArray(e)&&typeof e[0]=="number",$a={linear:We,easeIn:jm,easeInOut:md,easeOut:km,circIn:ai,circInOut:hd,circOut:Qd,backIn:ii,backInOut:Ed,backOut:Bd,anticipate:Id},Lm=e=>typeof e=="string",eu=e=>{if(pd(e)){It(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,A,n,r]=e;return wn(t,A,n,r)}else if(Lm(e))return It($a[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),$a[e];return e},Gn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Sm(e,t){let A=new Set,n=new Set,r=!1,o=!1;const s=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(u.schedule(c),e()),c(i)}const u={schedule:(c,g=!1,d=!1)=>{const E=d&&r?A:n;return g&&s.add(c),E.has(c)||E.add(c),c},cancel:c=>{n.delete(c),s.delete(c)},process:c=>{if(i=c,r){o=!0;return}r=!0,[A,n]=[n,A],A.forEach(a),A.clear(),r=!1,o&&(o=!1,u.process(c))}};return u}const Om=40;function vd(e,t){let A=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>A=!0,s=Gn.reduce((x,b)=>(x[b]=Sm(o),x),{}),{setup:i,read:a,resolveKeyframes:u,preUpdate:c,update:g,preRender:d,render:f,postRender:E}=s,B=()=>{const x=Qt.useManualTiming?r.timestamp:performance.now();A=!1,Qt.useManualTiming||(r.delta=n?1e3/60:Math.max(Math.min(x-r.timestamp,Om),1)),r.timestamp=x,r.isProcessing=!0,i.process(r),a.process(r),u.process(r),c.process(r),g.process(r),d.process(r),f.process(r),E.process(r),r.isProcessing=!1,A&&t&&(n=!1,e(B))},h=()=>{A=!0,n=!0,r.isProcessing||e(B)};return{schedule:Gn.reduce((x,b)=>{const I=s[b];return x[b]=(v,p=!1,D=!1)=>(A||h(),I.schedule(v,p,D)),x},{}),cancel:x=>{for(let b=0;b<Gn.length;b++)s[Gn[b]].cancel(x)},state:r,steps:s}}const{schedule:fe,cancel:Nt,state:ye,steps:co}=vd(typeof requestAnimationFrame<"u"?requestAnimationFrame:We,!0);let tr;function zm(){tr=void 0}const Re={now:()=>(tr===void 0&&Re.set(ye.isProcessing||Qt.useManualTiming?ye.timestamp:performance.now()),tr),set:e=>{tr=e,queueMicrotask(zm)}},wd=e=>t=>typeof t=="string"&&t.startsWith(e),ui=wd("--"),Hm=wd("var(--"),li=e=>Hm(e)?Vm.test(e.split("/*")[0].trim()):!1,Vm=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,kA={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ln={...kA,transform:e=>Et(0,1,e)},Yn={...kA,default:1},$A=e=>Math.round(e*1e5)/1e5,ci=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Gm(e){return e==null}const Ym=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,gi=(e,t)=>A=>!!(typeof A=="string"&&Ym.test(A)&&A.startsWith(e)||t&&!Gm(A)&&Object.prototype.hasOwnProperty.call(A,t)),xd=(e,t,A)=>n=>{if(typeof n!="string")return n;const[r,o,s,i]=n.match(ci);return{[e]:parseFloat(r),[t]:parseFloat(o),[A]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}},Um=e=>Et(0,255,e),go={...kA,transform:e=>Math.round(Um(e))},Xt={test:gi("rgb","red"),parse:xd("red","green","blue"),transform:({red:e,green:t,blue:A,alpha:n=1})=>"rgba("+go.transform(e)+", "+go.transform(t)+", "+go.transform(A)+", "+$A(ln.transform(n))+")"};function Wm(e){let t="",A="",n="",r="";return e.length>5?(t=e.substring(1,3),A=e.substring(3,5),n=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),A=e.substring(2,3),n=e.substring(3,4),r=e.substring(4,5),t+=t,A+=A,n+=n,r+=r),{red:parseInt(t,16),green:parseInt(A,16),blue:parseInt(n,16),alpha:r?parseInt(r,16)/255:1}}const $o={test:gi("#"),parse:Wm,transform:Xt.transform},xn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),bt=xn("deg"),it=xn("%"),ee=xn("px"),Xm=xn("vh"),Zm=xn("vw"),tu={...it,parse:e=>it.parse(e)/100,transform:e=>it.transform(e*100)},CA={test:gi("hsl","hue"),parse:xd("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:A,alpha:n=1})=>"hsla("+Math.round(e)+", "+it.transform($A(t))+", "+it.transform($A(A))+", "+$A(ln.transform(n))+")"},we={test:e=>Xt.test(e)||$o.test(e)||CA.test(e),parse:e=>Xt.test(e)?Xt.parse(e):CA.test(e)?CA.parse(e):$o.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Xt.transform(e):CA.transform(e),getAnimatableNone:e=>{const t=we.parse(e);return t.alpha=0,we.transform(t)}},qm=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Km(e){var t,A;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ci))==null?void 0:t.length)||0)+(((A=e.match(qm))==null?void 0:A.length)||0)>0}const bd="number",Dd="color",Jm="var",_m="var(",Au="${}",$m=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function cn(e){const t=e.toString(),A=[],n={color:[],number:[],var:[]},r=[];let o=0;const i=t.replace($m,a=>(we.test(a)?(n.color.push(o),r.push(Dd),A.push(we.parse(a))):a.startsWith(_m)?(n.var.push(o),r.push(Jm),A.push(a)):(n.number.push(o),r.push(bd),A.push(parseFloat(a))),++o,Au)).split(Au);return{values:A,split:i,indexes:n,types:r}}function yd(e){return cn(e).values}function Fd(e){const{split:t,types:A}=cn(e),n=t.length;return r=>{let o="";for(let s=0;s<n;s++)if(o+=t[s],r[s]!==void 0){const i=A[s];i===bd?o+=$A(r[s]):i===Dd?o+=we.transform(r[s]):o+=r[s]}return o}}const ep=e=>typeof e=="number"?0:we.test(e)?we.getAnimatableNone(e):e;function tp(e){const t=yd(e);return Fd(e)(t.map(ep))}const Mt={test:Km,parse:yd,createTransformer:Fd,getAnimatableNone:tp};function Co(e,t,A){return A<0&&(A+=1),A>1&&(A-=1),A<1/6?e+(t-e)*6*A:A<1/2?t:A<2/3?e+(t-e)*(2/3-A)*6:e}function Ap({hue:e,saturation:t,lightness:A,alpha:n}){e/=360,t/=100,A/=100;let r=0,o=0,s=0;if(!t)r=o=s=A;else{const i=A<.5?A*(1+t):A+t-A*t,a=2*A-i;r=Co(a,i,e+1/3),o=Co(a,i,e),s=Co(a,i,e-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:n}}function Cr(e,t){return A=>A>0?t:e}const Ie=(e,t,A)=>e+(t-e)*A,fo=(e,t,A)=>{const n=e*e,r=A*(t*t-n)+n;return r<0?0:Math.sqrt(r)},np=[$o,Xt,CA],rp=e=>np.find(t=>t.test(e));function nu(e){const t=rp(e);if(jA(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let A=t.parse(e);return t===CA&&(A=Ap(A)),A}const ru=(e,t)=>{const A=nu(e),n=nu(t);if(!A||!n)return Cr(e,t);const r={...A};return o=>(r.red=fo(A.red,n.red,o),r.green=fo(A.green,n.green,o),r.blue=fo(A.blue,n.blue,o),r.alpha=Ie(A.alpha,n.alpha,o),Xt.transform(r))},es=new Set(["none","hidden"]);function op(e,t){return es.has(e)?A=>A<=0?e:t:A=>A>=1?t:e}function sp(e,t){return A=>Ie(e,t,A)}function di(e){return typeof e=="number"?sp:typeof e=="string"?li(e)?Cr:we.test(e)?ru:up:Array.isArray(e)?Pd:typeof e=="object"?we.test(e)?ru:ip:Cr}function Pd(e,t){const A=[...e],n=A.length,r=e.map((o,s)=>di(o)(o,t[s]));return o=>{for(let s=0;s<n;s++)A[s]=r[s](o);return A}}function ip(e,t){const A={...e,...t},n={};for(const r in A)e[r]!==void 0&&t[r]!==void 0&&(n[r]=di(e[r])(e[r],t[r]));return r=>{for(const o in n)A[o]=n[o](r);return A}}function ap(e,t){const A=[],n={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const o=t.types[r],s=e.indexes[o][n[o]],i=e.values[s]??0;A[r]=i,n[o]++}return A}const up=(e,t)=>{const A=Mt.createTransformer(t),n=cn(e),r=cn(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?es.has(e)&&!r.values.length||es.has(t)&&!n.values.length?op(e,t):vn(Pd(ap(n,r),r.values),A):(jA(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Cr(e,t))};function Nd(e,t,A){return typeof e=="number"&&typeof t=="number"&&typeof A=="number"?Ie(e,t,A):di(e)(e,t)}const lp=e=>{const t=({timestamp:A})=>e(A);return{start:(A=!0)=>fe.update(t,A),stop:()=>Nt(t),now:()=>ye.isProcessing?ye.timestamp:Re.now()}},Md=(e,t,A=10)=>{let n="";const r=Math.max(Math.round(t/A),2);for(let o=0;o<r;o++)n+=Math.round(e(o/(r-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},fr=2e4;function Ci(e){let t=0;const A=50;let n=e.next(t);for(;!n.done&&t<fr;)t+=A,n=e.next(t);return t>=fr?1/0:t}function cp(e,t=100,A){const n=A({...e,keyframes:[0,t]}),r=Math.min(Ci(n),fr);return{type:"keyframes",ease:o=>n.next(r*o).value/t,duration:Ue(r)}}const gp=5;function Td(e,t,A){const n=Math.max(t-gp,0);return gd(A-e(n),t-n)}const Ee={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Bo=.001;function dp({duration:e=Ee.duration,bounce:t=Ee.bounce,velocity:A=Ee.velocity,mass:n=Ee.mass}){let r,o;jA(e<=_e(Ee.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=Et(Ee.minDamping,Ee.maxDamping,s),e=Et(Ee.minDuration,Ee.maxDuration,Ue(e)),s<1?(r=u=>{const c=u*s,g=c*e,d=c-A,f=ts(u,s),E=Math.exp(-g);return Bo-d/f*E},o=u=>{const g=u*s*e,d=g*A+A,f=Math.pow(s,2)*Math.pow(u,2)*e,E=Math.exp(-g),B=ts(Math.pow(u,2),s);return(-r(u)+Bo>0?-1:1)*((d-f)*E)/B}):(r=u=>{const c=Math.exp(-u*e),g=(u-A)*e+1;return-Bo+c*g},o=u=>{const c=Math.exp(-u*e),g=(A-u)*(e*e);return c*g});const i=5/e,a=fp(r,o,i);if(e=_e(e),isNaN(a))return{stiffness:Ee.stiffness,damping:Ee.damping,duration:e};{const u=Math.pow(a,2)*n;return{stiffness:u,damping:s*2*Math.sqrt(n*u),duration:e}}}const Cp=12;function fp(e,t,A){let n=A;for(let r=1;r<Cp;r++)n=n-e(n)/t(n);return n}function ts(e,t){return e*Math.sqrt(1-t*t)}const Bp=["duration","bounce"],Ep=["stiffness","damping","mass"];function ou(e,t){return t.some(A=>e[A]!==void 0)}function Ip(e){let t={velocity:Ee.velocity,stiffness:Ee.stiffness,damping:Ee.damping,mass:Ee.mass,isResolvedFromDuration:!1,...e};if(!ou(e,Ep)&&ou(e,Bp))if(e.visualDuration){const A=e.visualDuration,n=2*Math.PI/(A*1.2),r=n*n,o=2*Et(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Ee.mass,stiffness:r,damping:o}}else{const A=dp(e);t={...t,...A,mass:Ee.mass},t.isResolvedFromDuration=!0}return t}function Br(e=Ee.visualDuration,t=Ee.bounce){const A=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:r}=A;const o=A.keyframes[0],s=A.keyframes[A.keyframes.length-1],i={done:!1,value:o},{stiffness:a,damping:u,mass:c,duration:g,velocity:d,isResolvedFromDuration:f}=Ip({...A,velocity:-Ue(A.velocity||0)}),E=d||0,B=u/(2*Math.sqrt(a*c)),h=s-o,Q=Ue(Math.sqrt(a/c)),m=Math.abs(h)<5;n||(n=m?Ee.restSpeed.granular:Ee.restSpeed.default),r||(r=m?Ee.restDelta.granular:Ee.restDelta.default);let x;if(B<1){const I=ts(Q,B);x=v=>{const p=Math.exp(-B*Q*v);return s-p*((E+B*Q*h)/I*Math.sin(I*v)+h*Math.cos(I*v))}}else if(B===1)x=I=>s-Math.exp(-Q*I)*(h+(E+Q*h)*I);else{const I=Q*Math.sqrt(B*B-1);x=v=>{const p=Math.exp(-B*Q*v),D=Math.min(I*v,300);return s-p*((E+B*Q*h)*Math.sinh(D)+I*h*Math.cosh(D))/I}}const b={calculatedDuration:f&&g||null,next:I=>{const v=x(I);if(f)i.done=I>=g;else{let p=I===0?E:0;B<1&&(p=I===0?_e(E):Td(x,I,v));const D=Math.abs(p)<=n,F=Math.abs(s-v)<=r;i.done=D&&F}return i.value=i.done?s:v,i},toString:()=>{const I=Math.min(Ci(b),fr),v=Md(p=>b.next(I*p).value,I,30);return I+"ms "+v},toTransition:()=>{}};return b}Br.applyToOptions=e=>{const t=cp(e,100,Br);return e.ease=t.ease,e.duration=_e(t.duration),e.type="keyframes",e};function As({keyframes:e,velocity:t=0,power:A=.8,timeConstant:n=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:s,min:i,max:a,restDelta:u=.5,restSpeed:c}){const g=e[0],d={done:!1,value:g},f=D=>i!==void 0&&D<i||a!==void 0&&D>a,E=D=>i===void 0?a:a===void 0||Math.abs(i-D)<Math.abs(a-D)?i:a;let B=A*t;const h=g+B,Q=s===void 0?h:s(h);Q!==h&&(B=Q-g);const m=D=>-B*Math.exp(-D/n),x=D=>Q+m(D),b=D=>{const F=m(D),k=x(D);d.done=Math.abs(F)<=u,d.value=d.done?Q:k};let I,v;const p=D=>{f(d.value)&&(I=D,v=Br({keyframes:[d.value,E(d.value)],velocity:Td(x,D,d.value),damping:r,stiffness:o,restDelta:u,restSpeed:c}))};return p(0),{calculatedDuration:null,next:D=>{let F=!1;return!v&&I===void 0&&(F=!0,b(D),p(D)),I!==void 0&&D>=I?v.next(D-I):(!F&&b(D),d)}}}function Qp(e,t,A){const n=[],r=A||Qt.mix||Nd,o=e.length-1;for(let s=0;s<o;s++){let i=r(e[s],e[s+1]);if(t){const a=Array.isArray(t)?t[s]||We:t;i=vn(a,i)}n.push(i)}return n}function hp(e,t,{clamp:A=!0,ease:n,mixer:r}={}){const o=e.length;if(It(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const i=Qp(t,n,r),a=i.length,u=c=>{if(s&&c<e[0])return t[0];let g=0;if(a>1)for(;g<e.length-2&&!(c<e[g+1]);g++);const d=un(e[g],e[g+1],c);return i[g](d)};return A?c=>u(Et(e[0],e[o-1],c)):u}function mp(e,t){const A=e[e.length-1];for(let n=1;n<=t;n++){const r=un(0,t,n);e.push(Ie(A,1,r))}}function pp(e){const t=[0];return mp(t,e.length-1),t}function vp(e,t){return e.map(A=>A*t)}function wp(e,t){return e.map(()=>t||md).splice(0,e.length-1)}function fA({duration:e=300,keyframes:t,times:A,ease:n="easeInOut"}){const r=Rm(n)?n.map(eu):eu(n),o={done:!1,value:t[0]},s=vp(A&&A.length===t.length?A:pp(t),e),i=hp(s,t,{ease:Array.isArray(r)?r:wp(t,r)});return{calculatedDuration:e,next:a=>(o.value=i(a),o.done=a>=e,o)}}const xp=e=>e!==null;function fi(e,{repeat:t,repeatType:A="loop"},n,r=1){const o=e.filter(xp),i=r<0||t&&A!=="loop"&&t%2===1?0:o.length-1;return!i||n===void 0?o[i]:n}const bp={decay:As,inertia:As,tween:fA,keyframes:fA,spring:Br};function jd(e){typeof e.type=="string"&&(e.type=bp[e.type])}class Bi{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,A){return this.finished.then(t,A)}}const Dp=e=>e/100;class Ei extends Bi{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,r;const{motionValue:A}=this.options;A&&A.updatedAt!==Re.now()&&this.tick(Re.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(n=this.options).onStop)==null||r.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;jd(t);const{type:A=fA,repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:s=0}=t;let{keyframes:i}=t;const a=A||fA;process.env.NODE_ENV!=="production"&&a!==fA&&It(i.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${i}`,"spring-two-frames"),a!==fA&&typeof i[0]!="number"&&(this.mixKeyframes=vn(Dp,Nd(i[0],i[1])),i=[0,100]);const u=a({...t,keyframes:i});o==="mirror"&&(this.mirroredGenerator=a({...t,keyframes:[...i].reverse(),velocity:-s})),u.calculatedDuration===null&&(u.calculatedDuration=Ci(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=u}updateTime(t){const A=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=A}tick(t,A=!1){const{generator:n,totalDuration:r,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:i,calculatedDuration:a}=this;if(this.startTime===null)return n.next(0);const{delay:u=0,keyframes:c,repeat:g,repeatType:d,repeatDelay:f,type:E,onUpdate:B,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),A?this.currentTime=t:this.updateTime(t);const Q=this.currentTime-u*(this.playbackSpeed>=0?1:-1),m=this.playbackSpeed>=0?Q<0:Q>r;this.currentTime=Math.max(Q,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let x=this.currentTime,b=n;if(g){const D=Math.min(this.currentTime,r)/i;let F=Math.floor(D),k=D%1;!k&&D>=1&&(k=1),k===1&&F--,F=Math.min(F,g+1),!!(F%2)&&(d==="reverse"?(k=1-k,f&&(k-=f/i)):d==="mirror"&&(b=s)),x=Et(0,1,k)*i}const I=m?{done:!1,value:c[0]}:b.next(x);o&&(I.value=o(I.value));let{done:v}=I;!m&&a!==null&&(v=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const p=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&v);return p&&E!==As&&(I.value=fi(c,this.options,h,this.speed)),B&&B(I.value),p&&this.finish(),I}then(t,A){return this.finished.then(t,A)}get duration(){return Ue(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ue(t)}get time(){return Ue(this.currentTime)}set time(t){var A;t=_e(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(A=this.driver)==null||A.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Re.now());const A=this.playbackSpeed!==t;this.playbackSpeed=t,A&&(this.time=Ue(this.currentTime))}play(){var r,o;if(this.isStopped)return;const{driver:t=lp,startTime:A}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),(o=(r=this.options).onPlay)==null||o.call(r);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=A??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Re.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,A;this.notifyFinished(),this.teardown(),this.state="finished",(A=(t=this.options).onComplete)==null||A.call(t)}cancel(){var t,A;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(A=(t=this.options).onCancel)==null||A.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var A;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(A=this.driver)==null||A.stop(),t.observe(this)}}function yp(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Zt=e=>e*180/Math.PI,ns=e=>{const t=Zt(Math.atan2(e[1],e[0]));return rs(t)},Fp={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ns,rotateZ:ns,skewX:e=>Zt(Math.atan(e[1])),skewY:e=>Zt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},rs=e=>(e=e%360,e<0&&(e+=360),e),su=ns,iu=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),au=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Pp={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:iu,scaleY:au,scale:e=>(iu(e)+au(e))/2,rotateX:e=>rs(Zt(Math.atan2(e[6],e[5]))),rotateY:e=>rs(Zt(Math.atan2(-e[2],e[0]))),rotateZ:su,rotate:su,skewX:e=>Zt(Math.atan(e[4])),skewY:e=>Zt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function os(e){return e.includes("scale")?1:0}function ss(e,t){if(!e||e==="none")return os(t);const A=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,r;if(A)n=Pp,r=A;else{const i=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=Fp,r=i}if(!r)return os(t);const o=n[t],s=r[1].split(",").map(Mp);return typeof o=="function"?o(s):s[o]}const Np=(e,t)=>{const{transform:A="none"}=getComputedStyle(e);return ss(A,t)};function Mp(e){return parseFloat(e.trim())}const RA=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],LA=new Set(RA),uu=e=>e===kA||e===ee,Tp=new Set(["x","y","z"]),jp=RA.filter(e=>!Tp.has(e));function kp(e){const t=[];return jp.forEach(A=>{const n=e.getValue(A);n!==void 0&&(t.push([A,n.get()]),n.set(A.startsWith("scale")?1:0))}),t}const Jt={width:({x:e},{paddingLeft:t="0",paddingRight:A="0"})=>e.max-e.min-parseFloat(t)-parseFloat(A),height:({y:e},{paddingTop:t="0",paddingBottom:A="0"})=>e.max-e.min-parseFloat(t)-parseFloat(A),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ss(t,"x"),y:(e,{transform:t})=>ss(t,"y")};Jt.translateX=Jt.x;Jt.translateY=Jt.y;const _t=new Set;let is=!1,as=!1,us=!1;function kd(){if(as){const e=Array.from(_t).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),A=new Map;t.forEach(n=>{const r=kp(n);r.length&&(A.set(n,r),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const r=A.get(n);r&&r.forEach(([o,s])=>{var i;(i=n.getValue(o))==null||i.set(s)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}as=!1,is=!1,_t.forEach(e=>e.complete(us)),_t.clear()}function Rd(){_t.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(as=!0)})}function Rp(){us=!0,Rd(),kd(),us=!1}class Ii{constructor(t,A,n,r,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=A,this.name=n,this.motionValue=r,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(_t.add(this),is||(is=!0,fe.read(Rd),fe.resolveKeyframes(kd))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:A,element:n,motionValue:r}=this;if(t[0]===null){const o=r==null?void 0:r.get(),s=t[t.length-1];if(o!==void 0)t[0]=o;else if(n&&A){const i=n.readValue(A,s);i!=null&&(t[0]=i)}t[0]===void 0&&(t[0]=s),r&&o===void 0&&r.set(t[0])}yp(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_t.delete(this)}cancel(){this.state==="scheduled"&&(_t.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Lp=e=>e.startsWith("--");function Sp(e,t,A){Lp(t)?e.style.setProperty(t,A):e.style[t]=A}const Op=ri(()=>window.ScrollTimeline!==void 0),zp={};function Hp(e,t){const A=ri(e);return()=>zp[t]??A()}const Ld=Hp(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),JA=([e,t,A,n])=>`cubic-bezier(${e}, ${t}, ${A}, ${n})`,lu={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:JA([0,.65,.55,1]),circOut:JA([.55,0,1,.45]),backIn:JA([.31,.01,.66,-.59]),backOut:JA([.33,1.53,.69,.99])};function Sd(e,t){if(e)return typeof e=="function"?Ld()?Md(e,t):"ease-out":pd(e)?JA(e):Array.isArray(e)?e.map(A=>Sd(A,t)||lu.easeOut):lu[e]}function Vp(e,t,A,{delay:n=0,duration:r=300,repeat:o=0,repeatType:s="loop",ease:i="easeOut",times:a}={},u=void 0){const c={[t]:A};a&&(c.offset=a);const g=Sd(i,r);Array.isArray(g)&&(c.easing=g);const d={delay:n,duration:r,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return u&&(d.pseudoElement=u),e.animate(c,d)}function Od(e){return typeof e=="function"&&"applyToOptions"in e}function Gp({type:e,...t}){return Od(e)&&Ld()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Yp extends Bi{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:A,name:n,keyframes:r,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:i,onComplete:a}=t;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=t,It(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=Gp(t);this.animation=Vp(A,n,r,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=fi(r,this.options,i,this.speed);this.updateMotionValue?this.updateMotionValue(c):Sp(A,n,c),this.animation.cancel()}a==null||a(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,A;(A=(t=this.animation).finish)==null||A.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,A;this.isPseudoElement||(A=(t=this.animation).commitStyles)==null||A.call(t)}get duration(){var A,n;const t=((n=(A=this.animation.effect)==null?void 0:A.getComputedTiming)==null?void 0:n.call(A).duration)||0;return Ue(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ue(t)}get time(){return Ue(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=_e(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:A}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Op()?(this.animation.timeline=t,We):A(this)}}const zd={anticipate:Id,backInOut:Ed,circInOut:hd};function Up(e){return e in zd}function Wp(e){typeof e.ease=="string"&&Up(e.ease)&&(e.ease=zd[e.ease])}const cu=10;class Xp extends Yp{constructor(t){Wp(t),jd(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:A,onUpdate:n,onComplete:r,element:o,...s}=this.options;if(!A)return;if(t!==void 0){A.set(t);return}const i=new Ei({...s,autoplay:!1}),a=_e(this.finishedTime??this.time);A.setWithVelocity(i.sample(a-cu).value,i.sample(a).value,cu),i.stop()}}const gu=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Mt.test(e)||e==="0")&&!e.startsWith("url("));function Zp(e){const t=e[0];if(e.length===1)return!0;for(let A=0;A<e.length;A++)if(e[A]!==t)return!0}function qp(e,t,A,n){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=gu(r,t),i=gu(o,t);return jA(s===i,`You are trying to animate ${t} from "${r}" to "${o}". "${s?o:r}" is not an animatable value.`,"value-not-animatable"),!s||!i?!1:Zp(e)||(A==="spring"||Od(A))&&n}function ls(e){e.duration=0,e.type="keyframes"}const Kp=new Set(["opacity","clipPath","filter","transform"]),Jp=ri(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function _p(e){var c;const{motionValue:t,name:A,repeatDelay:n,repeatType:r,damping:o,type:s}=e;if(!(((c=t==null?void 0:t.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:u}=t.owner.getProps();return Jp()&&A&&Kp.has(A)&&(A!=="transform"||!u)&&!a&&!n&&r!=="mirror"&&o!==0&&s!=="inertia"}const $p=40;class e1 extends Bi{constructor({autoplay:t=!0,delay:A=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s="loop",keyframes:i,name:a,motionValue:u,element:c,...g}){var E;super(),this.stop=()=>{var B,h;this._animation&&(this._animation.stop(),(B=this.stopTimeline)==null||B.call(this)),(h=this.keyframeResolver)==null||h.cancel()},this.createdAt=Re.now();const d={autoplay:t,delay:A,type:n,repeat:r,repeatDelay:o,repeatType:s,name:a,motionValue:u,element:c,...g},f=(c==null?void 0:c.KeyframeResolver)||Ii;this.keyframeResolver=new f(i,(B,h,Q)=>this.onKeyframesResolved(B,h,d,!Q),a,u,c),(E=this.keyframeResolver)==null||E.scheduleResolve()}onKeyframesResolved(t,A,n,r){this.keyframeResolver=void 0;const{name:o,type:s,velocity:i,delay:a,isHandoff:u,onUpdate:c}=n;this.resolvedAt=Re.now(),qp(t,o,s,i)||((Qt.instantAnimations||!a)&&(c==null||c(fi(t,n,A))),t[0]=t[t.length-1],ls(n),n.repeat=0);const d={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>$p?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:A,...n,keyframes:t},f=!u&&_p(d)?new Xp({...d,element:d.motionValue.owner.current}):new Ei(d);f.finished.then(()=>this.notifyFinished()).catch(We),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,A){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Rp()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const t1=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function A1(e){const t=t1.exec(e);if(!t)return[,];const[,A,n,r]=t;return[`--${A??n}`,r]}const n1=4;function Hd(e,t,A=1){It(A<=n1,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[n,r]=A1(e);if(!n)return;const o=window.getComputedStyle(t).getPropertyValue(n);if(o){const s=o.trim();return ud(s)?parseFloat(s):s}return li(r)?Hd(r,t,A+1):r}function Qi(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Vd=new Set(["width","height","top","left","right","bottom",...RA]),r1={test:e=>e==="auto",parse:e=>e},Gd=e=>t=>t.test(e),Yd=[kA,ee,it,bt,Zm,Xm,r1],du=e=>Yd.find(Gd(e));function o1(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||cd(e):!0}const s1=new Set(["brightness","contrast","saturate","opacity"]);function i1(e){const[t,A]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=A.match(ci)||[];if(!n)return e;const r=A.replace(n,"");let o=s1.has(t)?1:0;return n!==A&&(o*=100),t+"("+o+r+")"}const a1=/\b([a-z-]*)\(.*?\)/gu,cs={...Mt,getAnimatableNone:e=>{const t=e.match(a1);return t?t.map(i1).join(" "):e}},Cu={...kA,transform:Math.round},u1={rotate:bt,rotateX:bt,rotateY:bt,rotateZ:bt,scale:Yn,scaleX:Yn,scaleY:Yn,scaleZ:Yn,skew:bt,skewX:bt,skewY:bt,distance:ee,translateX:ee,translateY:ee,translateZ:ee,x:ee,y:ee,z:ee,perspective:ee,transformPerspective:ee,opacity:ln,originX:tu,originY:tu,originZ:ee},hi={borderWidth:ee,borderTopWidth:ee,borderRightWidth:ee,borderBottomWidth:ee,borderLeftWidth:ee,borderRadius:ee,radius:ee,borderTopLeftRadius:ee,borderTopRightRadius:ee,borderBottomRightRadius:ee,borderBottomLeftRadius:ee,width:ee,maxWidth:ee,height:ee,maxHeight:ee,top:ee,right:ee,bottom:ee,left:ee,padding:ee,paddingTop:ee,paddingRight:ee,paddingBottom:ee,paddingLeft:ee,margin:ee,marginTop:ee,marginRight:ee,marginBottom:ee,marginLeft:ee,backgroundPositionX:ee,backgroundPositionY:ee,...u1,zIndex:Cu,fillOpacity:ln,strokeOpacity:ln,numOctaves:Cu},l1={...hi,color:we,backgroundColor:we,outlineColor:we,fill:we,stroke:we,borderColor:we,borderTopColor:we,borderRightColor:we,borderBottomColor:we,borderLeftColor:we,filter:cs,WebkitFilter:cs},Ud=e=>l1[e];function Wd(e,t){let A=Ud(e);return A!==cs&&(A=Mt),A.getAnimatableNone?A.getAnimatableNone(t):void 0}const c1=new Set(["auto","none","0"]);function g1(e,t,A){let n=0,r;for(;n<e.length&&!r;){const o=e[n];typeof o=="string"&&!c1.has(o)&&cn(o).values.length&&(r=e[n]),n++}if(r&&A)for(const o of t)e[o]=Wd(A,r)}class d1 extends Ii{constructor(t,A,n,r,o){super(t,A,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:A,name:n}=this;if(!A||!A.current)return;super.readKeyframes();for(let a=0;a<t.length;a++){let u=t[a];if(typeof u=="string"&&(u=u.trim(),li(u))){const c=Hd(u,A.current);c!==void 0&&(t[a]=c),a===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Vd.has(n)||t.length!==2)return;const[r,o]=t,s=du(r),i=du(o);if(s!==i)if(uu(s)&&uu(i))for(let a=0;a<t.length;a++){const u=t[a];typeof u=="string"&&(t[a]=parseFloat(u))}else Jt[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:A}=this,n=[];for(let r=0;r<t.length;r++)(t[r]===null||o1(t[r]))&&n.push(r);n.length&&g1(t,n,A)}measureInitialState(){const{element:t,unresolvedKeyframes:A,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Jt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),A[0]=this.measuredOrigin;const r=A[A.length-1];r!==void 0&&t.getValue(n,r).jump(r,!1)}measureEndState(){var i;const{element:t,name:A,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const r=t.getValue(A);r&&r.jump(this.measuredOrigin,!1);const o=n.length-1,s=n[o];n[o]=Jt[A](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(i=this.removedTransforms)!=null&&i.length&&this.removedTransforms.forEach(([a,u])=>{t.getValue(a).set(u)}),this.resolveNoneKeyframes()}}function C1(e,t,A){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const r=(A==null?void 0:A[e])??n.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}const Xd=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Zd(e){return ld(e)&&"offsetHeight"in e}const fu=30,f1=e=>!isNaN(parseFloat(e));class B1{constructor(t,A={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var o;const r=Re.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=A.owner}setCurrent(t){this.current=t,this.updatedAt=Re.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=f1(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&si(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,A){this.events[t]||(this.events[t]=new oi);const n=this.events[t].add(A);return t==="change"?()=>{n(),fe.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,A){this.passiveEffect=t,this.stopPassiveEffect=A}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,A,n){this.set(A),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,A=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,A&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Re.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>fu)return 0;const A=Math.min(this.updatedAt-this.prevUpdatedAt,fu);return gd(parseFloat(this.current)-parseFloat(this.prevFrameValue),A)}start(t){return this.stop(),new Promise(A=>{this.hasAnimated=!0,this.animation=t(A),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,A;(t=this.dependents)==null||t.clear(),(A=this.events.destroy)==null||A.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yA(e,t){return new B1(e,t)}const{schedule:mi}=vd(queueMicrotask,!1),Ke={x:!1,y:!1};function qd(){return Ke.x||Ke.y}function E1(e){return e==="x"||e==="y"?Ke[e]?null:(Ke[e]=!0,()=>{Ke[e]=!1}):Ke.x||Ke.y?null:(Ke.x=Ke.y=!0,()=>{Ke.x=Ke.y=!1})}function Kd(e,t){const A=C1(e),n=new AbortController,r={passive:!0,...t,signal:n.signal};return[A,r,()=>n.abort()]}function Bu(e){return!(e.pointerType==="touch"||qd())}function I1(e,t,A={}){const[n,r,o]=Kd(e,A),s=i=>{if(!Bu(i))return;const{target:a}=i,u=t(a,i);if(typeof u!="function"||!a)return;const c=g=>{Bu(g)&&(u(g),a.removeEventListener("pointerleave",c))};a.addEventListener("pointerleave",c,r)};return n.forEach(i=>{i.addEventListener("pointerenter",s,r)}),o}const Jd=(e,t)=>t?e===t?!0:Jd(e,t.parentElement):!1,pi=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Q1=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function h1(e){return Q1.has(e.tagName)||e.tabIndex!==-1}const Ar=new WeakSet;function Eu(e){return t=>{t.key==="Enter"&&e(t)}}function Eo(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const m1=(e,t)=>{const A=e.currentTarget;if(!A)return;const n=Eu(()=>{if(Ar.has(A))return;Eo(A,"down");const r=Eu(()=>{Eo(A,"up")}),o=()=>Eo(A,"cancel");A.addEventListener("keyup",r,t),A.addEventListener("blur",o,t)});A.addEventListener("keydown",n,t),A.addEventListener("blur",()=>A.removeEventListener("keydown",n),t)};function Iu(e){return pi(e)&&!qd()}function p1(e,t,A={}){const[n,r,o]=Kd(e,A),s=i=>{const a=i.currentTarget;if(!Iu(i))return;Ar.add(a);const u=t(a,i),c=(f,E)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",d),Ar.has(a)&&Ar.delete(a),Iu(f)&&typeof u=="function"&&u(f,{success:E})},g=f=>{c(f,a===window||a===document||A.useGlobalTarget||Jd(a,f.target))},d=f=>{c(f,!1)};window.addEventListener("pointerup",g,r),window.addEventListener("pointercancel",d,r)};return n.forEach(i=>{(A.useGlobalTarget?window:i).addEventListener("pointerdown",s,r),Zd(i)&&(i.addEventListener("focus",u=>m1(u,r)),!h1(i)&&!i.hasAttribute("tabindex")&&(i.tabIndex=0))}),o}function _d(e){return ld(e)&&"ownerSVGElement"in e}function v1(e){return _d(e)&&e.tagName==="svg"}const Fe=e=>!!(e&&e.getVelocity),w1=[...Yd,we,Mt],x1=e=>w1.find(Gd(e)),vi=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Qu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function b1(...e){return t=>{let A=!1;const n=e.map(r=>{const o=Qu(r,t);return!A&&typeof o=="function"&&(A=!0),o});if(A)return()=>{for(let r=0;r<n.length;r++){const o=n[r];typeof o=="function"?o():Qu(e[r],null)}}}}function D1(...e){return C.useCallback(b1(...e),e)}class y1 extends C.Component{getSnapshotBeforeUpdate(t){const A=this.props.childRef.current;if(A&&t.isPresent&&!this.props.isPresent){const n=A.offsetParent,r=Zd(n)&&n.offsetWidth||0,o=this.props.sizeRef.current;o.height=A.offsetHeight||0,o.width=A.offsetWidth||0,o.top=A.offsetTop,o.left=A.offsetLeft,o.right=r-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function F1({children:e,isPresent:t,anchorX:A,root:n}){const r=w.useId(),o=w.useRef(null),s=w.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:i}=w.useContext(vi),a=D1(o,e==null?void 0:e.ref);return w.useInsertionEffect(()=>{const{width:u,height:c,top:g,left:d,right:f}=s.current;if(t||!o.current||!u||!c)return;const E=A==="left"?`left: ${d}`:`right: ${f}`;o.current.dataset.motionPopId=r;const B=document.createElement("style");i&&(B.nonce=i);const h=n??document.head;return h.appendChild(B),B.sheet&&B.sheet.insertRule(`
|
|
51
|
+
*/const Kh=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Jh=Sg("LoaderCircle",Kh),Sr=w.createContext(null);Sr.displayName="PanelGroupContext";const he={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Zs=10,Kt=w.useLayoutEffect,Ya=C.useId,_h=typeof Ya=="function"?Ya:()=>null;let $h=0;function qs(e=null){const t=_h(),A=w.useRef(e||t||null);return A.current===null&&(A.current=""+$h++),e??A.current}function Og({children:e,className:t="",collapsedSize:A,collapsible:n,defaultSize:r,forwardedRef:o,id:s,maxSize:i,minSize:a,onCollapse:u,onExpand:c,onResize:g,order:d,style:f,tagName:E="div",...B}){const h=w.useContext(Sr);if(h===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:Q,expandPanel:m,getPanelSize:x,getPanelStyle:b,groupId:I,isPanelCollapsed:v,reevaluatePanelConstraints:p,registerPanel:D,resizePanel:F,unregisterPanel:k}=h,T=qs(s),z=w.useRef({callbacks:{onCollapse:u,onExpand:c,onResize:g},constraints:{collapsedSize:A,collapsible:n,defaultSize:r,maxSize:i,minSize:a},id:T,idIsFromProps:s!==void 0,order:d});w.useRef({didLogMissingDefaultSizeWarning:!1}),Kt(()=>{const{callbacks:y,constraints:R}=z.current,H={...R};z.current.id=T,z.current.idIsFromProps=s!==void 0,z.current.order=d,y.onCollapse=u,y.onExpand=c,y.onResize=g,R.collapsedSize=A,R.collapsible=n,R.defaultSize=r,R.maxSize=i,R.minSize=a,(H.collapsedSize!==R.collapsedSize||H.collapsible!==R.collapsible||H.maxSize!==R.maxSize||H.minSize!==R.minSize)&&p(z.current,H)}),Kt(()=>{const y=z.current;return D(y),()=>{k(y)}},[d,T,D,k]),w.useImperativeHandle(o,()=>({collapse:()=>{Q(z.current)},expand:y=>{m(z.current,y)},getId(){return T},getSize(){return x(z.current)},isCollapsed(){return v(z.current)},isExpanded(){return!v(z.current)},resize:y=>{F(z.current,y)}}),[Q,m,x,v,T,F]);const P=b(z.current,r);return w.createElement(E,{...B,children:e,className:t,id:T,style:{...P,...f},[he.groupId]:I,[he.panel]:"",[he.panelCollapsible]:n||void 0,[he.panelId]:T,[he.panelSize]:parseFloat(""+P.flexGrow).toFixed(1)})}const zg=w.forwardRef((e,t)=>w.createElement(Og,{...e,forwardedRef:t}));Og.displayName="Panel";zg.displayName="forwardRef(Panel)";let Jo=null,er=-1,yt=null;function em(e,t){if(t){const A=(t&Ug)!==0,n=(t&Wg)!==0,r=(t&Xg)!==0,o=(t&Zg)!==0;if(A)return r?"se-resize":o?"ne-resize":"e-resize";if(n)return r?"sw-resize":o?"nw-resize":"w-resize";if(r)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function tm(){yt!==null&&(document.head.removeChild(yt),Jo=null,yt=null,er=-1)}function so(e,t){var A,n;const r=em(e,t);if(Jo!==r){if(Jo=r,yt===null&&(yt=document.createElement("style"),document.head.appendChild(yt)),er>=0){var o;(o=yt.sheet)===null||o===void 0||o.removeRule(er)}er=(A=(n=yt.sheet)===null||n===void 0?void 0:n.insertRule(`*{cursor: ${r} !important;}`))!==null&&A!==void 0?A:-1}}function Hg(e){return e.type==="keydown"}function Vg(e){return e.type.startsWith("pointer")}function Gg(e){return e.type.startsWith("mouse")}function Or(e){if(Vg(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Gg(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function Am(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function nm(e,t,A){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function rm(e,t){if(e===t)throw new Error("Cannot compare node with itself");const A={a:Xa(e),b:Xa(t)};let n;for(;A.a.at(-1)===A.b.at(-1);)e=A.a.pop(),t=A.b.pop(),n=e;oe(n,"Stacking order can only be calculated for elements with a common ancestor");const r={a:Wa(Ua(A.a)),b:Wa(Ua(A.b))};if(r.a===r.b){const o=n.childNodes,s={a:A.a.at(-1),b:A.b.at(-1)};let i=o.length;for(;i--;){const a=o[i];if(a===s.a)return 1;if(a===s.b)return-1}}return Math.sign(r.a-r.b)}const om=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function sm(e){var t;const A=getComputedStyle((t=Yg(e))!==null&&t!==void 0?t:e).display;return A==="flex"||A==="inline-flex"}function im(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||sm(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||om.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Ua(e){let t=e.length;for(;t--;){const A=e[t];if(oe(A,"Missing node"),im(A))return A}return null}function Wa(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Xa(e){const t=[];for(;e;)t.push(e),e=Yg(e);return t}function Yg(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const Ug=1,Wg=2,Xg=4,Zg=8,am=Am()==="coarse";let Je=[],mA=!1,Wt=new Map,zr=new Map;const sn=new Set;function um(e,t,A,n,r){var o;const{ownerDocument:s}=t,i={direction:A,element:t,hitAreaMargins:n,setResizeHandlerState:r},a=(o=Wt.get(s))!==null&&o!==void 0?o:0;return Wt.set(s,a+1),sn.add(i),cr(),function(){var c;zr.delete(e),sn.delete(i);const g=(c=Wt.get(s))!==null&&c!==void 0?c:1;if(Wt.set(s,g-1),cr(),g===1&&Wt.delete(s),Je.includes(i)){const d=Je.indexOf(i);d>=0&&Je.splice(d,1),Js(),r("up",!0,null)}}}function lm(e){const{target:t}=e,{x:A,y:n}=Or(e);mA=!0,Ks({target:t,x:A,y:n}),cr(),Je.length>0&&(gr("down",e),e.preventDefault(),qg(t)||e.stopImmediatePropagation())}function io(e){const{x:t,y:A}=Or(e);if(mA&&e.buttons===0&&(mA=!1,gr("up",e)),!mA){const{target:n}=e;Ks({target:n,x:t,y:A})}gr("move",e),Js(),Je.length>0&&e.preventDefault()}function ao(e){const{target:t}=e,{x:A,y:n}=Or(e);zr.clear(),mA=!1,Je.length>0&&(e.preventDefault(),qg(t)||e.stopImmediatePropagation()),gr("up",e),Ks({target:t,x:A,y:n}),Js(),cr()}function qg(e){let t=e;for(;t;){if(t.hasAttribute(he.resizeHandle))return!0;t=t.parentElement}return!1}function Ks({target:e,x:t,y:A}){Je.splice(0);let n=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(n=e),sn.forEach(r=>{const{element:o,hitAreaMargins:s}=r,i=o.getBoundingClientRect(),{bottom:a,left:u,right:c,top:g}=i,d=am?s.coarse:s.fine;if(t>=u-d&&t<=c+d&&A>=g-d&&A<=a+d){if(n!==null&&document.contains(n)&&o!==n&&!o.contains(n)&&!n.contains(o)&&rm(n,o)>0){let E=n,B=!1;for(;E&&!E.contains(o);){if(nm(E.getBoundingClientRect(),i)){B=!0;break}E=E.parentElement}if(B)return}Je.push(r)}})}function uo(e,t){zr.set(e,t)}function Js(){let e=!1,t=!1;Je.forEach(n=>{const{direction:r}=n;r==="horizontal"?e=!0:t=!0});let A=0;zr.forEach(n=>{A|=n}),e&&t?so("intersection",A):e?so("horizontal",A):t?so("vertical",A):tm()}let lo=new AbortController;function cr(){lo.abort(),lo=new AbortController;const e={capture:!0,signal:lo.signal};sn.size&&(mA?(Je.length>0&&Wt.forEach((t,A)=>{const{body:n}=A;t>0&&(n.addEventListener("contextmenu",ao,e),n.addEventListener("pointerleave",io,e),n.addEventListener("pointermove",io,e))}),window.addEventListener("pointerup",ao,e),window.addEventListener("pointercancel",ao,e)):Wt.forEach((t,A)=>{const{body:n}=A;t>0&&(n.addEventListener("pointerdown",lm,e),n.addEventListener("pointermove",io,e))}))}function gr(e,t){sn.forEach(A=>{const{setResizeHandlerState:n}=A,r=Je.includes(A);n(e,r,t)})}function cm(){const[e,t]=w.useState(0);return w.useCallback(()=>t(A=>A+1),[])}function oe(e,t){if(!e)throw console.error(t),Error(t)}function eA(e,t,A=Zs){return e.toFixed(A)===t.toFixed(A)?0:e>t?1:-1}function Ct(e,t,A=Zs){return eA(e,t,A)===0}function Le(e,t,A){return eA(e,t,A)===0}function gm(e,t,A){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=e[n],o=t[n];if(!Le(r,o,A))return!1}return!0}function dA({panelConstraints:e,panelIndex:t,size:A}){const n=e[t];oe(n!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:r=0,collapsible:o,maxSize:s=100,minSize:i=0}=n;if(eA(A,i)<0)if(o){const a=(r+i)/2;eA(A,a)<0?A=r:A=i}else A=i;return A=Math.min(s,A),A=parseFloat(A.toFixed(Zs)),A}function qA({delta:e,initialLayout:t,panelConstraints:A,pivotIndices:n,prevLayout:r,trigger:o}){if(Le(e,0))return t;const s=[...t],[i,a]=n;oe(i!=null,"Invalid first pivot index"),oe(a!=null,"Invalid second pivot index");let u=0;if(o==="keyboard"){{const g=e<0?a:i,d=A[g];oe(d,`Panel constraints not found for index ${g}`);const{collapsedSize:f=0,collapsible:E,minSize:B=0}=d;if(E){const h=t[g];if(oe(h!=null,`Previous layout not found for panel index ${g}`),Le(h,f)){const Q=B-h;eA(Q,Math.abs(e))>0&&(e=e<0?0-Q:Q)}}}{const g=e<0?i:a,d=A[g];oe(d,`No panel constraints found for index ${g}`);const{collapsedSize:f=0,collapsible:E,minSize:B=0}=d;if(E){const h=t[g];if(oe(h!=null,`Previous layout not found for panel index ${g}`),Le(h,B)){const Q=h-f;eA(Q,Math.abs(e))>0&&(e=e<0?0-Q:Q)}}}}{const g=e<0?1:-1;let d=e<0?a:i,f=0;for(;;){const B=t[d];oe(B!=null,`Previous layout not found for panel index ${d}`);const Q=dA({panelConstraints:A,panelIndex:d,size:100})-B;if(f+=Q,d+=g,d<0||d>=A.length)break}const E=Math.min(Math.abs(e),Math.abs(f));e=e<0?0-E:E}{let d=e<0?i:a;for(;d>=0&&d<A.length;){const f=Math.abs(e)-Math.abs(u),E=t[d];oe(E!=null,`Previous layout not found for panel index ${d}`);const B=E-f,h=dA({panelConstraints:A,panelIndex:d,size:B});if(!Le(E,h)&&(u+=E-h,s[d]=h,u.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?d--:d++}}if(gm(r,s))return r;{const g=e<0?a:i,d=t[g];oe(d!=null,`Previous layout not found for panel index ${g}`);const f=d+u,E=dA({panelConstraints:A,panelIndex:g,size:f});if(s[g]=E,!Le(E,f)){let B=f-E,Q=e<0?a:i;for(;Q>=0&&Q<A.length;){const m=s[Q];oe(m!=null,`Previous layout not found for panel index ${Q}`);const x=m+B,b=dA({panelConstraints:A,panelIndex:Q,size:x});if(Le(m,b)||(B-=b-m,s[Q]=b),Le(B,0))break;e>0?Q--:Q++}}}const c=s.reduce((g,d)=>d+g,0);return Le(c,100)?s:r}function dm({layout:e,panelsArray:t,pivotIndices:A}){let n=0,r=100,o=0,s=0;const i=A[0];oe(i!=null,"No pivot index found"),t.forEach((g,d)=>{const{constraints:f}=g,{maxSize:E=100,minSize:B=0}=f;d===i?(n=B,r=E):(o+=B,s+=E)});const a=Math.min(r,100-o),u=Math.max(n,100-s),c=e[i];return{valueMax:a,valueMin:u,valueNow:c}}function an(e,t=document){return Array.from(t.querySelectorAll(`[${he.resizeHandleId}][data-panel-group-id="${e}"]`))}function Kg(e,t,A=document){const r=an(e,A).findIndex(o=>o.getAttribute(he.resizeHandleId)===t);return r??null}function Jg(e,t,A){const n=Kg(e,t,A);return n!=null?[n,n+1]:[-1,-1]}function _g(e,t=document){var A;if(t instanceof HTMLElement&&(t==null||(A=t.dataset)===null||A===void 0?void 0:A.panelGroupId)==e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function Hr(e,t=document){const A=t.querySelector(`[${he.resizeHandleId}="${e}"]`);return A||null}function Cm(e,t,A,n=document){var r,o,s,i;const a=Hr(t,n),u=an(e,n),c=a?u.indexOf(a):-1,g=(r=(o=A[c])===null||o===void 0?void 0:o.id)!==null&&r!==void 0?r:null,d=(s=(i=A[c+1])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null;return[g,d]}function fm({committedValuesRef:e,eagerValuesRef:t,groupId:A,layout:n,panelDataArray:r,panelGroupElement:o,setLayout:s}){w.useRef({didWarnAboutMissingResizeHandle:!1}),Kt(()=>{if(!o)return;const i=an(A,o);for(let a=0;a<r.length-1;a++){const{valueMax:u,valueMin:c,valueNow:g}=dm({layout:n,panelsArray:r,pivotIndices:[a,a+1]}),d=i[a];if(d!=null){const f=r[a];oe(f,`No panel data found for index "${a}"`),d.setAttribute("aria-controls",f.id),d.setAttribute("aria-valuemax",""+Math.round(u)),d.setAttribute("aria-valuemin",""+Math.round(c)),d.setAttribute("aria-valuenow",g!=null?""+Math.round(g):"")}}return()=>{i.forEach((a,u)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[A,n,r,o]),w.useEffect(()=>{if(!o)return;const i=t.current;oe(i,"Eager values not found");const{panelDataArray:a}=i,u=_g(A,o);oe(u!=null,`No group found for id "${A}"`);const c=an(A,o);oe(c,`No resize handles found for group id "${A}"`);const g=c.map(d=>{const f=d.getAttribute(he.resizeHandleId);oe(f,"Resize handle element has no handle id attribute");const[E,B]=Cm(A,f,a,o);if(E==null||B==null)return()=>{};const h=Q=>{if(!Q.defaultPrevented)switch(Q.key){case"Enter":{Q.preventDefault();const m=a.findIndex(x=>x.id===E);if(m>=0){const x=a[m];oe(x,`No panel data found for index ${m}`);const b=n[m],{collapsedSize:I=0,collapsible:v,minSize:p=0}=x.constraints;if(b!=null&&v){const D=qA({delta:Le(b,I)?p-I:I-b,initialLayout:n,panelConstraints:a.map(F=>F.constraints),pivotIndices:Jg(A,f,o),prevLayout:n,trigger:"keyboard"});n!==D&&s(D)}}break}}};return d.addEventListener("keydown",h),()=>{d.removeEventListener("keydown",h)}});return()=>{g.forEach(d=>d())}},[o,e,t,A,n,r,s])}function Za(e,t){if(e.length!==t.length)return!1;for(let A=0;A<e.length;A++)if(e[A]!==t[A])return!1;return!0}function $g(e,t){const A=e==="horizontal",{x:n,y:r}=Or(t);return A?n:r}function Bm(e,t,A,n,r){const o=A==="horizontal",s=Hr(t,r);oe(s,`No resize handle element found for id "${t}"`);const i=s.getAttribute(he.groupId);oe(i,"Resize handle element has no group id attribute");let{initialCursorPosition:a}=n;const u=$g(A,e),c=_g(i,r);oe(c,`No group element found for id "${i}"`);const g=c.getBoundingClientRect(),d=o?g.width:g.height;return(u-a)/d*100}function Em(e,t,A,n,r,o){if(Hg(e)){const s=A==="horizontal";let i=0;e.shiftKey?i=100:r!=null?i=r:i=10;let a=0;switch(e.key){case"ArrowDown":a=s?0:i;break;case"ArrowLeft":a=s?-i:0;break;case"ArrowRight":a=s?i:0;break;case"ArrowUp":a=s?0:-i;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return n==null?0:Bm(e,t,A,n,o)}function Im({panelDataArray:e}){const t=Array(e.length),A=e.map(o=>o.constraints);let n=0,r=100;for(let o=0;o<e.length;o++){const s=A[o];oe(s,`Panel constraints not found for index ${o}`);const{defaultSize:i}=s;i!=null&&(n++,t[o]=i,r-=i)}for(let o=0;o<e.length;o++){const s=A[o];oe(s,`Panel constraints not found for index ${o}`);const{defaultSize:i}=s;if(i!=null)continue;const a=e.length-n,u=r/a;n++,t[o]=u,r-=u}return t}function aA(e,t,A){t.forEach((n,r)=>{const o=e[r];oe(o,`Panel data not found for index ${r}`);const{callbacks:s,constraints:i,id:a}=o,{collapsedSize:u=0,collapsible:c}=i,g=A[a];if(g==null||n!==g){A[a]=n;const{onCollapse:d,onExpand:f,onResize:E}=s;E&&E(n,g),c&&(d||f)&&(f&&(g==null||Ct(g,u))&&!Ct(n,u)&&f(),d&&(g==null||!Ct(g,u))&&Ct(n,u)&&d())}})}function Vn(e,t){if(e.length!==t.length)return!1;for(let A=0;A<e.length;A++)if(e[A]!=t[A])return!1;return!0}function Qm({defaultSize:e,dragState:t,layout:A,panelData:n,panelIndex:r,precision:o=3}){const s=A[r];let i;return s==null?i=e!=null?e.toPrecision(o):"1":n.length===1?i="1":i=s.toPrecision(o),{flexBasis:0,flexGrow:i,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function hm(e,t=10){let A=null;return(...r)=>{A!==null&&clearTimeout(A),A=setTimeout(()=>{e(...r)},t)}}function qa(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,A)=>{localStorage.setItem(t,A)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function ed(e){return`react-resizable-panels:${e}`}function td(e){return e.map(t=>{const{constraints:A,id:n,idIsFromProps:r,order:o}=t;return r?n:o?`${o}:${JSON.stringify(A)}`:JSON.stringify(A)}).sort((t,A)=>t.localeCompare(A)).join(",")}function Ad(e,t){try{const A=ed(e),n=t.getItem(A);if(n){const r=JSON.parse(n);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function mm(e,t,A){var n,r;const o=(n=Ad(e,A))!==null&&n!==void 0?n:{},s=td(t);return(r=o[s])!==null&&r!==void 0?r:null}function pm(e,t,A,n,r){var o;const s=ed(e),i=td(t),a=(o=Ad(e,r))!==null&&o!==void 0?o:{};a[i]={expandToSizes:Object.fromEntries(A.entries()),layout:n};try{r.setItem(s,JSON.stringify(a))}catch(u){console.error(u)}}function Ka({layout:e,panelConstraints:t}){const A=[...e],n=A.reduce((o,s)=>o+s,0);if(A.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${A.map(o=>`${o}%`).join(", ")}`);if(!Le(n,100)&&A.length>0)for(let o=0;o<t.length;o++){const s=A[o];oe(s!=null,`No layout data found for index ${o}`);const i=100/n*s;A[o]=i}let r=0;for(let o=0;o<t.length;o++){const s=A[o];oe(s!=null,`No layout data found for index ${o}`);const i=dA({panelConstraints:t,panelIndex:o,size:s});s!=i&&(r+=s-i,A[o]=i)}if(!Le(r,0))for(let o=0;o<t.length;o++){const s=A[o];oe(s!=null,`No layout data found for index ${o}`);const i=s+r,a=dA({panelConstraints:t,panelIndex:o,size:i});if(s!==a&&(r-=a-s,A[o]=a,Le(r,0)))break}return A}const vm=100,KA={getItem:e=>(qa(KA),KA.getItem(e)),setItem:(e,t)=>{qa(KA),KA.setItem(e,t)}},Ja={};function nd({autoSaveId:e=null,children:t,className:A="",direction:n,forwardedRef:r,id:o=null,onLayout:s=null,keyboardResizeBy:i=null,storage:a=KA,style:u,tagName:c="div",...g}){const d=qs(o),f=w.useRef(null),[E,B]=w.useState(null),[h,Q]=w.useState([]),m=cm(),x=w.useRef({}),b=w.useRef(new Map),I=w.useRef(0),v=w.useRef({autoSaveId:e,direction:n,dragState:E,id:d,keyboardResizeBy:i,onLayout:s,storage:a}),p=w.useRef({layout:h,panelDataArray:[],panelDataArrayChanged:!1});w.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),w.useImperativeHandle(r,()=>({getId:()=>v.current.id,getLayout:()=>{const{layout:S}=p.current;return S},setLayout:S=>{const{onLayout:j}=v.current,{layout:Y,panelDataArray:V}=p.current,L=Ka({layout:S,panelConstraints:V.map(W=>W.constraints)});Za(Y,L)||(Q(L),p.current.layout=L,j&&j(L),aA(V,L,x.current))}}),[]),Kt(()=>{v.current.autoSaveId=e,v.current.direction=n,v.current.dragState=E,v.current.id=d,v.current.onLayout=s,v.current.storage=a}),fm({committedValuesRef:v,eagerValuesRef:p,groupId:d,layout:h,panelDataArray:p.current.panelDataArray,setLayout:Q,panelGroupElement:f.current}),w.useEffect(()=>{const{panelDataArray:S}=p.current;if(e){if(h.length===0||h.length!==S.length)return;let j=Ja[e];j==null&&(j=hm(pm,vm),Ja[e]=j);const Y=[...S],V=new Map(b.current);j(e,Y,V,h,a)}},[e,h,a]),w.useEffect(()=>{});const D=w.useCallback(S=>{const{onLayout:j}=v.current,{layout:Y,panelDataArray:V}=p.current;if(S.constraints.collapsible){const L=V.map(le=>le.constraints),{collapsedSize:W=0,panelSize:X,pivotIndices:Ae}=Vt(V,S,Y);if(oe(X!=null,`Panel size not found for panel "${S.id}"`),!Ct(X,W)){b.current.set(S.id,X);const ge=gA(V,S)===V.length-1?X-W:W-X,ae=qA({delta:ge,initialLayout:Y,panelConstraints:L,pivotIndices:Ae,prevLayout:Y,trigger:"imperative-api"});Vn(Y,ae)||(Q(ae),p.current.layout=ae,j&&j(ae),aA(V,ae,x.current))}}},[]),F=w.useCallback((S,j)=>{const{onLayout:Y}=v.current,{layout:V,panelDataArray:L}=p.current;if(S.constraints.collapsible){const W=L.map(K=>K.constraints),{collapsedSize:X=0,panelSize:Ae=0,minSize:le=0,pivotIndices:ge}=Vt(L,S,V),ae=j??le;if(Ct(Ae,X)){const K=b.current.get(S.id),Pe=K!=null&&K>=ae?K:ae,ct=gA(L,S)===L.length-1?Ae-Pe:Pe-Ae,De=qA({delta:ct,initialLayout:V,panelConstraints:W,pivotIndices:ge,prevLayout:V,trigger:"imperative-api"});Vn(V,De)||(Q(De),p.current.layout=De,Y&&Y(De),aA(L,De,x.current))}}},[]),k=w.useCallback(S=>{const{layout:j,panelDataArray:Y}=p.current,{panelSize:V}=Vt(Y,S,j);return oe(V!=null,`Panel size not found for panel "${S.id}"`),V},[]),T=w.useCallback((S,j)=>{const{panelDataArray:Y}=p.current,V=gA(Y,S);return Qm({defaultSize:j,dragState:E,layout:h,panelData:Y,panelIndex:V})},[E,h]),z=w.useCallback(S=>{const{layout:j,panelDataArray:Y}=p.current,{collapsedSize:V=0,collapsible:L,panelSize:W}=Vt(Y,S,j);return oe(W!=null,`Panel size not found for panel "${S.id}"`),L===!0&&Ct(W,V)},[]),P=w.useCallback(S=>{const{layout:j,panelDataArray:Y}=p.current,{collapsedSize:V=0,collapsible:L,panelSize:W}=Vt(Y,S,j);return oe(W!=null,`Panel size not found for panel "${S.id}"`),!L||eA(W,V)>0},[]),y=w.useCallback(S=>{const{panelDataArray:j}=p.current;j.push(S),j.sort((Y,V)=>{const L=Y.order,W=V.order;return L==null&&W==null?0:L==null?-1:W==null?1:L-W}),p.current.panelDataArrayChanged=!0,m()},[m]);Kt(()=>{if(p.current.panelDataArrayChanged){p.current.panelDataArrayChanged=!1;const{autoSaveId:S,onLayout:j,storage:Y}=v.current,{layout:V,panelDataArray:L}=p.current;let W=null;if(S){const Ae=mm(S,L,Y);Ae&&(b.current=new Map(Object.entries(Ae.expandToSizes)),W=Ae.layout)}W==null&&(W=Im({panelDataArray:L}));const X=Ka({layout:W,panelConstraints:L.map(Ae=>Ae.constraints)});Za(V,X)||(Q(X),p.current.layout=X,j&&j(X),aA(L,X,x.current))}}),Kt(()=>{const S=p.current;return()=>{S.layout=[]}},[]);const R=w.useCallback(S=>{let j=!1;const Y=f.current;return Y&&window.getComputedStyle(Y,null).getPropertyValue("direction")==="rtl"&&(j=!0),function(L){L.preventDefault();const W=f.current;if(!W)return()=>null;const{direction:X,dragState:Ae,id:le,keyboardResizeBy:ge,onLayout:ae}=v.current,{layout:K,panelDataArray:Pe}=p.current,{initialLayout:je}=Ae??{},ct=Jg(le,S,W);let De=Em(L,S,X,Ae,ge,W);const gt=X==="horizontal";gt&&j&&(De=-De);const ht=Pe.map(Lt=>Lt.constraints),mt=qA({delta:De,initialLayout:je??K,panelConstraints:ht,pivotIndices:ct,prevLayout:K,trigger:Hg(L)?"keyboard":"mouse-or-touch"}),Mn=!Vn(K,mt);(Vg(L)||Gg(L))&&I.current!=De&&(I.current=De,!Mn&&De!==0?gt?uo(S,De<0?Ug:Wg):uo(S,De<0?Xg:Zg):uo(S,0)),Mn&&(Q(mt),p.current.layout=mt,ae&&ae(mt),aA(Pe,mt,x.current))}},[]),H=w.useCallback((S,j)=>{const{onLayout:Y}=v.current,{layout:V,panelDataArray:L}=p.current,W=L.map(K=>K.constraints),{panelSize:X,pivotIndices:Ae}=Vt(L,S,V);oe(X!=null,`Panel size not found for panel "${S.id}"`);const ge=gA(L,S)===L.length-1?X-j:j-X,ae=qA({delta:ge,initialLayout:V,panelConstraints:W,pivotIndices:Ae,prevLayout:V,trigger:"imperative-api"});Vn(V,ae)||(Q(ae),p.current.layout=ae,Y&&Y(ae),aA(L,ae,x.current))},[]),O=w.useCallback((S,j)=>{const{layout:Y,panelDataArray:V}=p.current,{collapsedSize:L=0,collapsible:W}=j,{collapsedSize:X=0,collapsible:Ae,maxSize:le=100,minSize:ge=0}=S.constraints,{panelSize:ae}=Vt(V,S,Y);ae!=null&&(W&&Ae&&Ct(ae,L)?Ct(L,X)||H(S,X):ae<ge?H(S,ge):ae>le&&H(S,le))},[H]),M=w.useCallback((S,j)=>{const{direction:Y}=v.current,{layout:V}=p.current;if(!f.current)return;const L=Hr(S,f.current);oe(L,`Drag handle element not found for id "${S}"`);const W=$g(Y,j);B({dragHandleId:S,dragHandleRect:L.getBoundingClientRect(),initialCursorPosition:W,initialLayout:V})},[]),N=w.useCallback(()=>{B(null)},[]),G=w.useCallback(S=>{const{panelDataArray:j}=p.current,Y=gA(j,S);Y>=0&&(j.splice(Y,1),delete x.current[S.id],p.current.panelDataArrayChanged=!0,m())},[m]),_=w.useMemo(()=>({collapsePanel:D,direction:n,dragState:E,expandPanel:F,getPanelSize:k,getPanelStyle:T,groupId:d,isPanelCollapsed:z,isPanelExpanded:P,reevaluatePanelConstraints:O,registerPanel:y,registerResizeHandle:R,resizePanel:H,startDragging:M,stopDragging:N,unregisterPanel:G,panelGroupElement:f.current}),[D,E,n,F,k,T,d,z,P,O,y,R,H,M,N,G]),ne={display:"flex",flexDirection:n==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return w.createElement(Sr.Provider,{value:_},w.createElement(c,{...g,children:t,className:A,id:o,ref:f,style:{...ne,...u},[he.group]:"",[he.groupDirection]:n,[he.groupId]:d}))}const rd=w.forwardRef((e,t)=>w.createElement(nd,{...e,forwardedRef:t}));nd.displayName="PanelGroup";rd.displayName="forwardRef(PanelGroup)";function gA(e,t){return e.findIndex(A=>A===t||A.id===t.id)}function Vt(e,t,A){const n=gA(e,t),o=n===e.length-1?[n-1,n]:[n,n+1],s=A[n];return{...t.constraints,panelSize:s,pivotIndices:o}}function wm({disabled:e,handleId:t,resizeHandler:A,panelGroupElement:n}){w.useEffect(()=>{if(e||A==null||n==null)return;const r=Hr(t,n);if(r==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),A(s);break}case"F6":{s.preventDefault();const i=r.getAttribute(he.groupId);oe(i,`No group element found for id "${i}"`);const a=an(i,n),u=Kg(i,t,n);oe(u!==null,`No resize element found for id "${t}"`);const c=s.shiftKey?u>0?u-1:a.length-1:u+1<a.length?u+1:0;a[c].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[n,e,t,A])}function od({children:e=null,className:t="",disabled:A=!1,hitAreaMargins:n,id:r,onBlur:o,onClick:s,onDragging:i,onFocus:a,onPointerDown:u,onPointerUp:c,style:g={},tabIndex:d=0,tagName:f="div",...E}){var B,h;const Q=w.useRef(null),m=w.useRef({onClick:s,onDragging:i,onPointerDown:u,onPointerUp:c});w.useEffect(()=>{m.current.onClick=s,m.current.onDragging=i,m.current.onPointerDown=u,m.current.onPointerUp=c});const x=w.useContext(Sr);if(x===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:b,groupId:I,registerResizeHandle:v,startDragging:p,stopDragging:D,panelGroupElement:F}=x,k=qs(r),[T,z]=w.useState("inactive"),[P,y]=w.useState(!1),[R,H]=w.useState(null),O=w.useRef({state:T});Kt(()=>{O.current.state=T}),w.useEffect(()=>{if(A)H(null);else{const _=v(k);H(()=>_)}},[A,k,v]);const M=(B=n==null?void 0:n.coarse)!==null&&B!==void 0?B:15,N=(h=n==null?void 0:n.fine)!==null&&h!==void 0?h:5;w.useEffect(()=>{if(A||R==null)return;const _=Q.current;oe(_,"Element ref not attached");let ne=!1;return um(k,_,b,{coarse:M,fine:N},(j,Y,V)=>{if(!Y){z("inactive");return}switch(j){case"down":{z("drag"),ne=!1,oe(V,'Expected event to be defined for "down" action'),p(k,V);const{onDragging:L,onPointerDown:W}=m.current;L==null||L(!0),W==null||W();break}case"move":{const{state:L}=O.current;ne=!0,L!=="drag"&&z("hover"),oe(V,'Expected event to be defined for "move" action'),R(V);break}case"up":{z("hover"),D();const{onClick:L,onDragging:W,onPointerUp:X}=m.current;W==null||W(!1),X==null||X(),ne||L==null||L();break}}})},[M,b,A,N,v,k,R,p,D]),wm({disabled:A,handleId:k,resizeHandler:R,panelGroupElement:F});const G={touchAction:"none",userSelect:"none"};return w.createElement(f,{...E,children:e,className:t,id:r,onBlur:()=>{y(!1),o==null||o()},onFocus:()=>{y(!0),a==null||a()},ref:Q,role:"separator",style:{...G,...g},tabIndex:d,[he.groupDirection]:b,[he.groupId]:I,[he.resizeHandle]:"",[he.resizeHandleActive]:T==="drag"?"pointer":P?"keyboard":void 0,[he.resizeHandleEnabled]:!A,[he.resizeHandleId]:k,[he.resizeHandleState]:T})}od.displayName="PanelResizeHandle";function sd({className:e,...t}){return l.jsx(rd,{"data-slot":"resizable-panel-group",className:$("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function dr({...e}){return l.jsx(zg,{"data-slot":"resizable-panel",...e})}function id({withHandle:e,className:t,...A}){return l.jsx(od,{"data-slot":"resizable-handle",className:$("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...A,children:e&&l.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:l.jsx(qh,{className:"size-2.5"})})})}const pn=()=>{const[e,t]=w.useState(!1);return w.useEffect(()=>{const A=()=>{t(window.innerWidth<768)};return A(),window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}},[]),e},xm=({items:e,isDefaultOpen:t=!1,isStandalone:A=!1,resizableContent:n,title:r="Moments",feddbackTitle:o,feedbackHelpfullButtonTitle:s,feedbackNotHelpfullButtonTitle:i,feedbackCommentPlaceholder:a,feedbackSubmitText:u,feedbackThankYouMessage:c,feedbackCancelButtonTitle:g,feedbackSubmitButtonHoverTitle:d})=>{const[f,E]=w.useState(t),B=w.useRef(null),h=w.useRef(null),Q=w.useRef([]),[m,x]=w.useState([]),[b,I]=w.useState(!1),[v,p]=w.useState(null),D=pn(),F=w.useMemo(()=>[...e].reverse(),[e]);w.useEffect(()=>{Q.current=Array(F.length).fill(null)},[F.length]);const k=()=>{if(!h.current)return;const y=h.current.getBoundingClientRect(),R=[];Q.current.forEach((H,O)=>{if(!H)return;const M=H.getBoundingClientRect();M.top<y.bottom&&M.bottom>y.top&&R.push(O)}),x(R)};w.useEffect(()=>{if(t&&!b){const y=setTimeout(()=>{k(),I(!0)},200);return()=>clearTimeout(y)}},[b,t]),w.useEffect(()=>{const y=h.current;if(y&&f){const R=setTimeout(()=>{k()},100);return y.addEventListener("scroll",k),()=>{clearTimeout(R),y.removeEventListener("scroll",k)}}},[f]),w.useEffect(()=>{const y=()=>{f&&k()};return window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[f]);const T=y=>{if(v===y||D||m.length<=5||!m.includes(y))return 1;const H=[...m].sort((M,N)=>M-N).indexOf(y);return H<5?1:Math.max(0,.6-(H-5)*.1)},z=y=>{switch(y.type){case"task-done":return l.jsx(jg,{id:y.id,title:r,message:y.message,timestamp:y.timestamp,completedTaskCount:y.completedTaskCount??0,taskCount:y.taskCount??0});case"good-job":return l.jsx(Mg,{id:y.id,title:r,message:y.message,timestamp:y.timestamp});case"legal-thread":return l.jsx(Tg,{id:y.id,title:r,message:y.message,timestamp:y.timestamp,onClickAskGenAI:()=>{var R;return(R=y.onClickAskGenAI)==null?void 0:R.call(y)},onClickAskManager:()=>{var R;return(R=y.onClickAskManager)==null?void 0:R.call(y)}});case"unhappy-customer":return l.jsx(kg,{id:y.id,title:r,message:y.message,timestamp:y.timestamp});case"genai-support":return l.jsx(Ng,{id:y.id,title:r,message:y.message,timestamp:y.timestamp});case"default":return l.jsx(Rg,{id:y.id,title:y.title??y.type,message:y.message,timestamp:y.timestamp,icon:y.icon,scenarioId:y.scenarioId,showFeedbackArea:y.showFeedbackArea,feedbackSubmitButtonHoverTitle:d??"",feedbackCancelButtonTitle:g??"",feddbackTitle:o,feedbackHelpfullButtonTitle:s,feedbackNotHelpfullButtonTitle:i,feedbackCommentPlaceholder:a,feedbackSubmitText:u,feedbackThankYouMessage:c,matchId:(y==null?void 0:y.matchId)??"",sendFeedback:y==null?void 0:y.sendFeedback,showThankYou:y==null?void 0:y.showThankYou,feedbackLoading:y==null?void 0:y.feedbackLoading})}},P=(y,R)=>l.jsx("div",{ref:H=>{Q.current[R]=H},onMouseEnter:()=>p(R),onMouseLeave:()=>p(null),children:y});return l.jsx("div",{ref:B,className:$("relative",!A&&!n?"max-h-[500px]":"h-full"),children:!A&&n?l.jsxs(sd,{direction:"vertical",className:"h-full md:pb-2",children:[l.jsx(dr,{defaultSize:D?60:35,children:e.length==1?l.jsxs("div",{className:"w-full flex flex-col gap-2 md:px-6 md:py-4 px-3 py-3",children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-start h-10",children:[l.jsx("span",{className:"text-lg font-medium text-foreground",children:r}),l.jsx("div",{className:"w-6 h-6 flex items-center justify-center bg-foreground-08 text-secondary-foreground rounded-full",children:e.length})]}),F.map((y,R)=>l.jsx("div",{children:P(z(y),R)},`item-${y.id||R}`))]}):l.jsx("div",{className:"h-full flex flex-col md:px-6 md:py-4 px-3 py-3",children:l.jsxs(Zo,{defaultOpen:t,open:f,onOpenChange:y=>{E(y),y&&setTimeout(k,100)},className:"h-full flex flex-col",children:[l.jsxs(qo,{className:"w-full flex flex-row items-center justify-between mb-2",children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-center",children:[l.jsx("span",{className:"text-lg font-medium text-foreground",children:r}),l.jsx("div",{className:"w-6 h-6 flex items-center justify-center bg-foreground-08 text-secondary-foreground rounded-full",children:e.length})]}),l.jsx("div",{className:"h-10 w-10 p-2 flex items-center justify-center",children:l.jsx(U,{name:"ChevronDown",width:16,height:9,className:"text-foreground"})})]}),!f&&F.length>0&&l.jsxs("div",{className:"w-full relative flex items-center justify-center rounded-xl md:rounded-3xl",children:[l.jsx("div",{className:"z-[3] w-full shadow-[0_4px_6px_1px_rgba(0,0,0,0.25)] rounded-xl md:rounded-3xl",ref:y=>{Q.current[0]=y},children:z(F[0])}),!D&&e.length>1&&l.jsx("div",{className:"z-[2] absolute -bottom-2 w-[calc(100%-16px)] h-12 shadow-[0_4px_6px_1px_rgba(0,0,0,0.25)] rounded-3xl bg-background-08"}),!D&&e.length>2&&l.jsx("div",{className:"z-[1] absolute -bottom-4 w-[calc(100%-32px)] h-12 shadow-[0_4px_6px_1px_rgba(0,0,0,0.25)] rounded-3xl bg-background-08"})]}),l.jsx(Ko,{className:"flex-1 overflow-y-auto flex flex-col gap-2 max-h-[calc(100vh-68px)]",id:"moments-content",ref:h,children:F.map((y,R)=>l.jsx("div",{style:{opacity:T(R),transition:"opacity 0.2s ease-in-out"},children:P(z(y),R)},`item-${y.id||R}`))})]})})},`panel-1-${D}`),l.jsx(id,{}),l.jsx(dr,{defaultSize:D?40:65,children:l.jsx("div",{className:"h-full overflow-y-auto no-scrollbar",children:n})},`panel-2-${D}`)]},`panel-group-${D}`):l.jsx(l.Fragment,{children:e.length==1?l.jsxs("div",{className:"w-full flex flex-col gap-2 px-6 py-4",children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-start h-10",children:[l.jsx("span",{className:"text-lg font-medium text-foreground",children:r}),l.jsx("div",{className:"w-6 h-6 flex items-center justify-center bg-foreground-08 text-secondary-foreground rounded-full",children:e.length})]}),F.map((y,R)=>l.jsx("div",{children:P(z(y),R)},`item-${y.id||R}`))]}):l.jsx("div",{className:"h-full flex flex-col px-6 py-4",children:l.jsxs(Zo,{defaultOpen:t,open:f,onOpenChange:y=>{E(y),y&&setTimeout(k,100)},className:"h-full flex flex-col",children:[l.jsxs(qo,{className:"w-full flex flex-row items-center justify-between mb-2",children:[l.jsxs("div",{className:"flex flex-row gap-2 items-center justify-center",children:[l.jsx("span",{className:"text-lg font-medium text-foreground",children:r}),l.jsx("div",{className:"w-6 h-6 flex items-center justify-center bg-foreground-08 text-secondary-foreground rounded-full",children:e.length})]}),l.jsx("div",{className:"h-10 w-10 p-2 flex items-center justify-center",children:f?l.jsx(U,{name:"ChevronUp",width:24,height:24,className:"text-foreground"}):l.jsx(U,{name:"ChevronDown",width:24,height:24,className:"text-foreground"})})]}),!f&&F.length>0&&l.jsxs("div",{className:"w-full relative flex items-center justify-center rounded-xl md:rounded-3xl",children:[l.jsx("div",{className:"z-[3] w-full shadow-[0_4px_6px_1px_rgba(0,0,0,0.25)] rounded-xl md:rounded-3xl",ref:y=>{Q.current[0]=y},children:z(F[0])}),!D&&e.length>1&&l.jsx("div",{className:"z-[2] absolute -bottom-2 w-[calc(100%-16px)] h-12 shadow-[0_4px_6px_1px_rgba(0,0,0,0.25)] rounded-3xl bg-background-08"}),!D&&e.length>2&&l.jsx("div",{className:"z-[1] absolute -bottom-4 w-[calc(100%-32px)] h-12 shadow-[0_4px_6px_1px_rgba(0,0,0,0.25)] rounded-3xl bg-background-08"})]}),l.jsx(Ko,{className:"flex-1 overflow-y-auto flex flex-col gap-2 max-h-[calc(100vh-68px)]",id:"moments-content",ref:h,children:F.map((y,R)=>l.jsx("div",{style:{opacity:T(R),transition:"opacity 0.2s ease-in-out"},children:P(z(y),R)},`item-${y.id||R}`))})]})})})})};function bm({className:e,...t}){return l.jsx("textarea",{"data-slot":"textarea",className:$("border-input text-sm placeholder:text-muted-foreground focus-visible:border-primary focus-visible:border-2 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}const _s=({value:e,onChange:t,onSendClick:A,placeholder:n="Type something...",...r})=>{const o=w.useRef(null);w.useEffect(()=>{const i=o.current;if(!i)return;i.style.height="0px";const u=24*5,g=Math.min(Math.max(i.scrollHeight,52),u);i.style.height=`${g}px`,i.style.overflowY=i.scrollHeight>u?"auto":"hidden"},[e]);const s=i=>{i.key==="Enter"&&(i.preventDefault(),A())};return l.jsxs("div",{className:"relative w-full",children:[l.jsx(bm,{ref:o,value:e,onChange:t,onKeyDown:s,className:"!py-4 resize-none box-border !pl-4 min-h-[52px] h-auto !pr-[71px] !w-full",placeholder:n,...r}),l.jsx(Qe,{size:"sm",className:"bg-primary absolute top-2 right-2 px-[15.5px] rounded-full",onClick:A,children:l.jsx(U,{name:"Send",width:16,height:16,className:"text-background"})})]})},Dm=({isShown:e,personList:t,onClick:A})=>e?l.jsx("div",{className:"flex flex-col items-center justify-center gap-3",children:t.map(n=>l.jsxs("div",{className:`w-fit cursor-pointer h-fit relative${n.isDisable?" opacity-50":""}`,onClick:()=>A(n.id),children:[l.jsx(qt,{type:"secondary",fullName:n.fullName}),n.isActive&&l.jsx("div",{className:"w-2.5 h-2.5 bg-success rounded-full absolute bottom-0 right-0"})]},n.id))}):null,ym=({suggestion:e={items:[],messages:[]},messages:t,input:A,showInput:n=!0,onInputChange:r,onSend:o,onSuggestionClick:s,onSearchDocClick:i,placeholder:a="Type something...",searchDocText:u="Search in Doc",searchDocLoadingText:c="Searching...",showSearchDocButton:g=!0})=>{var h;const[d,f]=w.useState(!1),E=()=>{A.trim()&&(o(A.trim()),r(""))},B=async()=>{if(i){f(!0);try{await i()}finally{f(!1)}}};return l.jsxs("div",{className:"flex flex-col h-full w-full bg-background gap-6 rounded-b-xl rounded-t-4xl",children:[l.jsx("div",{className:"flex-1 overflow-y-auto",children:l.jsx("div",{className:"flex flex-col gap-2 ",id:"ai-chat-messages-container",children:t==null?void 0:t.map(Q=>w.createElement(xA,{...Q,key:Q.id}))})}),e&&l.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.messages&&e.messages.length>0&&((h=e.messages)==null?void 0:h.map(Q=>l.jsx("div",{className:"border-t pt-4",children:l.jsx(xA,{...Q})},Q.id))),e.items&&e.items.length>0&&l.jsx("div",{className:"flex flex-wrap gap-2 items-start justify-end",children:e.items.map((Q,m)=>l.jsx(Qe,{className:"rounded-lg text-primary text-sm font-medium px-3 py-1.5 bg-secondary hover:bg-secondary/70",onClick:()=>s==null?void 0:s(Q),children:Q},m))})]}),l.jsxs("div",{className:"border-t p-4 flex flex-col gap-2",children:[g&&l.jsx(Qe,{className:"flex rounded-lg text-primary py-1 px-3 bg-secondary hover:bg-secondary/70 items-center justify-center",onClick:B,disabled:d,id:"search-doc-button",children:d?l.jsxs(l.Fragment,{children:[l.jsx(Jh,{className:"animate-spin mr-2 h-4 w-4"}),c]}):u}),n&&l.jsx(_s,{value:A,onChange:Q=>r(Q.target.value),onSendClick:E,placeholder:a,id:"message-send-box"})]})]})},Fm=({suggestion:e={items:[],messages:[]},messages:t,input:A,showInput:n=!0,supervisors:r=[],onSupervisorSelect:o,onInputChange:s,onSend:i,onSuggestionClick:a,placeholder:u="Type something...",supervisorSearchPlaceholder:c="Ara...",selectedSupervisorPlaceholder:g="Supervisor seç",emptySupervisorResultMessage:d="Sonuç bulunamadı"})=>{var k;const[f,E]=w.useState(""),[B,h]=w.useState(!1),[Q,m]=w.useState(null),x=w.useRef(null);w.useEffect(()=>{if(!B)return;const T=z=>{x.current&&!x.current.contains(z.target)&&(h(!1),E(""))};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[B]);const b=w.useMemo(()=>r.filter(T=>T.name.toLowerCase().includes(f.toLowerCase())),[r,f]),I=T=>{m(T),o==null||o(T),h(!1),E("")},v=w.useMemo(()=>r.reduce((T,z)=>T+(z.unreadCount??0),0),[r]),p=T=>{a==null||a(T)},D=()=>{A.trim()&&(i(A.trim()),s(""))},F=r.length>0;return l.jsxs("div",{className:"flex flex-col h-full w-full bg-background gap-6 rounded-b-xl rounded-t-4xl",children:[F&&l.jsxs("div",{ref:x,className:"relative shrink-0",children:[l.jsxs("button",{type:"button",onClick:()=>h(T=>!T),className:$("flex items-center justify-between gap-2 w-full px-3 py-2.5 rounded-lg border border-input bg-background text-sm text-left transition-colors hover:bg-secondary/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),"aria-expanded":B,children:[l.jsx("span",{className:"truncate flex-1 text-muted-foreground",children:Q?Q.name:g}),!B&&v>0&&l.jsx("span",{className:"shrink-0 min-w-5 h-5 flex items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-medium px-1.5",children:v>99?"99+":v}),l.jsx(U,{name:B?"ChevronUp":"ChevronDown",width:16,height:16,className:"shrink-0 text-muted-foreground"})]}),B&&l.jsxs("div",{className:"absolute top-full left-0 right-0 z-10 mt-2 flex flex-col gap-2 rounded-md border border-input bg-background p-2 shadow-md",children:[l.jsx(Fs,{type:"search",value:f,onChange:T=>E(T.target.value),placeholder:c,className:"w-full","aria-label":c}),l.jsx("div",{className:"flex flex-col max-h-48 overflow-y-auto rounded-md border border-input bg-background",children:b.length===0?l.jsx("div",{className:"px-3 py-4 text-sm text-muted-foreground text-center",children:d}):b.map(T=>l.jsxs("button",{type:"button",onClick:()=>I(T),className:$("flex items-center justify-between gap-2 w-full px-3 py-2.5 text-left text-sm transition-colors hover:bg-secondary/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",(Q==null?void 0:Q.id)===T.id&&"bg-secondary"),children:[l.jsx("span",{className:"truncate flex-1",children:T.name}),typeof T.unreadCount=="number"&&T.unreadCount>0&&l.jsx("span",{className:"shrink-0 min-w-5 h-5 flex items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-medium px-1.5",children:T.unreadCount>99?"99+":T.unreadCount})]},T.id))})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:l.jsx("div",{className:"flex flex-col gap-2.5",id:"supervisor-chat-container",children:t==null?void 0:t.map(T=>w.createElement(xA,{...T,key:T.id}))})}),e&&l.jsxs("div",{className:"flex flex-col gap-2.5 ",children:[e.messages&&e.messages.length>0&&((k=e.messages)==null?void 0:k.map(T=>l.jsx("div",{className:"border-t pt-4",children:l.jsx(xA,{...T})},T.id))),e.items&&e.items.length>0&&l.jsx("div",{className:"flex flex-wrap gap-2 items-start justify-end",children:e.items.map((T,z)=>l.jsx(Qe,{className:"rounded-lg whitespace-pre-wrap text-left text-primary text-sm font-medium px-3 py-1.8 bg-secondary hover:bg-secondary/70",onClick:()=>p(T),children:T},z))})]}),n&&l.jsx("div",{className:"border-t p-4",children:l.jsx(_s,{value:A,onChange:T=>s(T.target.value),onSendClick:D,placeholder:u})})]})},$s=w.createContext({});function ei(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const ti=typeof window<"u",ad=ti?w.useLayoutEffect:w.useEffect,Vr=w.createContext(null);function Ai(e,t){e.indexOf(t)===-1&&e.push(t)}function ni(e,t){const A=e.indexOf(t);A>-1&&e.splice(A,1)}const Et=(e,t,A)=>A>t?t:A<e?e:A;function _o(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let jA=()=>{},It=()=>{};process.env.NODE_ENV!=="production"&&(jA=(e,t,A)=>{!e&&typeof console<"u"&&console.warn(_o(t,A))},It=(e,t,A)=>{if(!e)throw new Error(_o(t,A))});const Qt={},ud=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function ld(e){return typeof e=="object"&&e!==null}const cd=e=>/^0[^.\s]+$/u.test(e);function ri(e){let t;return()=>(t===void 0&&(t=e()),t)}const We=e=>e,Pm=(e,t)=>A=>t(e(A)),vn=(...e)=>e.reduce(Pm),un=(e,t,A)=>{const n=t-e;return n===0?1:(A-e)/n};class oi{constructor(){this.subscriptions=[]}add(t){return Ai(this.subscriptions,t),()=>ni(this.subscriptions,t)}notify(t,A,n){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,A,n);else for(let o=0;o<r;o++){const s=this.subscriptions[o];s&&s(t,A,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const _e=e=>e*1e3,Ue=e=>e/1e3;function gd(e,t){return t?e*(1e3/t):0}const _a=new Set;function si(e,t,A){e||_a.has(t)||(console.warn(_o(t,A)),_a.add(t))}const dd=(e,t,A)=>(((1-3*A+3*t)*e+(3*A-6*t))*e+3*t)*e,Nm=1e-7,Mm=12;function Tm(e,t,A,n,r){let o,s,i=0;do s=t+(A-t)/2,o=dd(s,n,r)-e,o>0?A=s:t=s;while(Math.abs(o)>Nm&&++i<Mm);return s}function wn(e,t,A,n){if(e===t&&A===n)return We;const r=o=>Tm(o,0,1,e,A);return o=>o===0||o===1?o:dd(r(o),t,n)}const Cd=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,fd=e=>t=>1-e(1-t),Bd=wn(.33,1.53,.69,.99),ii=fd(Bd),Ed=Cd(ii),Id=e=>(e*=2)<1?.5*ii(e):.5*(2-Math.pow(2,-10*(e-1))),ai=e=>1-Math.sin(Math.acos(e)),Qd=fd(ai),hd=Cd(ai),jm=wn(.42,0,1,1),km=wn(0,0,.58,1),md=wn(.42,0,.58,1),Rm=e=>Array.isArray(e)&&typeof e[0]!="number",pd=e=>Array.isArray(e)&&typeof e[0]=="number",$a={linear:We,easeIn:jm,easeInOut:md,easeOut:km,circIn:ai,circInOut:hd,circOut:Qd,backIn:ii,backInOut:Ed,backOut:Bd,anticipate:Id},Lm=e=>typeof e=="string",eu=e=>{if(pd(e)){It(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,A,n,r]=e;return wn(t,A,n,r)}else if(Lm(e))return It($a[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),$a[e];return e},Gn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Sm(e,t){let A=new Set,n=new Set,r=!1,o=!1;const s=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(u.schedule(c),e()),c(i)}const u={schedule:(c,g=!1,d=!1)=>{const E=d&&r?A:n;return g&&s.add(c),E.has(c)||E.add(c),c},cancel:c=>{n.delete(c),s.delete(c)},process:c=>{if(i=c,r){o=!0;return}r=!0,[A,n]=[n,A],A.forEach(a),A.clear(),r=!1,o&&(o=!1,u.process(c))}};return u}const Om=40;function vd(e,t){let A=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>A=!0,s=Gn.reduce((x,b)=>(x[b]=Sm(o),x),{}),{setup:i,read:a,resolveKeyframes:u,preUpdate:c,update:g,preRender:d,render:f,postRender:E}=s,B=()=>{const x=Qt.useManualTiming?r.timestamp:performance.now();A=!1,Qt.useManualTiming||(r.delta=n?1e3/60:Math.max(Math.min(x-r.timestamp,Om),1)),r.timestamp=x,r.isProcessing=!0,i.process(r),a.process(r),u.process(r),c.process(r),g.process(r),d.process(r),f.process(r),E.process(r),r.isProcessing=!1,A&&t&&(n=!1,e(B))},h=()=>{A=!0,n=!0,r.isProcessing||e(B)};return{schedule:Gn.reduce((x,b)=>{const I=s[b];return x[b]=(v,p=!1,D=!1)=>(A||h(),I.schedule(v,p,D)),x},{}),cancel:x=>{for(let b=0;b<Gn.length;b++)s[Gn[b]].cancel(x)},state:r,steps:s}}const{schedule:fe,cancel:Nt,state:ye,steps:co}=vd(typeof requestAnimationFrame<"u"?requestAnimationFrame:We,!0);let tr;function zm(){tr=void 0}const Re={now:()=>(tr===void 0&&Re.set(ye.isProcessing||Qt.useManualTiming?ye.timestamp:performance.now()),tr),set:e=>{tr=e,queueMicrotask(zm)}},wd=e=>t=>typeof t=="string"&&t.startsWith(e),ui=wd("--"),Hm=wd("var(--"),li=e=>Hm(e)?Vm.test(e.split("/*")[0].trim()):!1,Vm=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,kA={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ln={...kA,transform:e=>Et(0,1,e)},Yn={...kA,default:1},$A=e=>Math.round(e*1e5)/1e5,ci=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Gm(e){return e==null}const Ym=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,gi=(e,t)=>A=>!!(typeof A=="string"&&Ym.test(A)&&A.startsWith(e)||t&&!Gm(A)&&Object.prototype.hasOwnProperty.call(A,t)),xd=(e,t,A)=>n=>{if(typeof n!="string")return n;const[r,o,s,i]=n.match(ci);return{[e]:parseFloat(r),[t]:parseFloat(o),[A]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}},Um=e=>Et(0,255,e),go={...kA,transform:e=>Math.round(Um(e))},Xt={test:gi("rgb","red"),parse:xd("red","green","blue"),transform:({red:e,green:t,blue:A,alpha:n=1})=>"rgba("+go.transform(e)+", "+go.transform(t)+", "+go.transform(A)+", "+$A(ln.transform(n))+")"};function Wm(e){let t="",A="",n="",r="";return e.length>5?(t=e.substring(1,3),A=e.substring(3,5),n=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),A=e.substring(2,3),n=e.substring(3,4),r=e.substring(4,5),t+=t,A+=A,n+=n,r+=r),{red:parseInt(t,16),green:parseInt(A,16),blue:parseInt(n,16),alpha:r?parseInt(r,16)/255:1}}const $o={test:gi("#"),parse:Wm,transform:Xt.transform},xn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),bt=xn("deg"),it=xn("%"),ee=xn("px"),Xm=xn("vh"),Zm=xn("vw"),tu={...it,parse:e=>it.parse(e)/100,transform:e=>it.transform(e*100)},CA={test:gi("hsl","hue"),parse:xd("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:A,alpha:n=1})=>"hsla("+Math.round(e)+", "+it.transform($A(t))+", "+it.transform($A(A))+", "+$A(ln.transform(n))+")"},we={test:e=>Xt.test(e)||$o.test(e)||CA.test(e),parse:e=>Xt.test(e)?Xt.parse(e):CA.test(e)?CA.parse(e):$o.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Xt.transform(e):CA.transform(e),getAnimatableNone:e=>{const t=we.parse(e);return t.alpha=0,we.transform(t)}},qm=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Km(e){var t,A;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ci))==null?void 0:t.length)||0)+(((A=e.match(qm))==null?void 0:A.length)||0)>0}const bd="number",Dd="color",Jm="var",_m="var(",Au="${}",$m=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function cn(e){const t=e.toString(),A=[],n={color:[],number:[],var:[]},r=[];let o=0;const i=t.replace($m,a=>(we.test(a)?(n.color.push(o),r.push(Dd),A.push(we.parse(a))):a.startsWith(_m)?(n.var.push(o),r.push(Jm),A.push(a)):(n.number.push(o),r.push(bd),A.push(parseFloat(a))),++o,Au)).split(Au);return{values:A,split:i,indexes:n,types:r}}function yd(e){return cn(e).values}function Fd(e){const{split:t,types:A}=cn(e),n=t.length;return r=>{let o="";for(let s=0;s<n;s++)if(o+=t[s],r[s]!==void 0){const i=A[s];i===bd?o+=$A(r[s]):i===Dd?o+=we.transform(r[s]):o+=r[s]}return o}}const ep=e=>typeof e=="number"?0:we.test(e)?we.getAnimatableNone(e):e;function tp(e){const t=yd(e);return Fd(e)(t.map(ep))}const Mt={test:Km,parse:yd,createTransformer:Fd,getAnimatableNone:tp};function Co(e,t,A){return A<0&&(A+=1),A>1&&(A-=1),A<1/6?e+(t-e)*6*A:A<1/2?t:A<2/3?e+(t-e)*(2/3-A)*6:e}function Ap({hue:e,saturation:t,lightness:A,alpha:n}){e/=360,t/=100,A/=100;let r=0,o=0,s=0;if(!t)r=o=s=A;else{const i=A<.5?A*(1+t):A+t-A*t,a=2*A-i;r=Co(a,i,e+1/3),o=Co(a,i,e),s=Co(a,i,e-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:n}}function Cr(e,t){return A=>A>0?t:e}const Ie=(e,t,A)=>e+(t-e)*A,fo=(e,t,A)=>{const n=e*e,r=A*(t*t-n)+n;return r<0?0:Math.sqrt(r)},np=[$o,Xt,CA],rp=e=>np.find(t=>t.test(e));function nu(e){const t=rp(e);if(jA(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let A=t.parse(e);return t===CA&&(A=Ap(A)),A}const ru=(e,t)=>{const A=nu(e),n=nu(t);if(!A||!n)return Cr(e,t);const r={...A};return o=>(r.red=fo(A.red,n.red,o),r.green=fo(A.green,n.green,o),r.blue=fo(A.blue,n.blue,o),r.alpha=Ie(A.alpha,n.alpha,o),Xt.transform(r))},es=new Set(["none","hidden"]);function op(e,t){return es.has(e)?A=>A<=0?e:t:A=>A>=1?t:e}function sp(e,t){return A=>Ie(e,t,A)}function di(e){return typeof e=="number"?sp:typeof e=="string"?li(e)?Cr:we.test(e)?ru:up:Array.isArray(e)?Pd:typeof e=="object"?we.test(e)?ru:ip:Cr}function Pd(e,t){const A=[...e],n=A.length,r=e.map((o,s)=>di(o)(o,t[s]));return o=>{for(let s=0;s<n;s++)A[s]=r[s](o);return A}}function ip(e,t){const A={...e,...t},n={};for(const r in A)e[r]!==void 0&&t[r]!==void 0&&(n[r]=di(e[r])(e[r],t[r]));return r=>{for(const o in n)A[o]=n[o](r);return A}}function ap(e,t){const A=[],n={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const o=t.types[r],s=e.indexes[o][n[o]],i=e.values[s]??0;A[r]=i,n[o]++}return A}const up=(e,t)=>{const A=Mt.createTransformer(t),n=cn(e),r=cn(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?es.has(e)&&!r.values.length||es.has(t)&&!n.values.length?op(e,t):vn(Pd(ap(n,r),r.values),A):(jA(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Cr(e,t))};function Nd(e,t,A){return typeof e=="number"&&typeof t=="number"&&typeof A=="number"?Ie(e,t,A):di(e)(e,t)}const lp=e=>{const t=({timestamp:A})=>e(A);return{start:(A=!0)=>fe.update(t,A),stop:()=>Nt(t),now:()=>ye.isProcessing?ye.timestamp:Re.now()}},Md=(e,t,A=10)=>{let n="";const r=Math.max(Math.round(t/A),2);for(let o=0;o<r;o++)n+=Math.round(e(o/(r-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},fr=2e4;function Ci(e){let t=0;const A=50;let n=e.next(t);for(;!n.done&&t<fr;)t+=A,n=e.next(t);return t>=fr?1/0:t}function cp(e,t=100,A){const n=A({...e,keyframes:[0,t]}),r=Math.min(Ci(n),fr);return{type:"keyframes",ease:o=>n.next(r*o).value/t,duration:Ue(r)}}const gp=5;function Td(e,t,A){const n=Math.max(t-gp,0);return gd(A-e(n),t-n)}const Ee={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Bo=.001;function dp({duration:e=Ee.duration,bounce:t=Ee.bounce,velocity:A=Ee.velocity,mass:n=Ee.mass}){let r,o;jA(e<=_e(Ee.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=Et(Ee.minDamping,Ee.maxDamping,s),e=Et(Ee.minDuration,Ee.maxDuration,Ue(e)),s<1?(r=u=>{const c=u*s,g=c*e,d=c-A,f=ts(u,s),E=Math.exp(-g);return Bo-d/f*E},o=u=>{const g=u*s*e,d=g*A+A,f=Math.pow(s,2)*Math.pow(u,2)*e,E=Math.exp(-g),B=ts(Math.pow(u,2),s);return(-r(u)+Bo>0?-1:1)*((d-f)*E)/B}):(r=u=>{const c=Math.exp(-u*e),g=(u-A)*e+1;return-Bo+c*g},o=u=>{const c=Math.exp(-u*e),g=(A-u)*(e*e);return c*g});const i=5/e,a=fp(r,o,i);if(e=_e(e),isNaN(a))return{stiffness:Ee.stiffness,damping:Ee.damping,duration:e};{const u=Math.pow(a,2)*n;return{stiffness:u,damping:s*2*Math.sqrt(n*u),duration:e}}}const Cp=12;function fp(e,t,A){let n=A;for(let r=1;r<Cp;r++)n=n-e(n)/t(n);return n}function ts(e,t){return e*Math.sqrt(1-t*t)}const Bp=["duration","bounce"],Ep=["stiffness","damping","mass"];function ou(e,t){return t.some(A=>e[A]!==void 0)}function Ip(e){let t={velocity:Ee.velocity,stiffness:Ee.stiffness,damping:Ee.damping,mass:Ee.mass,isResolvedFromDuration:!1,...e};if(!ou(e,Ep)&&ou(e,Bp))if(e.visualDuration){const A=e.visualDuration,n=2*Math.PI/(A*1.2),r=n*n,o=2*Et(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Ee.mass,stiffness:r,damping:o}}else{const A=dp(e);t={...t,...A,mass:Ee.mass},t.isResolvedFromDuration=!0}return t}function Br(e=Ee.visualDuration,t=Ee.bounce){const A=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:r}=A;const o=A.keyframes[0],s=A.keyframes[A.keyframes.length-1],i={done:!1,value:o},{stiffness:a,damping:u,mass:c,duration:g,velocity:d,isResolvedFromDuration:f}=Ip({...A,velocity:-Ue(A.velocity||0)}),E=d||0,B=u/(2*Math.sqrt(a*c)),h=s-o,Q=Ue(Math.sqrt(a/c)),m=Math.abs(h)<5;n||(n=m?Ee.restSpeed.granular:Ee.restSpeed.default),r||(r=m?Ee.restDelta.granular:Ee.restDelta.default);let x;if(B<1){const I=ts(Q,B);x=v=>{const p=Math.exp(-B*Q*v);return s-p*((E+B*Q*h)/I*Math.sin(I*v)+h*Math.cos(I*v))}}else if(B===1)x=I=>s-Math.exp(-Q*I)*(h+(E+Q*h)*I);else{const I=Q*Math.sqrt(B*B-1);x=v=>{const p=Math.exp(-B*Q*v),D=Math.min(I*v,300);return s-p*((E+B*Q*h)*Math.sinh(D)+I*h*Math.cosh(D))/I}}const b={calculatedDuration:f&&g||null,next:I=>{const v=x(I);if(f)i.done=I>=g;else{let p=I===0?E:0;B<1&&(p=I===0?_e(E):Td(x,I,v));const D=Math.abs(p)<=n,F=Math.abs(s-v)<=r;i.done=D&&F}return i.value=i.done?s:v,i},toString:()=>{const I=Math.min(Ci(b),fr),v=Md(p=>b.next(I*p).value,I,30);return I+"ms "+v},toTransition:()=>{}};return b}Br.applyToOptions=e=>{const t=cp(e,100,Br);return e.ease=t.ease,e.duration=_e(t.duration),e.type="keyframes",e};function As({keyframes:e,velocity:t=0,power:A=.8,timeConstant:n=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:s,min:i,max:a,restDelta:u=.5,restSpeed:c}){const g=e[0],d={done:!1,value:g},f=D=>i!==void 0&&D<i||a!==void 0&&D>a,E=D=>i===void 0?a:a===void 0||Math.abs(i-D)<Math.abs(a-D)?i:a;let B=A*t;const h=g+B,Q=s===void 0?h:s(h);Q!==h&&(B=Q-g);const m=D=>-B*Math.exp(-D/n),x=D=>Q+m(D),b=D=>{const F=m(D),k=x(D);d.done=Math.abs(F)<=u,d.value=d.done?Q:k};let I,v;const p=D=>{f(d.value)&&(I=D,v=Br({keyframes:[d.value,E(d.value)],velocity:Td(x,D,d.value),damping:r,stiffness:o,restDelta:u,restSpeed:c}))};return p(0),{calculatedDuration:null,next:D=>{let F=!1;return!v&&I===void 0&&(F=!0,b(D),p(D)),I!==void 0&&D>=I?v.next(D-I):(!F&&b(D),d)}}}function Qp(e,t,A){const n=[],r=A||Qt.mix||Nd,o=e.length-1;for(let s=0;s<o;s++){let i=r(e[s],e[s+1]);if(t){const a=Array.isArray(t)?t[s]||We:t;i=vn(a,i)}n.push(i)}return n}function hp(e,t,{clamp:A=!0,ease:n,mixer:r}={}){const o=e.length;if(It(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const i=Qp(t,n,r),a=i.length,u=c=>{if(s&&c<e[0])return t[0];let g=0;if(a>1)for(;g<e.length-2&&!(c<e[g+1]);g++);const d=un(e[g],e[g+1],c);return i[g](d)};return A?c=>u(Et(e[0],e[o-1],c)):u}function mp(e,t){const A=e[e.length-1];for(let n=1;n<=t;n++){const r=un(0,t,n);e.push(Ie(A,1,r))}}function pp(e){const t=[0];return mp(t,e.length-1),t}function vp(e,t){return e.map(A=>A*t)}function wp(e,t){return e.map(()=>t||md).splice(0,e.length-1)}function fA({duration:e=300,keyframes:t,times:A,ease:n="easeInOut"}){const r=Rm(n)?n.map(eu):eu(n),o={done:!1,value:t[0]},s=vp(A&&A.length===t.length?A:pp(t),e),i=hp(s,t,{ease:Array.isArray(r)?r:wp(t,r)});return{calculatedDuration:e,next:a=>(o.value=i(a),o.done=a>=e,o)}}const xp=e=>e!==null;function fi(e,{repeat:t,repeatType:A="loop"},n,r=1){const o=e.filter(xp),i=r<0||t&&A!=="loop"&&t%2===1?0:o.length-1;return!i||n===void 0?o[i]:n}const bp={decay:As,inertia:As,tween:fA,keyframes:fA,spring:Br};function jd(e){typeof e.type=="string"&&(e.type=bp[e.type])}class Bi{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,A){return this.finished.then(t,A)}}const Dp=e=>e/100;class Ei extends Bi{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,r;const{motionValue:A}=this.options;A&&A.updatedAt!==Re.now()&&this.tick(Re.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(n=this.options).onStop)==null||r.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;jd(t);const{type:A=fA,repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:s=0}=t;let{keyframes:i}=t;const a=A||fA;process.env.NODE_ENV!=="production"&&a!==fA&&It(i.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${i}`,"spring-two-frames"),a!==fA&&typeof i[0]!="number"&&(this.mixKeyframes=vn(Dp,Nd(i[0],i[1])),i=[0,100]);const u=a({...t,keyframes:i});o==="mirror"&&(this.mirroredGenerator=a({...t,keyframes:[...i].reverse(),velocity:-s})),u.calculatedDuration===null&&(u.calculatedDuration=Ci(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=u}updateTime(t){const A=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=A}tick(t,A=!1){const{generator:n,totalDuration:r,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:i,calculatedDuration:a}=this;if(this.startTime===null)return n.next(0);const{delay:u=0,keyframes:c,repeat:g,repeatType:d,repeatDelay:f,type:E,onUpdate:B,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),A?this.currentTime=t:this.updateTime(t);const Q=this.currentTime-u*(this.playbackSpeed>=0?1:-1),m=this.playbackSpeed>=0?Q<0:Q>r;this.currentTime=Math.max(Q,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let x=this.currentTime,b=n;if(g){const D=Math.min(this.currentTime,r)/i;let F=Math.floor(D),k=D%1;!k&&D>=1&&(k=1),k===1&&F--,F=Math.min(F,g+1),!!(F%2)&&(d==="reverse"?(k=1-k,f&&(k-=f/i)):d==="mirror"&&(b=s)),x=Et(0,1,k)*i}const I=m?{done:!1,value:c[0]}:b.next(x);o&&(I.value=o(I.value));let{done:v}=I;!m&&a!==null&&(v=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const p=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&v);return p&&E!==As&&(I.value=fi(c,this.options,h,this.speed)),B&&B(I.value),p&&this.finish(),I}then(t,A){return this.finished.then(t,A)}get duration(){return Ue(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ue(t)}get time(){return Ue(this.currentTime)}set time(t){var A;t=_e(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(A=this.driver)==null||A.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Re.now());const A=this.playbackSpeed!==t;this.playbackSpeed=t,A&&(this.time=Ue(this.currentTime))}play(){var r,o;if(this.isStopped)return;const{driver:t=lp,startTime:A}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),(o=(r=this.options).onPlay)==null||o.call(r);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=A??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Re.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,A;this.notifyFinished(),this.teardown(),this.state="finished",(A=(t=this.options).onComplete)==null||A.call(t)}cancel(){var t,A;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(A=(t=this.options).onCancel)==null||A.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var A;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(A=this.driver)==null||A.stop(),t.observe(this)}}function yp(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Zt=e=>e*180/Math.PI,ns=e=>{const t=Zt(Math.atan2(e[1],e[0]));return rs(t)},Fp={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ns,rotateZ:ns,skewX:e=>Zt(Math.atan(e[1])),skewY:e=>Zt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},rs=e=>(e=e%360,e<0&&(e+=360),e),su=ns,iu=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),au=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Pp={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:iu,scaleY:au,scale:e=>(iu(e)+au(e))/2,rotateX:e=>rs(Zt(Math.atan2(e[6],e[5]))),rotateY:e=>rs(Zt(Math.atan2(-e[2],e[0]))),rotateZ:su,rotate:su,skewX:e=>Zt(Math.atan(e[4])),skewY:e=>Zt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function os(e){return e.includes("scale")?1:0}function ss(e,t){if(!e||e==="none")return os(t);const A=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,r;if(A)n=Pp,r=A;else{const i=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=Fp,r=i}if(!r)return os(t);const o=n[t],s=r[1].split(",").map(Mp);return typeof o=="function"?o(s):s[o]}const Np=(e,t)=>{const{transform:A="none"}=getComputedStyle(e);return ss(A,t)};function Mp(e){return parseFloat(e.trim())}const RA=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],LA=new Set(RA),uu=e=>e===kA||e===ee,Tp=new Set(["x","y","z"]),jp=RA.filter(e=>!Tp.has(e));function kp(e){const t=[];return jp.forEach(A=>{const n=e.getValue(A);n!==void 0&&(t.push([A,n.get()]),n.set(A.startsWith("scale")?1:0))}),t}const Jt={width:({x:e},{paddingLeft:t="0",paddingRight:A="0"})=>e.max-e.min-parseFloat(t)-parseFloat(A),height:({y:e},{paddingTop:t="0",paddingBottom:A="0"})=>e.max-e.min-parseFloat(t)-parseFloat(A),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ss(t,"x"),y:(e,{transform:t})=>ss(t,"y")};Jt.translateX=Jt.x;Jt.translateY=Jt.y;const _t=new Set;let is=!1,as=!1,us=!1;function kd(){if(as){const e=Array.from(_t).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),A=new Map;t.forEach(n=>{const r=kp(n);r.length&&(A.set(n,r),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const r=A.get(n);r&&r.forEach(([o,s])=>{var i;(i=n.getValue(o))==null||i.set(s)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}as=!1,is=!1,_t.forEach(e=>e.complete(us)),_t.clear()}function Rd(){_t.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(as=!0)})}function Rp(){us=!0,Rd(),kd(),us=!1}class Ii{constructor(t,A,n,r,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=A,this.name=n,this.motionValue=r,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(_t.add(this),is||(is=!0,fe.read(Rd),fe.resolveKeyframes(kd))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:A,element:n,motionValue:r}=this;if(t[0]===null){const o=r==null?void 0:r.get(),s=t[t.length-1];if(o!==void 0)t[0]=o;else if(n&&A){const i=n.readValue(A,s);i!=null&&(t[0]=i)}t[0]===void 0&&(t[0]=s),r&&o===void 0&&r.set(t[0])}yp(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_t.delete(this)}cancel(){this.state==="scheduled"&&(_t.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Lp=e=>e.startsWith("--");function Sp(e,t,A){Lp(t)?e.style.setProperty(t,A):e.style[t]=A}const Op=ri(()=>window.ScrollTimeline!==void 0),zp={};function Hp(e,t){const A=ri(e);return()=>zp[t]??A()}const Ld=Hp(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),JA=([e,t,A,n])=>`cubic-bezier(${e}, ${t}, ${A}, ${n})`,lu={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:JA([0,.65,.55,1]),circOut:JA([.55,0,1,.45]),backIn:JA([.31,.01,.66,-.59]),backOut:JA([.33,1.53,.69,.99])};function Sd(e,t){if(e)return typeof e=="function"?Ld()?Md(e,t):"ease-out":pd(e)?JA(e):Array.isArray(e)?e.map(A=>Sd(A,t)||lu.easeOut):lu[e]}function Vp(e,t,A,{delay:n=0,duration:r=300,repeat:o=0,repeatType:s="loop",ease:i="easeOut",times:a}={},u=void 0){const c={[t]:A};a&&(c.offset=a);const g=Sd(i,r);Array.isArray(g)&&(c.easing=g);const d={delay:n,duration:r,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return u&&(d.pseudoElement=u),e.animate(c,d)}function Od(e){return typeof e=="function"&&"applyToOptions"in e}function Gp({type:e,...t}){return Od(e)&&Ld()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Yp extends Bi{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:A,name:n,keyframes:r,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:i,onComplete:a}=t;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=t,It(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=Gp(t);this.animation=Vp(A,n,r,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=fi(r,this.options,i,this.speed);this.updateMotionValue?this.updateMotionValue(c):Sp(A,n,c),this.animation.cancel()}a==null||a(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,A;(A=(t=this.animation).finish)==null||A.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,A;this.isPseudoElement||(A=(t=this.animation).commitStyles)==null||A.call(t)}get duration(){var A,n;const t=((n=(A=this.animation.effect)==null?void 0:A.getComputedTiming)==null?void 0:n.call(A).duration)||0;return Ue(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ue(t)}get time(){return Ue(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=_e(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:A}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Op()?(this.animation.timeline=t,We):A(this)}}const zd={anticipate:Id,backInOut:Ed,circInOut:hd};function Up(e){return e in zd}function Wp(e){typeof e.ease=="string"&&Up(e.ease)&&(e.ease=zd[e.ease])}const cu=10;class Xp extends Yp{constructor(t){Wp(t),jd(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:A,onUpdate:n,onComplete:r,element:o,...s}=this.options;if(!A)return;if(t!==void 0){A.set(t);return}const i=new Ei({...s,autoplay:!1}),a=_e(this.finishedTime??this.time);A.setWithVelocity(i.sample(a-cu).value,i.sample(a).value,cu),i.stop()}}const gu=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Mt.test(e)||e==="0")&&!e.startsWith("url("));function Zp(e){const t=e[0];if(e.length===1)return!0;for(let A=0;A<e.length;A++)if(e[A]!==t)return!0}function qp(e,t,A,n){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=gu(r,t),i=gu(o,t);return jA(s===i,`You are trying to animate ${t} from "${r}" to "${o}". "${s?o:r}" is not an animatable value.`,"value-not-animatable"),!s||!i?!1:Zp(e)||(A==="spring"||Od(A))&&n}function ls(e){e.duration=0,e.type="keyframes"}const Kp=new Set(["opacity","clipPath","filter","transform"]),Jp=ri(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function _p(e){var c;const{motionValue:t,name:A,repeatDelay:n,repeatType:r,damping:o,type:s}=e;if(!(((c=t==null?void 0:t.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:u}=t.owner.getProps();return Jp()&&A&&Kp.has(A)&&(A!=="transform"||!u)&&!a&&!n&&r!=="mirror"&&o!==0&&s!=="inertia"}const $p=40;class e1 extends Bi{constructor({autoplay:t=!0,delay:A=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s="loop",keyframes:i,name:a,motionValue:u,element:c,...g}){var E;super(),this.stop=()=>{var B,h;this._animation&&(this._animation.stop(),(B=this.stopTimeline)==null||B.call(this)),(h=this.keyframeResolver)==null||h.cancel()},this.createdAt=Re.now();const d={autoplay:t,delay:A,type:n,repeat:r,repeatDelay:o,repeatType:s,name:a,motionValue:u,element:c,...g},f=(c==null?void 0:c.KeyframeResolver)||Ii;this.keyframeResolver=new f(i,(B,h,Q)=>this.onKeyframesResolved(B,h,d,!Q),a,u,c),(E=this.keyframeResolver)==null||E.scheduleResolve()}onKeyframesResolved(t,A,n,r){this.keyframeResolver=void 0;const{name:o,type:s,velocity:i,delay:a,isHandoff:u,onUpdate:c}=n;this.resolvedAt=Re.now(),qp(t,o,s,i)||((Qt.instantAnimations||!a)&&(c==null||c(fi(t,n,A))),t[0]=t[t.length-1],ls(n),n.repeat=0);const d={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>$p?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:A,...n,keyframes:t},f=!u&&_p(d)?new Xp({...d,element:d.motionValue.owner.current}):new Ei(d);f.finished.then(()=>this.notifyFinished()).catch(We),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,A){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Rp()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const t1=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function A1(e){const t=t1.exec(e);if(!t)return[,];const[,A,n,r]=t;return[`--${A??n}`,r]}const n1=4;function Hd(e,t,A=1){It(A<=n1,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[n,r]=A1(e);if(!n)return;const o=window.getComputedStyle(t).getPropertyValue(n);if(o){const s=o.trim();return ud(s)?parseFloat(s):s}return li(r)?Hd(r,t,A+1):r}function Qi(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Vd=new Set(["width","height","top","left","right","bottom",...RA]),r1={test:e=>e==="auto",parse:e=>e},Gd=e=>t=>t.test(e),Yd=[kA,ee,it,bt,Zm,Xm,r1],du=e=>Yd.find(Gd(e));function o1(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||cd(e):!0}const s1=new Set(["brightness","contrast","saturate","opacity"]);function i1(e){const[t,A]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=A.match(ci)||[];if(!n)return e;const r=A.replace(n,"");let o=s1.has(t)?1:0;return n!==A&&(o*=100),t+"("+o+r+")"}const a1=/\b([a-z-]*)\(.*?\)/gu,cs={...Mt,getAnimatableNone:e=>{const t=e.match(a1);return t?t.map(i1).join(" "):e}},Cu={...kA,transform:Math.round},u1={rotate:bt,rotateX:bt,rotateY:bt,rotateZ:bt,scale:Yn,scaleX:Yn,scaleY:Yn,scaleZ:Yn,skew:bt,skewX:bt,skewY:bt,distance:ee,translateX:ee,translateY:ee,translateZ:ee,x:ee,y:ee,z:ee,perspective:ee,transformPerspective:ee,opacity:ln,originX:tu,originY:tu,originZ:ee},hi={borderWidth:ee,borderTopWidth:ee,borderRightWidth:ee,borderBottomWidth:ee,borderLeftWidth:ee,borderRadius:ee,radius:ee,borderTopLeftRadius:ee,borderTopRightRadius:ee,borderBottomRightRadius:ee,borderBottomLeftRadius:ee,width:ee,maxWidth:ee,height:ee,maxHeight:ee,top:ee,right:ee,bottom:ee,left:ee,padding:ee,paddingTop:ee,paddingRight:ee,paddingBottom:ee,paddingLeft:ee,margin:ee,marginTop:ee,marginRight:ee,marginBottom:ee,marginLeft:ee,backgroundPositionX:ee,backgroundPositionY:ee,...u1,zIndex:Cu,fillOpacity:ln,strokeOpacity:ln,numOctaves:Cu},l1={...hi,color:we,backgroundColor:we,outlineColor:we,fill:we,stroke:we,borderColor:we,borderTopColor:we,borderRightColor:we,borderBottomColor:we,borderLeftColor:we,filter:cs,WebkitFilter:cs},Ud=e=>l1[e];function Wd(e,t){let A=Ud(e);return A!==cs&&(A=Mt),A.getAnimatableNone?A.getAnimatableNone(t):void 0}const c1=new Set(["auto","none","0"]);function g1(e,t,A){let n=0,r;for(;n<e.length&&!r;){const o=e[n];typeof o=="string"&&!c1.has(o)&&cn(o).values.length&&(r=e[n]),n++}if(r&&A)for(const o of t)e[o]=Wd(A,r)}class d1 extends Ii{constructor(t,A,n,r,o){super(t,A,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:A,name:n}=this;if(!A||!A.current)return;super.readKeyframes();for(let a=0;a<t.length;a++){let u=t[a];if(typeof u=="string"&&(u=u.trim(),li(u))){const c=Hd(u,A.current);c!==void 0&&(t[a]=c),a===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Vd.has(n)||t.length!==2)return;const[r,o]=t,s=du(r),i=du(o);if(s!==i)if(uu(s)&&uu(i))for(let a=0;a<t.length;a++){const u=t[a];typeof u=="string"&&(t[a]=parseFloat(u))}else Jt[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:A}=this,n=[];for(let r=0;r<t.length;r++)(t[r]===null||o1(t[r]))&&n.push(r);n.length&&g1(t,n,A)}measureInitialState(){const{element:t,unresolvedKeyframes:A,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Jt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),A[0]=this.measuredOrigin;const r=A[A.length-1];r!==void 0&&t.getValue(n,r).jump(r,!1)}measureEndState(){var i;const{element:t,name:A,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const r=t.getValue(A);r&&r.jump(this.measuredOrigin,!1);const o=n.length-1,s=n[o];n[o]=Jt[A](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(i=this.removedTransforms)!=null&&i.length&&this.removedTransforms.forEach(([a,u])=>{t.getValue(a).set(u)}),this.resolveNoneKeyframes()}}function C1(e,t,A){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const r=(A==null?void 0:A[e])??n.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}const Xd=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Zd(e){return ld(e)&&"offsetHeight"in e}const fu=30,f1=e=>!isNaN(parseFloat(e));class B1{constructor(t,A={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var o;const r=Re.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=A.owner}setCurrent(t){this.current=t,this.updatedAt=Re.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=f1(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&si(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,A){this.events[t]||(this.events[t]=new oi);const n=this.events[t].add(A);return t==="change"?()=>{n(),fe.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,A){this.passiveEffect=t,this.stopPassiveEffect=A}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,A,n){this.set(A),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,A=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,A&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Re.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>fu)return 0;const A=Math.min(this.updatedAt-this.prevUpdatedAt,fu);return gd(parseFloat(this.current)-parseFloat(this.prevFrameValue),A)}start(t){return this.stop(),new Promise(A=>{this.hasAnimated=!0,this.animation=t(A),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,A;(t=this.dependents)==null||t.clear(),(A=this.events.destroy)==null||A.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yA(e,t){return new B1(e,t)}const{schedule:mi}=vd(queueMicrotask,!1),Ke={x:!1,y:!1};function qd(){return Ke.x||Ke.y}function E1(e){return e==="x"||e==="y"?Ke[e]?null:(Ke[e]=!0,()=>{Ke[e]=!1}):Ke.x||Ke.y?null:(Ke.x=Ke.y=!0,()=>{Ke.x=Ke.y=!1})}function Kd(e,t){const A=C1(e),n=new AbortController,r={passive:!0,...t,signal:n.signal};return[A,r,()=>n.abort()]}function Bu(e){return!(e.pointerType==="touch"||qd())}function I1(e,t,A={}){const[n,r,o]=Kd(e,A),s=i=>{if(!Bu(i))return;const{target:a}=i,u=t(a,i);if(typeof u!="function"||!a)return;const c=g=>{Bu(g)&&(u(g),a.removeEventListener("pointerleave",c))};a.addEventListener("pointerleave",c,r)};return n.forEach(i=>{i.addEventListener("pointerenter",s,r)}),o}const Jd=(e,t)=>t?e===t?!0:Jd(e,t.parentElement):!1,pi=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Q1=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function h1(e){return Q1.has(e.tagName)||e.tabIndex!==-1}const Ar=new WeakSet;function Eu(e){return t=>{t.key==="Enter"&&e(t)}}function Eo(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const m1=(e,t)=>{const A=e.currentTarget;if(!A)return;const n=Eu(()=>{if(Ar.has(A))return;Eo(A,"down");const r=Eu(()=>{Eo(A,"up")}),o=()=>Eo(A,"cancel");A.addEventListener("keyup",r,t),A.addEventListener("blur",o,t)});A.addEventListener("keydown",n,t),A.addEventListener("blur",()=>A.removeEventListener("keydown",n),t)};function Iu(e){return pi(e)&&!qd()}function p1(e,t,A={}){const[n,r,o]=Kd(e,A),s=i=>{const a=i.currentTarget;if(!Iu(i))return;Ar.add(a);const u=t(a,i),c=(f,E)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",d),Ar.has(a)&&Ar.delete(a),Iu(f)&&typeof u=="function"&&u(f,{success:E})},g=f=>{c(f,a===window||a===document||A.useGlobalTarget||Jd(a,f.target))},d=f=>{c(f,!1)};window.addEventListener("pointerup",g,r),window.addEventListener("pointercancel",d,r)};return n.forEach(i=>{(A.useGlobalTarget?window:i).addEventListener("pointerdown",s,r),Zd(i)&&(i.addEventListener("focus",u=>m1(u,r)),!h1(i)&&!i.hasAttribute("tabindex")&&(i.tabIndex=0))}),o}function _d(e){return ld(e)&&"ownerSVGElement"in e}function v1(e){return _d(e)&&e.tagName==="svg"}const Fe=e=>!!(e&&e.getVelocity),w1=[...Yd,we,Mt],x1=e=>w1.find(Gd(e)),vi=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Qu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function b1(...e){return t=>{let A=!1;const n=e.map(r=>{const o=Qu(r,t);return!A&&typeof o=="function"&&(A=!0),o});if(A)return()=>{for(let r=0;r<n.length;r++){const o=n[r];typeof o=="function"?o():Qu(e[r],null)}}}}function D1(...e){return C.useCallback(b1(...e),e)}class y1 extends C.Component{getSnapshotBeforeUpdate(t){const A=this.props.childRef.current;if(A&&t.isPresent&&!this.props.isPresent){const n=A.offsetParent,r=Zd(n)&&n.offsetWidth||0,o=this.props.sizeRef.current;o.height=A.offsetHeight||0,o.width=A.offsetWidth||0,o.top=A.offsetTop,o.left=A.offsetLeft,o.right=r-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function F1({children:e,isPresent:t,anchorX:A,root:n}){const r=w.useId(),o=w.useRef(null),s=w.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:i}=w.useContext(vi),a=D1(o,e==null?void 0:e.ref);return w.useInsertionEffect(()=>{const{width:u,height:c,top:g,left:d,right:f}=s.current;if(t||!o.current||!u||!c)return;const E=A==="left"?`left: ${d}`:`right: ${f}`;o.current.dataset.motionPopId=r;const B=document.createElement("style");i&&(B.nonce=i);const h=n??document.head;return h.appendChild(B),B.sheet&&B.sheet.insertRule(`
|
|
52
52
|
[data-motion-pop-id="${r}"] {
|
|
53
53
|
position: absolute !important;
|
|
54
54
|
width: ${u}px !important;
|
package/dist/index.es.js
CHANGED
|
@@ -12098,7 +12098,7 @@ const dd = ({
|
|
|
12098
12098
|
type: "button",
|
|
12099
12099
|
onClick: () => h((T) => !T),
|
|
12100
12100
|
className: ee(
|
|
12101
|
-
"flex items-center justify-between gap-2 w-full px-3 py-2.5 rounded-
|
|
12101
|
+
"flex items-center justify-between gap-2 w-full px-3 py-2.5 rounded-lg border border-input bg-background text-sm text-left transition-colors hover:bg-secondary/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
12102
12102
|
),
|
|
12103
12103
|
"aria-expanded": B,
|
|
12104
12104
|
children: [
|