@1urso/generic-editor 0.1.12 → 0.1.14

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.
@@ -45,7 +45,7 @@ If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHid
45
45
  For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return t.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Xn=`DialogDescriptionWarning`,Zn=({contentRef:e,descriptionId:n})=>{let r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Jn(Xn).contentName}}.`;return t.useEffect(()=>{let t=e.current?.getAttribute(`aria-describedby`);n&&t&&(document.getElementById(n)||console.warn(r))},[r,e,n]),null},Qn=Cn,$n=Tn,er=kn,tr=jn,nr=Fn,rr=Bn,ir=Hn,ar=Wn;function or(e){let n=t.useRef({value:e,previous:e});return t.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}function sr(e){let[n,r]=t.useState(void 0);return L(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let n=t[0],i,a;if(`borderBoxSize`in n){let e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else r(void 0)},[e]),n}var cr=[`top`,`right`,`bottom`,`left`],lr=Math.min,ur=Math.max,dr=Math.round,fr=Math.floor,pr=e=>({x:e,y:e}),mr={left:`right`,right:`left`,bottom:`top`,top:`bottom`},hr={start:`end`,end:`start`};function gr(e,t,n){return ur(e,lr(t,n))}function _r(e,t){return typeof e==`function`?e(t):e}function vr(e){return e.split(`-`)[0]}function yr(e){return e.split(`-`)[1]}function br(e){return e===`x`?`y`:`x`}function xr(e){return e===`y`?`height`:`width`}var Sr=new Set([`top`,`bottom`]);function Cr(e){return Sr.has(vr(e))?`y`:`x`}function wr(e){return br(Cr(e))}function Tr(e,t,n){n===void 0&&(n=!1);let r=yr(e),i=wr(e),a=xr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Pr(o)),[o,Pr(o)]}function Er(e){let t=Pr(e);return[Dr(e),t,Dr(t)]}function Dr(e){return e.replace(/start|end/g,e=>hr[e])}var Or=[`left`,`right`],kr=[`right`,`left`],Ar=[`top`,`bottom`],jr=[`bottom`,`top`];function Mr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?kr:Or:t?Or:kr;case`left`:case`right`:return t?Ar:jr;default:return[]}}function Nr(e,t,n,r){let i=yr(e),a=Mr(vr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Dr)))),a}function Pr(e){return e.replace(/left|right|bottom|top/g,e=>mr[e])}function Fr(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ir(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Fr(e)}function Lr(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Rr(e,t,n){let{reference:r,floating:i}=e,a=Cr(t),o=wr(t),s=xr(o),c=vr(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(yr(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var zr=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Rr(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=Rr(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function Br(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=_r(t,e),p=Ir(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Lr(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Lr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Vr=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=_r(e,t)||{};if(l==null)return{};let d=Ir(u),f={x:n,y:r},p=wr(i),m=xr(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=lr(d[_],T),D=lr(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=gr(O,A,k),M=!c.arrow&&yr(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Hr=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=_r(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=vr(r),_=Cr(o),v=vr(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Pr(o)]:Er(o)),x=p!==`none`;!d&&x&&b.push(...Nr(o,m,p,y));let S=[o,...b],C=await Br(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Tr(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Cr(t))||T.every(e=>Cr(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Cr(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ur(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Wr(e){return cr.some(t=>e[t]>=0)}var Gr=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=_r(e,t);switch(r){case`referenceHidden`:{let e=Ur(await Br(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Wr(e)}}}case`escaped`:{let e=Ur(await Br(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Wr(e)}}}default:return{}}}}},Kr=new Set([`left`,`top`]);async function qr(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=vr(n),s=yr(n),c=Cr(n)===`y`,l=Kr.has(o)?-1:1,u=a&&c?-1:1,d=_r(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Jr=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await qr(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Yr=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=_r(e,t),l={x:n,y:r},u=await Br(t,c),d=Cr(vr(i)),f=br(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=gr(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=gr(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},Xr=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=_r(e,t),u={x:n,y:r},d=Cr(i),f=br(d),p=u[f],m=u[d],h=_r(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Kr.has(vr(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Zr=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=_r(e,t),u=await Br(t,l),d=vr(i),f=yr(i),p=Cr(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=lr(h-u[g],v),x=lr(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=ur(u.left,0),t=ur(u.right,0),n=ur(u.top,0),r=ur(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:ur(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:ur(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<`u`}function $r(e){return ni(e)?(e.nodeName||``).toLowerCase():`#document`}function ei(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ti(e){return((ni(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ni(e){return Qr()?e instanceof Node||e instanceof ei(e).Node:!1}function ri(e){return Qr()?e instanceof Element||e instanceof ei(e).Element:!1}function ii(e){return Qr()?e instanceof HTMLElement||e instanceof ei(e).HTMLElement:!1}function ai(e){return!Qr()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ei(e).ShadowRoot}var oi=new Set([`inline`,`contents`]);function si(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=bi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!oi.has(i)}var ci=new Set([`table`,`td`,`th`]);function li(e){return ci.has($r(e))}var ui=[`:popover-open`,`:modal`];function di(e){return ui.some(t=>{try{return e.matches(t)}catch{return!1}})}var fi=[`transform`,`translate`,`scale`,`rotate`,`perspective`],pi=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],mi=[`paint`,`layout`,`strict`,`content`];function hi(e){let t=_i(),n=ri(e)?bi(e):e;return fi.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||pi.some(e=>(n.willChange||``).includes(e))||mi.some(e=>(n.contain||``).includes(e))}function gi(e){let t=Si(e);for(;ii(t)&&!yi(t);){if(hi(t))return t;if(di(t))return null;t=Si(t)}return null}function _i(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var vi=new Set([`html`,`body`,`#document`]);function yi(e){return vi.has($r(e))}function bi(e){return ei(e).getComputedStyle(e)}function xi(e){return ri(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Si(e){if($r(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ai(e)&&e.host||ti(e);return ai(t)?t.host:t}function Ci(e){let t=Si(e);return yi(t)?e.ownerDocument?e.ownerDocument.body:e.body:ii(t)&&si(t)?t:Ci(t)}function wi(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ci(e),i=r===e.ownerDocument?.body,a=ei(r);if(i){let e=Ti(a);return t.concat(a,a.visualViewport||[],si(r)?r:[],e&&n?wi(e):[])}return t.concat(r,wi(r,[],n))}function Ti(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ei(e){let t=bi(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ii(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=dr(n)!==a||dr(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Di(e){return ri(e)?e:e.contextElement}function Oi(e){let t=Di(e);if(!ii(t))return pr(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ei(t),o=(a?dr(n.width):n.width)/r,s=(a?dr(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ki=pr(0);function Ai(e){let t=ei(e);return!_i()||!t.visualViewport?ki:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ji(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ei(e)?!1:t}function Mi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Di(e),o=pr(1);t&&(r?ri(r)&&(o=Oi(r)):o=Oi(e));let s=ji(a,n,r)?Ai(a):pr(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=ei(a),t=r&&ri(r)?ei(r):r,n=e,i=Ti(n);for(;i&&r&&t!==n;){let e=Oi(i),t=i.getBoundingClientRect(),r=bi(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ei(i),i=Ti(n)}}return Lr({width:u,height:d,x:c,y:l})}function Ni(e,t){let n=xi(e).scrollLeft;return t?t.left+n:Mi(ti(e)).left+n}function Pi(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ni(e,n),y:n.top+t.scrollTop}}function Fi(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ti(r),s=t?di(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=pr(1),u=pr(0),d=ii(r);if((d||!d&&!a)&&(($r(r)!==`body`||si(o))&&(c=xi(r)),ii(r))){let e=Mi(r);l=Oi(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Pi(o,c):pr(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ii(e){return Array.from(e.getClientRects())}function Li(e){let t=ti(e),n=xi(e),r=e.ownerDocument.body,i=ur(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ur(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ni(e),s=-n.scrollTop;return bi(r).direction===`rtl`&&(o+=ur(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ri=25;function zi(e,t){let n=ei(e),r=ti(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=_i();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ni(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Ri&&(a-=o)}else l<=Ri&&(a+=l);return{width:a,height:o,x:s,y:c}}var Bi=new Set([`absolute`,`fixed`]);function Vi(e,t){let n=Mi(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ii(e)?Oi(e):pr(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Hi(e,t,n){let r;if(t===`viewport`)r=zi(e,n);else if(t===`document`)r=Li(ti(e));else if(ri(t))r=Vi(t,n);else{let n=Ai(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Lr(r)}function Ui(e,t){let n=Si(e);return n===t||!ri(n)||yi(n)?!1:bi(n).position===`fixed`||Ui(n,t)}function Wi(e,t){let n=t.get(e);if(n)return n;let r=wi(e,[],!1).filter(e=>ri(e)&&$r(e)!==`body`),i=null,a=bi(e).position===`fixed`,o=a?Si(e):e;for(;ri(o)&&!yi(o);){let t=bi(o),n=hi(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Bi.has(i.position)||si(o)&&!n&&Ui(e,o))?r=r.filter(e=>e!==o):i=t,o=Si(o)}return t.set(e,r),r}function Gi(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?di(t)?[]:Wi(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Hi(t,n,i);return e.top=ur(r.top,e.top),e.right=lr(r.right,e.right),e.bottom=lr(r.bottom,e.bottom),e.left=ur(r.left,e.left),e},Hi(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Ki(e){let{width:t,height:n}=Ei(e);return{width:t,height:n}}function qi(e,t,n){let r=ii(t),i=ti(t),a=n===`fixed`,o=Mi(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=pr(0);function l(){c.x=Ni(i)}if(r||!r&&!a)if(($r(t)!==`body`||si(i))&&(s=xi(t)),r){let e=Mi(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Pi(i,s):pr(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ji(e){return bi(e).position===`static`}function Yi(e,t){if(!ii(e)||bi(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ti(e)===n&&(n=n.ownerDocument.body),n}function Xi(e,t){let n=ei(e);if(di(e))return n;if(!ii(e)){let t=Si(e);for(;t&&!yi(t);){if(ri(t)&&!Ji(t))return t;t=Si(t)}return n}let r=Yi(e,t);for(;r&&li(r)&&Ji(r);)r=Yi(r,t);return r&&yi(r)&&Ji(r)&&!hi(r)?n:r||gi(e)||n}var Zi=async function(e){let t=this.getOffsetParent||Xi,n=this.getDimensions,r=await n(e.floating);return{reference:qi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Qi(e){return bi(e).direction===`rtl`}var $i={convertOffsetParentRelativeRectToViewportRelativeRect:Fi,getDocumentElement:ti,getClippingRect:Gi,getOffsetParent:Xi,getElementRects:Zi,getClientRects:Ii,getDimensions:Ki,getScale:Oi,isElement:ri,isRTL:Qi};function ea(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ta(e,t){let n=null,r,i=ti(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=fr(d),h=fr(i.clientWidth-(u+f)),g=fr(i.clientHeight-(d+p)),_=fr(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ur(0,lr(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!ea(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function na(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Di(e),u=i||a?[...l?wi(l):[],...wi(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?ta(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?Mi(e):null;c&&g();function g(){let t=Mi(e);h&&!ea(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ra=Jr,ia=Yr,aa=Hr,oa=Zr,sa=Gr,ca=Vr,la=Xr,ua=(e,t,n)=>{let r=new Map,i={platform:$i,...n},a={...i.platform,_c:r};return zr(e,t,{...i,platform:a})},da=typeof document<`u`?t.useLayoutEffect:function(){};function fa(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!fa(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!fa(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function pa(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ma(e,t){let n=pa(e);return Math.round(t*n)/n}function ha(e){let n=t.useRef(e);return da(()=>{n.current=e}),n}function ga(e){e===void 0&&(e={});let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o,elements:{reference:s,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=t.useState({x:0,y:0,strategy:i,placement:r,middlewareData:{},isPositioned:!1}),[m,h]=t.useState(a);fa(m,a)||h(a);let[g,_]=t.useState(null),[v,y]=t.useState(null),b=t.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=t.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=s||g,C=c||v,w=t.useRef(null),T=t.useRef(null),E=t.useRef(f),D=u!=null,O=ha(u),k=ha(o),A=ha(d),j=t.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:r,strategy:i,middleware:m};k.current&&(e.platform=k.current),ua(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!fa(E.current,t)&&(E.current=t,n.flushSync(()=>{p(t)}))})},[m,r,i,k,A]);da(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=t.useRef(!1);da(()=>(M.current=!0,()=>{M.current=!1}),[]),da(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=t.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),ee=t.useMemo(()=>({reference:S,floating:C}),[S,C]),P=t.useMemo(()=>{let e={position:i,left:0,top:0};if(!ee.floating)return e;let t=ma(ee.floating,f.x),n=ma(ee.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+n+`px)`,...pa(ee.floating)>=1.5&&{willChange:`transform`}}:{position:i,left:t,top:n}},[i,l,ee.floating,f.x,f.y]);return t.useMemo(()=>({...f,update:j,refs:N,elements:ee,floatingStyles:P}),[f,j,N,ee,P])}var _a=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ca({element:r.current,padding:i}).fn(n):r?ca({element:r,padding:i}).fn(n):{}}}},va=(e,t)=>({...ra(e),options:[e,t]}),ya=(e,t)=>({...ia(e),options:[e,t]}),ba=(e,t)=>({...la(e),options:[e,t]}),xa=(e,t)=>({...aa(e),options:[e,t]}),Sa=(e,t)=>({...oa(e),options:[e,t]}),Ca=(e,t)=>({...sa(e),options:[e,t]}),wa=(e,t)=>({..._a(e),options:[e,t]}),Ta=`Arrow`,Ea=t.forwardRef((e,t)=>{let{children:n,width:i=10,height:a=5,...o}=e;return(0,r.jsx)(O.svg,{...o,ref:t,width:i,height:a,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,r.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Ea.displayName=Ta;var Da=Ea,Oa=`Popper`,[ka,Aa]=P(Oa),[ja,Ma]=ka(Oa),Na=e=>{let{__scopePopper:n,children:i}=e,[a,o]=t.useState(null);return(0,r.jsx)(ja,{scope:n,anchor:a,onAnchorChange:o,children:i})};Na.displayName=Oa;var Pa=`PopperAnchor`,Fa=t.forwardRef((e,n)=>{let{__scopePopper:i,virtualRef:a,...o}=e,s=Ma(Pa,i),c=t.useRef(null),l=v(n,c),u=t.useRef(null);return t.useEffect(()=>{let e=u.current;u.current=a?.current||c.current,e!==u.current&&s.onAnchorChange(u.current)}),a?null:(0,r.jsx)(O.div,{...o,ref:l})});Fa.displayName=Pa;var Ia=`PopperContent`,[La,Ra]=ka(Ia),za=t.forwardRef((e,n)=>{let{__scopePopper:i,side:a=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,y=Ma(Ia,i),[b,x]=t.useState(null),S=v(n,e=>x(e)),[C,w]=t.useState(null),T=sr(C),E=T?.width??0,D=T?.height??0,k=a+(s===`center`?``:`-`+s),A=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},j=Array.isArray(d)?d:[d],M=j.length>0,N={padding:A,boundary:j.filter(Ua),altBoundary:M},{refs:ee,floatingStyles:P,placement:te,isPositioned:F,middlewareData:I}=ga({strategy:`fixed`,placement:k,whileElementsMounted:(...e)=>na(...e,{animationFrame:h===`always`}),elements:{reference:y.anchor},middleware:[va({mainAxis:o+D,alignmentAxis:c}),u&&ya({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?ba():void 0,...N}),u&&xa({...N}),Sa({...N,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),C&&wa({element:C,padding:l}),Wa({arrowWidth:E,arrowHeight:D}),m&&Ca({strategy:`referenceHidden`,...N})]}),[ne,re]=Ga(te),ie=z(g);L(()=>{F&&ie?.()},[F,ie]);let ae=I.arrow?.x,oe=I.arrow?.y,R=I.arrow?.centerOffset!==0,[se,ce]=t.useState();return L(()=>{b&&ce(window.getComputedStyle(b).zIndex)},[b]),(0,r.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...P,transform:F?P.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,r.jsx)(La,{scope:i,placedSide:ne,onArrowChange:w,arrowX:ae,arrowY:oe,shouldHideArrow:R,children:(0,r.jsx)(O.div,{"data-side":ne,"data-align":re,..._,ref:S,style:{..._.style,animation:F?void 0:`none`}})})})});za.displayName=Ia;var Ba=`PopperArrow`,Va={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ha=t.forwardRef(function(e,t){let{__scopePopper:n,...i}=e,a=Ra(Ba,n),o=Va[a.placedSide];return(0,r.jsx)(`span`,{ref:a.onArrowChange,style:{position:`absolute`,left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[a.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[a.placedSide],visibility:a.shouldHideArrow?`hidden`:void 0},children:(0,r.jsx)(Da,{...i,ref:t,style:{...i.style,display:`block`}})})});Ha.displayName=Ba;function Ua(e){return e!==null}var Wa=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Ga(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Ga(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Ka=Na,qa=Fa,Ja=za,Ya=Ha,Xa=`rovingFocusGroup.onEntryFocus`,Za={bubbles:!1,cancelable:!0},Qa=`RovingFocusGroup`,[$a,eo,to]=F(Qa),[no,ro]=P(Qa,[to]),[io,ao]=no(Qa),oo=t.forwardRef((e,t)=>(0,r.jsx)($a.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,r.jsx)($a.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,r.jsx)(so,{...e,ref:t})})}));oo.displayName=Qa;var so=t.forwardRef((e,n)=>{let{__scopeRovingFocusGroup:i,orientation:a,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=t.useRef(null),h=v(n,m),g=he(s),[_,y]=re({prop:c,defaultProp:l??null,onChange:u,caller:Qa}),[b,x]=t.useState(!1),S=z(d),C=eo(i),w=t.useRef(!1),[T,E]=t.useState(0);return t.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(Xa,S),()=>e.removeEventListener(Xa,S)},[S]),(0,r.jsx)(io,{scope:i,orientation:a,dir:g,loop:o,currentTabStopId:_,onItemFocus:t.useCallback(e=>y(e),[y]),onItemShiftTab:t.useCallback(()=>x(!0),[]),onFocusableItemAdd:t.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>E(e=>e-1),[]),children:(0,r.jsx)(O.div,{tabIndex:b||T===0?-1:0,"data-orientation":a,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:I(e.onMouseDown,()=>{w.current=!0}),onFocus:I(e.onFocus,e=>{let t=!w.current;if(e.target===e.currentTarget&&t&&!b){let t=new CustomEvent(Xa,Za);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=C().filter(e=>e.focusable);mo([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}w.current=!1}),onBlur:I(e.onBlur,()=>x(!1))})})}),co=`RovingFocusGroupItem`,lo=t.forwardRef((e,n)=>{let{__scopeRovingFocusGroup:i,focusable:a=!0,active:o=!1,tabStopId:s,children:c,...l}=e,u=fe(),d=s||u,f=ao(co,i),p=f.currentTabStopId===d,m=eo(i),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f;return t.useEffect(()=>{if(a)return h(),()=>g()},[a,h,g]),(0,r.jsx)($a.ItemSlot,{scope:i,id:d,focusable:a,active:o,children:(0,r.jsx)(O.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:n,onMouseDown:I(e.onMouseDown,e=>{a?f.onItemFocus(d):e.preventDefault()}),onFocus:I(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:I(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=po(e,f.orientation,f.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?ho(n,r+1):n.slice(r+1)}setTimeout(()=>mo(n))}}),children:typeof c==`function`?c({isCurrentTabStop:p,hasTabStop:_!=null}):c})})});lo.displayName=co;var uo={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function fo(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function po(e,t,n){let r=fo(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return uo[r]}function mo(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ho(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var go=oo,_o=lo,vo=[`Enter`,` `],yo=[`ArrowDown`,`PageUp`,`Home`],bo=[`ArrowUp`,`PageDown`,`End`],xo=[...yo,...bo],So={ltr:[...vo,`ArrowRight`],rtl:[...vo,`ArrowLeft`]},Co={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},wo=`Menu`,[To,Eo,Do]=F(wo),[Oo,ko]=P(wo,[Do,Aa,ro]),Ao=Aa(),jo=ro(),[Mo,No]=Oo(wo),[Po,Fo]=Oo(wo),Io=e=>{let{__scopeMenu:n,open:i=!1,children:a,dir:o,onOpenChange:s,modal:c=!0}=e,l=Ao(n),[u,d]=t.useState(null),f=t.useRef(!1),p=z(s),m=he(o);return t.useEffect(()=>{let e=()=>{f.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>f.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,r.jsx)(Ka,{...l,children:(0,r.jsx)(Mo,{scope:n,open:i,onOpenChange:p,content:u,onContentChange:d,children:(0,r.jsx)(Po,{scope:n,onClose:t.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:c,children:a})})})};Io.displayName=wo;var Lo=`MenuAnchor`,Ro=t.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e,a=Ao(n);return(0,r.jsx)(qa,{...a,...i,ref:t})});Ro.displayName=Lo;var zo=`MenuPortal`,[Bo,Vo]=Oo(zo,{forceMount:void 0}),Ho=e=>{let{__scopeMenu:t,forceMount:n,children:i,container:a}=e,o=No(zo,t);return(0,r.jsx)(Bo,{scope:t,forceMount:n,children:(0,r.jsx)(R,{present:n||o.open,children:(0,r.jsx)(Je,{asChild:!0,container:a,children:i})})})};Ho.displayName=zo;var Uo=`MenuContent`,[Wo,Go]=Oo(Uo),Ko=t.forwardRef((e,t)=>{let n=Vo(Uo,e.__scopeMenu),{forceMount:i=n.forceMount,...a}=e,o=No(Uo,e.__scopeMenu),s=Fo(Uo,e.__scopeMenu);return(0,r.jsx)(To.Provider,{scope:e.__scopeMenu,children:(0,r.jsx)(R,{present:i||o.open,children:(0,r.jsx)(To.Slot,{scope:e.__scopeMenu,children:s.modal?(0,r.jsx)(qo,{...a,ref:t}):(0,r.jsx)(Jo,{...a,ref:t})})})})}),qo=t.forwardRef((e,n)=>{let i=No(Uo,e.__scopeMenu),a=t.useRef(null),o=v(n,a);return t.useEffect(()=>{let e=a.current;if(e)return _n(e)},[]),(0,r.jsx)(Xo,{...e,ref:o,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:I(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})}),Jo=t.forwardRef((e,t)=>{let n=No(Uo,e.__scopeMenu);return(0,r.jsx)(Xo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Yo=y(`MenuContent.ScrollLock`),Xo=t.forwardRef((e,n)=>{let{__scopeMenu:i,loop:a=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,y=No(Uo,i),b=Fo(Uo,i),x=Ao(i),S=jo(i),C=Eo(i),[w,T]=t.useState(null),E=t.useRef(null),D=v(n,E,y.onContentChange),O=t.useRef(0),k=t.useRef(``),A=t.useRef(0),j=t.useRef(null),M=t.useRef(`right`),N=t.useRef(0),ee=g?cn:t.Fragment,P=g?{as:Yo,allowPinchZoom:!0}:void 0,te=e=>{let t=k.current+e,n=C().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Ps(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){k.current=t,window.clearTimeout(O.current),t!==``&&(O.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};t.useEffect(()=>()=>window.clearTimeout(O.current),[]),Xe();let F=t.useCallback(e=>M.current===j.current?.side&&Is(e,j.current?.area),[]);return(0,r.jsx)(Wo,{scope:i,searchRef:k,onItemEnter:t.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:t.useCallback(e=>{F(e)||(E.current?.focus(),T(null))},[F]),onTriggerLeave:t.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:A,onPointerGraceIntentChange:t.useCallback(e=>{j.current=e},[]),children:(0,r.jsx)(ee,{...P,children:(0,r.jsx)(Fe,{asChild:!0,trapped:o,onMountAutoFocus:I(s,e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:(0,r.jsx)(we,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,r.jsx)(go,{asChild:!0,...S,dir:b.dir,orientation:`vertical`,loop:a,currentTabStopId:w,onCurrentTabStopIdChange:T,onEntryFocus:I(u,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,r.jsx)(Ja,{role:`menu`,"aria-orientation":`vertical`,"data-state":ks(y.open),"data-radix-menu-content":``,dir:b.dir,...x,..._,ref:D,style:{outline:`none`,..._.style},onKeyDown:I(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key));let i=E.current;if(e.target!==i||!xo.includes(e.key))return;e.preventDefault();let a=C().filter(e=>!e.disabled).map(e=>e.ref.current);bo.includes(e.key)&&a.reverse(),Ms(a)}),onBlur:I(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(O.current),k.current=``)}),onPointerMove:I(e.onPointerMove,Ls(e=>{let t=e.target,n=N.current!==e.clientX;e.currentTarget.contains(t)&&n&&(M.current=e.clientX>N.current?`right`:`left`,N.current=e.clientX)}))})})})})})})});Ko.displayName=Uo;var Zo=`MenuGroup`,Qo=t.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e;return(0,r.jsx)(O.div,{role:`group`,...i,ref:t})});Qo.displayName=Zo;var $o=`MenuLabel`,es=t.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e;return(0,r.jsx)(O.div,{...i,ref:t})});es.displayName=$o;var ts=`MenuItem`,ns=`menu.itemSelect`,rs=t.forwardRef((e,n)=>{let{disabled:i=!1,onSelect:a,...o}=e,s=t.useRef(null),c=Fo(ts,e.__scopeMenu),l=Go(ts,e.__scopeMenu),u=v(n,s),d=t.useRef(!1),f=()=>{let e=s.current;if(!i&&e){let t=new CustomEvent(ns,{bubbles:!0,cancelable:!0});e.addEventListener(ns,e=>a?.(e),{once:!0}),k(e,t),t.defaultPrevented?d.current=!1:c.onClose()}};return(0,r.jsx)(is,{...o,ref:u,disabled:i,onClick:I(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:I(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:I(e.onKeyDown,e=>{let t=l.searchRef.current!==``;i||t&&e.key===` `||vo.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});rs.displayName=ts;var is=t.forwardRef((e,n)=>{let{__scopeMenu:i,disabled:a=!1,textValue:o,...s}=e,c=Go(ts,i),l=jo(i),u=t.useRef(null),d=v(n,u),[f,p]=t.useState(!1),[m,h]=t.useState(``);return t.useEffect(()=>{let e=u.current;e&&h((e.textContent??``).trim())},[s.children]),(0,r.jsx)(To.ItemSlot,{scope:i,disabled:a,textValue:o??m,children:(0,r.jsx)(_o,{asChild:!0,...l,focusable:!a,children:(0,r.jsx)(O.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":a||void 0,"data-disabled":a?``:void 0,...s,ref:d,onPointerMove:I(e.onPointerMove,Ls(e=>{a?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:I(e.onPointerLeave,Ls(e=>c.onItemLeave(e))),onFocus:I(e.onFocus,()=>p(!0)),onBlur:I(e.onBlur,()=>p(!1))})})})}),as=`MenuCheckboxItem`,os=t.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:i,...a}=e;return(0,r.jsx)(ms,{scope:e.__scopeMenu,checked:n,children:(0,r.jsx)(rs,{role:`menuitemcheckbox`,"aria-checked":As(n)?`mixed`:n,...a,ref:t,"data-state":js(n),onSelect:I(a.onSelect,()=>i?.(As(n)?!0:!n),{checkForDefaultPrevented:!1})})})});os.displayName=as;var ss=`MenuRadioGroup`,[cs,ls]=Oo(ss,{value:void 0,onValueChange:()=>{}}),us=t.forwardRef((e,t)=>{let{value:n,onValueChange:i,...a}=e,o=z(i);return(0,r.jsx)(cs,{scope:e.__scopeMenu,value:n,onValueChange:o,children:(0,r.jsx)(Qo,{...a,ref:t})})});us.displayName=ss;var ds=`MenuRadioItem`,fs=t.forwardRef((e,t)=>{let{value:n,...i}=e,a=ls(ds,e.__scopeMenu),o=n===a.value;return(0,r.jsx)(ms,{scope:e.__scopeMenu,checked:o,children:(0,r.jsx)(rs,{role:`menuitemradio`,"aria-checked":o,...i,ref:t,"data-state":js(o),onSelect:I(i.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});fs.displayName=ds;var ps=`MenuItemIndicator`,[ms,hs]=Oo(ps,{checked:!1}),gs=t.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:i,...a}=e,o=hs(ps,n);return(0,r.jsx)(R,{present:i||As(o.checked)||o.checked===!0,children:(0,r.jsx)(O.span,{...a,ref:t,"data-state":js(o.checked)})})});gs.displayName=ps;var _s=`MenuSeparator`,vs=t.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e;return(0,r.jsx)(O.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:t})});vs.displayName=_s;var ys=`MenuArrow`,bs=t.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e,a=Ao(n);return(0,r.jsx)(Ya,{...a,...i,ref:t})});bs.displayName=ys;var xs=`MenuSub`,[Ss,Cs]=Oo(xs),ws=e=>{let{__scopeMenu:n,children:i,open:a=!1,onOpenChange:o}=e,s=No(xs,n),c=Ao(n),[l,u]=t.useState(null),[d,f]=t.useState(null),p=z(o);return t.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),(0,r.jsx)(Ka,{...c,children:(0,r.jsx)(Mo,{scope:n,open:a,onOpenChange:p,content:d,onContentChange:f,children:(0,r.jsx)(Ss,{scope:n,contentId:fe(),triggerId:fe(),trigger:l,onTriggerChange:u,children:i})})})};ws.displayName=xs;var Ts=`MenuSubTrigger`,Es=t.forwardRef((e,n)=>{let i=No(Ts,e.__scopeMenu),a=Fo(Ts,e.__scopeMenu),o=Cs(Ts,e.__scopeMenu),s=Go(Ts,e.__scopeMenu),c=t.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},f=t.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return t.useEffect(()=>f,[f]),t.useEffect(()=>{let e=l.current;return()=>{window.clearTimeout(e),u(null)}},[l,u]),(0,r.jsx)(Ro,{asChild:!0,...d,children:(0,r.jsx)(is,{id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":i.open,"aria-controls":o.contentId,"data-state":ks(i.open),...e,ref:_(n,o.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:I(e.onPointerMove,Ls(t=>{s.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!i.open&&!c.current&&(s.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:I(e.onPointerLeave,Ls(e=>{f();let t=i.content?.getBoundingClientRect();if(t){let n=i.content?.dataset.side,r=n===`right`,a=r?-5:5,o=t[r?`left`:`right`],c=t[r?`right`:`left`];s.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:o,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:o,y:t.bottom}],side:n}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:I(e.onKeyDown,t=>{let n=s.searchRef.current!==``;e.disabled||n&&t.key===` `||So[a.dir].includes(t.key)&&(i.onOpenChange(!0),i.content?.focus(),t.preventDefault())})})})});Es.displayName=Ts;var Ds=`MenuSubContent`,Os=t.forwardRef((e,n)=>{let i=Vo(Uo,e.__scopeMenu),{forceMount:a=i.forceMount,...o}=e,s=No(Uo,e.__scopeMenu),c=Fo(Uo,e.__scopeMenu),l=Cs(Ds,e.__scopeMenu),u=t.useRef(null),d=v(n,u);return(0,r.jsx)(To.Provider,{scope:e.__scopeMenu,children:(0,r.jsx)(R,{present:a||s.open,children:(0,r.jsx)(To.Slot,{scope:e.__scopeMenu,children:(0,r.jsx)(Xo,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:d,align:`start`,side:c.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:I(e.onFocusOutside,e=>{e.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:I(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:I(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Co[c.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});Os.displayName=Ds;function ks(e){return e?`open`:`closed`}function As(e){return e===`indeterminate`}function js(e){return As(e)?`indeterminate`:e?`checked`:`unchecked`}function Ms(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ns(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Ps(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ns(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Fs(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Is(e,t){return t?Fs({x:e.clientX,y:e.clientY},t):!1}function Ls(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Rs=Io,zs=Ro,Bs=Ho,Vs=Ko,Hs=Qo,Us=es,Ws=rs,Gs=os,Ks=us,qs=fs,Js=gs,Ys=vs,Xs=bs,Zs=ws,Qs=Es,$s=Os,ec=`ContextMenu`,[tc,nc]=P(ec,[ko]),rc=ko(),[ic,ac]=tc(ec),oc=e=>{let{__scopeContextMenu:n,children:i,onOpenChange:a,dir:o,modal:s=!0}=e,[c,l]=t.useState(!1),u=rc(n),d=z(a),f=t.useCallback(e=>{l(e),d(e)},[d]);return(0,r.jsx)(ic,{scope:n,open:c,onOpenChange:f,modal:s,children:(0,r.jsx)(Rs,{...u,dir:o,open:c,onOpenChange:f,modal:s,children:i})})};oc.displayName=ec;var sc=`ContextMenuTrigger`,cc=t.forwardRef((e,n)=>{let{__scopeContextMenu:i,disabled:a=!1,...o}=e,s=ac(sc,i),c=rc(i),l=t.useRef({x:0,y:0}),u=t.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=t.useRef(0),f=t.useCallback(()=>window.clearTimeout(d.current),[]),p=e=>{l.current={x:e.clientX,y:e.clientY},s.onOpenChange(!0)};return t.useEffect(()=>f,[f]),t.useEffect(()=>void(a&&f()),[a,f]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(zs,{...c,virtualRef:u}),(0,r.jsx)(O.span,{"data-state":s.open?`open`:`closed`,"data-disabled":a?``:void 0,...o,ref:n,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:a?e.onContextMenu:I(e.onContextMenu,e=>{f(),p(e),e.preventDefault()}),onPointerDown:a?e.onPointerDown:I(e.onPointerDown,Lc(e=>{f(),d.current=window.setTimeout(()=>p(e),700)})),onPointerMove:a?e.onPointerMove:I(e.onPointerMove,Lc(f)),onPointerCancel:a?e.onPointerCancel:I(e.onPointerCancel,Lc(f)),onPointerUp:a?e.onPointerUp:I(e.onPointerUp,Lc(f))})]})});cc.displayName=sc;var lc=`ContextMenuPortal`,uc=e=>{let{__scopeContextMenu:t,...n}=e,i=rc(t);return(0,r.jsx)(Bs,{...i,...n})};uc.displayName=lc;var dc=`ContextMenuContent`,fc=t.forwardRef((e,n)=>{let{__scopeContextMenu:i,...a}=e,o=ac(dc,i),s=rc(i),c=t.useRef(!1);return(0,r.jsx)(Vs,{...s,...a,ref:n,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&c.current&&t.preventDefault(),c.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!o.modal&&(c.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});fc.displayName=dc;var pc=`ContextMenuGroup`,mc=t.forwardRef((e,t)=>{let{__scopeContextMenu:n,...i}=e,a=rc(n);return(0,r.jsx)(Hs,{...a,...i,ref:t})});mc.displayName=pc;var hc=`ContextMenuLabel`,gc=t.forwardRef((e,t)=>{let{__scopeContextMenu:n,...i}=e,a=rc(n);return(0,r.jsx)(Us,{...a,...i,ref:t})});gc.displayName=hc;var _c=`ContextMenuItem`,vc=t.forwardRef((e,t)=>{let{__scopeContextMenu:n,...i}=e,a=rc(n);return(0,r.jsx)(Ws,{...a,...i,ref:t})});vc.displayName=_c;var yc=`ContextMenuCheckboxItem`,bc=t.forwardRef((e,t)=>{let{__scopeContextMenu:n,...i}=e,a=rc(n);return(0,r.jsx)(Gs,{...a,...i,ref:t})});bc.displayName=yc;var xc=`ContextMenuRadioGroup`,Sc=t.forwardRef((e,t)=>{let{__scopeContextMenu:n,...i}=e,a=rc(n);return(0,r.jsx)(Ks,{...a,...i,ref:t})});Sc.displayName=xc;var Cc=`ContextMenuRadioItem`,wc=t.forwardRef((e,t)=>{let{__scopeContextMenu:n,...i}=e,a=rc(n);return(0,r.jsx)(qs,{...a,...i,ref:t})});wc.displayName=Cc;var Tc=`ContextMenuItemIndicator`,Ec=t.forwardRef((e,t)=>{let{__scopeContextMenu:n,...i}=e,a=rc(n);return(0,r.jsx)(Js,{...a,...i,ref:t})});Ec.displayName=Tc;var Dc=`ContextMenuSeparator`,Oc=t.forwardRef((e,t)=>{let{__scopeContextMenu:n,...i}=e,a=rc(n);return(0,r.jsx)(Ys,{...a,...i,ref:t})});Oc.displayName=Dc;var kc=`ContextMenuArrow`,Ac=t.forwardRef((e,t)=>{let{__scopeContextMenu:n,...i}=e,a=rc(n);return(0,r.jsx)(Xs,{...a,...i,ref:t})});Ac.displayName=kc;var jc=`ContextMenuSub`,Mc=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:i,open:a,defaultOpen:o}=e,s=rc(t),[c,l]=re({prop:a,defaultProp:o??!1,onChange:i,caller:jc});return(0,r.jsx)(Zs,{...s,open:c,onOpenChange:l,children:n})};Mc.displayName=jc;var Nc=`ContextMenuSubTrigger`,Pc=t.forwardRef((e,t)=>{let{__scopeContextMenu:n,...i}=e,a=rc(n);return(0,r.jsx)(Qs,{...a,...i,ref:t})});Pc.displayName=Nc;var Fc=`ContextMenuSubContent`,Ic=t.forwardRef((e,t)=>{let{__scopeContextMenu:n,...i}=e,a=rc(n);return(0,r.jsx)($s,{...a,...i,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Ic.displayName=Fc;function Lc(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var Rc=oc,zc=cc,Bc=uc,Vc=fc,B=vc,Hc=Oc,Uc=Mc,Wc=Pc,Gc=Ic,Kc=`DropdownMenu`,[qc,Jc]=P(Kc,[ko]),Yc=ko(),[Xc,Zc]=qc(Kc),Qc=e=>{let{__scopeDropdownMenu:n,children:i,dir:a,open:o,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=Yc(n),d=t.useRef(null),[f,p]=re({prop:o,defaultProp:s??!1,onChange:c,caller:Kc});return(0,r.jsx)(Xc,{scope:n,triggerId:fe(),triggerRef:d,contentId:fe(),open:f,onOpenChange:p,onOpenToggle:t.useCallback(()=>p(e=>!e),[p]),modal:l,children:(0,r.jsx)(Rs,{...u,open:f,onOpenChange:p,dir:a,modal:l,children:i})})};Qc.displayName=Kc;var $c=`DropdownMenuTrigger`,el=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:i=!1,...a}=e,o=Zc($c,n),s=Yc(n);return(0,r.jsx)(zs,{asChild:!0,...s,children:(0,r.jsx)(O.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":i?``:void 0,disabled:i,...a,ref:_(t,o.triggerRef),onPointerDown:I(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:I(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});el.displayName=$c;var tl=`DropdownMenuPortal`,nl=e=>{let{__scopeDropdownMenu:t,...n}=e,i=Yc(t);return(0,r.jsx)(Bs,{...i,...n})};nl.displayName=tl;var rl=`DropdownMenuContent`,il=t.forwardRef((e,n)=>{let{__scopeDropdownMenu:i,...a}=e,o=Zc(rl,i),s=Yc(i),c=t.useRef(!1);return(0,r.jsx)(Vs,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...a,ref:n,onCloseAutoFocus:I(e.onCloseAutoFocus,e=>{c.current||o.triggerRef.current?.focus(),c.current=!1,e.preventDefault()}),onInteractOutside:I(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!o.modal||r)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});il.displayName=rl;var al=`DropdownMenuGroup`,ol=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,a=Yc(n);return(0,r.jsx)(Hs,{...a,...i,ref:t})});ol.displayName=al;var sl=`DropdownMenuLabel`,cl=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,a=Yc(n);return(0,r.jsx)(Us,{...a,...i,ref:t})});cl.displayName=sl;var ll=`DropdownMenuItem`,ul=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,a=Yc(n);return(0,r.jsx)(Ws,{...a,...i,ref:t})});ul.displayName=ll;var dl=`DropdownMenuCheckboxItem`,fl=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,a=Yc(n);return(0,r.jsx)(Gs,{...a,...i,ref:t})});fl.displayName=dl;var pl=`DropdownMenuRadioGroup`,ml=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,a=Yc(n);return(0,r.jsx)(Ks,{...a,...i,ref:t})});ml.displayName=pl;var hl=`DropdownMenuRadioItem`,gl=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,a=Yc(n);return(0,r.jsx)(qs,{...a,...i,ref:t})});gl.displayName=hl;var _l=`DropdownMenuItemIndicator`,vl=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,a=Yc(n);return(0,r.jsx)(Js,{...a,...i,ref:t})});vl.displayName=_l;var yl=`DropdownMenuSeparator`,bl=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,a=Yc(n);return(0,r.jsx)(Ys,{...a,...i,ref:t})});bl.displayName=yl;var xl=`DropdownMenuArrow`,Sl=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,a=Yc(n);return(0,r.jsx)(Xs,{...a,...i,ref:t})});Sl.displayName=xl;var Cl=e=>{let{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:a,defaultOpen:o}=e,s=Yc(t),[c,l]=re({prop:i,defaultProp:o??!1,onChange:a,caller:`DropdownMenuSub`});return(0,r.jsx)(Zs,{...s,open:c,onOpenChange:l,children:n})},wl=`DropdownMenuSubTrigger`,Tl=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,a=Yc(n);return(0,r.jsx)(Qs,{...a,...i,ref:t})});Tl.displayName=wl;var El=`DropdownMenuSubContent`,Dl=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,a=Yc(n);return(0,r.jsx)($s,{...a,...i,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Dl.displayName=El;var Ol=Qc,kl=el,Al=nl,jl=il,Ml=ol,Nl=cl,Pl=ul,Fl=fl,Il=ml,Ll=gl,Rl=vl,zl=bl,Bl=Cl,Vl=Tl,Hl=Dl;function Ul(e,[t,n]){return Math.min(n,Math.max(t,e))}function Wl(e,n){return t.useReducer((e,t)=>n[e][t]??e,e)}var Gl=`ScrollArea`,[Kl,ql]=P(Gl),[Jl,Yl]=Kl(Gl),Xl=t.forwardRef((e,n)=>{let{__scopeScrollArea:i,type:a=`hover`,dir:o,scrollHideDelay:s=600,...c}=e,[l,u]=t.useState(null),[d,f]=t.useState(null),[p,m]=t.useState(null),[h,g]=t.useState(null),[_,y]=t.useState(null),[b,x]=t.useState(0),[S,C]=t.useState(0),[w,T]=t.useState(!1),[E,D]=t.useState(!1),k=v(n,e=>u(e)),A=he(o);return(0,r.jsx)(Jl,{scope:i,type:a,dir:A,scrollHideDelay:s,scrollArea:l,viewport:d,onViewportChange:f,content:p,onContentChange:m,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:w,onScrollbarXEnabledChange:T,scrollbarY:_,onScrollbarYChange:y,scrollbarYEnabled:E,onScrollbarYEnabledChange:D,onCornerWidthChange:x,onCornerHeightChange:C,children:(0,r.jsx)(O.div,{dir:A,...c,ref:k,style:{position:`relative`,"--radix-scroll-area-corner-width":b+`px`,"--radix-scroll-area-corner-height":S+`px`,...e.style}})})});Xl.displayName=Gl;var Zl=`ScrollAreaViewport`,Ql=t.forwardRef((e,n)=>{let{__scopeScrollArea:i,children:a,nonce:o,...s}=e,c=Yl(Zl,i),l=v(n,t.useRef(null),c.onViewportChange);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:o}),(0,r.jsx)(O.div,{"data-radix-scroll-area-viewport":``,...s,ref:l,style:{overflowX:c.scrollbarXEnabled?`scroll`:`hidden`,overflowY:c.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,r.jsx)(`div`,{ref:c.onContentChange,style:{minWidth:`100%`,display:`table`},children:a})})]})});Ql.displayName=Zl;var $l=`ScrollAreaScrollbar`,eu=t.forwardRef((e,n)=>{let{forceMount:i,...a}=e,o=Yl($l,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=o,l=e.orientation===`horizontal`;return t.useEffect(()=>(l?s(!0):c(!0),()=>{l?s(!1):c(!1)}),[l,s,c]),o.type===`hover`?(0,r.jsx)(tu,{...a,ref:n,forceMount:i}):o.type===`scroll`?(0,r.jsx)(nu,{...a,ref:n,forceMount:i}):o.type===`auto`?(0,r.jsx)(ru,{...a,ref:n,forceMount:i}):o.type===`always`?(0,r.jsx)(iu,{...a,ref:n}):null});eu.displayName=$l;var tu=t.forwardRef((e,n)=>{let{forceMount:i,...a}=e,o=Yl($l,e.__scopeScrollArea),[s,c]=t.useState(!1);return t.useEffect(()=>{let e=o.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),c(!0)},r=()=>{t=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[o.scrollArea,o.scrollHideDelay]),(0,r.jsx)(R,{present:i||s,children:(0,r.jsx)(ru,{"data-state":s?`visible`:`hidden`,...a,ref:n})})}),nu=t.forwardRef((e,n)=>{let{forceMount:i,...a}=e,o=Yl($l,e.__scopeScrollArea),s=e.orientation===`horizontal`,c=wu(()=>u(`SCROLL_END`),100),[l,u]=Wl(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return t.useEffect(()=>{if(l===`idle`){let e=window.setTimeout(()=>u(`HIDE`),o.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,o.scrollHideDelay,u]),t.useEffect(()=>{let e=o.viewport,t=s?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(u(`SCROLL`),c()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[o.viewport,s,u,c]),(0,r.jsx)(R,{present:i||l!==`hidden`,children:(0,r.jsx)(iu,{"data-state":l===`hidden`?`hidden`:`visible`,...a,ref:n,onPointerEnter:I(e.onPointerEnter,()=>u(`POINTER_ENTER`)),onPointerLeave:I(e.onPointerLeave,()=>u(`POINTER_LEAVE`))})})}),ru=t.forwardRef((e,n)=>{let i=Yl($l,e.__scopeScrollArea),{forceMount:a,...o}=e,[s,c]=t.useState(!1),l=e.orientation===`horizontal`,u=wu(()=>{if(i.viewport){let e=i.viewport.offsetWidth<i.viewport.scrollWidth,t=i.viewport.offsetHeight<i.viewport.scrollHeight;c(l?e:t)}},10);return Tu(i.viewport,u),Tu(i.content,u),(0,r.jsx)(R,{present:a||s,children:(0,r.jsx)(iu,{"data-state":s?`visible`:`hidden`,...o,ref:n})})}),iu=t.forwardRef((e,n)=>{let{orientation:i=`vertical`,...a}=e,o=Yl($l,e.__scopeScrollArea),s=t.useRef(null),c=t.useRef(0),[l,u]=t.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=_u(l.viewport,l.content),f={...a,sizes:l,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:e=>s.current=e,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:e=>c.current=e};function p(e,t){return yu(e,c.current,l,t)}return i===`horizontal`?(0,r.jsx)(au,{...f,ref:n,onThumbPositionChange:()=>{if(o.viewport&&s.current){let e=o.viewport.scrollLeft,t=bu(e,l,o.dir);s.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollLeft=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollLeft=p(e,o.dir))}}):i===`vertical`?(0,r.jsx)(ou,{...f,ref:n,onThumbPositionChange:()=>{if(o.viewport&&s.current){let e=o.viewport.scrollTop,t=bu(e,l);s.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollTop=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollTop=p(e))}}):null}),au=t.forwardRef((e,n)=>{let{sizes:i,onSizesChange:a,...o}=e,s=Yl($l,e.__scopeScrollArea),[c,l]=t.useState(),u=t.useRef(null),d=v(n,u,s.onScrollbarXChange);return t.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),(0,r.jsx)(lu,{"data-orientation":`horizontal`,...o,ref:d,sizes:i,style:{bottom:0,left:s.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:s.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":vu(i)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(s.viewport){let r=s.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),Su(r,n)&&t.preventDefault()}},onResize:()=>{u.current&&s.viewport&&c&&a({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:gu(c.paddingLeft),paddingEnd:gu(c.paddingRight)}})}})}),ou=t.forwardRef((e,n)=>{let{sizes:i,onSizesChange:a,...o}=e,s=Yl($l,e.__scopeScrollArea),[c,l]=t.useState(),u=t.useRef(null),d=v(n,u,s.onScrollbarYChange);return t.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),(0,r.jsx)(lu,{"data-orientation":`vertical`,...o,ref:d,sizes:i,style:{top:0,right:s.dir===`ltr`?0:void 0,left:s.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":vu(i)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(s.viewport){let r=s.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),Su(r,n)&&t.preventDefault()}},onResize:()=>{u.current&&s.viewport&&c&&a({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:gu(c.paddingTop),paddingEnd:gu(c.paddingBottom)}})}})}),[su,cu]=Kl($l),lu=t.forwardRef((e,n)=>{let{__scopeScrollArea:i,sizes:a,hasThumb:o,onThumbChange:s,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:f,onResize:p,...m}=e,h=Yl($l,i),[g,_]=t.useState(null),y=v(n,e=>_(e)),b=t.useRef(null),x=t.useRef(``),S=h.viewport,C=a.content-a.viewport,w=z(f),T=z(u),E=wu(p,10);function D(e){b.current&&d({x:e.clientX-b.current.left,y:e.clientY-b.current.top})}return t.useEffect(()=>{let e=e=>{let t=e.target;g?.contains(t)&&w(e,C)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[S,g,C,w]),t.useEffect(T,[a,T]),Tu(g,E),Tu(h.content,E),(0,r.jsx)(su,{scope:i,scrollbar:g,hasThumb:o,onThumbChange:z(s),onThumbPointerUp:z(c),onThumbPositionChange:T,onThumbPointerDown:z(l),children:(0,r.jsx)(O.div,{...m,ref:y,style:{position:`absolute`,...m.style},onPointerDown:I(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),b.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,h.viewport&&(h.viewport.style.scrollBehavior=`auto`),D(e))}),onPointerMove:I(e.onPointerMove,D),onPointerUp:I(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=x.current,h.viewport&&(h.viewport.style.scrollBehavior=``),b.current=null})})})}),uu=`ScrollAreaThumb`,du=t.forwardRef((e,t)=>{let{forceMount:n,...i}=e,a=cu(uu,e.__scopeScrollArea);return(0,r.jsx)(R,{present:n||a.hasThumb,children:(0,r.jsx)(fu,{ref:t,...i})})}),fu=t.forwardRef((e,n)=>{let{__scopeScrollArea:i,style:a,...o}=e,s=Yl(uu,i),c=cu(uu,i),{onThumbPositionChange:l}=c,u=v(n,e=>c.onThumbChange(e)),d=t.useRef(void 0),f=wu(()=>{d.current&&=(d.current(),void 0)},100);return t.useEffect(()=>{let e=s.viewport;if(e){let t=()=>{f(),d.current||(d.current=Cu(e,l),l())};return l(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[s.viewport,f,l]),(0,r.jsx)(O.div,{"data-state":c.hasThumb?`visible`:`hidden`,...o,ref:u,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...a},onPointerDownCapture:I(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;c.onThumbPointerDown({x:n,y:r})}),onPointerUp:I(e.onPointerUp,c.onThumbPointerUp)})});du.displayName=uu;var pu=`ScrollAreaCorner`,mu=t.forwardRef((e,t)=>{let n=Yl(pu,e.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&i?(0,r.jsx)(hu,{...e,ref:t}):null});mu.displayName=pu;var hu=t.forwardRef((e,n)=>{let{__scopeScrollArea:i,...a}=e,o=Yl(pu,i),[s,c]=t.useState(0),[l,u]=t.useState(0),d=!!(s&&l);return Tu(o.scrollbarX,()=>{let e=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(e),u(e)}),Tu(o.scrollbarY,()=>{let e=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(e),c(e)}),d?(0,r.jsx)(O.div,{...a,ref:n,style:{width:s,height:l,position:`absolute`,right:o.dir===`ltr`?0:void 0,left:o.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function gu(e){return e?parseInt(e,10):0}function _u(e,t){let n=e/t;return isNaN(n)?0:n}function vu(e){let t=_u(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function yu(e,t,n,r=`ltr`){let i=vu(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return xu([c,l],d)(e)}function bu(e,t,n=`ltr`){let r=vu(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Ul(e,n===`ltr`?[0,o]:[o*-1,0]);return xu([0,o],[0,s])(c)}function xu(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Su(e,t){return e>0&&e<t}var Cu=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function wu(e,n){let r=z(e),i=t.useRef(0);return t.useEffect(()=>()=>window.clearTimeout(i.current),[]),t.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(r,n)},[r,n])}function Tu(e,t){let n=z(t);L(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var Eu=Xl,Du=Ql,Ou=eu,ku=du,Au=mu,ju=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Mu=[` `,`Enter`],Nu=`Select`,[Pu,Fu,Iu]=F(Nu),[Lu,Ru]=P(Nu,[Iu,Aa]),zu=Aa(),[Bu,Vu]=Lu(Nu),[Hu,Uu]=Lu(Nu),Wu=e=>{let{__scopeSelect:n,children:i,open:a,defaultOpen:o,onOpenChange:s,value:c,defaultValue:l,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:g}=e,_=zu(n),[v,y]=t.useState(null),[b,x]=t.useState(null),[S,C]=t.useState(!1),w=he(d),[T,E]=re({prop:a,defaultProp:o??!1,onChange:s,caller:Nu}),[D,O]=re({prop:c,defaultProp:l,onChange:u,caller:Nu}),k=t.useRef(null),A=v?g||!!v.closest(`form`):!0,[j,M]=t.useState(new Set),N=Array.from(j).map(e=>e.props.value).join(`;`);return(0,r.jsx)(Ka,{..._,children:(0,r.jsxs)(Bu,{required:h,scope:n,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:fe(),value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:m,children:[(0,r.jsx)(Pu.Provider,{scope:n,children:(0,r.jsx)(Hu,{scope:e.__scopeSelect,onNativeOptionAdd:t.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:t.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:i})}),A?(0,r.jsxs)(zd,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:D,onChange:e=>O(e.target.value),disabled:m,form:g,children:[D===void 0?(0,r.jsx)(`option`,{value:``}):null,Array.from(j)]},N):null]})})};Wu.displayName=Nu;var Gu=`SelectTrigger`,Ku=t.forwardRef((e,n)=>{let{__scopeSelect:i,disabled:a=!1,...o}=e,s=zu(i),c=Vu(Gu,i),l=c.disabled||a,u=v(n,c.onTriggerChange),d=Fu(i),f=t.useRef(`touch`),[p,m,h]=Vd(e=>{let t=d().filter(e=>!e.disabled),n=Hd(t,e,t.find(e=>e.value===c.value));n!==void 0&&c.onValueChange(n.value)}),g=e=>{l||(c.onOpenChange(!0),h()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,r.jsx)(qa,{asChild:!0,...s,children:(0,r.jsx)(O.button,{type:`button`,role:`combobox`,"aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":`none`,dir:c.dir,"data-state":c.open?`open`:`closed`,disabled:l,"data-disabled":l?``:void 0,"data-placeholder":Bd(c.value)?``:void 0,...o,ref:u,onClick:I(o.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&g(e)}),onPointerDown:I(o.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:I(o.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&ju.includes(e.key)&&(g(),e.preventDefault())})})})});Ku.displayName=Gu;var qu=`SelectValue`,Ju=t.forwardRef((e,t)=>{let{__scopeSelect:n,className:i,style:a,children:o,placeholder:s=``,...c}=e,l=Vu(qu,n),{onValueNodeHasChildrenChange:u}=l,d=o!==void 0,f=v(t,l.onValueNodeChange);return L(()=>{u(d)},[u,d]),(0,r.jsx)(O.span,{...c,ref:f,style:{pointerEvents:`none`},children:Bd(l.value)?(0,r.jsx)(r.Fragment,{children:s}):o})});Ju.displayName=qu;var Yu=`SelectIcon`,Xu=t.forwardRef((e,t)=>{let{__scopeSelect:n,children:i,...a}=e;return(0,r.jsx)(O.span,{"aria-hidden":!0,...a,ref:t,children:i||`▼`})});Xu.displayName=Yu;var Zu=`SelectPortal`,Qu=e=>(0,r.jsx)(Je,{asChild:!0,...e});Qu.displayName=Zu;var $u=`SelectContent`,ed=t.forwardRef((e,i)=>{let a=Vu($u,e.__scopeSelect),[o,s]=t.useState();if(L(()=>{s(new DocumentFragment)},[]),!a.open){let t=o;return t?n.createPortal((0,r.jsx)(nd,{scope:e.__scopeSelect,children:(0,r.jsx)(Pu.Slot,{scope:e.__scopeSelect,children:(0,r.jsx)(`div`,{children:e.children})})}),t):null}return(0,r.jsx)(od,{...e,ref:i})});ed.displayName=$u;var td=10,[nd,rd]=Lu($u),id=`SelectContentImpl`,ad=y(`SelectContent.RemoveScroll`),od=t.forwardRef((e,n)=>{let{__scopeSelect:i,position:a=`item-aligned`,onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:c,side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:y,...b}=e,x=Vu($u,i),[S,C]=t.useState(null),[w,T]=t.useState(null),E=v(n,e=>C(e)),[D,O]=t.useState(null),[k,A]=t.useState(null),j=Fu(i),[M,N]=t.useState(!1),ee=t.useRef(!1);t.useEffect(()=>{if(S)return _n(S)},[S]),Xe();let P=t.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&w&&(w.scrollTop=0),n===r&&w&&(w.scrollTop=w.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,w]),te=t.useCallback(()=>P([D,S]),[P,D,S]);t.useEffect(()=>{M&&te()},[M,te]);let{onOpenChange:F,triggerPointerDownPosRef:L}=x;t.useEffect(()=>{if(S){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():S.contains(n.target)||F(!1),document.removeEventListener(`pointermove`,t),L.current=null};return L.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[S,F,L]),t.useEffect(()=>{let e=()=>F(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[ne,re]=Vd(e=>{let t=j().filter(e=>!e.disabled),n=Hd(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ie=t.useCallback((e,t,n)=>{let r=!ee.current&&!n;(x.value!==void 0&&x.value===t||r)&&(O(e),r&&(ee.current=!0))},[x.value]),ae=t.useCallback(()=>S?.focus(),[S]),oe=t.useCallback((e,t,n)=>{let r=!ee.current&&!n;(x.value!==void 0&&x.value===t||r)&&A(e)},[x.value]),R=a===`popper`?ud:cd,se=R===ud?{side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:y}:{};return(0,r.jsx)(nd,{scope:i,content:S,viewport:w,onViewportChange:T,itemRefCallback:ie,selectedItem:D,onItemLeave:ae,itemTextRefCallback:oe,focusSelectedItem:te,selectedItemText:k,position:a,isPositioned:M,searchRef:ne,children:(0,r.jsx)(cn,{as:ad,allowPinchZoom:!0,children:(0,r.jsx)(Fe,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:I(o,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,r.jsx)(we,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:(0,r.jsx)(R,{role:`listbox`,id:x.contentId,"data-state":x.open?`open`:`closed`,dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...se,onPlaced:()=>N(!0),ref:E,style:{display:`flex`,flexDirection:`column`,outline:`none`,...b.style},onKeyDown:I(b.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&re(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>P(t)),e.preventDefault()}})})})})})})});od.displayName=id;var sd=`SelectItemAlignedPosition`,cd=t.forwardRef((e,n)=>{let{__scopeSelect:i,onPlaced:a,...o}=e,s=Vu($u,i),c=rd($u,i),[l,u]=t.useState(null),[d,f]=t.useState(null),p=v(n,e=>f(e)),m=Fu(i),h=t.useRef(!1),g=t.useRef(!0),{viewport:_,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=c,S=t.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&d&&_&&y&&b){let e=s.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if(s.dir!==`rtl`){let i=r.left-t.left,a=n.left-i,o=e.left-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-td,d=Ul(a,[td,Math.max(td,u-c)]);l.style.minWidth=s+`px`,l.style.left=d+`px`}else{let i=t.right-r.right,a=window.innerWidth-n.right-i,o=window.innerWidth-e.right-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-td,d=Ul(a,[td,Math.max(td,u-c)]);l.style.minWidth=s+`px`,l.style.right=d+`px`}let i=m(),o=window.innerHeight-td*2,c=_.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),v=parseInt(u.paddingBottom,10),x=f+p+c+v+g,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-td,D=o-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=i.length>0&&y===i[i.length-1].ref.current;l.style.bottom=`0px`;let t=d.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);l.style.height=n+`px`}else{let e=i.length>0&&y===i[0].ref.current;l.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;l.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}l.style.margin=`${td}px 0`,l.style.minHeight=S+`px`,l.style.maxHeight=o+`px`,a?.(),requestAnimationFrame(()=>h.current=!0)}},[m,s.trigger,s.valueNode,l,d,_,y,b,s.dir,a]);L(()=>S(),[S]);let[C,w]=t.useState();return L(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]),(0,r.jsx)(dd,{scope:i,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:t.useCallback(e=>{e&&g.current===!0&&(S(),x?.(),g.current=!1)},[S,x]),children:(0,r.jsx)(`div`,{ref:u,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,r.jsx)(O.div,{...o,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...o.style}})})})});cd.displayName=sd;var ld=`SelectPopperPosition`,ud=t.forwardRef((e,t)=>{let{__scopeSelect:n,align:i=`start`,collisionPadding:a=td,...o}=e,s=zu(n);return(0,r.jsx)(Ja,{...s,...o,ref:t,align:i,collisionPadding:a,style:{boxSizing:`border-box`,...o.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ud.displayName=ld;var[dd,fd]=Lu($u,{}),pd=`SelectViewport`,md=t.forwardRef((e,n)=>{let{__scopeSelect:i,nonce:a,...o}=e,s=rd(pd,i),c=fd(pd,i),l=v(n,s.onViewportChange),u=t.useRef(0);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:a}),(0,r.jsx)(Pu.Slot,{scope:i,children:(0,r.jsx)(O.div,{"data-radix-select-viewport":``,role:`presentation`,...o,ref:l,style:{position:`relative`,flex:1,overflow:`hidden auto`,...o.style},onScroll:I(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=c;if(r?.current&&n){let e=Math.abs(u.current-t.scrollTop);if(e>0){let r=window.innerHeight-td*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}u.current=t.scrollTop})})})]})});md.displayName=pd;var hd=`SelectGroup`,[gd,_d]=Lu(hd),vd=t.forwardRef((e,t)=>{let{__scopeSelect:n,...i}=e,a=fe();return(0,r.jsx)(gd,{scope:n,id:a,children:(0,r.jsx)(O.div,{role:`group`,"aria-labelledby":a,...i,ref:t})})});vd.displayName=hd;var yd=`SelectLabel`,bd=t.forwardRef((e,t)=>{let{__scopeSelect:n,...i}=e,a=_d(yd,n);return(0,r.jsx)(O.div,{id:a.id,...i,ref:t})});bd.displayName=yd;var xd=`SelectItem`,[Sd,Cd]=Lu(xd),wd=t.forwardRef((e,n)=>{let{__scopeSelect:i,value:a,disabled:o=!1,textValue:s,...c}=e,l=Vu(xd,i),u=rd(xd,i),d=l.value===a,[f,p]=t.useState(s??``),[m,h]=t.useState(!1),g=v(n,e=>u.itemRefCallback?.(e,a,o)),_=fe(),y=t.useRef(`touch`),b=()=>{o||(l.onValueChange(a),l.onOpenChange(!1))};if(a===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,r.jsx)(Sd,{scope:i,value:a,disabled:o,textId:_,isSelected:d,onItemTextChange:t.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,r.jsx)(Pu.ItemSlot,{scope:i,value:a,disabled:o,textValue:f,children:(0,r.jsx)(O.div,{role:`option`,"aria-labelledby":_,"data-highlighted":m?``:void 0,"aria-selected":d&&m,"data-state":d?`checked`:`unchecked`,"aria-disabled":o||void 0,"data-disabled":o?``:void 0,tabIndex:o?void 0:-1,...c,ref:g,onFocus:I(c.onFocus,()=>h(!0)),onBlur:I(c.onBlur,()=>h(!1)),onClick:I(c.onClick,()=>{y.current!==`mouse`&&b()}),onPointerUp:I(c.onPointerUp,()=>{y.current===`mouse`&&b()}),onPointerDown:I(c.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:I(c.onPointerMove,e=>{y.current=e.pointerType,o?u.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:I(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:I(c.onKeyDown,e=>{u.searchRef?.current!==``&&e.key===` `||(Mu.includes(e.key)&&b(),e.key===` `&&e.preventDefault())})})})})});wd.displayName=xd;var Td=`SelectItemText`,Ed=t.forwardRef((e,i)=>{let{__scopeSelect:a,className:o,style:s,...c}=e,l=Vu(Td,a),u=rd(Td,a),d=Cd(Td,a),f=Uu(Td,a),[p,m]=t.useState(null),h=v(i,e=>m(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=p?.textContent,_=t.useMemo(()=>(0,r.jsx)(`option`,{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=f;return L(()=>(y(_),()=>b(_)),[y,b,_]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(O.span,{id:d.textId,...c,ref:h}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?n.createPortal(c.children,l.valueNode):null]})});Ed.displayName=Td;var Dd=`SelectItemIndicator`,Od=t.forwardRef((e,t)=>{let{__scopeSelect:n,...i}=e;return Cd(Dd,n).isSelected?(0,r.jsx)(O.span,{"aria-hidden":!0,...i,ref:t}):null});Od.displayName=Dd;var kd=`SelectScrollUpButton`,Ad=t.forwardRef((e,n)=>{let i=rd(kd,e.__scopeSelect),a=fd(kd,e.__scopeSelect),[o,s]=t.useState(!1),c=v(n,a.onScrollButtonChange);return L(()=>{if(i.viewport&&i.isPositioned){let e=function(){s(t.scrollTop>0)},t=i.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[i.viewport,i.isPositioned]),o?(0,r.jsx)(Nd,{...e,ref:c,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=i;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ad.displayName=kd;var jd=`SelectScrollDownButton`,Md=t.forwardRef((e,n)=>{let i=rd(jd,e.__scopeSelect),a=fd(jd,e.__scopeSelect),[o,s]=t.useState(!1),c=v(n,a.onScrollButtonChange);return L(()=>{if(i.viewport&&i.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;s(Math.ceil(t.scrollTop)<e)},t=i.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[i.viewport,i.isPositioned]),o?(0,r.jsx)(Nd,{...e,ref:c,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=i;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Md.displayName=jd;var Nd=t.forwardRef((e,n)=>{let{__scopeSelect:i,onAutoScroll:a,...o}=e,s=rd(`SelectScrollButton`,i),c=t.useRef(null),l=Fu(i),u=t.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return t.useEffect(()=>()=>u(),[u]),L(()=>{l().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[l]),(0,r.jsx)(O.div,{"aria-hidden":!0,...o,ref:n,style:{flexShrink:0,...o.style},onPointerDown:I(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(a,50))}),onPointerMove:I(o.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(a,50))}),onPointerLeave:I(o.onPointerLeave,()=>{u()})})}),Pd=`SelectSeparator`,Fd=t.forwardRef((e,t)=>{let{__scopeSelect:n,...i}=e;return(0,r.jsx)(O.div,{"aria-hidden":!0,...i,ref:t})});Fd.displayName=Pd;var Id=`SelectArrow`,Ld=t.forwardRef((e,t)=>{let{__scopeSelect:n,...i}=e,a=zu(n),o=Vu(Id,n),s=rd(Id,n);return o.open&&s.position===`popper`?(0,r.jsx)(Ya,{...a,...i,ref:t}):null});Ld.displayName=Id;var Rd=`SelectBubbleInput`,zd=t.forwardRef(({__scopeSelect:e,value:n,...i},a)=>{let o=t.useRef(null),s=v(a,o),c=or(n);return t.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,`value`).set;if(c!==n&&r){let t=new Event(`change`,{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[c,n]),(0,r.jsx)(O.select,{...i,style:{...A,...i.style},ref:s,defaultValue:n})});zd.displayName=Rd;function Bd(e){return e===``||e===void 0}function Vd(e){let n=z(e),r=t.useRef(``),i=t.useRef(0),a=t.useCallback(e=>{let t=r.current+e;n(t),(function e(t){r.current=t,window.clearTimeout(i.current),t!==``&&(i.current=window.setTimeout(()=>e(``),1e3))})(t)},[n]),o=t.useCallback(()=>{r.current=``,window.clearTimeout(i.current)},[]);return t.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,a,o]}function Hd(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ud(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ud(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Wd=Wu,Gd=Ku,Kd=Ju,qd=Xu,Jd=Qu,Yd=ed,Xd=md,Zd=vd,Qd=bd,$d=wd,ef=Ed,tf=Od,nf=Fd,[rf,af]=P(`Tooltip`,[Aa]),of=Aa(),sf=`TooltipProvider`,cf=700,lf=`tooltip.open`,[uf,df]=rf(sf),ff=e=>{let{__scopeTooltip:n,delayDuration:i=cf,skipDelayDuration:a=300,disableHoverableContent:o=!1,children:s}=e,c=t.useRef(!0),l=t.useRef(!1),u=t.useRef(0);return t.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),(0,r.jsx)(uf,{scope:n,isOpenDelayedRef:c,delayDuration:i,onOpen:t.useCallback(()=>{window.clearTimeout(u.current),c.current=!1},[]),onClose:t.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,a)},[a]),isPointerInTransitRef:l,onPointerInTransitChange:t.useCallback(e=>{l.current=e},[]),disableHoverableContent:o,children:s})};ff.displayName=sf;var pf=`Tooltip`,[mf,hf]=rf(pf),gf=e=>{let{__scopeTooltip:n,children:i,open:a,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=df(pf,e.__scopeTooltip),d=of(n),[f,p]=t.useState(null),m=fe(),h=t.useRef(0),g=c??u.disableHoverableContent,_=l??u.delayDuration,v=t.useRef(!1),[y,b]=re({prop:a,defaultProp:o??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(lf))):u.onClose(),s?.(e)},caller:pf}),x=t.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=t.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=t.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=t.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);return t.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,r.jsx)(Ka,{...d,children:(0,r.jsx)(mf,{scope:n,contentId:m,open:y,stateAttribute:x,trigger:f,onTriggerChange:p,onTriggerEnter:t.useCallback(()=>{u.isOpenDelayedRef.current?w():S()},[u.isOpenDelayedRef,w,S]),onTriggerLeave:t.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:i})})};gf.displayName=pf;var _f=`TooltipTrigger`,vf=t.forwardRef((e,n)=>{let{__scopeTooltip:i,...a}=e,o=hf(_f,i),s=df(_f,i),c=of(i),l=v(n,t.useRef(null),o.onTriggerChange),u=t.useRef(!1),d=t.useRef(!1),f=t.useCallback(()=>u.current=!1,[]);return t.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,r.jsx)(qa,{asChild:!0,...c,children:(0,r.jsx)(O.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...a,ref:l,onPointerMove:I(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:I(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:I(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:I(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:I(e.onBlur,o.onClose),onClick:I(e.onClick,o.onClose)})})});vf.displayName=_f;var yf=`TooltipPortal`,[bf,xf]=rf(yf,{forceMount:void 0}),Sf=e=>{let{__scopeTooltip:t,forceMount:n,children:i,container:a}=e,o=hf(yf,t);return(0,r.jsx)(bf,{scope:t,forceMount:n,children:(0,r.jsx)(R,{present:n||o.open,children:(0,r.jsx)(Je,{asChild:!0,container:a,children:i})})})};Sf.displayName=yf;var Cf=`TooltipContent`,wf=t.forwardRef((e,t)=>{let n=xf(Cf,e.__scopeTooltip),{forceMount:i=n.forceMount,side:a=`top`,...o}=e,s=hf(Cf,e.__scopeTooltip);return(0,r.jsx)(R,{present:i||s.open,children:s.disableHoverableContent?(0,r.jsx)(kf,{side:a,...o,ref:t}):(0,r.jsx)(Tf,{side:a,...o,ref:t})})}),Tf=t.forwardRef((e,n)=>{let i=hf(Cf,e.__scopeTooltip),a=df(Cf,e.__scopeTooltip),o=t.useRef(null),s=v(n,o),[c,l]=t.useState(null),{trigger:u,onClose:d}=i,f=o.current,{onPointerInTransitChange:p}=a,m=t.useCallback(()=>{l(null),p(!1)},[p]),h=t.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Nf(r,Mf(r,n.getBoundingClientRect())),a=Pf(t.getBoundingClientRect());l(If([...i,...a])),p(!0)},[p]);return t.useEffect(()=>()=>m(),[m]),t.useEffect(()=>{if(u&&f){let e=e=>h(e,f),t=e=>h(e,u);return u.addEventListener(`pointerleave`,e),f.addEventListener(`pointerleave`,t),()=>{u.removeEventListener(`pointerleave`,e),f.removeEventListener(`pointerleave`,t)}}},[u,f,h,m]),t.useEffect(()=>{if(c){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!Ff(n,c);r?m():i&&(m(),d())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,c,d,m]),(0,r.jsx)(kf,{...e,ref:s})}),[Ef,Df]=rf(pf,{isInside:!1}),Of=C(`TooltipContent`),kf=t.forwardRef((e,n)=>{let{__scopeTooltip:i,children:a,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=e,u=hf(Cf,i),d=of(i),{onClose:f}=u;return t.useEffect(()=>(document.addEventListener(lf,f),()=>document.removeEventListener(lf,f)),[f]),t.useEffect(()=>{if(u.trigger){let e=e=>{e.target?.contains(u.trigger)&&f()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[u.trigger,f]),(0,r.jsx)(we,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,r.jsxs)(Ja,{"data-state":u.stateAttribute,...d,...l,ref:n,style:{...l.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,r.jsx)(Of,{children:a}),(0,r.jsx)(Ef,{scope:i,isInside:!0,children:(0,r.jsx)(N,{id:u.contentId,role:`tooltip`,children:o||a})})]})})});wf.displayName=Cf;var Af=`TooltipArrow`,jf=t.forwardRef((e,t)=>{let{__scopeTooltip:n,...i}=e,a=of(n);return Df(Af,n).isInside?null:(0,r.jsx)(Ya,{...a,...i,ref:t})});jf.displayName=Af;function Mf(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Nf(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Pf(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Ff(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function If(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),Lf(t)}function Lf(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Rf=ff,V=d(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()})),zf={asChild:{type:`boolean`}},Bf={width:{type:`string`,className:`rt-r-w`,customProperties:[`--width`],responsive:!0},minWidth:{type:`string`,className:`rt-r-min-w`,customProperties:[`--min-width`],responsive:!0},maxWidth:{type:`string`,className:`rt-r-max-w`,customProperties:[`--max-width`],responsive:!0}},Vf={height:{type:`string`,className:`rt-r-h`,customProperties:[`--height`],responsive:!0},minHeight:{type:`string`,className:`rt-r-min-h`,customProperties:[`--min-height`],responsive:!0},maxHeight:{type:`string`,className:`rt-r-max-h`,customProperties:[`--max-height`],responsive:!0}},Hf=[`1`,`2`,`3`,`4`],Uf={...zf,align:{type:`enum`,className:`rt-r-align`,values:[`start`,`center`],default:`center`},size:{type:`enum`,className:`rt-r-size`,values:Hf,default:`3`,responsive:!0},width:Bf.width,minWidth:Bf.minWidth,maxWidth:{...Bf.maxWidth,default:`600px`},...Vf},Wf=`gray.gold.bronze.brown.yellow.amber.orange.tomato.red.ruby.crimson.pink.plum.purple.violet.iris.indigo.blue.cyan.teal.jade.green.grass.lime.mint.sky`.split(`.`),Gf=[`auto`,`gray`,`mauve`,`slate`,`sage`,`olive`,`sand`],Kf={color:{type:`enum`,values:Wf,default:void 0}},qf={color:{type:`enum`,values:Wf,default:``}},Jf={highContrast:{type:`boolean`,className:`rt-high-contrast`,default:void 0}},Yf={trim:{type:`enum`,className:`rt-r-lt`,values:[`normal`,`start`,`end`,`both`],responsive:!0}},Xf={align:{type:`enum`,className:`rt-r-ta`,values:[`left`,`center`,`right`],responsive:!0}},Zf={wrap:{type:`enum`,className:`rt-r-tw`,values:[`wrap`,`nowrap`,`pretty`,`balance`],responsive:!0}},Qf={truncate:{type:`boolean`,className:`rt-truncate`}},$f={weight:{type:`enum`,className:`rt-r-weight`,values:[`light`,`regular`,`medium`,`bold`],responsive:!0}},ep=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],tp=[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],np={as:{type:`enum`,values:ep,default:`h1`},...zf,size:{type:`enum`,className:`rt-r-size`,values:tp,default:`6`,responsive:!0},...$f,...Xf,...Yf,...Qf,...Zf,...Kf,...Jf},rp=[`initial`,`xs`,`sm`,`md`,`lg`,`xl`];function ip(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ap(e){return typeof e==`object`&&Object.keys(e).some(e=>rp.includes(e))}function op({className:e,customProperties:t,...n}){return[sp({allowArbitraryValues:!0,className:e,...n}),lp({customProperties:t,...n})]}function sp({allowArbitraryValues:e,value:t,className:n,propValues:r,parseValue:i=e=>e}){let a=[];if(t){if(typeof t==`string`&&r.includes(t))return cp(n,t,i);if(ap(t)){let o=t;for(let t in o){if(!ip(o,t)||!rp.includes(t))continue;let s=o[t];if(s!==void 0){if(r.includes(s)){let e=cp(n,s,i),r=t===`initial`?e:`${t}:${e}`;a.push(r)}else if(e){let e=t===`initial`?n:`${t}:${n}`;a.push(e)}}}return a.join(` `)}if(e)return n}}function cp(e,t,n){let r=e?`-`:``,i=n(t),a=i?.startsWith(`-`);return`${a?`-`:``}${e}${r}${a?i?.substring(1):i}`}function lp({customProperties:e,value:t,propValues:n,parseValue:r=e=>e}){let i={};if(!(!t||typeof t==`string`&&n.includes(t))){if(typeof t==`string`&&(i=Object.fromEntries(e.map(e=>[e,t]))),ap(t)){let r=t;for(let t in r){if(!ip(r,t)||!rp.includes(t))continue;let a=r[t];if(!n.includes(a))for(let n of e)i={[t===`initial`?n:`${n}-${t}`]:a,...i}}}for(let e in i){let t=i[e];t!==void 0&&(i[e]=r(t))}return i}}function up(...e){let t={};for(let n of e)n&&(t={...t,...n});return Object.keys(t).length?t:void 0}var dp=m(V());function fp(...e){return Object.assign({},...e)}function pp(e,...t){let n,r,i={...e},a=fp(...t);for(let e in a){let t=i[e],o=a[e];if(o.default!==void 0&&t===void 0&&(t=o.default),o.type===`enum`&&![o.default,...o.values].includes(t)&&!ap(t)&&(t=o.default),i[e]=t,`className`in o&&o.className){delete i[e];let a=`responsive`in o;if(!t||ap(t)&&!a)continue;if(ap(t)&&(o.default!==void 0&&t.initial===void 0&&(t.initial=o.default),o.type===`enum`&&([o.default,...o.values].includes(t.initial)||(t.initial=o.default))),o.type===`enum`){let e=sp({allowArbitraryValues:!1,value:t,className:o.className,propValues:o.values,parseValue:o.parseValue});n=(0,dp.default)(n,e);continue}if(o.type===`string`||o.type===`enum | string`){let e=o.type===`string`?[]:o.values,[i,a]=op({className:o.className,customProperties:o.customProperties,propValues:e,parseValue:o.parseValue,value:t});r=up(r,a),n=(0,dp.default)(n,i);continue}if(o.type===`boolean`&&t){n=(0,dp.default)(n,o.className);continue}}}return i.className=(0,dp.default)(n,e.className),i.style=up(r,e.style),i}var mp=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`-1`,`-2`,`-3`,`-4`,`-5`,`-6`,`-7`,`-8`,`-9`],hp={m:{type:`enum | string`,values:mp,responsive:!0,className:`rt-r-m`,customProperties:[`--m`]},mx:{type:`enum | string`,values:mp,responsive:!0,className:`rt-r-mx`,customProperties:[`--ml`,`--mr`]},my:{type:`enum | string`,values:mp,responsive:!0,className:`rt-r-my`,customProperties:[`--mt`,`--mb`]},mt:{type:`enum | string`,values:mp,responsive:!0,className:`rt-r-mt`,customProperties:[`--mt`]},mr:{type:`enum | string`,values:mp,responsive:!0,className:`rt-r-mr`,customProperties:[`--mr`]},mb:{type:`enum | string`,values:mp,responsive:!0,className:`rt-r-mb`,customProperties:[`--mb`]},ml:{type:`enum | string`,values:mp,responsive:!0,className:`rt-r-ml`,customProperties:[`--ml`]}},gp=m(V()),_p=t.forwardRef((e,n)=>{let{children:r,className:i,asChild:a,as:o=`h1`,color:s,...c}=pp(e,np,hp);return t.createElement(b,{"data-accent-color":s,...c,ref:n,className:(0,gp.default)(`rt-Heading`,i)},a?r:t.createElement(o,null,r))});_p.displayName=`Heading`;var vp=[`span`,`div`,`label`,`p`],yp=[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],bp={as:{type:`enum`,values:vp,default:`span`},...zf,size:{type:`enum`,className:`rt-r-size`,values:yp,responsive:!0},...$f,...Xf,...Yf,...Qf,...Zf,...Kf,...Jf},xp=m(V()),H=t.forwardRef((e,n)=>{let{children:r,className:i,asChild:a,as:o=`span`,color:s,...c}=pp(e,bp,hp);return t.createElement(b,{"data-accent-color":s,...c,ref:n,className:(0,xp.default)(`rt-Text`,i)},a?r:t.createElement(o,null,r))});H.displayName=`Text`;function Sp(e){switch(e){case`tomato`:case`red`:case`ruby`:case`crimson`:case`pink`:case`plum`:case`purple`:case`violet`:return`mauve`;case`iris`:case`indigo`:case`blue`:case`sky`:case`cyan`:return`slate`;case`teal`:case`jade`:case`mint`:case`green`:return`sage`;case`grass`:case`lime`:return`olive`;case`yellow`:case`amber`:case`orange`:case`brown`:case`gold`:case`bronze`:return`sand`;case`gray`:return`gray`}}var Cp=[`none`,`small`,`medium`,`large`,`full`],wp={radius:{type:`enum`,values:Cp,default:void 0}},Tp=[`inherit`,`light`,`dark`],Ep=[`solid`,`translucent`],Dp=[`90%`,`95%`,`100%`,`105%`,`110%`],Op={...zf,hasBackground:{type:`boolean`,default:!0},appearance:{type:`enum`,values:Tp,default:`inherit`},accentColor:{type:`enum`,values:Wf,default:`indigo`},grayColor:{type:`enum`,values:Gf,default:`auto`},panelBackground:{type:`enum`,values:Ep,default:`translucent`},radius:{type:`enum`,values:Cp,default:`medium`},scaling:{type:`enum`,values:Dp,default:`100%`}},kp=m(V()),Ap=()=>{},jp=t.createContext(void 0);function Mp(){let e=t.useContext(jp);if(e===void 0)throw Error("`useThemeContext` must be used within a `Theme`");return e}var Np=t.forwardRef((e,n)=>t.useContext(jp)===void 0?t.createElement(Rf,{delayDuration:200},t.createElement(ge,{dir:`ltr`},t.createElement(Pp,{...e,ref:n}))):t.createElement(Fp,{...e,ref:n}));Np.displayName=`Theme`;var Pp=t.forwardRef((e,n)=>{let{appearance:r=Op.appearance.default,accentColor:i=Op.accentColor.default,grayColor:a=Op.grayColor.default,panelBackground:o=Op.panelBackground.default,radius:s=Op.radius.default,scaling:c=Op.scaling.default,hasBackground:l=Op.hasBackground.default,...u}=e,[d,f]=t.useState(r);t.useEffect(()=>f(r),[r]);let[p,m]=t.useState(i);t.useEffect(()=>m(i),[i]);let[h,g]=t.useState(a);t.useEffect(()=>g(a),[a]);let[_,v]=t.useState(o);t.useEffect(()=>v(o),[o]);let[y,b]=t.useState(s);t.useEffect(()=>b(s),[s]);let[x,S]=t.useState(c);return t.useEffect(()=>S(c),[c]),t.createElement(Fp,{...u,ref:n,isRoot:!0,hasBackground:l,appearance:d,accentColor:p,grayColor:h,panelBackground:_,radius:y,scaling:x,onAppearanceChange:f,onAccentColorChange:m,onGrayColorChange:g,onPanelBackgroundChange:v,onRadiusChange:b,onScalingChange:S})});Pp.displayName=`ThemeRoot`;var Fp=t.forwardRef((e,n)=>{let r=t.useContext(jp),{asChild:i,isRoot:a,hasBackground:o,appearance:s=r?.appearance??Op.appearance.default,accentColor:c=r?.accentColor??Op.accentColor.default,grayColor:l=r?.resolvedGrayColor??Op.grayColor.default,panelBackground:u=r?.panelBackground??Op.panelBackground.default,radius:d=r?.radius??Op.radius.default,scaling:f=r?.scaling??Op.scaling.default,onAppearanceChange:p=Ap,onAccentColorChange:m=Ap,onGrayColorChange:h=Ap,onPanelBackgroundChange:g=Ap,onRadiusChange:_=Ap,onScalingChange:v=Ap,...y}=e,x=i?b:`div`,S=l===`auto`?Sp(c):l,C=e.appearance===`light`||e.appearance===`dark`,w=o===void 0?a||C:o;return t.createElement(jp.Provider,{value:t.useMemo(()=>({appearance:s,accentColor:c,grayColor:l,resolvedGrayColor:S,panelBackground:u,radius:d,scaling:f,onAppearanceChange:p,onAccentColorChange:m,onGrayColorChange:h,onPanelBackgroundChange:g,onRadiusChange:_,onScalingChange:v}),[s,c,l,S,u,d,f,p,m,h,g,_,v])},t.createElement(x,{"data-is-root-theme":a?`true`:`false`,"data-accent-color":c,"data-gray-color":S,"data-has-background":w?`true`:`false`,"data-panel-background":u,"data-radius":d,"data-scaling":f,ref:n,...y,className:(0,kp.default)(`radix-themes`,{light:s===`light`,dark:s===`dark`},y.className)}))});Fp.displayName=`ThemeImpl`;var Ip=e=>{if(!t.isValidElement(e))throw Error(`Expected a single React Element child, but got: ${t.Children.toArray(e).map(e=>typeof e==`object`&&`type`in e&&typeof e.type==`string`?e.type:typeof e).join(`, `)}`);return e};function Lp(e,n){let{asChild:r,children:i}=e;if(!r)return typeof n==`function`?n(i):n;let a=t.Children.only(i);return t.cloneElement(a,{children:typeof n==`function`?n(a.props.children):n})}var Rp=[`1`,`2`,`3`],zp=[`solid`,`soft`,`surface`,`outline`],Bp={...zf,size:{type:`enum`,className:`rt-r-size`,values:Rp,default:`1`,responsive:!0},variant:{type:`enum`,className:`rt-variant`,values:zp,default:`soft`},...qf,...Jf,...wp},Vp=m(V()),Hp=t.forwardRef((e,n)=>{let{asChild:r,className:i,color:a,radius:o,...s}=pp(e,Bp,hp),c=r?b:`span`;return t.createElement(c,{"data-accent-color":a,"data-radius":o,...s,ref:n,className:(0,Vp.default)(`rt-reset`,`rt-Badge`,i)})});Hp.displayName=`Badge`;var Up=b,Wp=[`div`,`span`],Gp=[`none`,`inline`,`inline-block`,`block`,`contents`],Kp={as:{type:`enum`,values:Wp,default:`div`},...zf,display:{type:`enum`,className:`rt-r-display`,values:Gp,responsive:!0}},qp=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],Jp={p:{type:`enum | string`,className:`rt-r-p`,customProperties:[`--p`],values:qp,responsive:!0},px:{type:`enum | string`,className:`rt-r-px`,customProperties:[`--pl`,`--pr`],values:qp,responsive:!0},py:{type:`enum | string`,className:`rt-r-py`,customProperties:[`--pt`,`--pb`],values:qp,responsive:!0},pt:{type:`enum | string`,className:`rt-r-pt`,customProperties:[`--pt`],values:qp,responsive:!0},pr:{type:`enum | string`,className:`rt-r-pr`,customProperties:[`--pr`],values:qp,responsive:!0},pb:{type:`enum | string`,className:`rt-r-pb`,customProperties:[`--pb`],values:qp,responsive:!0},pl:{type:`enum | string`,className:`rt-r-pl`,customProperties:[`--pl`],values:qp,responsive:!0}},Yp=[`visible`,`hidden`,`clip`,`scroll`,`auto`],Xp=[`static`,`relative`,`absolute`,`fixed`,`sticky`],Zp=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`-1`,`-2`,`-3`,`-4`,`-5`,`-6`,`-7`,`-8`,`-9`],Qp=[`0`,`1`],$p=[`0`,`1`],em={...Jp,...Bf,...Vf,position:{type:`enum`,className:`rt-r-position`,values:Xp,responsive:!0},inset:{type:`enum | string`,className:`rt-r-inset`,customProperties:[`--inset`],values:Zp,responsive:!0},top:{type:`enum | string`,className:`rt-r-top`,customProperties:[`--top`],values:Zp,responsive:!0},right:{type:`enum | string`,className:`rt-r-right`,customProperties:[`--right`],values:Zp,responsive:!0},bottom:{type:`enum | string`,className:`rt-r-bottom`,customProperties:[`--bottom`],values:Zp,responsive:!0},left:{type:`enum | string`,className:`rt-r-left`,customProperties:[`--left`],values:Zp,responsive:!0},overflow:{type:`enum`,className:`rt-r-overflow`,values:Yp,responsive:!0},overflowX:{type:`enum`,className:`rt-r-ox`,values:Yp,responsive:!0},overflowY:{type:`enum`,className:`rt-r-oy`,values:Yp,responsive:!0},flexBasis:{type:`string`,className:`rt-r-fb`,customProperties:[`--flex-basis`],responsive:!0},flexShrink:{type:`enum | string`,className:`rt-r-fs`,customProperties:[`--flex-shrink`],values:Qp,responsive:!0},flexGrow:{type:`enum | string`,className:`rt-r-fg`,customProperties:[`--flex-grow`],values:$p,responsive:!0},gridArea:{type:`string`,className:`rt-r-ga`,customProperties:[`--grid-area`],responsive:!0},gridColumn:{type:`string`,className:`rt-r-gc`,customProperties:[`--grid-column`],responsive:!0},gridColumnStart:{type:`string`,className:`rt-r-gcs`,customProperties:[`--grid-column-start`],responsive:!0},gridColumnEnd:{type:`string`,className:`rt-r-gce`,customProperties:[`--grid-column-end`],responsive:!0},gridRow:{type:`string`,className:`rt-r-gr`,customProperties:[`--grid-row`],responsive:!0},gridRowStart:{type:`string`,className:`rt-r-grs`,customProperties:[`--grid-row-start`],responsive:!0},gridRowEnd:{type:`string`,className:`rt-r-gre`,customProperties:[`--grid-row-end`],responsive:!0}},tm=m(V()),U=t.forwardRef((e,n)=>{let{className:r,asChild:i,as:a=`div`,...o}=pp(e,Kp,em,hp);return t.createElement(i?Up:a,{...o,ref:n,className:(0,tm.default)(`rt-Box`,r)})});U.displayName=`Box`;var nm=[`1`,`2`,`3`,`4`],rm=[`classic`,`solid`,`soft`,`surface`,`outline`,`ghost`],im={...zf,size:{type:`enum`,className:`rt-r-size`,values:nm,default:`2`,responsive:!0},variant:{type:`enum`,className:`rt-variant`,values:rm,default:`solid`},...qf,...Jf,...wp,loading:{type:`boolean`,className:`rt-loading`,default:!1}},am=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],om={gap:{type:`enum | string`,className:`rt-r-gap`,customProperties:[`--gap`],values:am,responsive:!0},gapX:{type:`enum | string`,className:`rt-r-cg`,customProperties:[`--column-gap`],values:am,responsive:!0},gapY:{type:`enum | string`,className:`rt-r-rg`,customProperties:[`--row-gap`],values:am,responsive:!0}},sm=[`div`,`span`],cm=[`none`,`inline-flex`,`flex`],lm=[`row`,`column`,`row-reverse`,`column-reverse`],um=[`start`,`center`,`end`,`baseline`,`stretch`],dm=[`start`,`center`,`end`,`between`],fm=[`nowrap`,`wrap`,`wrap-reverse`],pm={as:{type:`enum`,values:sm,default:`div`},...zf,display:{type:`enum`,className:`rt-r-display`,values:cm,responsive:!0},direction:{type:`enum`,className:`rt-r-fd`,values:lm,responsive:!0},align:{type:`enum`,className:`rt-r-ai`,values:um,responsive:!0},justify:{type:`enum`,className:`rt-r-jc`,values:dm,parseValue:mm,responsive:!0},wrap:{type:`enum`,className:`rt-r-fw`,values:fm,responsive:!0},...om};function mm(e){return e===`between`?`space-between`:e}var hm=m(V()),W=t.forwardRef((e,n)=>{let{className:r,asChild:i,as:a=`div`,...o}=pp(e,pm,em,hp);return t.createElement(i?Up:a,{...o,ref:n,className:(0,hm.default)(`rt-Flex`,r)})});W.displayName=`Flex`;var gm={size:{type:`enum`,className:`rt-r-size`,values:[`1`,`2`,`3`],default:`2`,responsive:!0},loading:{type:`boolean`,default:!0}},_m=m(V()),vm=t.forwardRef((e,n)=>{let{className:r,children:i,loading:a,...o}=pp(e,gm,hp);if(!a)return i;let s=t.createElement(`span`,{...o,ref:n,className:(0,_m.default)(`rt-Spinner`,r)},t.createElement(`span`,{className:`rt-SpinnerLeaf`}),t.createElement(`span`,{className:`rt-SpinnerLeaf`}),t.createElement(`span`,{className:`rt-SpinnerLeaf`}),t.createElement(`span`,{className:`rt-SpinnerLeaf`}),t.createElement(`span`,{className:`rt-SpinnerLeaf`}),t.createElement(`span`,{className:`rt-SpinnerLeaf`}),t.createElement(`span`,{className:`rt-SpinnerLeaf`}),t.createElement(`span`,{className:`rt-SpinnerLeaf`}));return i===void 0?s:t.createElement(W,{asChild:!0,position:`relative`,align:`center`,justify:`center`},t.createElement(`span`,null,t.createElement(`span`,{"aria-hidden":!0,style:{display:`contents`,visibility:`hidden`},inert:void 0},i),t.createElement(W,{asChild:!0,align:`center`,justify:`center`,position:`absolute`,inset:`0`},t.createElement(`span`,null,s))))});vm.displayName=`Spinner`;var ym=N;function bm(e,t){if(e!==void 0)return typeof e==`string`?t(e):Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)]))}function xm(e){switch(e){case`1`:return`1`;case`2`:case`3`:return`2`;case`4`:return`3`}}var Sm=m(V()),Cm=t.forwardRef((e,n)=>{let{size:r=im.size.default}=e,{className:i,children:a,asChild:o,color:s,radius:c,disabled:l=e.loading,...u}=pp(e,im,hp),d=o?b:`button`;return t.createElement(d,{"data-disabled":l||void 0,"data-accent-color":s,"data-radius":c,...u,ref:n,className:(0,Sm.default)(`rt-reset`,`rt-BaseButton`,i),disabled:l},e.loading?t.createElement(t.Fragment,null,t.createElement(`span`,{style:{display:`contents`,visibility:`hidden`},"aria-hidden":!0},a),t.createElement(ym,null,a),t.createElement(W,{asChild:!0,align:`center`,justify:`center`,position:`absolute`,inset:`0`},t.createElement(`span`,null,t.createElement(vm,{size:bm(r,xm)})))):a)});Cm.displayName=`BaseButton`;var wm=m(V()),Tm=t.forwardRef(({className:e,...n},r)=>t.createElement(Cm,{...n,ref:r,className:(0,wm.default)(`rt-Button`,e)}));Tm.displayName=`Button`;var Em=t.default.forwardRef((e,n)=>t.default.createElement(`svg`,{width:`9`,height:`9`,viewBox:`0 0 9 9`,fill:`currentcolor`,xmlns:`http://www.w3.org/2000/svg`,...e,ref:n},t.default.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z`})));Em.displayName=`ThickDividerHorizontalIcon`;var Dm=t.default.forwardRef((e,n)=>t.default.createElement(`svg`,{width:`9`,height:`9`,viewBox:`0 0 9 9`,fill:`currentcolor`,xmlns:`http://www.w3.org/2000/svg`,...e,ref:n},t.default.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z`})));Dm.displayName=`ThickCheckIcon`;var Om=t.default.forwardRef((e,n)=>t.default.createElement(`svg`,{width:`9`,height:`9`,viewBox:`0 0 9 9`,fill:`currentcolor`,xmlns:`http://www.w3.org/2000/svg`,...e,ref:n},t.default.createElement(`path`,{d:`M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z`})));Om.displayName=`ChevronDownIcon`;var km=t.default.forwardRef((e,n)=>t.default.createElement(`svg`,{width:`9`,height:`9`,viewBox:`0 0 9 9`,fill:`currentcolor`,xmlns:`http://www.w3.org/2000/svg`,...e,ref:n},t.default.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z`})));km.displayName=`ThickChevronRightIcon`;var Am=[`1`,`2`,`3`],jm=[`vertical`,`horizontal`,`both`],Mm={...zf,size:{type:`enum`,className:`rt-r-size`,values:Am,default:`1`,responsive:!0},...wp,scrollbars:{type:`enum`,values:jm,default:`both`}};function Nm(e){let{m:t,mx:n,my:r,mt:i,mr:a,mb:o,ml:s,...c}=e;return{m:t,mx:n,my:r,mt:i,mr:a,mb:o,ml:s,rest:c}}var Pm=m(V()),Fm=hp.m.values;function Im(e){let[t,n]=op({className:`rt-r-m`,customProperties:[`--margin`],propValues:Fm,value:e.m}),[r,i]=op({className:`rt-r-mx`,customProperties:[`--margin-left`,`--margin-right`],propValues:Fm,value:e.mx}),[a,o]=op({className:`rt-r-my`,customProperties:[`--margin-top`,`--margin-bottom`],propValues:Fm,value:e.my}),[s,c]=op({className:`rt-r-mt`,customProperties:[`--margin-top`],propValues:Fm,value:e.mt}),[l,u]=op({className:`rt-r-mr`,customProperties:[`--margin-right`],propValues:Fm,value:e.mr}),[d,f]=op({className:`rt-r-mb`,customProperties:[`--margin-bottom`],propValues:Fm,value:e.mb}),[p,m]=op({className:`rt-r-ml`,customProperties:[`--margin-left`],propValues:Fm,value:e.ml});return[(0,Pm.default)(t,r,a,s,l,d,p),up(n,i,o,c,u,f,m)]}var Lm=m(V()),Rm=t.forwardRef((e,n)=>{let{rest:r,...i}=Nm(e),[a,o]=Im(i),{asChild:s,children:c,className:l,style:u,type:d,scrollHideDelay:f=d===`scroll`?void 0:0,dir:p,size:m=Mm.size.default,radius:h=Mm.radius.default,scrollbars:g=Mm.scrollbars.default,..._}=r;return t.createElement(Eu,{type:d,scrollHideDelay:f,className:(0,Lm.default)(`rt-ScrollAreaRoot`,a,l),style:up(o,u),asChild:s},Lp({asChild:s,children:c},e=>t.createElement(t.Fragment,null,t.createElement(Du,{..._,ref:n,className:`rt-ScrollAreaViewport`},e),t.createElement(`div`,{className:`rt-ScrollAreaViewportFocusRing`}),g===`vertical`?null:t.createElement(Ou,{"data-radius":h,orientation:`horizontal`,className:(0,Lm.default)(`rt-ScrollAreaScrollbar`,sp({className:`rt-r-size`,value:m,propValues:Mm.size.values}))},t.createElement(ku,{className:`rt-ScrollAreaThumb`})),g===`horizontal`?null:t.createElement(Ou,{"data-radius":h,orientation:`vertical`,className:(0,Lm.default)(`rt-ScrollAreaScrollbar`,sp({className:`rt-r-size`,value:m,propValues:Mm.size.values}))},t.createElement(ku,{className:`rt-ScrollAreaThumb`})),g===`both`?t.createElement(Au,{className:`rt-ScrollAreaCorner`}):null)))});Rm.displayName=`ScrollArea`;var zm={size:{type:`enum`,className:`rt-r-size`,values:[`1`,`2`],default:`2`,responsive:!0},variant:{type:`enum`,className:`rt-variant`,values:[`solid`,`soft`],default:`solid`},...Kf,...Jf},Bm={...zf,...Kf,shortcut:{type:`string`}},Vm={...Kf,shortcut:{type:`string`}},Hm={...Kf},Um=m(V()),Wm=e=>t.createElement(Qn,{...e,modal:!0});Wm.displayName=`Dialog.Root`;var Gm=t.forwardRef(({children:e,...n},r)=>t.createElement($n,{...n,ref:r,asChild:!0},Ip(e)));Gm.displayName=`Dialog.Trigger`;var Km=t.forwardRef(({align:e,...n},r)=>{let{align:i,...a}=Uf,{className:o}=pp({align:e},{align:i}),{className:s,forceMount:c,container:l,...u}=pp(n,a);return t.createElement(er,{container:l,forceMount:c},t.createElement(Np,{asChild:!0},t.createElement(tr,{className:`rt-BaseDialogOverlay rt-DialogOverlay`},t.createElement(`div`,{className:`rt-BaseDialogScroll rt-DialogScroll`},t.createElement(`div`,{className:`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${o}`},t.createElement(nr,{...u,ref:r,className:(0,Um.default)(`rt-BaseDialogContent`,`rt-DialogContent`,s)}))))))});Km.displayName=`Dialog.Content`;var qm=t.forwardRef((e,n)=>t.createElement(rr,{asChild:!0},t.createElement(_p,{size:`5`,mb:`3`,trim:`start`,...e,asChild:!1,ref:n})));qm.displayName=`Dialog.Title`;var Jm=t.forwardRef((e,n)=>t.createElement(ir,{asChild:!0},t.createElement(H,{as:`p`,size:`3`,...e,asChild:!1,ref:n})));Jm.displayName=`Dialog.Description`;var Ym=t.forwardRef(({children:e,...n},r)=>t.createElement(ar,{...n,ref:r,asChild:!0},Ip(e)));Ym.displayName=`Dialog.Close`;var Xm=m(V()),Zm=e=>t.createElement(Ol,{...e});Zm.displayName=`DropdownMenu.Root`;var Qm=t.forwardRef(({children:e,...n},r)=>t.createElement(kl,{...n,ref:r,asChild:!0},Ip(e)));Qm.displayName=`DropdownMenu.Trigger`;var $m=t.createContext({}),eh=t.forwardRef((e,n)=>{let r=Mp(),{size:i=zm.size.default,variant:a=zm.variant.default,highContrast:o=zm.highContrast.default}=e,{className:s,children:c,color:l,container:u,forceMount:d,...f}=pp(e,zm),p=l||r.accentColor;return t.createElement(Al,{container:u,forceMount:d},t.createElement(Np,{asChild:!0},t.createElement(jl,{"data-accent-color":p,align:`start`,sideOffset:4,collisionPadding:10,...f,asChild:!1,ref:n,className:(0,Xm.default)(`rt-PopperContent`,`rt-BaseMenuContent`,`rt-DropdownMenuContent`,s)},t.createElement(Rm,{type:`auto`},t.createElement(`div`,{className:(0,Xm.default)(`rt-BaseMenuViewport`,`rt-DropdownMenuViewport`)},t.createElement($m.Provider,{value:t.useMemo(()=>({size:i,variant:a,color:p,highContrast:o}),[i,a,p,o])},c))))))});eh.displayName=`DropdownMenu.Content`;var th=t.forwardRef(({className:e,...n},r)=>t.createElement(Nl,{...n,asChild:!1,ref:r,className:(0,Xm.default)(`rt-BaseMenuLabel`,`rt-DropdownMenuLabel`,e)}));th.displayName=`DropdownMenu.Label`;var nh=t.forwardRef((e,n)=>{let{className:r,children:i,color:a=Bm.color.default,shortcut:o,...s}=e;return t.createElement(Pl,{"data-accent-color":a,...s,ref:n,className:(0,Xm.default)(`rt-reset`,`rt-BaseMenuItem`,`rt-DropdownMenuItem`,r)},t.createElement(w,null,i),o&&t.createElement(`div`,{className:`rt-BaseMenuShortcut rt-DropdownMenuShortcut`},o))});nh.displayName=`DropdownMenu.Item`;var rh=t.forwardRef(({className:e,...n},r)=>t.createElement(Ml,{...n,asChild:!1,ref:r,className:(0,Xm.default)(`rt-BaseMenuGroup`,`rt-DropdownMenuGroup`,e)}));rh.displayName=`DropdownMenu.Group`;var ih=t.forwardRef(({className:e,...n},r)=>t.createElement(Il,{...n,asChild:!1,ref:r,className:(0,Xm.default)(`rt-BaseMenuRadioGroup`,`rt-DropdownMenuRadioGroup`,e)}));ih.displayName=`DropdownMenu.RadioGroup`;var ah=t.forwardRef((e,n)=>{let{children:r,className:i,color:a=Hm.color.default,...o}=e;return t.createElement(Ll,{...o,asChild:!1,ref:n,"data-accent-color":a,className:(0,Xm.default)(`rt-BaseMenuItem`,`rt-BaseMenuRadioItem`,`rt-DropdownMenuItem`,`rt-DropdownMenuRadioItem`,i)},r,t.createElement(Rl,{className:`rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator`},t.createElement(Dm,{className:`rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon`})))});ah.displayName=`DropdownMenu.RadioItem`;var oh=t.forwardRef((e,n)=>{let{children:r,className:i,shortcut:a,color:o=Vm.color.default,...s}=e;return t.createElement(Fl,{...s,asChild:!1,ref:n,"data-accent-color":o,className:(0,Xm.default)(`rt-BaseMenuItem`,`rt-BaseMenuCheckboxItem`,`rt-DropdownMenuItem`,`rt-DropdownMenuCheckboxItem`,i)},r,t.createElement(Rl,{className:`rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator`},t.createElement(Dm,{className:`rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon`})),a&&t.createElement(`div`,{className:`rt-BaseMenuShortcut rt-DropdownMenuShortcut`},a))});oh.displayName=`DropdownMenu.CheckboxItem`;var sh=e=>t.createElement(Bl,{...e});sh.displayName=`DropdownMenu.Sub`;var ch=t.forwardRef((e,n)=>{let{className:r,children:i,...a}=e;return t.createElement(Vl,{...a,asChild:!1,ref:n,className:(0,Xm.default)(`rt-BaseMenuItem`,`rt-BaseMenuSubTrigger`,`rt-DropdownMenuItem`,`rt-DropdownMenuSubTrigger`,r)},i,t.createElement(`div`,{className:`rt-BaseMenuShortcut rt-DropdownMenuShortcut`},t.createElement(km,{className:`rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon`})))});ch.displayName=`DropdownMenu.SubTrigger`;var lh=t.forwardRef((e,n)=>{let{size:r,variant:i,color:a,highContrast:o}=t.useContext($m),{className:s,children:c,container:l,forceMount:u,...d}=pp({size:r,variant:i,color:a,highContrast:o,...e},zm);return t.createElement(Al,{container:l,forceMount:u},t.createElement(Np,{asChild:!0},t.createElement(Hl,{"data-accent-color":a,alignOffset:-Number(r)*4,sideOffset:1,collisionPadding:10,...d,asChild:!1,ref:n,className:(0,Xm.default)(`rt-PopperContent`,`rt-BaseMenuContent`,`rt-BaseMenuSubContent`,`rt-DropdownMenuContent`,`rt-DropdownMenuSubContent`,s)},t.createElement(Rm,{type:`auto`},t.createElement(`div`,{className:(0,Xm.default)(`rt-BaseMenuViewport`,`rt-DropdownMenuViewport`)},c)))))});lh.displayName=`DropdownMenu.SubContent`;var uh=t.forwardRef(({className:e,...n},r)=>t.createElement(zl,{...n,asChild:!1,ref:r,className:(0,Xm.default)(`rt-BaseMenuSeparator`,`rt-DropdownMenuSeparator`,e)}));uh.displayName=`DropdownMenu.Separator`;var dh=m(V()),fh=t.forwardRef(({className:e,...n},r)=>t.createElement(Cm,{...n,ref:r,className:(0,dh.default)(`rt-IconButton`,e)}));fh.displayName=`IconButton`;var ph={size:{type:`enum`,className:`rt-r-size`,values:[`1`,`2`,`3`],default:`2`,responsive:!0}},mh={variant:{type:`enum`,className:`rt-variant`,values:[`classic`,`surface`,`soft`,`ghost`],default:`surface`},...Kf,...wp,placeholder:{type:`string`}},hh={variant:{type:`enum`,className:`rt-variant`,values:[`solid`,`soft`],default:`solid`},...Kf,...Jf},gh=m(V()),_h=t.createContext({}),vh=e=>{let{children:n,size:r=ph.size.default,...i}=e;return t.createElement(Wd,{...i},t.createElement(_h.Provider,{value:t.useMemo(()=>({size:r}),[r])},n))};vh.displayName=`Select.Root`;var yh=t.forwardRef((e,n)=>{let{children:r,className:i,color:a,radius:o,placeholder:s,...c}=pp({size:t.useContext(_h)?.size,...e},{size:ph.size},mh,hp);return t.createElement(Gd,{asChild:!0},t.createElement(`button`,{"data-accent-color":a,"data-radius":o,...c,ref:n,className:(0,gh.default)(`rt-reset`,`rt-SelectTrigger`,i)},t.createElement(`span`,{className:`rt-SelectTriggerInner`},t.createElement(Kd,{placeholder:s},r)),t.createElement(qd,{asChild:!0},t.createElement(Om,{className:`rt-SelectIcon`}))))});yh.displayName=`Select.Trigger`;var bh=t.forwardRef((e,n)=>{let{className:r,children:i,color:a,container:o,...s}=pp({size:t.useContext(_h)?.size,...e},{size:ph.size},hh),c=Mp(),l=a||c.accentColor;return t.createElement(Jd,{container:o},t.createElement(Np,{asChild:!0},t.createElement(Yd,{"data-accent-color":l,sideOffset:4,...s,asChild:!1,ref:n,className:(0,gh.default)({"rt-PopperContent":s.position===`popper`},`rt-SelectContent`,r)},t.createElement(Eu,{type:`auto`,className:`rt-ScrollAreaRoot`},t.createElement(Xd,{asChild:!0,className:`rt-SelectViewport`},t.createElement(Du,{className:`rt-ScrollAreaViewport`,style:{overflowY:void 0}},i)),t.createElement(Ou,{className:`rt-ScrollAreaScrollbar rt-r-size-1`,orientation:`vertical`},t.createElement(ku,{className:`rt-ScrollAreaThumb`}))))))});bh.displayName=`Select.Content`;var xh=t.forwardRef((e,n)=>{let{className:r,children:i,...a}=e;return t.createElement($d,{...a,asChild:!1,ref:n,className:(0,gh.default)(`rt-SelectItem`,r)},t.createElement(tf,{className:`rt-SelectItemIndicator`},t.createElement(Dm,{className:`rt-SelectItemIndicatorIcon`})),t.createElement(ef,null,i))});xh.displayName=`Select.Item`;var Sh=t.forwardRef(({className:e,...n},r)=>t.createElement(Zd,{...n,asChild:!1,ref:r,className:(0,gh.default)(`rt-SelectGroup`,e)}));Sh.displayName=`Select.Group`;var Ch=t.forwardRef(({className:e,...n},r)=>t.createElement(Qd,{...n,asChild:!1,ref:r,className:(0,gh.default)(`rt-SelectLabel`,e)}));Ch.displayName=`Select.Label`;var wh=t.forwardRef(({className:e,...n},r)=>t.createElement(nf,{...n,asChild:!1,ref:r,className:(0,gh.default)(`rt-SelectSeparator`,e)}));wh.displayName=`Select.Separator`;var Th={size:{type:`enum`,className:`rt-r-size`,values:[`1`,`2`,`3`],default:`2`,responsive:!0},variant:{type:`enum`,className:`rt-variant`,values:[`classic`,`surface`,`soft`],default:`surface`},resize:{type:`enum`,className:`rt-r-resize`,values:[`none`,`vertical`,`horizontal`,`both`],responsive:!0},...Kf,...wp},Eh=m(V()),Dh=t.forwardRef((e,n)=>{let{className:r,color:i,radius:a,style:o,...s}=pp(e,Th,hp);return t.createElement(`div`,{"data-accent-color":i,"data-radius":a,className:(0,Eh.default)(`rt-TextAreaRoot`,r),style:o},t.createElement(`textarea`,{className:`rt-reset rt-TextAreaInput`,ref:n,...s}))});Dh.displayName=`TextArea`;var Oh={size:{type:`enum`,className:`rt-r-size`,values:[`1`,`2`,`3`],default:`2`,responsive:!0},variant:{type:`enum`,className:`rt-variant`,values:[`classic`,`surface`,`soft`],default:`surface`},...Kf,...wp},kh={side:{type:`enum`,values:[`left`,`right`]},...Kf,gap:pm.gap,px:Jp.px,pl:Jp.pl,pr:Jp.pr},Ah=m(V()),jh=t.forwardRef((e,n)=>{let r=t.useRef(null),{children:i,className:a,color:o,radius:s,style:c,...l}=pp(e,Oh,hp);return t.createElement(`div`,{"data-accent-color":o,"data-radius":s,style:c,className:(0,Ah.default)(`rt-TextFieldRoot`,a),onPointerDown:e=>{let t=e.target;if(t.closest(`input, button, a`))return;let n=r.current;if(!n)return;let i=t.closest(`
46
46
  .rt-TextFieldSlot[data-side='right'],
47
47
  .rt-TextFieldSlot:not([data-side='right']) ~ .rt-TextFieldSlot:not([data-side='left'])
48
- `)?n.value.length:0;requestAnimationFrame(()=>{try{n.setSelectionRange(i,i)}catch{}n.focus()})}},t.createElement(`input`,{spellCheck:`false`,...l,ref:_(r,n),className:`rt-reset rt-TextFieldInput`}),i)});jh.displayName=`TextField.Root`;var Mh=t.forwardRef((e,n)=>{let{className:r,color:i,side:a,...o}=pp(e,kh);return t.createElement(`div`,{"data-accent-color":i,"data-side":a,...o,ref:n,className:(0,Ah.default)(`rt-TextFieldSlot`,r)})});Mh.displayName=`TextField.Slot`;function G(e,t=`Assertion error`){if(!e)throw Error(t)}function Nh({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Ph(e,t){return t.sort(e===`horizontal`?Fh:Ih)}function Fh(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function Ih(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function Lh(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function Rh(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function zh({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=Rh(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return G(i,`No rect found`),i}function Bh(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=Ph(n,Array.from(t.children).filter(Lh).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c,l=[];for(let t of a)if(t.hasAttribute(`data-panel`)){let i=r.find(e=>e.element===t);if(i){if(c){let r=c.element.getBoundingClientRect(),a=t.getBoundingClientRect(),u;if(s){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(l.length){case 0:u=[e,t];break;case 1:{let i=l[0];u=[i,zh({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:u=l;break}}else u=l.length?l:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let t of u)o.push({group:e,groupSize:Nh({group:e}),panels:[c,i],separator:`width`in t?void 0:t,rect:`width`in t?t:t.element.getBoundingClientRect()})}s=!1,c=i,l=[]}}else if(t.hasAttribute(`data-separator`)){let e=i.find(e=>e.element===t);e?l.push(e):(c=void 0,l=[])}else s=!0;return o}function Vh(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function Hh(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function Uh(e){return e/100*window.innerHeight}function Wh(e){return e/100*window.innerWidth}function Gh(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Kh({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=Gh(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=Hh(t,i);break;case`em`:r=Vh(t,i);break;case`vh`:r=Uh(i);break;case`vw`:r=Wh(i);break}return r}function qh(e){return parseFloat(e.toFixed(3))}function Jh(e){let{panels:t}=e,n=Nh({group:e});return n===0?t.map(e=>({collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize&&(i=qh(Kh({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize&&(a=qh(Kh({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize&&(o=qh(Kh({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize&&(s=qh(Kh({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,minSize:o,maxSize:s,panelId:e.id}})}var Yh=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}};function Xh(e,t,n=0){return Math.abs(qh(e)-qh(t))<=n}var Zh={cursorFlags:0,interactionState:{state:`inactive`},mountedGroups:new Map},Qh=new Yh;function $h(){return Zh}function eg(e){let t=typeof e==`function`?e(Zh):e;if(Zh===t)return Zh;let n=Zh;return Zh={...Zh,...t},t.cursorFlags!==void 0&&Qh.emit(`cursorFlagsChange`,Zh.cursorFlags),t.interactionState!==void 0&&Qh.emit(`interactionStateChange`,Zh.interactionState),t.mountedGroups!==void 0&&(Zh.mountedGroups.forEach((e,t)=>{e.derivedPanelConstraints.forEach(r=>{if(r.collapsible){let{layout:i}=n.mountedGroups.get(t)??{};if(i){let n=Xh(r.collapsedSize,e.layout[r.panelId]),a=Xh(r.collapsedSize,i[r.panelId]);n&&!a&&(t.inMemoryLastExpandedPanelSizes[r.panelId]=i[r.panelId])}}})}),Qh.emit(`mountedGroupsChange`,Zh.mountedGroups)),Zh}function tg(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function ng(e,t){return Xh(e,t)?0:e>t?1:-1}function rg({panelConstraints:e,size:t}){let{collapsedSize:n=0,collapsible:r,maxSize:i=100,minSize:a=0}=e;if(ng(t,a)<0)if(r){let e=(n+a)/2;t=ng(t,e)<0?n:a}else t=a;return t=Math.min(i,t),t=qh(t),t}function ig({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(Xh(e,0))return t;let o=Object.values(t),s=Object.values(i),c=[...o],[l,u]=r;G(l!=null,`Invalid first pivot index`),G(u!=null,`Invalid second pivot index`);let d=0;if(a===`keyboard`){{let t=e<0?u:l,r=n[t];G(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:s=0}=r;if(a){let n=o[t];if(G(n!=null,`Previous layout not found for panel index ${t}`),Xh(n,i)){let t=s-n;ng(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?l:u,r=n[t];G(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:s=0}=r;if(a){let n=o[t];if(G(n!=null,`Previous layout not found for panel index ${t}`),Xh(n,s)){let t=n-i;ng(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let t=e<0?1:-1,r=e<0?u:l,i=0;for(;;){let e=o[r];G(e!=null,`Previous layout not found for panel index ${r}`);let a=rg({panelConstraints:n[r],size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?l:u;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(d),i=o[t];G(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,s=rg({panelConstraints:n[t],size:a});if(!Xh(i,s)&&(d+=i-s,c[t]=s,d.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(tg(s,c))return i;{let t=e<0?u:l,r=o[t];G(r!=null,`Previous layout not found for panel index ${t}`);let i=r+d,a=rg({panelConstraints:n[t],size:i});if(c[t]=a,!Xh(a,i)){let t=i-a,r=e<0?u:l;for(;r>=0&&r<n.length;){let i=c[r];G(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,o=rg({panelConstraints:n[r],size:a});if(Xh(i,o)||(t-=o-i,c[r]=o),Xh(t,0))break;e>0?r--:r++}}}if(!Xh(Object.values(c).reduce((e,t)=>t+e,0),100,.1))return i;let f=Object.keys(i);return c.reduce((e,t,n)=>(e[f[n]]=t,e),{})}function ag(e){let{mountedGroups:t}=$h();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function og(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||ng(e[n],t[n])!==0)return!1;return!0}function sg({layout:e,panelConstraints:t}){let n=[...Object.values(e)],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(e=>`${e}%`).join(`, `)}`);if(!Xh(r,100)&&n.length>0)for(let e=0;e<t.length;e++){let t=n[e];G(t!=null,`No layout data found for index ${e}`),n[e]=100/r*t}let i=0;for(let e=0;e<t.length;e++){let r=n[e];G(r!=null,`No layout data found for index ${e}`);let a=rg({panelConstraints:t[e],size:r});r!=a&&(i+=r-a,n[e]=a)}if(!Xh(i,0))for(let e=0;e<t.length;e++){let r=n[e];G(r!=null,`No layout data found for index ${e}`);let a=r+i,o=rg({panelConstraints:t[e],size:a});if(r!==o&&(i-=o-r,n[e]=o,Xh(i,0)))break}let a=Object.keys(e);return n.reduce((e,t,n)=>(e[a[n]]=t,e),{})}function cg({groupId:e}){let t=()=>{let{mountedGroups:t}=$h();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,layout:a,separatorToPanels:o}=t(),s=sg({layout:e,panelConstraints:r});return n?a:(og(a,s)||eg(e=>({mountedGroups:new Map(e.mountedGroups).set(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,layout:s,separatorToPanels:o})})),s)}}}function lg(e){let{mountedGroups:t}=$h(),n=t.get(e);return G(n,`Mounted Group ${e.id} not found`),n}function ug(e,t){let n=ag(e),r=lg(n),i=n.separators.find(t=>t.element===e);G(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);G(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=cg({groupId:n.id}).getLayout(),c=sg({layout:ig({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});og(s,c)||eg(e=>({mountedGroups:new Map(e.mountedGroups).set(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,layout:c,separatorToPanels:r.separatorToPanels})}))}function dg(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=ag(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&ug(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&ug(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&ug(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&ug(t,-5);break;case`End`:e.preventDefault(),ug(t,100);break;case`Enter`:{e.preventDefault();let n=ag(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=lg(n),o=n.separators.find(e=>e.element===t);G(o,`Matching separator not found`);let s=a.get(o);G(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(G(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];ug(t,(l.collapsedSize===e?n.inMemoryLastExpandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=ag(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);G(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus();break}case`Home`:e.preventDefault(),ug(t,-100);break}}var fg=e=>e,pg=()=>{},mg=1,hg=2,gg=4,_g=8,vg={coarse:10,precise:5};function yg(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=Rh(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}var bg;function xg(){return bg===void 0&&(bg=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),bg}function Sg(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Cg(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:kg(e),b:kg(t)},r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;G(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Og(Dg(n.a)),b:Og(Dg(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var wg=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Tg(e){let t=getComputedStyle(Ag(e)??e).display;return t===`flex`||t===`inline-flex`}function Eg(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Tg(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`||wg.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function Dg(e){let t=e.length;for(;t--;){let n=e[t];if(G(n,`Missing node`),Eg(n))return n}return null}function Og(e){return e&&Number(getComputedStyle(e).zIndex)||0}function kg(e){let t=[];for(;e;)t.push(e),e=Ag(e);return t}function Ag(e){let{parentNode:t}=e;return Sg(t)?t.host:t}function jg(e,t){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 Mg({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Lh(n)||n.contains(e)||e.contains(n))return!0;if(Cg(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(jg(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Ng(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=xg()?vg.coarse:vg.precise,a=Bh(r),o=yg(r.orientation,a,{x:e.clientX,y:e.clientY});o&&o.distance.x<=i&&o.distance.y<=i&&Mg({groupElement:r.element,hitRegion:o.hitRegion.rect,pointerEventTarget:e.target})&&n.push(o.hitRegion)}),n}function Pg(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let{mountedGroups:t}=$h(),n=Ng(e,t),r=new Set,i=new Set,a=new Set,o=new Map,s=!1;n.forEach(e=>{r.add(e.group),e.panels.forEach(e=>{i.add(e)}),e.separator&&(a.add(e.separator),s||(s=!0,e.separator.element.focus()));let n=t.get(e.group);n&&o.set(e.group,n.layout)}),eg({interactionState:{hitRegions:n,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}}),n.length&&e.preventDefault()}function Fg({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(r===0&&i===0)return null;switch(n){case`active`:{let t=(e&mg)!==0,n=(e&hg)!==0,r=(e&gg)!==0,i=(e&_g)!==0;if(e){if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}}return r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`}var Ig=new WeakMap;function Lg(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=Ig.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets=[n]);let{cursorFlags:r,interactionState:i}=$h();switch(i.state){case`active`:case`hover`:{let e=Fg({cursorFlags:r,groups:i.hitRegions.map(e=>e.group),state:i.state}),a=`*{cursor: ${e} !important; ${i.state===`active`?`touch-action: none;`:``} }`;if(t===a)return;t=a,e?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}Ig.set(e,{prevStyle:t,styleSheet:n})}function Rg({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a}){let o=0,s=new Map(i);n.forEach(e=>{let{group:n,groupSize:c}=e,{disableCursor:l,orientation:u,panels:d}=n,f=0;f=a?u===`horizontal`?(t.clientX-a.x)/c*100:(t.clientY-a.y)/c*100:u===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let p=r.get(n),{defaultLayoutDeferred:m,derivedPanelConstraints:h,layout:g,separatorToPanels:_}=i.get(n)??{defaultLayoutDeferred:!1};if(h&&p&&g&&_){let t=ig({delta:f,initialLayout:p,panelConstraints:h,pivotIndices:e.panels.map(e=>d.indexOf(e)),prevLayout:g,trigger:`mouse-or-touch`});if(og(t,g)){if(f!==0&&!l)switch(u){case`horizontal`:o|=f<0?mg:hg;break;case`vertical`:o|=f<0?gg:_g;break}}else{s.set(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,layout:t,separatorToPanels:_});let n=e.group.panels.map(({id:e})=>e).join(`,`);e.group.inMemoryLayouts[n]=t}}}),eg({cursorFlags:o,mountedGroups:s}),Lg(e)}function zg(e){let{interactionState:t,mountedGroups:n}=$h();switch(t.state){case`active`:Rg({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n})}}function Bg(e){if(e.defaultPrevented)return;let{interactionState:t,mountedGroups:n}=$h();switch(t.state){case`active`:if(e.buttons===0){eg(e=>e.interactionState.state===`inactive`?e:{cursorFlags:0,interactionState:{state:`inactive`}});return}Rg({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint});break;default:{let r=Ng(e,n);r.length===0?t.state!==`inactive`&&eg({interactionState:{state:`inactive`}}):eg({interactionState:{hitRegions:r,state:`hover`}}),Lg(e.currentTarget);break}}}function Vg(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;e.preventDefault();let{interactionState:t}=$h();switch(t.state){case`active`:eg({cursorFlags:0,interactionState:{state:`inactive`}}),Lg(e.currentTarget)}}function Hg(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=qh(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=qh((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function Ug(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Nh({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:qh(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Wg(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Gg(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var Kg=new Map;function qg(e){let t=!0;G(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){if(Nh({group:e})===0)return;eg(t=>{let n=t.mountedGroups.get(e);if(n){let r=Jh(e),i=n.defaultLayoutDeferred?Hg(r):n.layout,a=sg({layout:i,panelConstraints:r});return!n.defaultLayoutDeferred&&og(i,a)&&Wg(n.derivedPanelConstraints,r)?t:{mountedGroups:new Map(t.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,layout:a,separatorToPanels:n.separatorToPanels})}}return t})}}else Ug(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{G(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=Nh({group:e}),s=Jh(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.defaultLayout;l&&(Gg(e.panels,l)||(l=void 0));let u=sg({layout:e.inMemoryLayouts[c]??l??Hg(s),panelConstraints:s}),d=Bh(e),f=e.element.ownerDocument;return eg(t=>{let n=new Map;return Kg.set(f,(Kg.get(f)??0)+1),d.forEach(e=>{e.separator&&n.set(e.separator,e.panels)}),{mountedGroups:new Map(t.mountedGroups).set(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,layout:u,separatorToPanels:n})}}),e.separators.forEach(e=>{G(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,dg)}),Kg.get(f)===1&&(f.addEventListener(`pointerdown`,Pg,!0),f.addEventListener(`pointerleave`,zg),f.addEventListener(`pointermove`,Bg),f.addEventListener(`pointerup`,Vg,!0)),function(){t=!1,Kg.set(f,Math.max(0,(Kg.get(f)??0)-1)),eg(t=>{let n=new Map(t.mountedGroups);return n.delete(e),{mountedGroups:n}}),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,dg)}),Kg.get(f)||(f.removeEventListener(`pointerdown`,Pg,!0),f.removeEventListener(`pointerleave`,zg),f.removeEventListener(`pointermove`,Bg),f.removeEventListener(`pointerup`,Vg,!0)),a.disconnect()}}function Jg(){let[e,n]=(0,t.useState)({});return[e,(0,t.useCallback)(()=>n({}),[])]}function Yg(e){let n=(0,t.useId)();return`${e??n}`}var Xg=typeof window<`u`?t.useLayoutEffect:t.useEffect;function Zg(e){let n=(0,t.useRef)(e);return Xg(()=>{n.current=e},[e]),(0,t.useCallback)((...e)=>n.current?.(...e),[n])}function Qg(...e){return Zg(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function $g(e){let n=(0,t.useRef)({...e});return Xg(()=>{for(let t in e)n.current[t]=e[t]},[e]),n.current}var e_=`--react-resizable-panels--panel--pointer-events`;function t_(e,t){return`--react-resizable-panels--${e.replace(/[^a-zA-Z0-9\-_]/g,``)}--${t.replace(/[^a-zA-Z0-9\-_]/g,``)}`}var n_=(0,t.createContext)(null);function r_(e,n){let r=(0,t.useRef)({getLayout:()=>({}),setLayout:fg});(0,t.useImperativeHandle)(n,()=>r.current,[]),Xg(()=>{Object.assign(r.current,cg({groupId:e}))})}function i_({children:e,className:n,defaultLayout:i,disableCursor:a,disabled:o,elementRef:s,groupRef:c,id:l,onLayoutChange:u,orientation:d=`horizontal`,style:f,...p}){let m=(0,t.useRef)({}),h=Zg(e=>{og(m.current,e)||(m.current=e,u?.(e))}),g=Yg(l),_=(0,t.useRef)(null),[v,y]=(0,t.useState)(!1),[b,x]=(0,t.useState)(i??{}),[S,C]=Jg(),w=(0,t.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],separators:[]}),T=Qg(_,s);r_(g,c);let E=(0,t.useMemo)(()=>({id:g,orientation:d,registerPanel:e=>{let t=w.current;return t.panels=Ph(d,[...t.panels,e]),C(),()=>{t.panels=t.panels.filter(t=>t!==e),C()}},registerSeparator:e=>{let t=w.current;return t.separators=Ph(d,[...t.separators,e]),C(),()=>{t.separators=t.separators.filter(t=>t!==e),C()}}}),[g,C,d]),D=$g({defaultLayout:i,disableCursor:a}),O=(0,t.useRef)(null);Xg(()=>{let e=_.current;if(e===null)return;let t=w.current,n={defaultLayout:D.defaultLayout,disableCursor:!!D.disableCursor,disabled:!!o,element:e,id:g,inMemoryLastExpandedPanelSizes:w.current.lastExpandedPanelSizes,inMemoryLayouts:w.current.layouts,orientation:d,panels:t.panels,separators:t.separators};O.current=n;let r=qg(n),i=$h().mountedGroups.get(n);if(i){let{defaultLayoutDeferred:e,derivedPanelConstraints:t,layout:n}=i;!e&&t.length>0&&(x(n),h?.(n))}let a=Qh.addListener(`interactionStateChange`,e=>{switch(e.state){case`active`:y(e.hitRegions.some(e=>e.group===n));break;default:y(!1);break}}),s=Qh.addListener(`mountedGroupsChange`,e=>{let t=e.get(n);if(t){let{defaultLayoutDeferred:e,derivedPanelConstraints:n,layout:r}=t;if(e||n.length===0)return;x(r),h?.(r)}});return()=>{O.current=null,r(),a(),s()}},[o,g,h,d,S,D]),(0,t.useEffect)(()=>{let e=O.current;e&&(e.defaultLayout=i,e.disableCursor=!!a)});let k={[e_]:v?`none`:void 0};for(let e in b){let t=t_(g,e);k[t]=b[e]}return(0,r.jsx)(n_.Provider,{value:E,children:(0,r.jsx)(`div`,{...p,"aria-orientation":d,className:n,"data-group":!0,"data-testid":g,id:g,ref:T,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,...k,display:`flex`,flexDirection:d===`horizontal`?`row`:`column`,flexWrap:`nowrap`},children:e})})}i_.displayName=`Group`;function a_(){let e=(0,t.useContext)(n_);return G(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function o_({groupId:e,panelId:t}){let n=()=>{let{mountedGroups:t}=$h();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,separatorToPanels:o}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,layout:a,separatorToPanels:o};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,layout:c,separatorToPanels:l}=n(),u=s.panels.findIndex(e=>e.id===t),d=u===s.panels.length-1,f=sg({layout:ig({delta:d?r-e:e-r,initialLayout:c,panelConstraints:o,pivotIndices:d?[u-1,u]:[u,u+1],prevLayout:c,trigger:`imperative-api`}),panelConstraints:o});og(c,f)||eg(e=>({mountedGroups:new Map(e.mountedGroups).set(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,layout:f,separatorToPanels:l})}))};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&Xh(t,n)},resize:e=>{if(a()!==e){let t;switch(typeof e){case`number`:{let{group:r}=n();t=qh(e/Nh({group:r})*100);break}case`string`:t=parseFloat(e);break}o(t)}}}}function s_(e,n){let{id:r}=a_(),i=(0,t.useRef)({collapse:pg,expand:pg,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:pg});(0,t.useImperativeHandle)(n,()=>i.current,[]),Xg(()=>{Object.assign(i.current,o_({groupId:r,panelId:e}))})}function c_({children:e,className:n,collapsedSize:i=`0%`,collapsible:a=!1,defaultSize:o,elementRef:s,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=Yg(c),_=(0,t.useRef)(null),v=Qg(_,s),{id:y,registerPanel:b}=a_(),x=d!==null,S=Zg((e,t,n)=>{d?.(e,c,n)});Xg(()=>{let e=_.current;if(e!==null)return b({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:x?S:void 0,panelConstraints:{collapsedSize:i,collapsible:a,defaultSize:o,maxSize:l,minSize:u}})},[i,a,o,x,g,h,l,u,S,b]),s_(g,f);let C=t_(y,g);return(0,r.jsx)(`div`,{...m,"data-panel":!0,"data-testid":g,id:g,ref:v,style:{...l_,flexBasis:0,flexGrow:`var(${C}, 1)`,flexShrink:1,overflow:`hidden`,pointerEvents:`var(${e_})`},children:(0,r.jsx)(`div`,{className:n,style:{width:`100%`,height:`100%`,...p},children:e})})}c_.displayName=`Panel`;var l_={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function u_({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=a=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=sg({layout:ig({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e,trigger:`keyboard`}),panelConstraints:t})[n],i=sg({layout:ig({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e,trigger:`keyboard`}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function d_({children:e,className:n,elementRef:i,id:a,style:o,...s}){let c=Yg(a),[l,u]=(0,t.useState)({}),[d,f]=(0,t.useState)(`inactive`),p=(0,t.useRef)(null),m=Qg(p,i),{id:h,orientation:g,registerSeparator:_}=a_(),v=g===`horizontal`?`vertical`:`horizontal`;return Xg(()=>{let e=p.current;if(e!==null){let t={element:e,id:c},n=_(t),r=Qh.addListener(`interactionStateChange`,e=>{f(e.state!==`inactive`&&e.hitRegions.some(e=>e.separator===t)?e.state:`inactive`)}),i=Qh.addListener(`mountedGroupsChange`,e=>{e.forEach(({derivedPanelConstraints:e,layout:n,separatorToPanels:r},i)=>{if(i.id===h){let a=r.get(t);if(a){let t=a[0],r=i.panels.indexOf(t);u(u_({layout:n,panelConstraints:e,panelId:t.id,panelIndex:r}))}}})});return()=>{r(),i(),n()}}},[h,c,_]),(0,r.jsx)(`div`,{...s,"aria-controls":l.valueControls,"aria-orientation":v,"aria-valuemax":l.valueMax,"aria-valuemin":l.valueMin,"aria-valuenow":l.valueNow,children:e,className:n,"data-separator":d,"data-testid":c,id:c,ref:m,role:`separator`,style:{flexBasis:`auto`,...o,flexGrow:0,flexShrink:0},tabIndex:0})}d_.displayName=`Separator`;function f_(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var p_=[`color`],m_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,p_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),h_=[`color`],g_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,h_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),__=[`color`],v_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,__);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),y_=[`color`],b_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,y_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),x_=[`color`],S_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,x_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),C_=[`color`],w_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,C_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),T_=[`color`],E_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,T_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M7.07095 0.650238C6.67391 0.650238 6.32977 0.925096 6.24198 1.31231L6.0039 2.36247C5.6249 2.47269 5.26335 2.62363 4.92436 2.81013L4.01335 2.23585C3.67748 2.02413 3.23978 2.07312 2.95903 2.35386L2.35294 2.95996C2.0722 3.2407 2.0232 3.6784 2.23493 4.01427L2.80942 4.92561C2.62307 5.2645 2.47227 5.62594 2.36216 6.00481L1.31209 6.24287C0.924883 6.33065 0.650024 6.6748 0.650024 7.07183V7.92897C0.650024 8.32601 0.924883 8.67015 1.31209 8.75794L2.36228 8.99603C2.47246 9.375 2.62335 9.73652 2.80979 10.0755L2.2354 10.9867C2.02367 11.3225 2.07267 11.7602 2.35341 12.041L2.95951 12.6471C3.24025 12.9278 3.67795 12.9768 4.01382 12.7651L4.92506 12.1907C5.26384 12.377 5.62516 12.5278 6.0039 12.6379L6.24198 13.6881C6.32977 14.0753 6.67391 14.3502 7.07095 14.3502H7.92809C8.32512 14.3502 8.66927 14.0753 8.75705 13.6881L8.99505 12.6383C9.37411 12.5282 9.73573 12.3773 10.0748 12.1909L10.986 12.7653C11.3218 12.977 11.7595 12.928 12.0403 12.6473L12.6464 12.0412C12.9271 11.7604 12.9761 11.3227 12.7644 10.9869L12.1902 10.076C12.3768 9.73688 12.5278 9.37515 12.638 8.99596L13.6879 8.75794C14.0751 8.67015 14.35 8.32601 14.35 7.92897V7.07183C14.35 6.6748 14.0751 6.33065 13.6879 6.24287L12.6381 6.00488C12.528 5.62578 12.3771 5.26414 12.1906 4.92507L12.7648 4.01407C12.9766 3.6782 12.9276 3.2405 12.6468 2.95975L12.0407 2.35366C11.76 2.07292 11.3223 2.02392 10.9864 2.23565L10.0755 2.80989C9.73622 2.62328 9.37437 2.47229 8.99505 2.36209L8.75705 1.31231C8.66927 0.925096 8.32512 0.650238 7.92809 0.650238H7.07095ZM4.92053 3.81251C5.44724 3.44339 6.05665 3.18424 6.71543 3.06839L7.07095 1.50024H7.92809L8.28355 3.06816C8.94267 3.18387 9.5524 3.44302 10.0794 3.81224L11.4397 2.9547L12.0458 3.56079L11.1882 4.92117C11.5573 5.44798 11.8164 6.0575 11.9321 6.71638L13.5 7.07183V7.92897L11.932 8.28444C11.8162 8.94342 11.557 9.55301 11.1878 10.0798L12.0453 11.4402L11.4392 12.0462L10.0787 11.1886C9.55192 11.5576 8.94241 11.8166 8.28355 11.9323L7.92809 13.5002H7.07095L6.71543 11.932C6.0569 11.8162 5.44772 11.5572 4.92116 11.1883L3.56055 12.046L2.95445 11.4399L3.81213 10.0794C3.4431 9.55266 3.18403 8.94326 3.06825 8.2845L1.50002 7.92897V7.07183L3.06818 6.71632C3.18388 6.05765 3.44283 5.44833 3.81171 4.92165L2.95398 3.561L3.56008 2.95491L4.92053 3.81251ZM9.02496 7.50008C9.02496 8.34226 8.34223 9.02499 7.50005 9.02499C6.65786 9.02499 5.97513 8.34226 5.97513 7.50008C5.97513 6.65789 6.65786 5.97516 7.50005 5.97516C8.34223 5.97516 9.02496 6.65789 9.02496 7.50008ZM9.92496 7.50008C9.92496 8.83932 8.83929 9.92499 7.50005 9.92499C6.1608 9.92499 5.07513 8.83932 5.07513 7.50008C5.07513 6.16084 6.1608 5.07516 7.50005 5.07516C8.83929 5.07516 9.92496 6.16084 9.92496 7.50008Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),D_=[`color`],O_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,D_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M5 7.50003C5 8.32845 4.32843 9.00003 3.5 9.00003C2.67157 9.00003 2 8.32845 2 7.50003C2 6.6716 2.67157 6.00003 3.5 6.00003C4.32843 6.00003 5 6.6716 5 7.50003ZM5.71313 8.66388C5.29445 9.45838 4.46048 10 3.5 10C2.11929 10 1 8.88074 1 7.50003C1 6.11931 2.11929 5.00003 3.5 5.00003C4.46048 5.00003 5.29445 5.54167 5.71313 6.33616L9.10424 4.21671C9.03643 3.98968 9 3.74911 9 3.50003C9 2.11932 10.1193 1.00003 11.5 1.00003C12.8807 1.00003 14 2.11932 14 3.50003C14 4.88074 12.8807 6.00003 11.5 6.00003C10.6915 6.00003 9.97264 5.61624 9.51566 5.0209L5.9853 7.22738C5.99502 7.31692 6 7.40789 6 7.50003C6 7.59216 5.99502 7.68312 5.9853 7.77267L9.51567 9.97915C9.97265 9.38382 10.6915 9.00003 11.5 9.00003C12.8807 9.00003 14 10.1193 14 11.5C14 12.8807 12.8807 14 11.5 14C10.1193 14 9 12.8807 9 11.5C9 11.2509 9.03643 11.0104 9.10425 10.7833L5.71313 8.66388ZM11.5 5.00003C12.3284 5.00003 13 4.32846 13 3.50003C13 2.6716 12.3284 2.00003 11.5 2.00003C10.6716 2.00003 10 2.6716 10 3.50003C10 4.32846 10.6716 5.00003 11.5 5.00003ZM13 11.5C13 12.3285 12.3284 13 11.5 13C10.6716 13 10 12.3285 10 11.5C10 10.6716 10.6716 10 11.5 10C12.3284 10 13 10.6716 13 11.5Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),k_=(0,t.createContext)(void 0),A_=[`Arial`,`Helvetica`,`Times New Roman`,`Courier New`,`Verdana`,`Georgia`,`Palatino`,`Garamond`,`Bookman`,`Comic Sans MS`,`Trebuchet MS`,`Arial Black`,`Impact`];let j_=({children:e,isList:n=!1,availableProps:i=[],theme:a=`light`})=>{let[o,s]=(0,t.useState)({elements:[],selectedElementId:null,isList:n,mockData:[],singleMockData:{},listSettings:{sortOrder:`asc`,newestPosition:`bottom`,scrollDirection:`down`},availableProps:i,availableFonts:[...A_,`Roboto`,`Open Sans`,`Lato`,`Montserrat`],theme:a});t.default.useEffect(()=>{o.availableFonts.forEach(e=>{if(A_.includes(e))return;let t=`font-${e.replace(/\s+/g,`-`).toLowerCase()}`;if(!document.getElementById(t)){let n=document.createElement(`link`);n.id=t,n.href=`https://fonts.googleapis.com/css2?family=${e.replace(/ /g,`+`)}&display=swap`,n.rel=`stylesheet`,document.head.appendChild(n)}})},[o.availableFonts]),t.default.useEffect(()=>{s(e=>({...e,isList:n,availableProps:i,theme:a}))},[n,i,a]);let c=t.default.useCallback(e=>{s(t=>({...t,canvasHeight:e}))},[]),l=t.default.useCallback(e=>{s(t=>({...t,...e,isList:e.isList??t.isList,availableProps:e.availableProps??t.availableProps,availableFonts:e.availableFonts??t.availableFonts,selectedElementId:null}))},[]),u=t.default.useCallback(e=>{let t={};e.type===`box`&&(t.backgroundColor=`var(--gray-4)`);let n={id:crypto.randomUUID(),x:50,y:50,width:200,height:e.type===`text`?50:150,...e,style:{...t,...e.style||{}}};s(e=>({...e,elements:[...e.elements,n]}))},[]),d=t.default.useCallback(e=>{s(t=>({...t,elements:t.elements.filter(t=>t.id!==e),selectedElementId:t.selectedElementId===e?null:t.selectedElementId}))},[]),f=t.default.useCallback(e=>{s(t=>({...t,selectedElementId:e}))},[]),p=t.default.useCallback((e,t)=>{s(n=>{let r=[...n.elements],i=r[e];return r.splice(e,1),r.splice(t,0,i),{...n,elements:r}})},[]),m=t.default.useCallback((e,t)=>{s(n=>({...n,elements:n.elements.map(n=>n.id===e?{...n,...t}:n)}))},[]),h=t.default.useCallback((e,t)=>{s(n=>({...n,mockData:e,singleMockData:t}))},[]),g=t.default.useCallback(e=>{s(t=>({...t,listSettings:{...t.listSettings,...e}}))},[]),_=t.default.useMemo(()=>({state:o,addElement:u,removeElement:d,selectElement:f,moveElement:p,updateElement:m,setMockData:h,updateListSettings:g,setCanvasHeight:c,loadState:l}),[o,u,d,f,p,m,h,g,c,l]);return(0,r.jsx)(k_.Provider,{value:_,children:e})},M_=()=>{let e=(0,t.useContext)(k_);if(!e)throw Error(`useEditor must be used within an EditorProvider`);return e};var K=function(){return K=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},K.apply(this,arguments)},N_={width:`100%`,height:`10px`,top:`0px`,left:`0px`,cursor:`row-resize`},P_={width:`10px`,height:`100%`,top:`0px`,left:`0px`,cursor:`col-resize`},F_={width:`20px`,height:`20px`,position:`absolute`,zIndex:1},I_={top:K(K({},N_),{top:`-5px`}),right:K(K({},P_),{left:void 0,right:`-5px`}),bottom:K(K({},N_),{top:void 0,bottom:`-5px`}),left:K(K({},P_),{left:`-5px`}),topRight:K(K({},F_),{right:`-10px`,top:`-10px`,cursor:`ne-resize`}),bottomRight:K(K({},F_),{right:`-10px`,bottom:`-10px`,cursor:`se-resize`}),bottomLeft:K(K({},F_),{left:`-10px`,bottom:`-10px`,cursor:`sw-resize`}),topLeft:K(K({},F_),{left:`-10px`,top:`-10px`,cursor:`nw-resize`})},L_=(0,t.memo)(function(e){var n=e.onResizeStart,i=e.direction,a=e.children,o=e.replaceStyles,s=e.className,c=(0,t.useCallback)(function(e){n(e,i)},[n,i]),l=(0,t.useCallback)(function(e){n(e,i)},[n,i]),u=(0,t.useMemo)(function(){return K(K({position:`absolute`,userSelect:`none`},I_[i]),o??{})},[o,i]);return(0,r.jsx)(`div`,{className:s||void 0,style:u,onMouseDown:c,onTouchStart:l,children:a})}),R_=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),z_=function(){return z_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z_.apply(this,arguments)},B_={width:`auto`,height:`auto`},V_=function(e,t,n){return Math.max(Math.min(e,n),t)},H_=function(e,t,n){var r=Math.round(e/t);return r*t+n*(r-1)},U_=function(e,t){return new RegExp(e,`i`).test(t)},W_=function(e){return!!(e.touches&&e.touches.length)},G_=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},K_=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(n,r,i){return Math.abs(r-e)<Math.abs(t[n]-e)?i:n},0),i=Math.abs(t[r]-e);return n===0||i<n?t[r]:e},q_=function(e){return e=e.toString(),e===`auto`||e.endsWith(`px`)||e.endsWith(`%`)||e.endsWith(`vh`)||e.endsWith(`vw`)||e.endsWith(`vmax`)||e.endsWith(`vmin`)?e:`${e}px`},J_=function(e,t,n,r){if(e&&typeof e==`string`){if(e.endsWith(`px`))return Number(e.replace(`px`,``));if(e.endsWith(`%`)){var i=Number(e.replace(`%`,``))/100;return t*i}if(e.endsWith(`vw`)){var i=Number(e.replace(`vw`,``))/100;return n*i}if(e.endsWith(`vh`)){var i=Number(e.replace(`vh`,``))/100;return r*i}}return e},Y_=function(e,t,n,r,i,a,o){return r=J_(r,e.width,t,n),i=J_(i,e.height,t,n),a=J_(a,e.width,t,n),o=J_(o,e.height,t,n),{maxWidth:r===void 0?void 0:Number(r),maxHeight:i===void 0?void 0:Number(i),minWidth:a===void 0?void 0:Number(a),minHeight:o===void 0?void 0:Number(o)}},X_=function(e){return Array.isArray(e)?e:[e,e]},Z_=`as.ref.style.className.grid.gridGap.snap.bounds.boundsByDirection.size.defaultSize.minWidth.minHeight.maxWidth.maxHeight.lockAspectRatio.lockAspectRatioExtraWidth.lockAspectRatioExtraHeight.enable.handleStyles.handleClasses.handleWrapperStyle.handleWrapperClass.children.onResizeStart.onResize.onResizeStop.handleComponent.scale.resizeRatio.snapGap`.split(`.`),Q_=`__resizable_base__`,$_=function(e){R_(t,e);function t(t){var n=e.call(this,t)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.delta={width:0,height:0},n.appendBase=function(){if(!n.resizable||!n.window)return null;var e=n.parentNode;if(!e)return null;var t=n.window.document.createElement(`div`);return t.style.width=`100%`,t.style.height=`100%`,t.style.position=`absolute`,t.style.transform=`scale(0, 0)`,t.style.left=`0`,t.style.flex=`0 0 100%`,t.classList?t.classList.add(Q_):t.className+=Q_,e.appendChild(t),t},n.removeBase=function(e){var t=n.parentNode;t&&t.removeChild(e)},n.state={isResizing:!1,width:n.propsSize?.width??`auto`,height:n.propsSize?.height??`auto`,direction:`right`,original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:`100%`,width:`100%`,backgroundColor:`rgba(0,0,0,0)`,cursor:`auto`,opacity:0,position:`fixed`,zIndex:9999,top:`0`,left:`0`,bottom:`0`,right:`0`},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return Object.defineProperty(t.prototype,`parentNode`,{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`window`,{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`propsSize`,{get:function(){return this.props.size||this.props.defaultSize||B_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`size`,{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,i=this.resizable.style.position;i!==`relative`&&(this.resizable.style.position=`relative`),e=this.resizable.style.width===`auto`?n:this.resizable.offsetWidth,t=this.resizable.style.height===`auto`?r:this.resizable.offsetHeight,this.resizable.style.position=i}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`sizeStyle`,{get:function(){var e=this,t=this.props.size,n=function(t){if(e.state[t]===void 0||e.state[t]===`auto`)return`auto`;if(e.propsSize&&e.propsSize[t]&&e.propsSize[t]?.toString().endsWith(`%`)){if(e.state[t].toString().endsWith(`%`))return e.state[t].toString();var n=e.getParentSize();return`${Number(e.state[t].toString().replace(`px`,``))/n[t]*100}%`}return q_(e.state[t])};return{width:t&&t.width!==void 0&&!this.state.isResizing?q_(t.width):n(`width`),height:t&&t.height!==void 0&&!this.state.isResizing?q_(t.height):n(`height`)}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;n!==`wrap`&&(t=!0,this.parentNode.style.flexWrap=`wrap`),e.style.position=`relative`,e.style.minWidth=`100%`,e.style.minHeight=`100%`;var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener(`mouseup`,this.onMouseUp),this.window.addEventListener(`mousemove`,this.onMouseMove),this.window.addEventListener(`mouseleave`,this.onMouseUp),this.window.addEventListener(`touchmove`,this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener(`touchend`,this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener(`mouseup`,this.onMouseUp),this.window.removeEventListener(`mousemove`,this.onMouseMove),this.window.removeEventListener(`mouseleave`,this.onMouseUp),this.window.removeEventListener(`touchmove`,this.onMouseMove,!0),this.window.removeEventListener(`touchend`,this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:e.flexBasis===`auto`?void 0:e.flexBasis})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return this.state[t]===`auto`&&this.state.original[t]===e&&(n===void 0||n===`auto`)?`auto`:e},t.prototype.calculateNewMaxFromBoundary=function(e,t){var n=this.props.boundsByDirection,r=this.state.direction,i=n&&U_(`left`,r),a=n&&U_(`top`,r),o,s;if(this.props.bounds===`parent`){var c=this.parentNode;c&&(o=i?this.resizableRight-this.parentLeft:c.offsetWidth+(this.parentLeft-this.resizableLeft),s=a?this.resizableBottom-this.parentTop:c.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds===`window`?this.window&&(o=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,s=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(o=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),s=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return o&&Number.isFinite(o)&&(e=e&&e<o?e:o),s&&Number.isFinite(s)&&(t=t&&t<s?t:s),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var n=this.props.scale||1,r=X_(this.props.resizeRatio||1),i=r[0],a=r[1],o=this.state,s=o.direction,c=o.original,l=this.props,u=l.lockAspectRatio,d=l.lockAspectRatioExtraHeight,f=l.lockAspectRatioExtraWidth,p=c.width,m=c.height,h=d||0,g=f||0;return U_(`right`,s)&&(p=c.width+(e-c.x)*i/n,u&&(m=(p-g)/this.ratio+h)),U_(`left`,s)&&(p=c.width-(e-c.x)*i/n,u&&(m=(p-g)/this.ratio+h)),U_(`bottom`,s)&&(m=c.height+(t-c.y)*a/n,u&&(p=(m-h)*this.ratio+g)),U_(`top`,s)&&(m=c.height-(t-c.y)*a/n,u&&(p=(m-h)*this.ratio+g)),{newWidth:p,newHeight:m}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var i=this.props,a=i.lockAspectRatio,o=i.lockAspectRatioExtraHeight,s=i.lockAspectRatioExtraWidth,c=r.width===void 0?10:r.width,l=n.width===void 0||n.width<0?e:n.width,u=r.height===void 0?10:r.height,d=n.height===void 0||n.height<0?t:n.height,f=o||0,p=s||0;if(a){var m=(u-f)*this.ratio+p,h=(d-f)*this.ratio+p,g=(c-p)/this.ratio+f,_=(l-p)/this.ratio+f,v=Math.max(c,m),y=Math.min(l,h),b=Math.max(u,g),x=Math.min(d,_);e=V_(e,v,y),t=V_(t,b,x)}else e=V_(e,c,l),t=V_(t,u,d);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){var e=1/(this.props.scale||1);if(this.props.bounds===`parent`){var t=this.parentNode;if(t){var n=t.getBoundingClientRect();this.parentLeft=n.left*e,this.parentTop=n.top*e}}if(this.props.bounds&&typeof this.props.bounds!=`string`){var r=this.props.bounds.getBoundingClientRect();this.targetLeft=r.left*e,this.targetTop=r.top*e}if(this.resizable){var i=this.resizable.getBoundingClientRect(),a=i.left,o=i.top,s=i.right,c=i.bottom;this.resizableLeft=a*e,this.resizableRight=s*e,this.resizableTop=o*e,this.resizableBottom=c*e}},t.prototype.onResizeStart=function(e,t){if(!(!this.resizable||!this.window)){var n=0,r=0;if(e.nativeEvent&&G_(e.nativeEvent)?(n=e.nativeEvent.clientX,r=e.nativeEvent.clientY):e.nativeEvent&&W_(e.nativeEvent)&&(n=e.nativeEvent.touches[0].clientX,r=e.nativeEvent.touches[0].clientY),!(this.props.onResizeStart&&this.resizable&&this.props.onResizeStart(e,t,this.resizable)===!1)){this.props.size&&(this.props.size.height!==void 0&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),this.props.size.width!==void 0&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio==`number`?this.props.lockAspectRatio:this.size.width/this.size.height;var i,a=this.window.getComputedStyle(this.resizable);if(a.flexBasis!==`auto`){var o=this.parentNode;o&&(this.flexDir=this.window.getComputedStyle(o).flexDirection.startsWith(`row`)?`row`:`column`,i=a.flexBasis)}this.setBoundingClientRect(),this.bindEvents();var s={original:{x:n,y:r,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:z_(z_({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||`auto`}),direction:t,flexBasis:i};this.setState(s)}}},t.prototype.onMouseMove=function(e){var t=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&W_(e))try{e.preventDefault(),e.stopPropagation()}catch{}var r=this.props,i=r.maxWidth,a=r.maxHeight,o=r.minWidth,s=r.minHeight,c=W_(e)?e.touches[0].clientX:e.clientX,l=W_(e)?e.touches[0].clientY:e.clientY,u=this.state,d=u.direction,f=u.original,p=u.width,m=u.height,h=this.getParentSize(),g=Y_(h,this.window.innerWidth,this.window.innerHeight,i,a,o,s);i=g.maxWidth,a=g.maxHeight,o=g.minWidth,s=g.minHeight;var _=this.calculateNewSizeFromDirection(c,l),v=_.newHeight,y=_.newWidth,b=this.calculateNewMaxFromBoundary(i,a);this.props.snap&&this.props.snap.x&&(y=K_(y,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(v=K_(v,this.props.snap.y,this.props.snapGap));var x=this.calculateNewSizeFromAspectRatio(y,v,{width:b.maxWidth,height:b.maxHeight},{width:o,height:s});if(y=x.newWidth,v=x.newHeight,this.props.grid){var S=H_(y,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),C=H_(v,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),w=this.props.snapGap||0,T=w===0||Math.abs(S-y)<=w?S:y,E=w===0||Math.abs(C-v)<=w?C:v;y=T,v=E}var D={width:y-f.width,height:v-f.height};if(this.delta=D,p&&typeof p==`string`){if(p.endsWith(`%`)){var O=y/h.width*100;y=`${O}%`}else if(p.endsWith(`vw`)){var k=y/this.window.innerWidth*100;y=`${k}vw`}else if(p.endsWith(`vh`)){var A=y/this.window.innerHeight*100;y=`${A}vh`}}if(m&&typeof m==`string`){if(m.endsWith(`%`)){var O=v/h.height*100;v=`${O}%`}else if(m.endsWith(`vw`)){var k=v/this.window.innerWidth*100;v=`${k}vw`}else if(m.endsWith(`vh`)){var A=v/this.window.innerHeight*100;v=`${A}vh`}}var j={width:this.createSizeForCssProperty(y,`width`),height:this.createSizeForCssProperty(v,`height`)};this.flexDir===`row`?j.flexBasis=j.width:this.flexDir===`column`&&(j.flexBasis=j.height);var M=this.state.width!==j.width,N=this.state.height!==j.height,ee=this.state.flexBasis!==j.flexBasis,P=M||N||ee;P&&(0,n.flushSync)(function(){t.setState(j)}),this.props.onResize&&P&&this.props.onResize(e,d,this.resizable,D)}},t.prototype.onMouseUp=function(e){var t=this.state,n=t.isResizing,r=t.direction;t.original,!(!n||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(e,r,this.resizable,this.delta),this.props.size&&this.setState({width:this.props.size.width??`auto`,height:this.props.size.height??`auto`}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:z_(z_({},this.state.backgroundStyle),{cursor:`auto`})}))},t.prototype.updateSize=function(e){this.setState({width:e.width??`auto`,height:e.height??`auto`})},t.prototype.renderResizer=function(){var e=this,t=this.props,n=t.enable,i=t.handleStyles,a=t.handleClasses,o=t.handleWrapperStyle,s=t.handleWrapperClass,c=t.handleComponent;return n?(0,r.jsx)(`div`,{className:s,style:o,children:Object.keys(n).map(function(t){return n[t]===!1?null:(0,r.jsx)(L_,{direction:t,onResizeStart:e.onResizeStart,replaceStyles:i&&i[t],className:a&&a[t],children:c&&c[t]?c[t]:null},t)})}):null},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce(function(t,n){return Z_.indexOf(n)===-1&&(t[n]=e.props[n]),t},{}),n=z_(z_(z_({position:`relative`,userSelect:this.state.isResizing?`none`:`auto`},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:`border-box`,flexShrink:0});return this.state.flexBasis&&(n.flexBasis=this.state.flexBasis),(0,r.jsxs)(this.props.as||`div`,z_({style:n,className:this.props.className},t,{ref:function(t){t&&(e.resizable=t)},children:[this.state.isResizing&&(0,r.jsx)(`div`,{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:`div`,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(t.PureComponent);let ev=({children:e,element:n})=>{let{updateElement:i,removeElement:a,addElement:o,moveElement:s,state:c}=M_(),[l,u]=(0,t.useState)(!1),[d,f]=(0,t.useState)(!1),[p,m]=(0,t.useState)(n.content),[h,g]=(0,t.useState)(n.dataBinding||``),_=(0,t.useRef)(null),v=(0,t.useRef)(null),y=e=>{let t=_.current;if(t){let n=t.selectionStart,r=t.selectionEnd,i=p;m(i.substring(0,n)+`{{${e}}}`+i.substring(r)),setTimeout(()=>{t.focus();let r=n+e.length+4;t.setSelectionRange(r,r)},0)}else m(t=>t+`{{${e}}}`)},b=e=>{i(n.id,{style:{...n.style,...e}})},x=()=>{let e=c.elements.findIndex(e=>e.id===n.id);e<c.elements.length-1&&s(e,c.elements.length-1)},S=()=>{let e=c.elements.findIndex(e=>e.id===n.id);e>0&&s(e,0)},C=()=>{o({type:n.type,content:n.content,x:n.x+20,y:n.y+20,width:n.width,height:n.height,style:n.style})},w=[`#000000`,`#FFFFFF`,`#FF0000`,`#00FF00`,`#0000FF`,`#FFA500`,`#808080`,`#800080`,`transparent`];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Wm,{open:l,onOpenChange:u,children:(0,r.jsxs)(Km,{style:{maxWidth:450},children:[(0,r.jsx)(qm,{children:`Editar Texto`}),(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsx)(Dh,{ref:_,value:p,onChange:e=>m(e.target.value),placeholder:`Digite o novo texto...`,style:{height:100}}),c.availableProps&&c.availableProps.length>0&&(0,r.jsxs)(W,{direction:`column`,gap:`2`,children:[(0,r.jsx)(H,{size:`1`,color:`gray`,children:`Inserir variável:`}),(0,r.jsx)(W,{gap:`2`,wrap:`wrap`,children:c.availableProps.map(e=>(0,r.jsx)(Hp,{color:`blue`,variant:`surface`,style:{cursor:`pointer`},onClick:()=>y(e.dataName),children:e.name},e.dataName))})]}),(0,r.jsxs)(W,{gap:`3`,justify:`end`,children:[(0,r.jsx)(Ym,{children:(0,r.jsx)(Tm,{variant:`soft`,color:`gray`,children:`Cancelar`})}),(0,r.jsx)(Tm,{onClick:()=>{i(n.id,{content:p}),u(!1)},children:`Salvar`})]})]})]})}),(0,r.jsx)(Wm,{open:d,onOpenChange:f,children:(0,r.jsxs)(Km,{style:{maxWidth:450},children:[(0,r.jsx)(qm,{children:`Vincular Dados Manualmente`}),(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsx)(H,{size:`2`,children:`Nome da propriedade (ex: titulo, preco, imagem):`}),(0,r.jsx)(jh,{value:h,onChange:e=>g(e.target.value),placeholder:`propriedade`}),(0,r.jsxs)(W,{gap:`3`,justify:`end`,children:[(0,r.jsx)(Ym,{children:(0,r.jsx)(Tm,{variant:`soft`,color:`gray`,children:`Cancelar`})}),(0,r.jsx)(Tm,{onClick:()=>{let e=h,t={dataBinding:e};n.type===`text`&&(t.content=`{{${e}}}`),i(n.id,t),f(!1)},children:`Vincular`})]})]})]})}),(0,r.jsx)(`input`,{type:`file`,ref:v,style:{display:`none`},accept:`image/*`,onChange:e=>{let t=e.target.files?.[0];if(t){let e=new FileReader;e.onload=e=>{e.target?.result&&i(n.id,{content:e.target.result})},e.readAsDataURL(t)}}}),(0,r.jsxs)(Rc,{children:[(0,r.jsx)(zc,{asChild:!0,children:(0,r.jsx)(`div`,{style:{display:`contents`},children:e})}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Vc,{className:`ContextMenuContent`,children:[(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Vincular Dados`,n.dataBinding&&(0,r.jsxs)(`span`,{style:{fontSize:10,marginLeft:4,opacity:.7},children:[`(`,n.dataBinding,`)`]}),(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[c.availableProps&&c.availableProps.length>0&&(0,r.jsxs)(r.Fragment,{children:[c.availableProps.map(e=>(0,r.jsxs)(B,{className:`ContextMenuItem`,onSelect:()=>{let t={dataBinding:e.dataName};n.type===`text`&&(t.content=`{{${e.dataName}}}`),i(n.id,t)},children:[e.name,` `,(0,r.jsx)(`div`,{className:`RightSlot`,children:e.dataName})]},e.dataName)),(0,r.jsx)(Hc,{className:`ContextMenuSeparator`})]}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>{g(n.dataBinding||``),f(!0)},children:`Outro / Manual...`}),n.dataBinding&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Hc,{className:`ContextMenuSeparator`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>i(n.id,{dataBinding:void 0}),style:{color:`var(--red-9)`},children:`Remover Vínculo`})]})]})})]}),(0,r.jsx)(Hc,{className:`ContextMenuSeparator`}),n.type===`text`&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>{m(n.content),u(!0)},children:`Editar Texto...`}),(0,r.jsx)(Hc,{className:`ContextMenuSeparator`})]}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:C,children:`Duplicar`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>a(n.id),children:`Excluir`}),(0,r.jsx)(Hc,{className:`ContextMenuSeparator`}),n.type===`image`&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Alterar Imagem`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>v.current?.click(),children:`Carregar do Computador`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>{setTimeout(()=>{let e=window.prompt(`Insira a URL da imagem:`,n.content);e!==null&&i(n.id,{content:e})},10)},children:`Inserir URL`})]})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Ajuste da Imagem`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({objectFit:`cover`}),children:`Preencher (Cover)`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({objectFit:`contain`}),children:`Ajustar (Contain)`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({objectFit:`fill`}),children:`Esticar (Fill)`})]})})]}),(0,r.jsx)(Hc,{className:`ContextMenuSeparator`})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Camadas`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:x,children:`Trazer para frente`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:S,children:`Enviar para trás`})]})})]}),(0,r.jsx)(Hc,{className:`ContextMenuSeparator`}),n.type===`text`&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Fonte`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsx)(Gc,{className:`ContextMenuSubContent ContextMenuScrollable`,sideOffset:2,alignOffset:-5,children:c.availableFonts&&c.availableFonts.map(e=>(0,r.jsxs)(B,{className:`ContextMenuItem`,onSelect:()=>b({fontFamily:e}),style:{fontFamily:e},children:[e,n.style?.fontFamily===e&&(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(m_,{})})]},e))})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Tamanho da Fonte`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsx)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[12,14,16,20,24,32,48,64].map(e=>(0,r.jsxs)(B,{className:`ContextMenuItem`,onSelect:()=>b({fontSize:`${e}px`}),children:[e,`px`]},e))})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Cor do Texto`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsx)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:w.filter(e=>e!==`transparent`).map(e=>(0,r.jsxs)(B,{className:`ContextMenuItem`,onSelect:()=>b({color:e}),children:[(0,r.jsx)(`div`,{style:{width:12,height:12,backgroundColor:e,marginRight:8,border:`1px solid #ccc`}}),e]},e))})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Peso da Fonte`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({fontWeight:`normal`}),children:`Normal`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({fontWeight:`bold`}),children:`Negrito`})]})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Alinhamento`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({textAlign:`left`}),children:`Esquerda`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({textAlign:`center`}),children:`Centro`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({textAlign:`right`}),children:`Direita`})]})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Alinhamento Vertical`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({display:`flex`,flexDirection:`column`,justifyContent:`flex-start`}),children:`Topo`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({display:`flex`,flexDirection:`column`,justifyContent:`center`}),children:`Centro`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({display:`flex`,flexDirection:`column`,justifyContent:`flex-end`}),children:`Base`})]})})]})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Cor de Fundo`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsx)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:w.map(e=>(0,r.jsxs)(B,{className:`ContextMenuItem`,onSelect:()=>b({backgroundColor:e}),children:[(0,r.jsx)(`div`,{style:{width:12,height:12,backgroundColor:e,marginRight:8,border:`1px solid #ccc`}}),e===`transparent`?`Transparente`:e]},e))})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Arredondamento`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsx)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[0,4,8,12,16,24,`50%`].map(e=>(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({borderRadius:typeof e==`number`?`${e}px`:e}),children:e===`50%`?`Círculo`:`${e}px`},e))})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Espaçamento`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsx)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[0,4,8,12,16,24,32].map(e=>(0,r.jsxs)(B,{className:`ContextMenuItem`,onSelect:()=>b({padding:`${e}px`}),children:[e,`px`]},e))})})]})]})})]})]})};var tv=({element:e,isSelected:n})=>{let{selectElement:i,updateElement:a,state:o}=M_(),[s,c]=(0,t.useState)(!1),[l,u]=(0,t.useState)(!1),d=(0,t.useRef)({x:0,y:0}),f=(0,t.useRef)({x:0,y:0}),p=o.canvasHeight||150,m=(0,t.useRef)(0),h=(0,t.useRef)(0),g=(0,t.useRef)({x:0,y:0}),_=o.isList?o.mockData.length>0?o.mockData[0]:null:o.singleMockData,v=e.content;if(_){if(e.type===`text`)v=v.replace(/\{\{(.*?)\}\}/g,(e,t)=>{let n=_[t.trim()];return n==null?e:String(n)});else if(e.type===`image`)if(e.dataBinding){let t=_[e.dataBinding];t!=null&&(v=String(t))}else v=v.replace(/\{\{(.*?)\}\}/g,(e,t)=>{let n=_[t.trim()];return n==null?e:String(n)})}let y=t=>{t.stopPropagation(),i(e.id)},b=t=>{t.button===0&&(t.stopPropagation(),i(e.id),c(!0),d.current={x:t.clientX,y:t.clientY},f.current={x:e.x,y:e.y})},x=t=>{t.stopPropagation(),t.preventDefault(),u(!0);let n=t.target.closest(`.resizable-element`);if(n){let r=n.getBoundingClientRect();g.current={x:r.left+r.width/2,y:r.top+r.height/2};let i=t.clientX-g.current.x,a=t.clientY-g.current.y;m.current=Math.atan2(a,i)*(180/Math.PI),h.current=e.rotation||0}};(0,t.useEffect)(()=>{let t=t=>{if(s){let n=t.clientX-d.current.x,r=t.clientY-d.current.y,i=f.current.x+n,s=f.current.y+r;o.isList&&(s=Math.max(0,s),s+e.height>p&&(s=Math.max(0,p-e.height))),a(e.id,{x:i,y:s})}if(l){let n=t.clientX-g.current.x,r=t.clientY-g.current.y,i=Math.atan2(r,n)*(180/Math.PI)-m.current;a(e.id,{rotation:(h.current+i)%360})}},n=()=>{s&&c(!1),l&&u(!1)};return(s||l)&&(window.addEventListener(`mousemove`,t),window.addEventListener(`mouseup`,n)),()=>{window.removeEventListener(`mousemove`,t),window.removeEventListener(`mouseup`,n)}},[s,l,e.id,a]);let S={position:`absolute`,left:0,top:0,width:`100%`,height:`100%`,padding:e.type===`image`||e.type===`text`?0:`8px`,border:n?`2px solid var(--accent-9)`:`1px dashed transparent`,outline:n?`none`:`1px solid transparent`,cursor:s?`grabbing`:`grab`,borderRadius:`var(--radius-2)`,overflow:`hidden`,userSelect:`none`,...e.style};return(0,r.jsx)($_,{className:`resizable-element`,size:{width:e.width,height:e.height},maxHeight:o.isList?Math.max(10,p-e.y):void 0,onResizeStop:(t,n,r,i)=>{a(e.id,{width:e.width+i.width,height:e.height+i.height})},style:{position:`absolute`,transform:`translate(${e.x}px, ${e.y}px) rotate(${e.rotation||0}deg)`},enable:n?void 0:!1,children:(0,r.jsx)(ev,{element:e,children:(0,r.jsxs)(`div`,{style:{width:`100%`,height:`100%`,position:`relative`},children:[(0,r.jsxs)(U,{style:S,onMouseDown:b,onClick:y,onMouseEnter:e=>{n||(e.currentTarget.style.borderColor=`var(--gray-6)`)},onMouseLeave:e=>{n||(e.currentTarget.style.borderColor=`transparent`)},children:[e.type===`text`&&(0,r.jsx)(H,{style:{width:`100%`,height:`100%`},children:v}),e.type===`image`&&(v?(0,r.jsx)(`img`,{src:v,alt:`Element`,style:{width:`100%`,height:`100%`,objectFit:e.style?.objectFit||`cover`,display:`block`,pointerEvents:`none`}}):(0,r.jsx)(U,{style:{width:`100%`,height:`100%`,backgroundColor:`#eee`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,r.jsx)(H,{size:`1`,children:`Imagem Placeholder`})})),e.type===`box`&&(0,r.jsx)(U,{style:{width:`100%`,height:`100%`}})]}),n&&(0,r.jsx)(U,{style:{position:`absolute`,top:-30,left:`50%`,transform:`translateX(-50%)`,width:12,height:12,backgroundColor:`var(--accent-9)`,borderRadius:`50%`,cursor:`crosshair`,zIndex:50,boxShadow:`0 0 0 2px white`},onMouseDown:x,children:(0,r.jsx)(U,{style:{position:`absolute`,top:12,left:`50%`,width:2,height:18,backgroundColor:`var(--accent-9)`,transform:`translateX(-50%)`}})})]})})})};let nv=()=>{let{state:e,selectElement:t}=M_(),n=()=>{t(null)},i=e.canvasHeight||150;return(0,r.jsxs)(U,{onClick:n,style:{width:`100%`,height:`100%`,position:`relative`,overflow:`hidden`,backgroundColor:`var(--color-background)`,backgroundImage:`radial-gradient(var(--gray-5) 1px, transparent 1px)`,backgroundSize:`20px 20px`},children:[e.isList&&(0,r.jsx)(`div`,{style:{position:`absolute`,top:i,left:0,right:0,borderBottom:`2px dashed var(--accent-9)`,pointerEvents:`none`,zIndex:10},children:(0,r.jsxs)(`div`,{style:{position:`absolute`,right:10,bottom:2,backgroundColor:`var(--accent-9)`,color:`white`,fontSize:`10px`,padding:`2px 4px`,borderRadius:`2px`},children:[`Fim do Item (`,i,`px)`]})}),e.elements.length===0&&(0,r.jsx)(W,{align:`center`,justify:`center`,style:{height:`100%`,color:`var(--gray-8)`,pointerEvents:`none`},children:(0,r.jsx)(H,{children:`Adicione elementos e arraste livremente`})}),e.elements.map(t=>(0,r.jsx)(tv,{element:t,isSelected:e.selectedElementId===t.id},t.id))]})};var rv=(0,t.createContext)({});function iv(e){let n=(0,t.useRef)(null);return n.current===null&&(n.current=e()),n.current}var av=typeof window<`u`,ov=av?t.useLayoutEffect:t.useEffect,sv=(0,t.createContext)(null);function cv(e,t){e.indexOf(t)===-1&&e.push(t)}function lv(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var uv=(e,t,n)=>n>t?t:n<e?e:n;function dv(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var fv=()=>{},pv=()=>{};typeof process<`u`&&process.env.NODE_ENV!==`production`&&(fv=(e,t,n)=>{!e&&typeof console<`u`&&console.warn(dv(t,n))},pv=(e,t,n)=>{if(!e)throw Error(dv(t,n))});var mv={},hv=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function gv(e){return typeof e==`object`&&!!e}var _v=e=>/^0[^.\s]+$/u.test(e);function vv(e){let t;return()=>(t===void 0&&(t=e()),t)}var yv=e=>e,bv=(e,t)=>n=>t(e(n)),xv=(...e)=>e.reduce(bv),Sv=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},Cv=class{constructor(){this.subscriptions=[]}add(e){return cv(this.subscriptions,e),()=>lv(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},wv=e=>e*1e3,Tv=e=>e/1e3;function Ev(e,t){return t?e*(1e3/t):0}var Dv=new Set;function Ov(e,t,n){e||Dv.has(t)||(console.warn(dv(t,n)),Dv.add(t))}var kv=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Av=1e-7,jv=12;function Mv(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=kv(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Av&&++s<jv);return o}function Nv(e,t,n,r){if(e===t&&n===r)return yv;let i=t=>Mv(t,0,1,e,n);return e=>e===0||e===1?e:kv(i(e),t,r)}var Pv=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Fv=e=>t=>1-e(1-t),Iv=Nv(.33,1.53,.69,.99),Lv=Fv(Iv),Rv=Pv(Lv),zv=e=>(e*=2)<1?.5*Lv(e):.5*(2-2**(-10*(e-1))),Bv=e=>1-Math.sin(Math.acos(e)),Vv=Fv(Bv),Hv=Pv(Bv),Uv=Nv(.42,0,1,1),Wv=Nv(0,0,.58,1),Gv=Nv(.42,0,.58,1),Kv=e=>Array.isArray(e)&&typeof e[0]!=`number`,qv=e=>Array.isArray(e)&&typeof e[0]==`number`,Jv={linear:yv,easeIn:Uv,easeInOut:Gv,easeOut:Wv,circIn:Bv,circInOut:Hv,circOut:Vv,backIn:Lv,backInOut:Rv,backOut:Iv,anticipate:zv},Yv=e=>typeof e==`string`,Xv=e=>{if(qv(e)){pv(e.length===4,`Cubic bezier arrays must contain four numerical values.`,`cubic-bezier-length`);let[t,n,r,i]=e;return Nv(t,n,r,i)}else if(Yv(e))return pv(Jv[e]!==void 0,`Invalid easing type '${e}'`,`invalid-easing-type`),Jv[e];return e},Zv=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],Qv={value:null,addProjectionMetrics:null};function $v(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),t&&Qv.value&&Qv.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var ey=40;function ty(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Zv.reduce((e,n)=>(e[n]=$v(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=mv.useManualTiming?i.timestamp:performance.now();n=!1,mv.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,ey),1)),i.timestamp=a,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Zv.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Zv.length;t++)o[Zv[t]].cancel(e)},state:i,steps:o}}var{schedule:q,cancel:ny,state:J,steps:ry}=ty(typeof requestAnimationFrame<`u`?requestAnimationFrame:yv,!0),iy;function ay(){iy=void 0}var oy={now:()=>(iy===void 0&&oy.set(J.isProcessing||mv.useManualTiming?J.timestamp:performance.now()),iy),set:e=>{iy=e,queueMicrotask(ay)}},sy={layout:0,mainThread:0,waapi:0},cy=e=>t=>typeof t==`string`&&t.startsWith(e),ly=cy(`--`),uy=cy(`var(--`),dy=e=>uy(e)?fy.test(e.split(`/*`)[0].trim()):!1,fy=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function py(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var my={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},hy={...my,transform:e=>uv(0,1,e)},gy={...my,default:1},_y=e=>Math.round(e*1e5)/1e5,vy=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function yy(e){return e==null}var by=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xy=(e,t)=>n=>!!(typeof n==`string`&&by.test(n)&&n.startsWith(e)||t&&!yy(n)&&Object.prototype.hasOwnProperty.call(n,t)),Sy=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(vy);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Cy=e=>uv(0,255,e),wy={...my,transform:e=>Math.round(Cy(e))},Ty={test:xy(`rgb`,`red`),parse:Sy(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+wy.transform(e)+`, `+wy.transform(t)+`, `+wy.transform(n)+`, `+_y(hy.transform(r))+`)`};function Ey(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Dy={test:xy(`#`),parse:Ey,transform:Ty.transform},Oy=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ky=Oy(`deg`),Ay=Oy(`%`),Y=Oy(`px`),jy=Oy(`vh`),My=Oy(`vw`),Ny=(()=>({...Ay,parse:e=>Ay.parse(e)/100,transform:e=>Ay.transform(e*100)}))(),Py={test:xy(`hsl`,`hue`),parse:Sy(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Ay.transform(_y(t))+`, `+Ay.transform(_y(n))+`, `+_y(hy.transform(r))+`)`},X={test:e=>Ty.test(e)||Dy.test(e)||Py.test(e),parse:e=>Ty.test(e)?Ty.parse(e):Py.test(e)?Py.parse(e):Dy.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Ty.transform(e):Py.transform(e),getAnimatableNone:e=>{let t=X.parse(e);return t.alpha=0,X.transform(t)}},Fy=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Iy(e){return isNaN(e)&&typeof e==`string`&&(e.match(vy)?.length||0)+(e.match(Fy)?.length||0)>0}var Ly=`number`,Ry=`color`,zy=`var`,By=`var(`,Vy="${}",Hy=/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 Uy(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Hy,e=>(X.test(e)?(r.color.push(a),i.push(Ry),n.push(X.parse(e))):e.startsWith(By)?(r.var.push(a),i.push(zy),n.push(e)):(r.number.push(a),i.push(Ly),n.push(parseFloat(e))),++a,Vy)).split(Vy),indexes:r,types:i}}function Wy(e){return Uy(e).values}function Gy(e){let{split:t,types:n}=Uy(e),r=t.length;return e=>{let i=``;for(let a=0;a<r;a++)if(i+=t[a],e[a]!==void 0){let t=n[a];t===Ly?i+=_y(e[a]):t===Ry?i+=X.transform(e[a]):i+=e[a]}return i}}var Ky=e=>typeof e==`number`?0:X.test(e)?X.getAnimatableNone(e):e;function qy(e){let t=Wy(e);return Gy(e)(t.map(Ky))}var Jy={test:Iy,parse:Wy,createTransformer:Gy,getAnimatableNone:qy};function Yy(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Xy({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Yy(s,r,e+1/3),a=Yy(s,r,e),o=Yy(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Zy(e,t){return n=>n>0?t:e}var Z=(e,t,n)=>e+(t-e)*n,Qy=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},$y=[Dy,Ty,Py],eb=e=>$y.find(t=>t.test(e));function tb(e){let t=eb(e);if(fv(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,`color-not-animatable`),!t)return!1;let n=t.parse(e);return t===Py&&(n=Xy(n)),n}var nb=(e,t)=>{let n=tb(e),r=tb(t);if(!n||!r)return Zy(e,t);let i={...n};return e=>(i.red=Qy(n.red,r.red,e),i.green=Qy(n.green,r.green,e),i.blue=Qy(n.blue,r.blue,e),i.alpha=Z(n.alpha,r.alpha,e),Ty.transform(i))},rb=new Set([`none`,`hidden`]);function ib(e,t){return rb.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ab(e,t){return n=>Z(e,t,n)}function ob(e){return typeof e==`number`?ab:typeof e==`string`?dy(e)?Zy:X.test(e)?nb:ub:Array.isArray(e)?sb:typeof e==`object`?X.test(e)?nb:cb:Zy}function sb(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ob(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function cb(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ob(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function lb(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var ub=(e,t)=>{let n=Jy.createTransformer(t),r=Uy(e),i=Uy(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?rb.has(e)&&!i.values.length||rb.has(t)&&!r.values.length?ib(e,t):xv(sb(lb(r,i),i.values),n):(fv(!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`),Zy(e,t))};function db(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Z(e,t,n):ob(e)(e,t)}var fb=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>q.update(t,e),stop:()=>ny(t),now:()=>J.isProcessing?J.timestamp:oy.now()}},pb=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},mb=2e4;function hb(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function gb(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(hb(r),mb);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Tv(i)}}var _b=5;function vb(e,t,n){let r=Math.max(t-_b,0);return Ev(n-e(r),t-r)}var Q={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},yb=.001;function bb({duration:e=Q.duration,bounce:t=Q.bounce,velocity:n=Q.velocity,mass:r=Q.mass}){let i,a;fv(e<=wv(Q.maxDuration),`Spring duration must be 10 seconds or less`,`spring-duration-limit`);let o=1-t;o=uv(Q.minDamping,Q.maxDamping,o),e=uv(Q.minDuration,Q.maxDuration,Tv(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Cb(t,o),c=Math.exp(-i);return yb-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Cb(t**2,o);return(-i(t)+yb>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-yb+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Sb(i,a,s);if(e=wv(e),isNaN(c))return{stiffness:Q.stiffness,damping:Q.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var xb=12;function Sb(e,t,n){let r=n;for(let n=1;n<xb;n++)r-=e(r)/t(r);return r}function Cb(e,t){return e*Math.sqrt(1-t*t)}var wb=[`duration`,`bounce`],Tb=[`stiffness`,`damping`,`mass`];function Eb(e,t){return t.some(t=>e[t]!==void 0)}function Db(e){let t={velocity:Q.velocity,stiffness:Q.stiffness,damping:Q.damping,mass:Q.mass,isResolvedFromDuration:!1,...e};if(!Eb(e,Tb)&&Eb(e,wb))if(e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*uv(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Q.mass,stiffness:i,damping:a}}else{let n=bb(e);t={...t,...n,mass:Q.mass},t.isResolvedFromDuration=!0}return t}function Ob(e=Q.visualDuration,t=Q.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Db({...n,velocity:-Tv(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Tv(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?Q.restSpeed.granular:Q.restSpeed.default,i||=v?Q.restDelta.granular:Q.restDelta.default;let y;if(h<1){let e=Cb(_,h);y=t=>o-Math.exp(-h*_*t)*((m+h*_*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(h===1)y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}let b={calculatedDuration:p&&d||null,next:e=>{let t=y(e);if(p)s.done=e>=d;else{let n=e===0?m:0;h<1&&(n=e===0?wv(m):vb(y,e,t));let a=Math.abs(n)<=r,c=Math.abs(o-t)<=i;s.done=a&&c}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(hb(b),mb),t=pb(t=>b.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return b}Ob.applyToOptions=e=>{let t=gb(e,100,Ob);return e.ease=t.ease,e.duration=wv(t.duration),e.type=`keyframes`,e};function kb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Ob({keyframes:[f.value,m(f.value)],velocity:vb(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Ab(e,t,n){let r=[],i=n||mv.mix||db,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=xv(Array.isArray(t)?t[n]||yv:t,a)),r.push(a)}return r}function jb(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(pv(a===t.length,`Both input and output ranges must be the same length`,`range-length`),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Ab(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Sv(e[r],e[r+1],n);return s[r](i)};return n?t=>l(uv(e[0],e[a-1],t)):l}function Mb(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Sv(0,t,r);e.push(Z(n,1,i))}}function Nb(e){let t=[0];return Mb(t,e.length-1),t}function Pb(e,t){return e.map(e=>e*t)}function Fb(e,t){return e.map(()=>t||Gv).splice(0,e.length-1)}function Ib({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Kv(r)?r.map(Xv):Xv(r),a={done:!1,value:t[0]},o=jb(Pb(n&&n.length===t.length?n:Nb(t),e),t,{ease:Array.isArray(i)?i:Fb(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Lb=e=>e!==null;function Rb(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Lb),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var zb={decay:kb,inertia:kb,tween:Ib,keyframes:Ib,spring:Ob};function Bb(e){typeof e.type==`string`&&(e.type=zb[e.type])}var Vb=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Hb=e=>e/100,Ub=class extends Vb{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==oy.now()&&this.tick(oy.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},sy.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Bb(e);let{type:t=Ib,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Ib;process.env.NODE_ENV!==`production`&&s!==Ib&&pv(o.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`,`spring-two-frames`),s!==Ib&&typeof o[0]!=`number`&&(this.mixKeyframes=xv(Hb,db(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=hb(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=uv(0,1,n)*o}let b=_?{done:!1,value:l[0]}:y.next(v);i&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==kb&&(b.value=Rb(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Tv(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Tv(e)}get time(){return Tv(this.currentTime)}set time(e){e=wv(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(oy.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Tv(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=fb,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,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(oy.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,sy.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Wb(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Gb=e=>e*180/Math.PI,Kb=e=>Jb(Gb(Math.atan2(e[1],e[0]))),qb={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Kb,rotateZ:Kb,skewX:e=>Gb(Math.atan(e[1])),skewY:e=>Gb(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Jb=e=>(e%=360,e<0&&(e+=360),e),Yb=Kb,Xb=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Zb=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Qb={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Xb,scaleY:Zb,scale:e=>(Xb(e)+Zb(e))/2,rotateX:e=>Jb(Gb(Math.atan2(e[6],e[5]))),rotateY:e=>Jb(Gb(Math.atan2(-e[2],e[0]))),rotateZ:Yb,rotate:Yb,skewX:e=>Gb(Math.atan(e[4])),skewY:e=>Gb(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function $b(e){return e.includes(`scale`)?1:0}function ex(e,t){if(!e||e===`none`)return $b(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Qb,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=qb,i=t}if(!i)return $b(t);let a=r[t],o=i[1].split(`,`).map(nx);return typeof a==`function`?a(o):o[a]}var tx=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return ex(n,t)};function nx(e){return parseFloat(e.trim())}var rx=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],ix=(()=>new Set(rx))(),ax=e=>e===my||e===Y,ox=new Set([`x`,`y`,`z`]),sx=rx.filter(e=>!ox.has(e));function cx(e){let t=[];return sx.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith(`scale`)?1:0))}),t}var lx={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),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})=>ex(t,`x`),y:(e,{transform:t})=>ex(t,`y`)};lx.translateX=lx.x,lx.translateY=lx.y;var ux=new Set,dx=!1,fx=!1,px=!1;function mx(){if(fx){let e=Array.from(ux).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=cx(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}fx=!1,dx=!1,ux.forEach(e=>e.complete(px)),ux.clear()}function hx(){ux.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(fx=!0)})}function gx(){px=!0,hx(),mx(),px=!1}var _x=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(ux.add(this),dx||(dx=!0,q.read(hx),q.resolveKeyframes(mx))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Wb(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ux.delete(this)}cancel(){this.state===`scheduled`&&(ux.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},vx=e=>e.startsWith(`--`);function yx(e,t,n){vx(t)?e.style.setProperty(t,n):e.style[t]=n}var bx=vv(()=>window.ScrollTimeline!==void 0),xx={};function Sx(e,t){let n=vv(e);return()=>xx[t]??n()}var Cx=Sx(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),wx=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Tx={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:wx([0,.65,.55,1]),circOut:wx([.55,0,1,.45]),backIn:wx([.31,.01,.66,-.59]),backOut:wx([.33,1.53,.69,.99])};function Ex(e,t){if(e)return typeof e==`function`?Cx()?pb(e,t):`ease-out`:qv(e)?wx(e):Array.isArray(e)?e.map(e=>Ex(e,t)||Tx.easeOut):Tx[e]}function Dx(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Ex(s,i);Array.isArray(d)&&(u.easing=d),Qv.value&&sy.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return Qv.value&&p.finished.finally(()=>{sy.waapi--}),p}function Ox(e){return typeof e==`function`&&`applyToOptions`in e}function kx({type:e,...t}){return Ox(e)&&Cx()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Ax=class extends Vb{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,pv(typeof e.type!=`string`,`Mini animate() doesn't support "type" as a string.`,`mini-spring`);let c=kx(e);this.animation=Dx(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Rb(r,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(e):yx(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Tv(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Tv(e)}get time(){return Tv(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=wv(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&bx()?(this.animation.timeline=e,yv):t(this)}},jx={anticipate:zv,backInOut:Rv,circInOut:Hv};function Mx(e){return e in jx}function Nx(e){typeof e.ease==`string`&&Mx(e.ease)&&(e.ease=jx[e.ease])}var Px=10,Fx=class extends Ax{constructor(e){Nx(e),Bb(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Ub({...a,autoplay:!1}),s=Math.max(Px,oy.now()-this.startTime),c=uv(0,Px,s-Px);t.setWithVelocity(o.sample(Math.max(0,s-c)).value,o.sample(s).value,c),o.stop()}},Ix=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Jy.test(e)||e===`0`)&&!e.startsWith(`url(`));function Lx(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Rx(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Ix(i,t),s=Ix(a,t);return fv(o===s,`You are trying to animate ${t} from "${i}" to "${a}". "${o?a:i}" is not an animatable value.`,`value-not-animatable`),!o||!s?!1:Lx(e)||(n===`spring`||Ox(n))&&r}function zx(e){e.duration=0,e.type=`keyframes`}var Bx=new Set([`opacity`,`clipPath`,`filter`,`transform`]),Vx=vv(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Hx(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:s,transformTemplate:c}=t.owner.getProps();return Vx()&&n&&Bx.has(n)&&(n!==`transform`||!c)&&!s&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Ux=40,Wx=class extends Vb{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=oy.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||_x)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=oy.now(),Rx(e,i,a,o)||((mv.instantAnimations||!s)&&l?.(Rb(e,n,t)),e[0]=e[e.length-1],zx(n),n.repeat=0);let u={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>Ux?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=!c&&Hx(u)?new Fx({...u,element:u.motionValue.owner.current}):new Ub(u);d.finished.then(()=>this.notifyFinished()).catch(yv),this.pendingTimeline&&=(this.stopTimeline=d.attachTimeline(this.pendingTimeline),void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),gx()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},Gx=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Kx(e){let t=Gx.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}var qx=4;function Jx(e,t,n=1){pv(n<=qx,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,`max-css-var-depth`);let[r,i]=Kx(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return hv(e)?parseFloat(e):e}return dy(i)?Jx(i,t,n+1):i}function Yx(e,t){return e?.[t]??e?.default??e}var Xx=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...rx]),Zx={test:e=>e===`auto`,parse:e=>e},Qx=e=>t=>t.test(e),$x=[my,Y,Ay,ky,My,jy,Zx],eS=e=>$x.find(Qx(e));function tS(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||_v(e)}var nS=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function rS(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(vy)||[];if(!r)return e;let i=n.replace(r,``),a=nS.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var iS=/\b([a-z-]*)\(.*?\)/gu,aS={...Jy,getAnimatableNone:e=>{let t=e.match(iS);return t?t.map(rS).join(` `):e}},oS={...my,transform:Math.round},sS={borderWidth:Y,borderTopWidth:Y,borderRightWidth:Y,borderBottomWidth:Y,borderLeftWidth:Y,borderRadius:Y,radius:Y,borderTopLeftRadius:Y,borderTopRightRadius:Y,borderBottomRightRadius:Y,borderBottomLeftRadius:Y,width:Y,maxWidth:Y,height:Y,maxHeight:Y,top:Y,right:Y,bottom:Y,left:Y,inset:Y,insetBlock:Y,insetBlockStart:Y,insetBlockEnd:Y,insetInline:Y,insetInlineStart:Y,insetInlineEnd:Y,padding:Y,paddingTop:Y,paddingRight:Y,paddingBottom:Y,paddingLeft:Y,paddingBlock:Y,paddingBlockStart:Y,paddingBlockEnd:Y,paddingInline:Y,paddingInlineStart:Y,paddingInlineEnd:Y,margin:Y,marginTop:Y,marginRight:Y,marginBottom:Y,marginLeft:Y,marginBlock:Y,marginBlockStart:Y,marginBlockEnd:Y,marginInline:Y,marginInlineStart:Y,marginInlineEnd:Y,backgroundPositionX:Y,backgroundPositionY:Y,rotate:ky,rotateX:ky,rotateY:ky,rotateZ:ky,scale:gy,scaleX:gy,scaleY:gy,scaleZ:gy,skew:ky,skewX:ky,skewY:ky,distance:Y,translateX:Y,translateY:Y,translateZ:Y,x:Y,y:Y,z:Y,perspective:Y,transformPerspective:Y,opacity:hy,originX:Ny,originY:Ny,originZ:Y,zIndex:oS,fillOpacity:hy,strokeOpacity:hy,numOctaves:oS},cS={...sS,color:X,backgroundColor:X,outlineColor:X,fill:X,stroke:X,borderColor:X,borderTopColor:X,borderRightColor:X,borderBottomColor:X,borderLeftColor:X,filter:aS,WebkitFilter:aS},lS=e=>cS[e];function uS(e,t){let n=lS(e);return n!==aS&&(n=Jy),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var dS=new Set([`auto`,`none`,`0`]);function fS(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!dS.has(t)&&Uy(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=uS(n,i)}var pS=class extends _x{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),dy(r))){let i=Jx(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Xx.has(n)||e.length!==2)return;let[r,i]=e,a=eS(r),o=eS(i);if(py(r)!==py(i)&&lx[n]){this.needsMeasurement=!0;return}if(a!==o)if(ax(a)&&ax(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else lx[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||tS(e[t]))&&n.push(t);n.length&&fS(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=lx[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=lx[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function mS(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}var hS=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function gS(e){return gv(e)&&`offsetHeight`in e}var _S=30,vS=e=>!isNaN(parseFloat(e)),yS={current:void 0},bS=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=oy.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=oy.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=vS(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!==`production`&&Ov(!1,`value.onChange(callback) is deprecated. Switch to value.on("change", callback).`),this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new Cv);let n=this.events[e].add(t);return e===`change`?()=>{n(),q.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return yS.current&&yS.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=oy.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>_S)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,_S);return Ev(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function xS(e,t){return new bS(e,t)}var{schedule:SS,cancel:CS}=ty(queueMicrotask,!1),wS={x:!1,y:!1};function TS(){return wS.x||wS.y}function ES(e){return e===`x`||e===`y`?wS[e]?null:(wS[e]=!0,()=>{wS[e]=!1}):wS.x||wS.y?null:(wS.x=wS.y=!0,()=>{wS.x=wS.y=!1})}function DS(e,t){let n=mS(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function OS(e){return!(e.pointerType===`touch`||TS())}function kS(e,t,n={}){let[r,i,a]=DS(e,n),o=e=>{if(!OS(e))return;let{target:n}=e,r=t(n,e);if(typeof r!=`function`||!n)return;let a=e=>{OS(e)&&(r(e),n.removeEventListener(`pointerleave`,a))};n.addEventListener(`pointerleave`,a,i)};return r.forEach(e=>{e.addEventListener(`pointerenter`,o,i)}),a}var AS=(e,t)=>t?e===t?!0:AS(e,t.parentElement):!1,jS=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,MS=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function NS(e){return MS.has(e.tagName)||e.isContentEditable===!0}var PS=new WeakSet;function FS(e){return t=>{t.key===`Enter`&&e(t)}}function IS(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var LS=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=FS(()=>{if(PS.has(n))return;IS(n,`down`);let e=FS(()=>{IS(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>IS(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function RS(e){return jS(e)&&!TS()}function zS(e,t,n={}){let[r,i,a]=DS(e,n),o=e=>{let r=e.currentTarget;if(!RS(e))return;PS.add(r);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),PS.has(r)&&PS.delete(r),RS(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||AS(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),gS(e)&&(e.addEventListener(`focus`,e=>LS(e,i)),!NS(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function BS(e){return gv(e)&&`ownerSVGElement`in e}function VS(e){return BS(e)&&e.tagName===`svg`}var HS=e=>!!(e&&e.getVelocity),US=[...$x,X,Jy],WS=e=>US.find(Qx(e)),GS=(0,t.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function KS(e=!0){let n=(0,t.useContext)(sv);if(n===null)return[!0,null];let{isPresent:r,onExitComplete:i,register:a}=n,o=(0,t.useId)();(0,t.useEffect)(()=>{if(e)return a(o)},[e]);let s=(0,t.useCallback)(()=>e&&i&&i(o),[o,i,e]);return!r&&i?[!1,s]:[!0]}var qS=(0,t.createContext)({strict:!1}),JS={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},YS={};for(let e in JS)YS[e]={isEnabled:t=>JS[e].some(e=>!!t[e])};function XS(e){for(let t in e)YS[t]={...YS[t],...e[t]}}var ZS=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.ignoreStrict.viewport`.split(`.`));function QS(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||ZS.has(e)}function $S(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var eC=u((()=>{})),tC=f({default:()=>rC}),nC,rC,iC=u((()=>{eC(),nC=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,rC=$S(function(e){return nC.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),aC=e=>!QS(e);function oC(e){typeof e==`function`&&(aC=t=>t.startsWith(`on`)?!QS(t):e(t))}try{oC((iC(),h(tC)).default)}catch{}function sC(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||(aC(i)||n===!0&&QS(i)||!t&&!QS(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var cC=(0,t.createContext)({});function lC(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function uC(e){return typeof e==`string`||Array.isArray(e)}var dC=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],fC=[`initial`,...dC];function pC(e){return lC(e.animate)||fC.some(t=>uC(e[t]))}function mC(e){return!!(pC(e)||e.variants)}function hC(e,t){if(pC(e)){let{initial:t,animate:n}=e;return{initial:t===!1||uC(t)?t:void 0,animate:uC(n)?n:void 0}}return e.inherit===!1?{}:t}function gC(e){let{initial:n,animate:r}=hC(e,(0,t.useContext)(cC));return(0,t.useMemo)(()=>({initial:n,animate:r}),[_C(n),_C(r)])}function _C(e){return Array.isArray(e)?e.join(` `):e}function vC(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var yC={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(Y.test(e))e=parseFloat(e);else return e;return`${vC(e,t.target.x)}% ${vC(e,t.target.y)}%`}},bC={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Jy.parse(e);if(i.length>5)return r;let a=Jy.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Z(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},xC={borderRadius:{...yC,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:yC,borderTopRightRadius:yC,borderBottomLeftRadius:yC,borderBottomRightRadius:yC,boxShadow:bC};function SC(e,{layout:t,layoutId:n}){return ix.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!xC[e]||e===`opacity`)}var CC={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},wC=rx.length;function TC(e,t,n){let r=``,i=!0;for(let a=0;a<wC;a++){let o=rx[a],s=e[o];if(s===void 0)continue;let c=!0;if(c=typeof s==`number`?s===(o.startsWith(`scale`)?1:0):parseFloat(s)===0,!c||n){let e=hS(s,sS[o]);if(!c){i=!1;let t=CC[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function EC(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(ix.has(e)){o=!0;continue}else if(ly(e)){i[e]=n;continue}else{let t=hS(n,sS[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=TC(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var DC=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function OC(e,t,n){for(let r in t)!HS(t[r])&&!SC(r,n)&&(e[r]=t[r])}function kC({transformTemplate:e},n){return(0,t.useMemo)(()=>{let t=DC();return EC(t,n,e),Object.assign({},t.vars,t.style)},[n])}function AC(e,t){let n=e.style||{},r={};return OC(r,n,e),Object.assign(r,kC(e,t)),r}function jC(e,t){let n={},r=AC(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var MC={offset:`stroke-dashoffset`,array:`stroke-dasharray`},NC={offset:`strokeDashoffset`,array:`strokeDasharray`};function PC(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?MC:NC;e[a.offset]=Y.transform(-r);let o=Y.transform(t),s=Y.transform(n);e[a.array]=`${o} ${s}`}var FC=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function IC(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(EC(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of FC)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&PC(d,i,a,o,!1)}var LC=()=>({...DC(),attrs:{}}),RC=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function zC(e,n,r,i){let a=(0,t.useMemo)(()=>{let t=LC();return IC(t,n,RC(i),e.transformTemplate,e.style),{...t.attrs,style:{...t.style}}},[n]);if(e.style){let t={};OC(t,e.style,e),a.style={...t,...a.style}}return a}var BC=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function VC(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(BC.indexOf(e)>-1||/[A-Z]/u.test(e))}function HC(e,n,r,{latestValues:i},a,o=!1,s){let c=(s??VC(e)?zC:jC)(n,i,a,e),l=sC(n,typeof e==`string`,o),u=e===t.Fragment?{}:{...l,...c,ref:r},{children:d}=n,f=(0,t.useMemo)(()=>HS(d)?d.get():d,[d]);return(0,t.createElement)(e,{...u,children:f})}function UC(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function WC(e,t,n,r){if(typeof t==`function`){let[i,a]=UC(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=UC(r);t=t(n===void 0?e.custom:n,i,a)}return t}function GC(e){return HS(e)?e.get():e}function KC({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:qC(n,r,i,e),renderState:t()}}function qC(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=GC(a[e]);let{initial:o,animate:s}=e,c=pC(e),l=mC(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!lC(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=WC(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var JC=e=>(n,r)=>{let i=(0,t.useContext)(cC),a=(0,t.useContext)(sv),o=()=>KC(e,n,i,a);return r?o():iv(o)};function YC(e,t,n){let{style:r}=e,i={};for(let a in r)(HS(r[a])||t.style&&HS(t.style[a])||SC(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(i[a]=r[a]);return i}var XC=JC({scrapeMotionValuesFromProps:YC,createRenderState:DC});function ZC(e,t,n){let r=YC(e,t,n);for(let n in e)if(HS(e[n])||HS(t[n])){let t=rx.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var QC=JC({scrapeMotionValuesFromProps:ZC,createRenderState:LC}),$C=Symbol.for(`motionComponentSymbol`);function ew(e,n,r){let i=(0,t.useRef)(r);(0,t.useInsertionEffect)(()=>{i.current=r});let a=(0,t.useRef)(null);return(0,t.useCallback)(t=>{t&&e.onMount?.(t),n&&(t?n.mount(t):n.unmount());let r=i.current;if(typeof r==`function`)if(t){let e=r(t);typeof e==`function`&&(a.current=e)}else a.current?(a.current(),a.current=null):r(t);else r&&(r.current=t)},[n])}var tw=e=>e.replace(/([a-z])([A-Z])/gu,`$1-$2`).toLowerCase(),nw=`data-`+tw(`framerAppearId`),rw=(0,t.createContext)({});function iw(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function aw(e,n,r,i,a,o){let{visualElement:s}=(0,t.useContext)(cC),c=(0,t.useContext)(qS),l=(0,t.useContext)(sv),u=(0,t.useContext)(GS).reducedMotion,d=(0,t.useRef)(null);i||=c.renderer,!d.current&&i&&(d.current=i(e,{visualState:n,parent:s,props:r,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,isSVG:o}));let f=d.current,p=(0,t.useContext)(rw);f&&!f.projection&&a&&(f.type===`html`||f.type===`svg`)&&ow(d.current,r,a,p);let m=(0,t.useRef)(!1);(0,t.useInsertionEffect)(()=>{f&&m.current&&f.update(r,l)});let h=r[nw],g=(0,t.useRef)(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return ov(()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),g.current&&f.animationState&&f.animationState.animateChanges())}),(0,t.useEffect)(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),!1),f.enteringChildren=void 0)}),f}function ow(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:sw(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&iw(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function sw(e){if(e)return e.options.allowProjection===!1?sw(e.parent):e.projection}function cw(e,{forwardMotionProps:n=!1,type:i}={},a,o){a&&XS(a);let s=i?i===`svg`:VC(e),c=s?QC:XC;function l(i,l){let u,d={...(0,t.useContext)(GS),...i,layoutId:lw(i)},{isStatic:f}=d,p=gC(i),m=c(i,f);if(!f&&av){uw(d,a);let t=dw(d);u=t.MeasureLayout,p.visualElement=aw(e,m,d,o,t.ProjectionNode,s)}return(0,r.jsxs)(cC.Provider,{value:p,children:[u&&p.visualElement?(0,r.jsx)(u,{visualElement:p.visualElement,...d}):null,HC(e,i,ew(m,p.visualElement,l),m,f,n,s)]})}l.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let u=(0,t.forwardRef)(l);return u[$C]=e,u}function lw({layoutId:e}){let n=(0,t.useContext)(rv).id;return n&&e!==void 0?n+`-`+e:e}function uw(e,n){let r=(0,t.useContext)(qS).strict;if(process.env.NODE_ENV!==`production`&&n&&r){let t="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?fv(!1,t,`lazy-strict-mode`):pv(!1,t,`lazy-strict-mode`)}}function dw(e){let{drag:t,layout:n}=YS;if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function fw(e,t){if(typeof Proxy>`u`)return cw;let n=new Map,r=(n,r)=>cw(n,r,e,t);return new Proxy((e,t)=>(process.env.NODE_ENV!==`production`&&Ov(!1,`motion() is deprecated. Use motion.create() instead.`),r(e,t)),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,cw(a,void 0,e,t)),n.get(a))})}function pw({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function mw({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function hw(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function gw(e){return e===void 0||e===1}function _w({scale:e,scaleX:t,scaleY:n}){return!gw(e)||!gw(t)||!gw(n)}function vw(e){return _w(e)||yw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function yw(e){return bw(e.x)||bw(e.y)}function bw(e){return e&&e!==`0%`}function xw(e,t,n){return n+t*(e-n)}function Sw(e,t,n,r,i){return i!==void 0&&(e=xw(e,i,r)),xw(e,n,r)+t}function Cw(e,t=0,n=1,r,i){e.min=Sw(e.min,t,n,r,i),e.max=Sw(e.max,t,n,r,i)}function ww(e,{x:t,y:n}){Cw(e.x,t.translate,t.scale,t.originPoint),Cw(e.y,n.translate,n.scale,n.originPoint)}var Tw=.999999999999,Ew=1.0000000000001;function Dw(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Aw(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ww(e,o)),r&&vw(a.latestValues)&&Aw(e,a.latestValues))}t.x<Ew&&t.x>Tw&&(t.x=1),t.y<Ew&&t.y>Tw&&(t.y=1)}function Ow(e,t){e.min+=t,e.max+=t}function kw(e,t,n,r,i=.5){Cw(e,t,n,Z(e.min,e.max,i),r)}function Aw(e,t){kw(e.x,t.x,t.scaleX,t.scale,t.originX),kw(e.y,t.y,t.scaleY,t.scale,t.originY)}function jw(e,t){return pw(hw(e.getBoundingClientRect(),t))}function Mw(e,t,n){let r=jw(e,n),{scroll:i}=t;return i&&(Ow(r.x,i.offset.x),Ow(r.y,i.offset.y)),r}var Nw=()=>({translate:0,scale:1,origin:0,originPoint:0}),Pw=()=>({x:Nw(),y:Nw()}),Fw=()=>({min:0,max:0}),$=()=>({x:Fw(),y:Fw()}),Iw={current:null},Lw={current:!1};function Rw(){if(Lw.current=!0,av)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Iw.current=e.matches;e.addEventListener(`change`,t),t()}else Iw.current=!1}var zw=new WeakMap;function Bw(e,t,n){for(let r in t){let i=t[r],a=n[r];if(HS(i))e.addValue(r,i);else if(HS(a))e.addValue(r,xS(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,xS(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Vw=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Hw=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=_x,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=oy.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,q.render(this.render,!1,!0))};let{latestValues:s,renderState:c}=a;this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.blockInitialAnimation=!!i,this.isControllingVariants=pC(t),this.isVariantNode=mC(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:l,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in u){let t=u[e];s[e]!==void 0&&HS(t)&&t.set(s[e])}}mount(e){this.current=e,zw.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Lw.current||Rw(),this.shouldReduceMotion=Iw.current),process.env.NODE_ENV!==`production`&&Ov(this.shouldReduceMotion!==!0,`You have Reduced Motion enabled on your device. Animations may not appear as expected.`,`reduced-motion-disabled`),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),ny(this.notifyUpdate),ny(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n=ix.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&q.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in YS){let t=YS[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):$()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Vw.length;t++){let n=Vw[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Bw(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=xS(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(hv(n)||_v(n))?n=parseFloat(n):!WS(n)&&Jy.test(t)&&(n=uS(e,t)),this.setBaseTarget(e,HS(n)?n.get():n)),HS(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=WC(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!HS(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Cv),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){SS.render(this.render)}},Uw=class extends Hw{constructor(){super(...arguments),this.KeyframeResolver=pS}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;HS(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Ww(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Gw(e){return window.getComputedStyle(e)}var Kw=class extends Uw{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Ww}readValueFromInstance(e,t){if(ix.has(t))return this.projection?.isProjecting?$b(t):tx(e,t);{let n=Gw(e),r=(ly(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return jw(e,t)}build(e,t,n){EC(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return YC(e,t,n)}},qw=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]);function Jw(e,t,n,r){for(let n in Ww(e,t,void 0,r),t.attrs)e.setAttribute(qw.has(n)?n:tw(n),t.attrs[n])}var Yw=class extends Uw{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=$}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ix.has(t)){let e=lS(t);return e&&e.default||0}return t=qw.has(t)?t:tw(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return ZC(e,t,n)}build(e,t,n){IC(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Jw(e,t,n,r)}mount(e){this.isSVGTag=RC(e.tagName),super.mount(e)}},Xw=(e,n)=>n.isSVG??VC(e)?new Yw(n):new Kw(n,{allowProjection:e!==t.Fragment});function Zw(e,t,n){let r=e.getProps();return WC(r,t,n===void 0?r.custom:n,e)}var Qw=e=>Array.isArray(e);function $w(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,xS(n))}function eT(e){return Qw(e)?e[e.length-1]||0:e}function tT(e,t){let{transitionEnd:n={},transition:r={},...i}=Zw(e,t)||{};for(let t in i={...i,...n},i)$w(e,t,eT(i[t]))}function nT(e){return!!(HS(e)&&e.add)}function rT(e,t){let n=e.getValue(`willChange`);if(nT(n))return n.add(t);if(!n&&mv.WillChange){let n=new mv.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function iT(e){return e.props[nw]}var aT=e=>e!==null;function oT(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(aT),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}var sT={type:`spring`,stiffness:500,damping:25,restSpeed:10},cT=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),lT={type:`keyframes`,duration:.8},uT={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},dT=(e,{keyframes:t})=>t.length>2?lT:ix.has(e)?e.startsWith(`scale`)?cT(t[1]):sT:uT;function fT({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}var pT=(e,t,n,r={},i,a)=>o=>{let s=Yx(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=wv(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};fT(s)||Object.assign(u,dT(e,u)),u.duration&&=wv(u.duration),u.repeatDelay&&=wv(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(zx(u),u.delay===0&&(d=!0)),(mv.instantAnimations||mv.skipAnimations)&&(d=!0,zx(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=oT(u.keyframes,s);if(e!==void 0){q.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Ub(u):new Wx(u)};function mT({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function hT(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...s}=t;r&&(a=r);let c=[],l=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||l&&mT(l,t))continue;let o={delay:n,...Yx(a||{},t)},u=r.get();if(u!==void 0&&!r.isAnimating&&!Array.isArray(i)&&i===u&&!o.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){let n=iT(e);if(n){let e=window.MotionHandoffAnimation(n,t,q);e!==null&&(o.startTime=e,d=!0)}}rT(e,t),r.start(pT(t,r,i,e.shouldReduceMotion&&Xx.has(t)?{type:!1}:o,e,d));let f=r.animation;f&&c.push(f)}return o&&Promise.all(c).then(()=>{q.update(()=>{o&&tT(e,o)})}),c}function gT(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}function _T(e,t,n={}){let r=Zw(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(hT(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return vT(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function vT(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(_T(c,t,{...o,delay:n+(typeof r==`function`?0:r)+gT(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function yT(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>_T(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=_T(e,t,n);else{let i=typeof t==`function`?Zw(e,t,n.custom):t;r=Promise.all(hT(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}function bT(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var xT=fC.length;function ST(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&ST(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<xT;n++){let r=fC[n],i=e.props[r];(uC(i)||i===!1)&&(t[r]=i)}return t}var CT=[...dC].reverse(),wT=dC.length;function TT(e){return t=>Promise.all(t.map(({animation:t,options:n})=>yT(e,t,n)))}function ET(e){let t=TT(e),n=kT(),r=!0,i=t=>(n,r)=>{let i=Zw(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function a(n){t=n(e)}function o(a){let{props:o}=e,s=ST(e.parent)||{},c=[],l=new Set,u={},d=1/0;for(let t=0;t<wT;t++){let f=CT[t],p=n[f],m=o[f]===void 0?s[f]:o[f],h=uC(m),g=f===a?p.isActive:null;g===!1&&(d=t);let _=m===s[f]&&m!==o[f]&&h;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),p.protectedKeys={...u},!p.isActive&&g===null||!m&&!p.prevProp||lC(m)||typeof m==`boolean`)continue;let v=DT(p.prevProp,m),y=v||f===a&&p.isActive&&!_&&h||t>d&&h,b=!1,x=Array.isArray(m)?m:[m],S=x.reduce(i(f),{});g===!1&&(S={});let{prevResolvedValues:C={}}=p,w={...C,...S},T=t=>{y=!0,l.has(t)&&(b=!0,l.delete(t)),p.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in w){let t=S[e],n=C[e];if(u.hasOwnProperty(e))continue;let r=!1;r=Qw(t)&&Qw(n)?!bT(t,n):t!==n,r?t==null?l.add(e):T(e):t!==void 0&&l.has(e)?T(e):p.protectedKeys[e]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(y=!1);let E=_&&v;y&&(!E||b)&&c.push(...x.map(t=>{let n={type:f};if(typeof t==`string`&&r&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Zw(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=gT(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(l.size){let t={};if(typeof o.initial!=`boolean`){let n=Zw(e,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(t.transition=n.transition)}l.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),c.push({animation:t})}let f=!!c.length;return r&&(o.initial===!1||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(f=!1),r=!1,f?t(c):Promise.resolve()}function s(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=o(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=kT()}}}function DT(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!bT(t,e):!1}function OT(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function kT(){return{animate:OT(!0),whileInView:OT(),whileHover:OT(),whileTap:OT(),whileDrag:OT(),whileFocus:OT(),exit:OT()}}var AT=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},jT=class extends AT{constructor(e){super(e),e.animationState||=ET(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();lC(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},MT=0,NT={animation:{Feature:jT},exit:{Feature:class extends AT{constructor(){super(...arguments),this.id=MT++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function PT(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function FT(e){return{point:{x:e.pageX,y:e.pageY}}}var IT=e=>t=>jS(t)&&e(t,FT(t));function LT(e,t,n,r){return PT(e,t,IT(n),r)}var RT=1e-4,zT=1-RT,BT=1+RT,VT=.01,HT=0-VT,UT=0+VT;function WT(e){return e.max-e.min}function GT(e,t,n){return Math.abs(e-t)<=n}function KT(e,t,n,r=.5){e.origin=r,e.originPoint=Z(t.min,t.max,e.origin),e.scale=WT(n)/WT(t),e.translate=Z(n.min,n.max,e.origin)-e.originPoint,(e.scale>=zT&&e.scale<=BT||isNaN(e.scale))&&(e.scale=1),(e.translate>=HT&&e.translate<=UT||isNaN(e.translate))&&(e.translate=0)}function qT(e,t,n,r){KT(e.x,t.x,n.x,r?r.originX:void 0),KT(e.y,t.y,n.y,r?r.originY:void 0)}function JT(e,t,n){e.min=n.min+t.min,e.max=e.min+WT(t)}function YT(e,t,n){JT(e.x,t.x,n.x),JT(e.y,t.y,n.y)}function XT(e,t,n){e.min=t.min-n.min,e.max=e.min+WT(t)}function ZT(e,t,n){XT(e.x,t.x,n.x),XT(e.y,t.y,n.y)}function QT(e){return[e(`x`),e(`y`)]}var $T=({current:e})=>e?e.ownerDocument.defaultView:null,eE=(e,t)=>Math.abs(e-t);function tE(e,t){let n=eE(e.x,t.x),r=eE(e.y,t.y);return Math.sqrt(n**2+r**2)}var nE=new Set([`auto`,`scroll`]),rE=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=oE(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=tE(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=J;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=iE(t,this.transformPagePoint),q.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=oE(e.type===`pointercancel`?this.lastMoveEventInfo:iE(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!jS(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=iE(FT(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=J;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,oE(s,this.history)),this.removeListeners=xv(LT(this.contextWindow,`pointermove`,this.handlePointerMove),LT(this.contextWindow,`pointerup`,this.handlePointerUp),LT(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(nE.has(e.overflowX)||nE.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener(`scroll`,this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),q.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ny(this.updatePoint)}};function iE(e,t){return t?{point:t(e.point)}:e}function aE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oE({point:e},t){return{point:e,delta:aE(e,cE(t)),offset:aE(e,sE(t)),velocity:lE(t,.1)}}function sE(e){return e[0]}function cE(e){return e[e.length-1]}function lE(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=cE(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>wv(t)));)n--;if(!r)return{x:0,y:0};let a=Tv(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function uE(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Z(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Z(n,e,r.max):Math.min(e,n)),e}function dE(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function fE(e,{top:t,left:n,bottom:r,right:i}){return{x:dE(e.x,n,i),y:dE(e.y,t,r)}}function pE(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function mE(e,t){return{x:pE(e.x,t.x),y:pE(e.y,t.y)}}function hE(e,t){let n=.5,r=WT(e),i=WT(t);return i>r?n=Sv(t.min,t.max-r,e.min):r>i&&(n=Sv(e.min,e.max-i,t.min)),uv(0,1,n)}function gE(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var _E=.35;function vE(e=_E){return e===!1?e=0:e===!0&&(e=_E),{x:yE(e,`left`,`right`),y:yE(e,`top`,`bottom`)}}function yE(e,t,n){return{min:bE(e,t),max:bE(e,n)}}function bE(e,t){return typeof e==`number`?e:e[t]||0}var xE=new WeakMap,SE=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=$(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t?(this.stopAnimation(),this.snapToCursor(FT(e).point)):this.pauseAnimation()},a=(e,t)=>{this.stopAnimation();let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ES(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),QT(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Ay.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=WT(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&q.postRender(()=>i(e,t)),rT(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=wE(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&a(e,t)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>QT(e=>this.getAnimationState(e)===`paused`&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:l}=this.getProps();this.panSession=new rE(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:$T(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&q.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!CE(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=uE(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&iw(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=fE(n.layoutBox,e):this.constraints=!1,this.elastic=vE(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&QT(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=gE(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!iw(e))return!1;let n=e.current;pv(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.",`drag-constraints-ref`);let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=Mw(n,r.root,this.visualElement.getTransformPagePoint()),a=mE(r.layout.layoutBox,i);if(t){let e=t(mw(a));this.hasMutatedConstraints=!!e,e&&(a=pw(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=QT(o=>{if(!CE(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return rT(this.visualElement,e),n.start(pT(e,n,0,t,this.visualElement,!1))}stopAnimation(){QT(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){QT(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){QT(t=>{let{drag:n}=this.getProps();if(!CE(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Z(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!iw(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};QT(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=hE({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),QT(t=>{if(!CE(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Z(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;xE.set(this.visualElement,this);let e=this.visualElement.current,t=LT(e,`pointerdown`,e=>{let{drag:t,dragListener:n=!0}=this.getProps();t&&n&&!NS(e.target)&&this.start(e)}),n=()=>{let{dragConstraints:e}=this.getProps();iw(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener(`measure`,n);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),q.read(n);let a=PT(window,`resize`,()=>this.scalePositionWithinConstraints()),o=r.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(QT(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{a(),t(),i(),o&&o()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=_E,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function CE(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function wE(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var TE=class extends AT{constructor(e){super(e),this.removeGroupControls=yv,this.removeListeners=yv,this.controls=new SE(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||yv}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}},EE=e=>(t,n)=>{e&&q.postRender(()=>e(t,n))},DE=class extends AT{constructor(){super(...arguments),this.removePointerDownListener=yv}onPointerDown(e){this.session=new rE(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$T(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:EE(e),onStart:EE(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&q.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=LT(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},OE={hasAnimatedSinceResize:!0,hasEverUpdated:!1},kE=!1,AE=class extends t.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),kE&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),OE.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,kE=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||q.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),SS.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;kE=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function jE(e){let[n,i]=KS(),a=(0,t.useContext)(rv);return(0,r.jsx)(AE,{...e,layoutGroup:a,switchLayoutGroup:(0,t.useContext)(rw),isPresent:n,safeToRemove:i})}function ME(e,t,n){let r=HS(e)?e:xS(e);return r.start(pT(``,r,t,n)),r.animation}var NE=(e,t)=>e.depth-t.depth,PE=class{constructor(){this.children=[],this.isDirty=!1}add(e){cv(this.children,e),this.isDirty=!0}remove(e){lv(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(NE),this.isDirty=!1,this.children.forEach(e)}};function FE(e,t){let n=oy.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(ny(r),e(a-t))};return q.setup(r,!0),()=>ny(r)}var IE=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],LE=IE.length,RE=e=>typeof e==`string`?parseFloat(e):e,zE=e=>typeof e==`number`||Y.test(e);function BE(e,t,n,r,i,a){i?(e.opacity=Z(0,n.opacity??1,HE(r)),e.opacityExit=Z(t.opacity??1,0,UE(r))):a&&(e.opacity=Z(t.opacity??1,n.opacity??1,r));for(let i=0;i<LE;i++){let a=`border${IE[i]}Radius`,o=VE(t,a),s=VE(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||zE(o)===zE(s)?(e[a]=Math.max(Z(RE(o),RE(s),r),0),(Ay.test(s)||Ay.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Z(t.rotate||0,n.rotate||0,r))}function VE(e,t){return e[t]===void 0?e.borderRadius:e[t]}var HE=WE(0,.5,Vv),UE=WE(.5,.95,yv);function WE(e,t,n){return r=>r<e?0:r>t?1:n(Sv(e,t,r))}function GE(e,t){e.min=t.min,e.max=t.max}function KE(e,t){GE(e.x,t.x),GE(e.y,t.y)}function qE(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function JE(e,t,n,r,i){return e-=t,e=xw(e,1/n,r),i!==void 0&&(e=xw(e,1/i,r)),e}function YE(e,t=0,n=1,r=.5,i,a=e,o=e){if(Ay.test(t)&&(t=parseFloat(t),t=Z(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Z(a.min,a.max,r);e===a&&(s-=t),e.min=JE(e.min,t,n,s,i),e.max=JE(e.max,t,n,s,i)}function XE(e,t,[n,r,i],a,o){YE(e,t[n],t[r],t[i],t.scale,a,o)}var ZE=[`x`,`scaleX`,`originX`],QE=[`y`,`scaleY`,`originY`];function $E(e,t,n,r){XE(e.x,t,ZE,n?n.x:void 0,r?r.x:void 0),XE(e.y,t,QE,n?n.y:void 0,r?r.y:void 0)}function eD(e){return e.translate===0&&e.scale===1}function tD(e){return eD(e.x)&&eD(e.y)}function nD(e,t){return e.min===t.min&&e.max===t.max}function rD(e,t){return nD(e.x,t.x)&&nD(e.y,t.y)}function iD(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aD(e,t){return iD(e.x,t.x)&&iD(e.y,t.y)}function oD(e){return WT(e.x)/WT(e.y)}function sD(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var cD=class{constructor(){this.members=[]}add(e){cv(this.members,e),e.scheduleRender()}remove(e){if(lv(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t=this.members.findIndex(t=>e===t);if(t===0)return!1;let n;for(let e=t;e>=0;e--){let t=this.members[e];if(t.isPresent!==!1){n=t;break}}return n?(this.promote(n),!0):!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:r}=e.options;r===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function lD(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var uD={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},dD=[``,`X`,`Y`,`Z`],fD=1e3,pD=0;function mD(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function hD(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=iT(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,q,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&hD(r)}function gD({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=pD++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Qv.value&&(uD.nodes=uD.calculatedTargetDeltas=uD.calculatedProjections=0),this.nodes.forEach(yD),this.nodes.forEach(ED),this.nodes.forEach(DD),this.nodes.forEach(bD),Qv.addProjectionMetrics&&Qv.addProjectionMetrics(uD)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new PE)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Cv),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=BS(t)&&!VS(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;q.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=FE(i,250),OE.hasAnimatedSinceResize&&(OE.hasAnimatedSinceResize=!1,this.nodes.forEach(TD)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||PD,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!aD(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Yx(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||TD(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ny(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(OD),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&hD(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(SD);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(CD);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(wD),this.nodes.forEach(_D),this.nodes.forEach(vD)):this.nodes.forEach(CD),this.clearAllSnapshots();let e=oy.now();J.delta=uv(0,1e3/60,e-J.timestamp),J.timestamp=e,J.isProcessing=!0,ry.update.process(J),ry.preRender.process(J),ry.render.process(J),J.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,SS.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(xD),this.sharedNodes.forEach(kD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,q.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){q.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!WT(this.snapshot.measuredBox.x)&&!WT(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=$(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!tD(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||vw(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),RD(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return $();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(BD))){let{scroll:e}=this.root;e&&(Ow(t.x,e.offset.x),Ow(t.y,e.offset.y))}return t}removeElementScroll(e){let t=$();if(KE(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&KE(t,e),Ow(t.x,i.offset.x),Ow(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=$();KE(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Aw(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),vw(r.latestValues)&&Aw(n,r.latestValues)}return vw(this.latestValues)&&Aw(n,this.latestValues),n}removeTransform(e){let t=$();KE(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!vw(n.latestValues))continue;_w(n.latestValues)&&n.updateSnapshot();let r=$();KE(r,n.measurePageBox()),$E(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return vw(this.latestValues)&&$E(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==J.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=J.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=$(),this.targetWithTransforms=$()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),YT(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):KE(this.target,this.layout.layoutBox),ww(this.target,this.targetDelta)):KE(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Qv.value&&uD.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||_w(this.parent.latestValues)||yw(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$(),this.relativeTargetOrigin=$(),ZT(this.relativeTargetOrigin,t,n),KE(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===J.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;KE(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Dw(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=$());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(qE(this.prevProjectionDelta.x,this.projectionDelta.x),qE(this.prevProjectionDelta.y,this.projectionDelta.y)),qT(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!sD(this.projectionDelta.x,this.prevProjectionDelta.x)||!sD(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Qv.value&&uD.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Pw(),this.projectionDelta=Pw(),this.projectionDeltaWithTransform=Pw()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=Pw();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=$(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(ND));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;AD(a.x,e.x,n),AD(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ZT(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),MD(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&rD(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=$(),KE(d,this.relativeTarget)),s&&(this.animationValues=i,BE(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(ny(this.pendingAnimation),void 0),this.pendingAnimation=q.update(()=>{OE.hasAnimatedSinceResize=!0,sy.layout++,this.motionValue||=xS(0),this.currentAnimation=ME(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{sy.layout--},onComplete:()=>{sy.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(fD),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&zD(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||$();let t=WT(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=WT(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}KE(t,n),Aw(t,i),qT(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new cD),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&mD(`z`,e,r,this.animationValues);for(let t=0;t<dD.length;t++)mD(`rotate${dD[t]}`,e,r,this.animationValues),mD(`skew${dD[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=GC(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=GC(t?.pointerEvents)||``),this.hasProjected&&!vw(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=lD(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;for(let t in e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit,xC){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=xC[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?GC(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(SD),this.root.sharedNodes.clear()}}}function _D(e){e.updateLayout()}function vD(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?QT(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=WT(r);r.min=n[e].min,r.max=r.min+i}):zD(i,t.layoutBox,n)&&QT(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=WT(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Pw();qT(o,n,t.layoutBox);let s=Pw();a?qT(s,e.applyTransform(r,!0),t.measuredBox):qT(s,n,t.layoutBox);let c=!tD(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=$();ZT(o,t.layoutBox,i.layoutBox);let s=$();ZT(s,n,a.layoutBox),aD(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function yD(e){Qv.value&&uD.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function bD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function xD(e){e.clearSnapshot()}function SD(e){e.clearMeasurements()}function CD(e){e.isLayoutDirty=!1}function wD(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function TD(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ED(e){e.resolveTargetDelta()}function DD(e){e.calcProjection()}function OD(e){e.resetSkewAndRotation()}function kD(e){e.removeLeadSnapshot()}function AD(e,t,n){e.translate=Z(t.translate,0,n),e.scale=Z(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function jD(e,t,n,r){e.min=Z(t.min,n.min,r),e.max=Z(t.max,n.max,r)}function MD(e,t,n,r){jD(e.x,t.x,n.x,r),jD(e.y,t.y,n.y,r)}function ND(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var PD={duration:.45,ease:[.4,0,.1,1]},FD=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ID=FD(`applewebkit/`)&&!FD(`chrome/`)?Math.round:yv;function LD(e){e.min=ID(e.min),e.max=ID(e.max)}function RD(e){LD(e.x),LD(e.y)}function zD(e,t,n){return e===`position`||e===`preserve-aspect`&&!GT(oD(t),oD(n),.2)}function BD(e){return e!==e.root&&e.scroll?.wasRoot}var VD=gD({attachResizeListener:(e,t)=>PT(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),HD={current:void 0},UD=gD({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!HD.current){let e=new VD({});e.mount(window),e.setOptions({layoutScroll:!0}),HD.current=e}return HD.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),WD={pan:{Feature:DE},drag:{Feature:TE,ProjectionNode:UD,MeasureLayout:jE}};function GD(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&q.postRender(()=>i(t,FT(t)))}var KD=class extends AT{mount(){let{current:e}=this.node;e&&(this.unmount=kS(e,(e,t)=>(GD(this.node,t,`Start`),e=>GD(this.node,e,`End`))))}unmount(){}},qD=class extends AT{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=xv(PT(this.node.current,`focus`,()=>this.onFocus()),PT(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function JD(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&q.postRender(()=>i(t,FT(t)))}var YD=class extends AT{mount(){let{current:e}=this.node;e&&(this.unmount=zS(e,(e,t)=>(JD(this.node,t,`Start`),(e,{success:t})=>JD(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}},XD=new WeakMap,ZD=new WeakMap,QD=e=>{let t=XD.get(e.target);t&&t(e)},$D=e=>{e.forEach(QD)};function eO({root:e,...t}){let n=e||document;ZD.has(n)||ZD.set(n,{});let r=ZD.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver($D,{root:e,...t})),r[i]}function tO(e,t,n){let r=eO(t);return XD.set(e,n),r.observe(e),()=>{XD.delete(e),r.unobserve(e)}}var nO={some:0,all:1},rO=class extends AT{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:nO[r]};return tO(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(iO(e,t))&&this.startObserver()}unmount(){}};function iO({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var aO={inView:{Feature:rO},tap:{Feature:YD},focus:{Feature:qD},hover:{Feature:KD}},oO={layout:{ProjectionNode:UD,MeasureLayout:jE}},sO=fw({...NT,...aO,...WD,...oO},Xw),cO=({element:e,offsetY:t=0,dataContext:n})=>{let i=e.content;if(n){if(e.type===`text`)i=i.replace(/\{\{(.*?)\}\}/g,(e,t)=>{let r=n[t.trim()];return r==null?e:String(r)});else if(e.type===`image`)if(e.dataBinding){let t=n[e.dataBinding];t!=null&&(i=String(t))}else i=i.replace(/\{\{(.*?)\}\}/g,(e,t)=>{let r=n[t.trim()];return r==null?e:String(r)})}return(0,r.jsxs)(U,{style:{position:`absolute`,left:0,top:0,width:`${e.width}px`,height:`${e.height}px`,transform:`translate(${e.x}px, ${e.y+t}px) rotate(${e.rotation||0}deg)`,padding:e.type===`image`||e.type===`text`?0:`8px`,overflow:`hidden`,...e.style},children:[e.type===`text`&&(0,r.jsx)(H,{children:i}),e.type===`image`&&(i?(0,r.jsx)(`img`,{src:i,alt:`Element`,style:{width:`100%`,height:`100%`,objectFit:e.style?.objectFit||`cover`,display:`block`}}):(0,r.jsx)(U,{style:{width:`100%`,height:`100%`,backgroundColor:`#eee`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,r.jsx)(H,{size:`1`,children:`Imagem`})})),e.type===`box`&&(0,r.jsx)(U,{style:{width:`100%`,height:`100%`}})]})},lO=({children:e,index:t,height:n})=>(0,r.jsx)(sO.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},transition:{duration:.4,delay:t*.05,ease:`easeOut`},whileHover:{scale:1.02,transition:{duration:.2}},style:{position:`relative`,height:n,width:`100%`,marginBottom:`20px`,transformOrigin:`center center`},children:e});let uO=()=>{let{state:e}=M_(),n=t.default.useMemo(()=>e.canvasHeight?e.canvasHeight:e.elements.length===0?0:Math.max(...e.elements.map(e=>e.y+e.height)),[e.elements,e.canvasHeight]);return(0,r.jsx)(U,{style:{width:`100%`,height:`100%`,position:`relative`,overflow:`hidden`,backgroundColor:`var(--color-panel-solid)`},children:(0,r.jsx)(Rm,{type:`auto`,scrollbars:`vertical`,style:{height:`100%`,width:`100%`},children:(0,r.jsx)(U,{style:{position:`relative`,minHeight:`100%`,width:`100%`},children:(()=>{if(e.elements.length===0)return(0,r.jsx)(W,{align:`center`,justify:`center`,style:{height:`100%`},children:(0,r.jsx)(H,{color:`gray`,children:`Preview vazio`})});if(e.isList){let t=e.mockData.length>0?e.mockData:Array.from({length:10}).map((e,t)=>({id:t}));if(e.listSettings.sortProp){let n=e.listSettings.sortProp,r=e.listSettings.sortOrder===`asc`?1:-1;t=[...t].sort((e,t)=>{let i=e[n],a=t[n];return i<a?-1*r:i>a?1*r:0})}return e.listSettings.newestPosition===`top`&&(t=[...t].reverse()),(0,r.jsx)(W,{direction:`column`,justify:e.listSettings.newestPosition===`top`?`start`:`end`,p:`4`,style:{width:`100%`,minHeight:`100%`},children:t.map((t,i)=>(0,r.jsx)(lO,{index:i,height:n,children:e.elements.map(e=>(0,r.jsx)(cO,{element:e,offsetY:0,dataContext:t},`${e.id}-${i}`))},i))})}return e.elements.map(t=>(0,r.jsx)(cO,{element:t,dataContext:e.singleMockData},t.id))})()})})})},dO=()=>{let{state:e,updateListSettings:n,setCanvasHeight:i}=M_(),[a,o]=(0,t.useState)(``),[s,c]=(0,t.useState)(`150`);return(0,t.useEffect)(()=>{o(e.listSettings.sortProp||`__none__`),c(String(e.canvasHeight||150))},[e.listSettings.sortProp,e.canvasHeight]),(0,t.useEffect)(()=>{let e=parseInt(s,10);!isNaN(e)&&e>0&&i(e)},[s,i]),(0,r.jsxs)(Wm,{children:[(0,r.jsx)(Gm,{children:(0,r.jsxs)(Tm,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`center`,cursor:`pointer`},children:[(0,r.jsx)(E_,{}),` Configurações`]})}),(0,r.jsxs)(Km,{style:{maxWidth:600},children:[(0,r.jsx)(qm,{children:`Configurações do Editor`}),(0,r.jsx)(Jm,{size:`2`,mb:`4`,children:`Configure o comportamento da lista.`}),(0,r.jsx)(U,{pt:`3`,children:(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,children:`Ordenação`}),(0,r.jsxs)(W,{gap:`3`,align:`center`,children:[(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Propriedade para Ordenar (ex: data, id)`}),(0,r.jsxs)(vh,{value:a,onValueChange:e=>o(e),children:[(0,r.jsx)(yh,{style:{width:`100%`},placeholder:`Selecione...`}),(0,r.jsxs)(bh,{children:[(0,r.jsx)(xh,{value:`__none__`,children:`(Nenhum)`}),e.availableProps.map(e=>(0,r.jsx)(xh,{value:e.dataName,children:e.name},e.dataName))]})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Direção`}),(0,r.jsxs)(vh,{value:e.listSettings.sortOrder,onValueChange:e=>n({sortOrder:e}),children:[(0,r.jsx)(yh,{}),(0,r.jsxs)(bh,{children:[(0,r.jsx)(xh,{value:`asc`,children:`Crescente (A-Z)`}),(0,r.jsx)(xh,{value:`desc`,children:`Decrescente (Z-A)`})]})]})]})]}),(0,r.jsxs)(W,{gap:`3`,align:`center`,children:[(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Posição do Recente`}),(0,r.jsxs)(vh,{value:e.listSettings.newestPosition||`bottom`,onValueChange:e=>n({newestPosition:e}),children:[(0,r.jsx)(yh,{style:{width:`100%`}}),(0,r.jsxs)(bh,{children:[(0,r.jsx)(xh,{value:`top`,children:`Topo (Início)`}),(0,r.jsx)(xh,{value:`bottom`,children:`Base (Final)`})]})]})]}),(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Comportamento de Rolagem`}),(0,r.jsxs)(vh,{value:e.listSettings.scrollDirection||`down`,onValueChange:e=>n({scrollDirection:e}),children:[(0,r.jsx)(yh,{style:{width:`100%`}}),(0,r.jsxs)(bh,{children:[(0,r.jsx)(xh,{value:`down`,children:`Descer (Padrão)`}),(0,r.jsx)(xh,{value:`up`,children:`Subir (Chat)`})]})]})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Altura do Item da Lista (px)`}),(0,r.jsx)(jh,{type:`number`,min:`10`,value:s,onChange:e=>c(e.target.value)}),(0,r.jsx)(H,{size:`1`,color:`gray`,children:`Define a altura visual de cada item na lista para referência.`})]}),(0,r.jsx)(H,{size:`1`,color:`gray`,children:`Essa propriedade será usada para ordenar os itens no modo lista.`})]})}),(0,r.jsxs)(W,{gap:`3`,mt:`4`,justify:`end`,children:[(0,r.jsx)(Ym,{children:(0,r.jsx)(Tm,{variant:`soft`,color:`gray`,children:`Cancelar`})}),(0,r.jsx)(Ym,{children:(0,r.jsx)(Tm,{onClick:()=>{n({sortProp:a===`__none__`?``:a})},children:`Salvar Alterações`})})]})]})]})};var fO=({layout:e,initialState:n,onSave:i,theme:a=`light`})=>{let[o,s]=(0,t.useState)(!0),[c,l]=(0,t.useState)(!0),{addElement:u,loadState:d,state:f}=M_();t.default.useEffect(()=>{if(n)try{let e=typeof n==`string`?JSON.parse(n):n;Array.isArray(e)?d({elements:e}):e.elements&&d(e)}catch(e){console.error(`Failed to load initial state`,e)}},[n,d]);let p=e=>{console.log(`Adding element of type: ${e}`),u({type:e,content:`New ${e}`})};return(0,r.jsx)(Np,{appearance:a,accentColor:`blue`,grayColor:`slate`,radius:`medium`,scaling:`100%`,children:(0,r.jsxs)(W,{direction:`row`,style:{height:`100vh`,width:`100%`,overflow:`hidden`,backgroundColor:`var(--color-background)`},children:[c&&(0,r.jsxs)(W,{direction:`column`,width:`280px`,style:{borderRight:`1px solid var(--gray-5)`,backgroundColor:`var(--gray-2)`,flexShrink:0,height:`100%`},children:[(0,r.jsx)(U,{p:`4`,style:{borderBottom:`1px solid var(--gray-5)`,backgroundColor:`var(--gray-2)`},children:(0,r.jsx)(W,{direction:`column`,gap:`3`,children:(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,mb:`2`,as:`div`,children:`Editor`}),(0,r.jsxs)(Zm,{children:[(0,r.jsx)(Qm,{children:(0,r.jsx)(Tm,{variant:`solid`,color:`green`,size:`3`,style:{width:`100%`,cursor:`pointer`,justifyContent:`center`,marginBottom:`8px`},children:`Adicionar Novo +`})}),(0,r.jsxs)(eh,{style:{width:`240px`},children:[(0,r.jsx)(nh,{onSelect:()=>p(`text`),children:`Texto`}),(0,r.jsx)(nh,{onSelect:()=>p(`image`),children:`Imagem`}),(0,r.jsx)(nh,{onSelect:()=>p(`box`),children:`Caixa (Container)`})]})]}),(0,r.jsxs)(Tm,{variant:`soft`,color:`blue`,style:{width:`100%`,justifyContent:`center`,cursor:`pointer`},onClick:()=>{if(i){let e={elements:f.elements,isList:f.isList,mockData:f.mockData,singleMockData:f.singleMockData,listSettings:f.listSettings};i(JSON.stringify(e,null,2))}},children:[(0,r.jsx)(O_,{}),` Salvar Alterações`]}),(0,r.jsx)(U,{mt:`2`,children:(0,r.jsx)(dO,{})})]})})}),(0,r.jsx)(Rm,{type:`auto`,scrollbars:`vertical`,style:{flex:1},children:(0,r.jsx)(W,{direction:`column`,gap:`4`,p:`4`,children:(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,mb:`2`,as:`div`,children:`Variáveis Disponíveis`}),(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`2`,as:`div`,children:`Clique para copiar ou arraste (futuramente)`}),(0,r.jsxs)(W,{direction:`column`,gap:`2`,children:[e.props.map((e,t)=>(0,r.jsxs)(Hp,{color:`blue`,variant:`soft`,size:`2`,style:{padding:`8px`,justifyContent:`flex-start`},title:e.dataName,children:[e.name,(0,r.jsx)(H,{color:`gray`,style:{marginLeft:`auto`,fontSize:`10px`},children:`{{${e.dataName}}}`})]},t)),e.props.length===0&&(0,r.jsx)(H,{size:`1`,color:`gray`,style:{fontStyle:`italic`},children:`Nenhuma variável configurada.`})]})]})})})]}),(0,r.jsxs)(U,{style:{flex:1,position:`relative`,height:`100%`},children:[(0,r.jsx)(U,{style:{position:`absolute`,top:10,left:10,zIndex:10},children:(0,r.jsx)(fh,{size:`2`,variant:`soft`,color:`gray`,onClick:()=>l(!c),title:c?`Ocultar Barra Lateral`:`Mostrar Barra Lateral`,children:c?(0,r.jsx)(v_,{}):(0,r.jsx)(b_,{})})}),(0,r.jsx)(W,{style:{position:`absolute`,top:10,right:10,zIndex:10},gap:`2`,children:(0,r.jsx)(fh,{size:`2`,variant:`soft`,color:o?`blue`:`gray`,onClick:()=>s(!o),title:o?`Ocultar Preview`:`Mostrar Preview`,children:o?(0,r.jsx)(w_,{}):(0,r.jsx)(S_,{})})}),(0,r.jsxs)(i_,{orientation:`horizontal`,style:{height:`100%`,width:`100%`},children:[(0,r.jsx)(c_,{defaultSize:50,minSize:20,children:(0,r.jsx)(U,{style:{height:`100%`,width:`100%`,backgroundColor:`var(--color-background)`},children:(0,r.jsx)(nv,{})})}),o&&(0,r.jsx)(d_,{style:{width:`4px`,backgroundColor:`var(--gray-6)`,cursor:`col-resize`,transition:`background-color 0.2s`}}),o&&(0,r.jsx)(c_,{defaultSize:50,minSize:20,children:(0,r.jsx)(U,{style:{height:`100%`,width:`100%`,backgroundColor:`var(--gray-3)`,borderLeft:`1px solid var(--gray-5)`},children:(0,r.jsx)(uO,{})})})]})]})]})})};let pO=e=>(0,r.jsx)(j_,{isList:e.layout.isList,availableProps:e.layout.props,theme:e.theme,children:(0,r.jsx)(fO,{...e})}),mO=(e,t,n={})=>Function(`elements`,`data`,`options`,hO()+`
48
+ `)?n.value.length:0;requestAnimationFrame(()=>{try{n.setSelectionRange(i,i)}catch{}n.focus()})}},t.createElement(`input`,{spellCheck:`false`,...l,ref:_(r,n),className:`rt-reset rt-TextFieldInput`}),i)});jh.displayName=`TextField.Root`;var Mh=t.forwardRef((e,n)=>{let{className:r,color:i,side:a,...o}=pp(e,kh);return t.createElement(`div`,{"data-accent-color":i,"data-side":a,...o,ref:n,className:(0,Ah.default)(`rt-TextFieldSlot`,r)})});Mh.displayName=`TextField.Slot`;function G(e,t=`Assertion error`){if(!e)throw Error(t)}function Nh({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Ph(e,t){return t.sort(e===`horizontal`?Fh:Ih)}function Fh(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function Ih(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function Lh(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function Rh(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function zh({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=Rh(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return G(i,`No rect found`),i}function Bh(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=Ph(n,Array.from(t.children).filter(Lh).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c,l=[];for(let t of a)if(t.hasAttribute(`data-panel`)){let i=r.find(e=>e.element===t);if(i){if(c){let r=c.element.getBoundingClientRect(),a=t.getBoundingClientRect(),u;if(s){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(l.length){case 0:u=[e,t];break;case 1:{let i=l[0];u=[i,zh({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:u=l;break}}else u=l.length?l:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let t of u)o.push({group:e,groupSize:Nh({group:e}),panels:[c,i],separator:`width`in t?void 0:t,rect:`width`in t?t:t.element.getBoundingClientRect()})}s=!1,c=i,l=[]}}else if(t.hasAttribute(`data-separator`)){let e=i.find(e=>e.element===t);e?l.push(e):(c=void 0,l=[])}else s=!0;return o}function Vh(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function Hh(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function Uh(e){return e/100*window.innerHeight}function Wh(e){return e/100*window.innerWidth}function Gh(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Kh({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=Gh(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=Hh(t,i);break;case`em`:r=Vh(t,i);break;case`vh`:r=Uh(i);break;case`vw`:r=Wh(i);break}return r}function qh(e){return parseFloat(e.toFixed(3))}function Jh(e){let{panels:t}=e,n=Nh({group:e});return n===0?t.map(e=>({collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize&&(i=qh(Kh({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize&&(a=qh(Kh({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize&&(o=qh(Kh({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize&&(s=qh(Kh({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,minSize:o,maxSize:s,panelId:e.id}})}var Yh=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}};function Xh(e,t,n=0){return Math.abs(qh(e)-qh(t))<=n}var Zh={cursorFlags:0,interactionState:{state:`inactive`},mountedGroups:new Map},Qh=new Yh;function $h(){return Zh}function eg(e){let t=typeof e==`function`?e(Zh):e;if(Zh===t)return Zh;let n=Zh;return Zh={...Zh,...t},t.cursorFlags!==void 0&&Qh.emit(`cursorFlagsChange`,Zh.cursorFlags),t.interactionState!==void 0&&Qh.emit(`interactionStateChange`,Zh.interactionState),t.mountedGroups!==void 0&&(Zh.mountedGroups.forEach((e,t)=>{e.derivedPanelConstraints.forEach(r=>{if(r.collapsible){let{layout:i}=n.mountedGroups.get(t)??{};if(i){let n=Xh(r.collapsedSize,e.layout[r.panelId]),a=Xh(r.collapsedSize,i[r.panelId]);n&&!a&&(t.inMemoryLastExpandedPanelSizes[r.panelId]=i[r.panelId])}}})}),Qh.emit(`mountedGroupsChange`,Zh.mountedGroups)),Zh}function tg(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function ng(e,t){return Xh(e,t)?0:e>t?1:-1}function rg({panelConstraints:e,size:t}){let{collapsedSize:n=0,collapsible:r,maxSize:i=100,minSize:a=0}=e;if(ng(t,a)<0)if(r){let e=(n+a)/2;t=ng(t,e)<0?n:a}else t=a;return t=Math.min(i,t),t=qh(t),t}function ig({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(Xh(e,0))return t;let o=Object.values(t),s=Object.values(i),c=[...o],[l,u]=r;G(l!=null,`Invalid first pivot index`),G(u!=null,`Invalid second pivot index`);let d=0;if(a===`keyboard`){{let t=e<0?u:l,r=n[t];G(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:s=0}=r;if(a){let n=o[t];if(G(n!=null,`Previous layout not found for panel index ${t}`),Xh(n,i)){let t=s-n;ng(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?l:u,r=n[t];G(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:s=0}=r;if(a){let n=o[t];if(G(n!=null,`Previous layout not found for panel index ${t}`),Xh(n,s)){let t=n-i;ng(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let t=e<0?1:-1,r=e<0?u:l,i=0;for(;;){let e=o[r];G(e!=null,`Previous layout not found for panel index ${r}`);let a=rg({panelConstraints:n[r],size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?l:u;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(d),i=o[t];G(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,s=rg({panelConstraints:n[t],size:a});if(!Xh(i,s)&&(d+=i-s,c[t]=s,d.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(tg(s,c))return i;{let t=e<0?u:l,r=o[t];G(r!=null,`Previous layout not found for panel index ${t}`);let i=r+d,a=rg({panelConstraints:n[t],size:i});if(c[t]=a,!Xh(a,i)){let t=i-a,r=e<0?u:l;for(;r>=0&&r<n.length;){let i=c[r];G(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,o=rg({panelConstraints:n[r],size:a});if(Xh(i,o)||(t-=o-i,c[r]=o),Xh(t,0))break;e>0?r--:r++}}}if(!Xh(Object.values(c).reduce((e,t)=>t+e,0),100,.1))return i;let f=Object.keys(i);return c.reduce((e,t,n)=>(e[f[n]]=t,e),{})}function ag(e){let{mountedGroups:t}=$h();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function og(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||ng(e[n],t[n])!==0)return!1;return!0}function sg({layout:e,panelConstraints:t}){let n=[...Object.values(e)],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(e=>`${e}%`).join(`, `)}`);if(!Xh(r,100)&&n.length>0)for(let e=0;e<t.length;e++){let t=n[e];G(t!=null,`No layout data found for index ${e}`),n[e]=100/r*t}let i=0;for(let e=0;e<t.length;e++){let r=n[e];G(r!=null,`No layout data found for index ${e}`);let a=rg({panelConstraints:t[e],size:r});r!=a&&(i+=r-a,n[e]=a)}if(!Xh(i,0))for(let e=0;e<t.length;e++){let r=n[e];G(r!=null,`No layout data found for index ${e}`);let a=r+i,o=rg({panelConstraints:t[e],size:a});if(r!==o&&(i-=o-r,n[e]=o,Xh(i,0)))break}let a=Object.keys(e);return n.reduce((e,t,n)=>(e[a[n]]=t,e),{})}function cg({groupId:e}){let t=()=>{let{mountedGroups:t}=$h();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,layout:a,separatorToPanels:o}=t(),s=sg({layout:e,panelConstraints:r});return n?a:(og(a,s)||eg(e=>({mountedGroups:new Map(e.mountedGroups).set(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,layout:s,separatorToPanels:o})})),s)}}}function lg(e){let{mountedGroups:t}=$h(),n=t.get(e);return G(n,`Mounted Group ${e.id} not found`),n}function ug(e,t){let n=ag(e),r=lg(n),i=n.separators.find(t=>t.element===e);G(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);G(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=cg({groupId:n.id}).getLayout(),c=sg({layout:ig({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});og(s,c)||eg(e=>({mountedGroups:new Map(e.mountedGroups).set(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,layout:c,separatorToPanels:r.separatorToPanels})}))}function dg(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=ag(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&ug(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&ug(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&ug(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&ug(t,-5);break;case`End`:e.preventDefault(),ug(t,100);break;case`Enter`:{e.preventDefault();let n=ag(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=lg(n),o=n.separators.find(e=>e.element===t);G(o,`Matching separator not found`);let s=a.get(o);G(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(G(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];ug(t,(l.collapsedSize===e?n.inMemoryLastExpandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=ag(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);G(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus();break}case`Home`:e.preventDefault(),ug(t,-100);break}}var fg=e=>e,pg=()=>{},mg=1,hg=2,gg=4,_g=8,vg={coarse:10,precise:5};function yg(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=Rh(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}var bg;function xg(){return bg===void 0&&(bg=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),bg}function Sg(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Cg(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:kg(e),b:kg(t)},r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;G(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Og(Dg(n.a)),b:Og(Dg(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var wg=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Tg(e){let t=getComputedStyle(Ag(e)??e).display;return t===`flex`||t===`inline-flex`}function Eg(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Tg(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`||wg.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function Dg(e){let t=e.length;for(;t--;){let n=e[t];if(G(n,`Missing node`),Eg(n))return n}return null}function Og(e){return e&&Number(getComputedStyle(e).zIndex)||0}function kg(e){let t=[];for(;e;)t.push(e),e=Ag(e);return t}function Ag(e){let{parentNode:t}=e;return Sg(t)?t.host:t}function jg(e,t){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 Mg({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Lh(n)||n.contains(e)||e.contains(n))return!0;if(Cg(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(jg(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Ng(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=xg()?vg.coarse:vg.precise,a=Bh(r),o=yg(r.orientation,a,{x:e.clientX,y:e.clientY});o&&o.distance.x<=i&&o.distance.y<=i&&Mg({groupElement:r.element,hitRegion:o.hitRegion.rect,pointerEventTarget:e.target})&&n.push(o.hitRegion)}),n}function Pg(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let{mountedGroups:t}=$h(),n=Ng(e,t),r=new Set,i=new Set,a=new Set,o=new Map,s=!1;n.forEach(e=>{r.add(e.group),e.panels.forEach(e=>{i.add(e)}),e.separator&&(a.add(e.separator),s||(s=!0,e.separator.element.focus()));let n=t.get(e.group);n&&o.set(e.group,n.layout)}),eg({interactionState:{hitRegions:n,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}}),n.length&&e.preventDefault()}function Fg({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(r===0&&i===0)return null;switch(n){case`active`:{let t=(e&mg)!==0,n=(e&hg)!==0,r=(e&gg)!==0,i=(e&_g)!==0;if(e){if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}}return r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`}var Ig=new WeakMap;function Lg(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=Ig.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets=[n]);let{cursorFlags:r,interactionState:i}=$h();switch(i.state){case`active`:case`hover`:{let e=Fg({cursorFlags:r,groups:i.hitRegions.map(e=>e.group),state:i.state}),a=`*{cursor: ${e} !important; ${i.state===`active`?`touch-action: none;`:``} }`;if(t===a)return;t=a,e?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}Ig.set(e,{prevStyle:t,styleSheet:n})}function Rg({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a}){let o=0,s=new Map(i);n.forEach(e=>{let{group:n,groupSize:c}=e,{disableCursor:l,orientation:u,panels:d}=n,f=0;f=a?u===`horizontal`?(t.clientX-a.x)/c*100:(t.clientY-a.y)/c*100:u===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let p=r.get(n),{defaultLayoutDeferred:m,derivedPanelConstraints:h,layout:g,separatorToPanels:_}=i.get(n)??{defaultLayoutDeferred:!1};if(h&&p&&g&&_){let t=ig({delta:f,initialLayout:p,panelConstraints:h,pivotIndices:e.panels.map(e=>d.indexOf(e)),prevLayout:g,trigger:`mouse-or-touch`});if(og(t,g)){if(f!==0&&!l)switch(u){case`horizontal`:o|=f<0?mg:hg;break;case`vertical`:o|=f<0?gg:_g;break}}else{s.set(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,layout:t,separatorToPanels:_});let n=e.group.panels.map(({id:e})=>e).join(`,`);e.group.inMemoryLayouts[n]=t}}}),eg({cursorFlags:o,mountedGroups:s}),Lg(e)}function zg(e){let{interactionState:t,mountedGroups:n}=$h();switch(t.state){case`active`:Rg({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n})}}function Bg(e){if(e.defaultPrevented)return;let{interactionState:t,mountedGroups:n}=$h();switch(t.state){case`active`:if(e.buttons===0){eg(e=>e.interactionState.state===`inactive`?e:{cursorFlags:0,interactionState:{state:`inactive`}});return}Rg({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint});break;default:{let r=Ng(e,n);r.length===0?t.state!==`inactive`&&eg({interactionState:{state:`inactive`}}):eg({interactionState:{hitRegions:r,state:`hover`}}),Lg(e.currentTarget);break}}}function Vg(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;e.preventDefault();let{interactionState:t}=$h();switch(t.state){case`active`:eg({cursorFlags:0,interactionState:{state:`inactive`}}),Lg(e.currentTarget)}}function Hg(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=qh(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=qh((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function Ug(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Nh({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:qh(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Wg(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Gg(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var Kg=new Map;function qg(e){let t=!0;G(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){if(Nh({group:e})===0)return;eg(t=>{let n=t.mountedGroups.get(e);if(n){let r=Jh(e),i=n.defaultLayoutDeferred?Hg(r):n.layout,a=sg({layout:i,panelConstraints:r});return!n.defaultLayoutDeferred&&og(i,a)&&Wg(n.derivedPanelConstraints,r)?t:{mountedGroups:new Map(t.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,layout:a,separatorToPanels:n.separatorToPanels})}}return t})}}else Ug(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{G(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=Nh({group:e}),s=Jh(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.defaultLayout;l&&(Gg(e.panels,l)||(l=void 0));let u=sg({layout:e.inMemoryLayouts[c]??l??Hg(s),panelConstraints:s}),d=Bh(e),f=e.element.ownerDocument;return eg(t=>{let n=new Map;return Kg.set(f,(Kg.get(f)??0)+1),d.forEach(e=>{e.separator&&n.set(e.separator,e.panels)}),{mountedGroups:new Map(t.mountedGroups).set(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,layout:u,separatorToPanels:n})}}),e.separators.forEach(e=>{G(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,dg)}),Kg.get(f)===1&&(f.addEventListener(`pointerdown`,Pg,!0),f.addEventListener(`pointerleave`,zg),f.addEventListener(`pointermove`,Bg),f.addEventListener(`pointerup`,Vg,!0)),function(){t=!1,Kg.set(f,Math.max(0,(Kg.get(f)??0)-1)),eg(t=>{let n=new Map(t.mountedGroups);return n.delete(e),{mountedGroups:n}}),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,dg)}),Kg.get(f)||(f.removeEventListener(`pointerdown`,Pg,!0),f.removeEventListener(`pointerleave`,zg),f.removeEventListener(`pointermove`,Bg),f.removeEventListener(`pointerup`,Vg,!0)),a.disconnect()}}function Jg(){let[e,n]=(0,t.useState)({});return[e,(0,t.useCallback)(()=>n({}),[])]}function Yg(e){let n=(0,t.useId)();return`${e??n}`}var Xg=typeof window<`u`?t.useLayoutEffect:t.useEffect;function Zg(e){let n=(0,t.useRef)(e);return Xg(()=>{n.current=e},[e]),(0,t.useCallback)((...e)=>n.current?.(...e),[n])}function Qg(...e){return Zg(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function $g(e){let n=(0,t.useRef)({...e});return Xg(()=>{for(let t in e)n.current[t]=e[t]},[e]),n.current}var e_=`--react-resizable-panels--panel--pointer-events`;function t_(e,t){return`--react-resizable-panels--${e.replace(/[^a-zA-Z0-9\-_]/g,``)}--${t.replace(/[^a-zA-Z0-9\-_]/g,``)}`}var n_=(0,t.createContext)(null);function r_(e,n){let r=(0,t.useRef)({getLayout:()=>({}),setLayout:fg});(0,t.useImperativeHandle)(n,()=>r.current,[]),Xg(()=>{Object.assign(r.current,cg({groupId:e}))})}function i_({children:e,className:n,defaultLayout:i,disableCursor:a,disabled:o,elementRef:s,groupRef:c,id:l,onLayoutChange:u,orientation:d=`horizontal`,style:f,...p}){let m=(0,t.useRef)({}),h=Zg(e=>{og(m.current,e)||(m.current=e,u?.(e))}),g=Yg(l),_=(0,t.useRef)(null),[v,y]=(0,t.useState)(!1),[b,x]=(0,t.useState)(i??{}),[S,C]=Jg(),w=(0,t.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],separators:[]}),T=Qg(_,s);r_(g,c);let E=(0,t.useMemo)(()=>({id:g,orientation:d,registerPanel:e=>{let t=w.current;return t.panels=Ph(d,[...t.panels,e]),C(),()=>{t.panels=t.panels.filter(t=>t!==e),C()}},registerSeparator:e=>{let t=w.current;return t.separators=Ph(d,[...t.separators,e]),C(),()=>{t.separators=t.separators.filter(t=>t!==e),C()}}}),[g,C,d]),D=$g({defaultLayout:i,disableCursor:a}),O=(0,t.useRef)(null);Xg(()=>{let e=_.current;if(e===null)return;let t=w.current,n={defaultLayout:D.defaultLayout,disableCursor:!!D.disableCursor,disabled:!!o,element:e,id:g,inMemoryLastExpandedPanelSizes:w.current.lastExpandedPanelSizes,inMemoryLayouts:w.current.layouts,orientation:d,panels:t.panels,separators:t.separators};O.current=n;let r=qg(n),i=$h().mountedGroups.get(n);if(i){let{defaultLayoutDeferred:e,derivedPanelConstraints:t,layout:n}=i;!e&&t.length>0&&(x(n),h?.(n))}let a=Qh.addListener(`interactionStateChange`,e=>{switch(e.state){case`active`:y(e.hitRegions.some(e=>e.group===n));break;default:y(!1);break}}),s=Qh.addListener(`mountedGroupsChange`,e=>{let t=e.get(n);if(t){let{defaultLayoutDeferred:e,derivedPanelConstraints:n,layout:r}=t;if(e||n.length===0)return;x(r),h?.(r)}});return()=>{O.current=null,r(),a(),s()}},[o,g,h,d,S,D]),(0,t.useEffect)(()=>{let e=O.current;e&&(e.defaultLayout=i,e.disableCursor=!!a)});let k={[e_]:v?`none`:void 0};for(let e in b){let t=t_(g,e);k[t]=b[e]}return(0,r.jsx)(n_.Provider,{value:E,children:(0,r.jsx)(`div`,{...p,"aria-orientation":d,className:n,"data-group":!0,"data-testid":g,id:g,ref:T,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,...k,display:`flex`,flexDirection:d===`horizontal`?`row`:`column`,flexWrap:`nowrap`},children:e})})}i_.displayName=`Group`;function a_(){let e=(0,t.useContext)(n_);return G(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function o_({groupId:e,panelId:t}){let n=()=>{let{mountedGroups:t}=$h();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,separatorToPanels:o}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,layout:a,separatorToPanels:o};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,layout:c,separatorToPanels:l}=n(),u=s.panels.findIndex(e=>e.id===t),d=u===s.panels.length-1,f=sg({layout:ig({delta:d?r-e:e-r,initialLayout:c,panelConstraints:o,pivotIndices:d?[u-1,u]:[u,u+1],prevLayout:c,trigger:`imperative-api`}),panelConstraints:o});og(c,f)||eg(e=>({mountedGroups:new Map(e.mountedGroups).set(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,layout:f,separatorToPanels:l})}))};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&Xh(t,n)},resize:e=>{if(a()!==e){let t;switch(typeof e){case`number`:{let{group:r}=n();t=qh(e/Nh({group:r})*100);break}case`string`:t=parseFloat(e);break}o(t)}}}}function s_(e,n){let{id:r}=a_(),i=(0,t.useRef)({collapse:pg,expand:pg,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:pg});(0,t.useImperativeHandle)(n,()=>i.current,[]),Xg(()=>{Object.assign(i.current,o_({groupId:r,panelId:e}))})}function c_({children:e,className:n,collapsedSize:i=`0%`,collapsible:a=!1,defaultSize:o,elementRef:s,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=Yg(c),_=(0,t.useRef)(null),v=Qg(_,s),{id:y,registerPanel:b}=a_(),x=d!==null,S=Zg((e,t,n)=>{d?.(e,c,n)});Xg(()=>{let e=_.current;if(e!==null)return b({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:x?S:void 0,panelConstraints:{collapsedSize:i,collapsible:a,defaultSize:o,maxSize:l,minSize:u}})},[i,a,o,x,g,h,l,u,S,b]),s_(g,f);let C=t_(y,g);return(0,r.jsx)(`div`,{...m,"data-panel":!0,"data-testid":g,id:g,ref:v,style:{...l_,flexBasis:0,flexGrow:`var(${C}, 1)`,flexShrink:1,overflow:`hidden`,pointerEvents:`var(${e_})`},children:(0,r.jsx)(`div`,{className:n,style:{width:`100%`,height:`100%`,...p},children:e})})}c_.displayName=`Panel`;var l_={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function u_({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=a=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=sg({layout:ig({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e,trigger:`keyboard`}),panelConstraints:t})[n],i=sg({layout:ig({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e,trigger:`keyboard`}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function d_({children:e,className:n,elementRef:i,id:a,style:o,...s}){let c=Yg(a),[l,u]=(0,t.useState)({}),[d,f]=(0,t.useState)(`inactive`),p=(0,t.useRef)(null),m=Qg(p,i),{id:h,orientation:g,registerSeparator:_}=a_(),v=g===`horizontal`?`vertical`:`horizontal`;return Xg(()=>{let e=p.current;if(e!==null){let t={element:e,id:c},n=_(t),r=Qh.addListener(`interactionStateChange`,e=>{f(e.state!==`inactive`&&e.hitRegions.some(e=>e.separator===t)?e.state:`inactive`)}),i=Qh.addListener(`mountedGroupsChange`,e=>{e.forEach(({derivedPanelConstraints:e,layout:n,separatorToPanels:r},i)=>{if(i.id===h){let a=r.get(t);if(a){let t=a[0],r=i.panels.indexOf(t);u(u_({layout:n,panelConstraints:e,panelId:t.id,panelIndex:r}))}}})});return()=>{r(),i(),n()}}},[h,c,_]),(0,r.jsx)(`div`,{...s,"aria-controls":l.valueControls,"aria-orientation":v,"aria-valuemax":l.valueMax,"aria-valuemin":l.valueMin,"aria-valuenow":l.valueNow,children:e,className:n,"data-separator":d,"data-testid":c,id:c,ref:m,role:`separator`,style:{flexBasis:`auto`,...o,flexGrow:0,flexShrink:0},tabIndex:0})}d_.displayName=`Separator`;function f_(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var p_=[`color`],m_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,p_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),h_=[`color`],g_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,h_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),__=[`color`],v_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,__);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),y_=[`color`],b_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,y_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),x_=[`color`],S_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,x_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),C_=[`color`],w_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,C_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),T_=[`color`],E_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,T_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M7.07095 0.650238C6.67391 0.650238 6.32977 0.925096 6.24198 1.31231L6.0039 2.36247C5.6249 2.47269 5.26335 2.62363 4.92436 2.81013L4.01335 2.23585C3.67748 2.02413 3.23978 2.07312 2.95903 2.35386L2.35294 2.95996C2.0722 3.2407 2.0232 3.6784 2.23493 4.01427L2.80942 4.92561C2.62307 5.2645 2.47227 5.62594 2.36216 6.00481L1.31209 6.24287C0.924883 6.33065 0.650024 6.6748 0.650024 7.07183V7.92897C0.650024 8.32601 0.924883 8.67015 1.31209 8.75794L2.36228 8.99603C2.47246 9.375 2.62335 9.73652 2.80979 10.0755L2.2354 10.9867C2.02367 11.3225 2.07267 11.7602 2.35341 12.041L2.95951 12.6471C3.24025 12.9278 3.67795 12.9768 4.01382 12.7651L4.92506 12.1907C5.26384 12.377 5.62516 12.5278 6.0039 12.6379L6.24198 13.6881C6.32977 14.0753 6.67391 14.3502 7.07095 14.3502H7.92809C8.32512 14.3502 8.66927 14.0753 8.75705 13.6881L8.99505 12.6383C9.37411 12.5282 9.73573 12.3773 10.0748 12.1909L10.986 12.7653C11.3218 12.977 11.7595 12.928 12.0403 12.6473L12.6464 12.0412C12.9271 11.7604 12.9761 11.3227 12.7644 10.9869L12.1902 10.076C12.3768 9.73688 12.5278 9.37515 12.638 8.99596L13.6879 8.75794C14.0751 8.67015 14.35 8.32601 14.35 7.92897V7.07183C14.35 6.6748 14.0751 6.33065 13.6879 6.24287L12.6381 6.00488C12.528 5.62578 12.3771 5.26414 12.1906 4.92507L12.7648 4.01407C12.9766 3.6782 12.9276 3.2405 12.6468 2.95975L12.0407 2.35366C11.76 2.07292 11.3223 2.02392 10.9864 2.23565L10.0755 2.80989C9.73622 2.62328 9.37437 2.47229 8.99505 2.36209L8.75705 1.31231C8.66927 0.925096 8.32512 0.650238 7.92809 0.650238H7.07095ZM4.92053 3.81251C5.44724 3.44339 6.05665 3.18424 6.71543 3.06839L7.07095 1.50024H7.92809L8.28355 3.06816C8.94267 3.18387 9.5524 3.44302 10.0794 3.81224L11.4397 2.9547L12.0458 3.56079L11.1882 4.92117C11.5573 5.44798 11.8164 6.0575 11.9321 6.71638L13.5 7.07183V7.92897L11.932 8.28444C11.8162 8.94342 11.557 9.55301 11.1878 10.0798L12.0453 11.4402L11.4392 12.0462L10.0787 11.1886C9.55192 11.5576 8.94241 11.8166 8.28355 11.9323L7.92809 13.5002H7.07095L6.71543 11.932C6.0569 11.8162 5.44772 11.5572 4.92116 11.1883L3.56055 12.046L2.95445 11.4399L3.81213 10.0794C3.4431 9.55266 3.18403 8.94326 3.06825 8.2845L1.50002 7.92897V7.07183L3.06818 6.71632C3.18388 6.05765 3.44283 5.44833 3.81171 4.92165L2.95398 3.561L3.56008 2.95491L4.92053 3.81251ZM9.02496 7.50008C9.02496 8.34226 8.34223 9.02499 7.50005 9.02499C6.65786 9.02499 5.97513 8.34226 5.97513 7.50008C5.97513 6.65789 6.65786 5.97516 7.50005 5.97516C8.34223 5.97516 9.02496 6.65789 9.02496 7.50008ZM9.92496 7.50008C9.92496 8.83932 8.83929 9.92499 7.50005 9.92499C6.1608 9.92499 5.07513 8.83932 5.07513 7.50008C5.07513 6.16084 6.1608 5.07516 7.50005 5.07516C8.83929 5.07516 9.92496 6.16084 9.92496 7.50008Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),D_=[`color`],O_=(0,t.forwardRef)(function(e,n){var r=e.color,i=r===void 0?`currentColor`:r,a=f_(e,D_);return(0,t.createElement)(`svg`,Object.assign({width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},a,{ref:n}),(0,t.createElement)(`path`,{d:`M5 7.50003C5 8.32845 4.32843 9.00003 3.5 9.00003C2.67157 9.00003 2 8.32845 2 7.50003C2 6.6716 2.67157 6.00003 3.5 6.00003C4.32843 6.00003 5 6.6716 5 7.50003ZM5.71313 8.66388C5.29445 9.45838 4.46048 10 3.5 10C2.11929 10 1 8.88074 1 7.50003C1 6.11931 2.11929 5.00003 3.5 5.00003C4.46048 5.00003 5.29445 5.54167 5.71313 6.33616L9.10424 4.21671C9.03643 3.98968 9 3.74911 9 3.50003C9 2.11932 10.1193 1.00003 11.5 1.00003C12.8807 1.00003 14 2.11932 14 3.50003C14 4.88074 12.8807 6.00003 11.5 6.00003C10.6915 6.00003 9.97264 5.61624 9.51566 5.0209L5.9853 7.22738C5.99502 7.31692 6 7.40789 6 7.50003C6 7.59216 5.99502 7.68312 5.9853 7.77267L9.51567 9.97915C9.97265 9.38382 10.6915 9.00003 11.5 9.00003C12.8807 9.00003 14 10.1193 14 11.5C14 12.8807 12.8807 14 11.5 14C10.1193 14 9 12.8807 9 11.5C9 11.2509 9.03643 11.0104 9.10425 10.7833L5.71313 8.66388ZM11.5 5.00003C12.3284 5.00003 13 4.32846 13 3.50003C13 2.6716 12.3284 2.00003 11.5 2.00003C10.6716 2.00003 10 2.6716 10 3.50003C10 4.32846 10.6716 5.00003 11.5 5.00003ZM13 11.5C13 12.3285 12.3284 13 11.5 13C10.6716 13 10 12.3285 10 11.5C10 10.6716 10.6716 10 11.5 10C12.3284 10 13 10.6716 13 11.5Z`,fill:i,fillRule:`evenodd`,clipRule:`evenodd`}))}),k_=(0,t.createContext)(void 0),A_=[`Arial`,`Helvetica`,`Times New Roman`,`Courier New`,`Verdana`,`Georgia`,`Palatino`,`Garamond`,`Bookman`,`Comic Sans MS`,`Trebuchet MS`,`Arial Black`,`Impact`];let j_=({children:e,isList:n=!1,availableProps:i=[],theme:a=`light`})=>{let[o,s]=(0,t.useState)({elements:[],selectedElementId:null,isList:n,mockData:[],singleMockData:{},listSettings:{sortOrder:`asc`,newestPosition:`bottom`,scrollDirection:`down`},availableProps:i,availableFonts:[...A_,`Roboto`,`Open Sans`,`Lato`,`Montserrat`],theme:a});t.default.useEffect(()=>{o.availableFonts.forEach(e=>{if(A_.includes(e))return;let t=`font-${e.replace(/\s+/g,`-`).toLowerCase()}`;if(!document.getElementById(t)){let n=document.createElement(`link`);n.id=t,n.href=`https://fonts.googleapis.com/css2?family=${e.replace(/ /g,`+`)}&display=swap`,n.rel=`stylesheet`,document.head.appendChild(n)}})},[o.availableFonts]),t.default.useEffect(()=>{s(e=>({...e,isList:n,availableProps:i,theme:a}))},[n,i,a]);let c=t.default.useCallback(e=>{s(t=>({...t,canvasHeight:e}))},[]),l=t.default.useCallback(e=>{s(t=>({...t,...e,isList:e.isList??t.isList,availableProps:e.availableProps??t.availableProps,availableFonts:e.availableFonts??t.availableFonts,selectedElementId:null}))},[]),u=t.default.useCallback(e=>{let t={};e.type===`box`&&(t.backgroundColor=`var(--gray-4)`);let n={id:crypto.randomUUID(),x:50,y:50,width:200,height:e.type===`text`?50:150,...e,style:{...t,...e.style||{}}};s(e=>({...e,elements:[...e.elements,n]}))},[]),d=t.default.useCallback(e=>{s(t=>({...t,elements:t.elements.filter(t=>t.id!==e),selectedElementId:t.selectedElementId===e?null:t.selectedElementId}))},[]),f=t.default.useCallback(e=>{s(t=>({...t,selectedElementId:e}))},[]),p=t.default.useCallback((e,t)=>{s(n=>{let r=[...n.elements],i=r[e];return r.splice(e,1),r.splice(t,0,i),{...n,elements:r}})},[]),m=t.default.useCallback((e,t)=>{s(n=>({...n,elements:n.elements.map(n=>n.id===e?{...n,...t}:n)}))},[]),h=t.default.useCallback((e,t)=>{s(n=>({...n,mockData:e,singleMockData:t}))},[]),g=t.default.useCallback(e=>{s(t=>({...t,listSettings:{...t.listSettings,...e}}))},[]),_=t.default.useMemo(()=>({state:o,addElement:u,removeElement:d,selectElement:f,moveElement:p,updateElement:m,setMockData:h,updateListSettings:g,setCanvasHeight:c,loadState:l}),[o,u,d,f,p,m,h,g,c,l]);return(0,r.jsx)(k_.Provider,{value:_,children:e})},M_=()=>{let e=(0,t.useContext)(k_);if(!e)throw Error(`useEditor must be used within an EditorProvider`);return e};var K=function(){return K=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},K.apply(this,arguments)},N_={width:`100%`,height:`10px`,top:`0px`,left:`0px`,cursor:`row-resize`},P_={width:`10px`,height:`100%`,top:`0px`,left:`0px`,cursor:`col-resize`},F_={width:`20px`,height:`20px`,position:`absolute`,zIndex:1},I_={top:K(K({},N_),{top:`-5px`}),right:K(K({},P_),{left:void 0,right:`-5px`}),bottom:K(K({},N_),{top:void 0,bottom:`-5px`}),left:K(K({},P_),{left:`-5px`}),topRight:K(K({},F_),{right:`-10px`,top:`-10px`,cursor:`ne-resize`}),bottomRight:K(K({},F_),{right:`-10px`,bottom:`-10px`,cursor:`se-resize`}),bottomLeft:K(K({},F_),{left:`-10px`,bottom:`-10px`,cursor:`sw-resize`}),topLeft:K(K({},F_),{left:`-10px`,top:`-10px`,cursor:`nw-resize`})},L_=(0,t.memo)(function(e){var n=e.onResizeStart,i=e.direction,a=e.children,o=e.replaceStyles,s=e.className,c=(0,t.useCallback)(function(e){n(e,i)},[n,i]),l=(0,t.useCallback)(function(e){n(e,i)},[n,i]),u=(0,t.useMemo)(function(){return K(K({position:`absolute`,userSelect:`none`},I_[i]),o??{})},[o,i]);return(0,r.jsx)(`div`,{className:s||void 0,style:u,onMouseDown:c,onTouchStart:l,children:a})}),R_=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),z_=function(){return z_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z_.apply(this,arguments)},B_={width:`auto`,height:`auto`},V_=function(e,t,n){return Math.max(Math.min(e,n),t)},H_=function(e,t,n){var r=Math.round(e/t);return r*t+n*(r-1)},U_=function(e,t){return new RegExp(e,`i`).test(t)},W_=function(e){return!!(e.touches&&e.touches.length)},G_=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},K_=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(n,r,i){return Math.abs(r-e)<Math.abs(t[n]-e)?i:n},0),i=Math.abs(t[r]-e);return n===0||i<n?t[r]:e},q_=function(e){return e=e.toString(),e===`auto`||e.endsWith(`px`)||e.endsWith(`%`)||e.endsWith(`vh`)||e.endsWith(`vw`)||e.endsWith(`vmax`)||e.endsWith(`vmin`)?e:`${e}px`},J_=function(e,t,n,r){if(e&&typeof e==`string`){if(e.endsWith(`px`))return Number(e.replace(`px`,``));if(e.endsWith(`%`)){var i=Number(e.replace(`%`,``))/100;return t*i}if(e.endsWith(`vw`)){var i=Number(e.replace(`vw`,``))/100;return n*i}if(e.endsWith(`vh`)){var i=Number(e.replace(`vh`,``))/100;return r*i}}return e},Y_=function(e,t,n,r,i,a,o){return r=J_(r,e.width,t,n),i=J_(i,e.height,t,n),a=J_(a,e.width,t,n),o=J_(o,e.height,t,n),{maxWidth:r===void 0?void 0:Number(r),maxHeight:i===void 0?void 0:Number(i),minWidth:a===void 0?void 0:Number(a),minHeight:o===void 0?void 0:Number(o)}},X_=function(e){return Array.isArray(e)?e:[e,e]},Z_=`as.ref.style.className.grid.gridGap.snap.bounds.boundsByDirection.size.defaultSize.minWidth.minHeight.maxWidth.maxHeight.lockAspectRatio.lockAspectRatioExtraWidth.lockAspectRatioExtraHeight.enable.handleStyles.handleClasses.handleWrapperStyle.handleWrapperClass.children.onResizeStart.onResize.onResizeStop.handleComponent.scale.resizeRatio.snapGap`.split(`.`),Q_=`__resizable_base__`,$_=function(e){R_(t,e);function t(t){var n=e.call(this,t)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.delta={width:0,height:0},n.appendBase=function(){if(!n.resizable||!n.window)return null;var e=n.parentNode;if(!e)return null;var t=n.window.document.createElement(`div`);return t.style.width=`100%`,t.style.height=`100%`,t.style.position=`absolute`,t.style.transform=`scale(0, 0)`,t.style.left=`0`,t.style.flex=`0 0 100%`,t.classList?t.classList.add(Q_):t.className+=Q_,e.appendChild(t),t},n.removeBase=function(e){var t=n.parentNode;t&&t.removeChild(e)},n.state={isResizing:!1,width:n.propsSize?.width??`auto`,height:n.propsSize?.height??`auto`,direction:`right`,original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:`100%`,width:`100%`,backgroundColor:`rgba(0,0,0,0)`,cursor:`auto`,opacity:0,position:`fixed`,zIndex:9999,top:`0`,left:`0`,bottom:`0`,right:`0`},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return Object.defineProperty(t.prototype,`parentNode`,{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`window`,{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`propsSize`,{get:function(){return this.props.size||this.props.defaultSize||B_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`size`,{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,i=this.resizable.style.position;i!==`relative`&&(this.resizable.style.position=`relative`),e=this.resizable.style.width===`auto`?n:this.resizable.offsetWidth,t=this.resizable.style.height===`auto`?r:this.resizable.offsetHeight,this.resizable.style.position=i}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`sizeStyle`,{get:function(){var e=this,t=this.props.size,n=function(t){if(e.state[t]===void 0||e.state[t]===`auto`)return`auto`;if(e.propsSize&&e.propsSize[t]&&e.propsSize[t]?.toString().endsWith(`%`)){if(e.state[t].toString().endsWith(`%`))return e.state[t].toString();var n=e.getParentSize();return`${Number(e.state[t].toString().replace(`px`,``))/n[t]*100}%`}return q_(e.state[t])};return{width:t&&t.width!==void 0&&!this.state.isResizing?q_(t.width):n(`width`),height:t&&t.height!==void 0&&!this.state.isResizing?q_(t.height):n(`height`)}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;n!==`wrap`&&(t=!0,this.parentNode.style.flexWrap=`wrap`),e.style.position=`relative`,e.style.minWidth=`100%`,e.style.minHeight=`100%`;var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener(`mouseup`,this.onMouseUp),this.window.addEventListener(`mousemove`,this.onMouseMove),this.window.addEventListener(`mouseleave`,this.onMouseUp),this.window.addEventListener(`touchmove`,this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener(`touchend`,this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener(`mouseup`,this.onMouseUp),this.window.removeEventListener(`mousemove`,this.onMouseMove),this.window.removeEventListener(`mouseleave`,this.onMouseUp),this.window.removeEventListener(`touchmove`,this.onMouseMove,!0),this.window.removeEventListener(`touchend`,this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:e.flexBasis===`auto`?void 0:e.flexBasis})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return this.state[t]===`auto`&&this.state.original[t]===e&&(n===void 0||n===`auto`)?`auto`:e},t.prototype.calculateNewMaxFromBoundary=function(e,t){var n=this.props.boundsByDirection,r=this.state.direction,i=n&&U_(`left`,r),a=n&&U_(`top`,r),o,s;if(this.props.bounds===`parent`){var c=this.parentNode;c&&(o=i?this.resizableRight-this.parentLeft:c.offsetWidth+(this.parentLeft-this.resizableLeft),s=a?this.resizableBottom-this.parentTop:c.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds===`window`?this.window&&(o=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,s=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(o=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),s=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return o&&Number.isFinite(o)&&(e=e&&e<o?e:o),s&&Number.isFinite(s)&&(t=t&&t<s?t:s),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var n=this.props.scale||1,r=X_(this.props.resizeRatio||1),i=r[0],a=r[1],o=this.state,s=o.direction,c=o.original,l=this.props,u=l.lockAspectRatio,d=l.lockAspectRatioExtraHeight,f=l.lockAspectRatioExtraWidth,p=c.width,m=c.height,h=d||0,g=f||0;return U_(`right`,s)&&(p=c.width+(e-c.x)*i/n,u&&(m=(p-g)/this.ratio+h)),U_(`left`,s)&&(p=c.width-(e-c.x)*i/n,u&&(m=(p-g)/this.ratio+h)),U_(`bottom`,s)&&(m=c.height+(t-c.y)*a/n,u&&(p=(m-h)*this.ratio+g)),U_(`top`,s)&&(m=c.height-(t-c.y)*a/n,u&&(p=(m-h)*this.ratio+g)),{newWidth:p,newHeight:m}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var i=this.props,a=i.lockAspectRatio,o=i.lockAspectRatioExtraHeight,s=i.lockAspectRatioExtraWidth,c=r.width===void 0?10:r.width,l=n.width===void 0||n.width<0?e:n.width,u=r.height===void 0?10:r.height,d=n.height===void 0||n.height<0?t:n.height,f=o||0,p=s||0;if(a){var m=(u-f)*this.ratio+p,h=(d-f)*this.ratio+p,g=(c-p)/this.ratio+f,_=(l-p)/this.ratio+f,v=Math.max(c,m),y=Math.min(l,h),b=Math.max(u,g),x=Math.min(d,_);e=V_(e,v,y),t=V_(t,b,x)}else e=V_(e,c,l),t=V_(t,u,d);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){var e=1/(this.props.scale||1);if(this.props.bounds===`parent`){var t=this.parentNode;if(t){var n=t.getBoundingClientRect();this.parentLeft=n.left*e,this.parentTop=n.top*e}}if(this.props.bounds&&typeof this.props.bounds!=`string`){var r=this.props.bounds.getBoundingClientRect();this.targetLeft=r.left*e,this.targetTop=r.top*e}if(this.resizable){var i=this.resizable.getBoundingClientRect(),a=i.left,o=i.top,s=i.right,c=i.bottom;this.resizableLeft=a*e,this.resizableRight=s*e,this.resizableTop=o*e,this.resizableBottom=c*e}},t.prototype.onResizeStart=function(e,t){if(!(!this.resizable||!this.window)){var n=0,r=0;if(e.nativeEvent&&G_(e.nativeEvent)?(n=e.nativeEvent.clientX,r=e.nativeEvent.clientY):e.nativeEvent&&W_(e.nativeEvent)&&(n=e.nativeEvent.touches[0].clientX,r=e.nativeEvent.touches[0].clientY),!(this.props.onResizeStart&&this.resizable&&this.props.onResizeStart(e,t,this.resizable)===!1)){this.props.size&&(this.props.size.height!==void 0&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),this.props.size.width!==void 0&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio==`number`?this.props.lockAspectRatio:this.size.width/this.size.height;var i,a=this.window.getComputedStyle(this.resizable);if(a.flexBasis!==`auto`){var o=this.parentNode;o&&(this.flexDir=this.window.getComputedStyle(o).flexDirection.startsWith(`row`)?`row`:`column`,i=a.flexBasis)}this.setBoundingClientRect(),this.bindEvents();var s={original:{x:n,y:r,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:z_(z_({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||`auto`}),direction:t,flexBasis:i};this.setState(s)}}},t.prototype.onMouseMove=function(e){var t=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&W_(e))try{e.preventDefault(),e.stopPropagation()}catch{}var r=this.props,i=r.maxWidth,a=r.maxHeight,o=r.minWidth,s=r.minHeight,c=W_(e)?e.touches[0].clientX:e.clientX,l=W_(e)?e.touches[0].clientY:e.clientY,u=this.state,d=u.direction,f=u.original,p=u.width,m=u.height,h=this.getParentSize(),g=Y_(h,this.window.innerWidth,this.window.innerHeight,i,a,o,s);i=g.maxWidth,a=g.maxHeight,o=g.minWidth,s=g.minHeight;var _=this.calculateNewSizeFromDirection(c,l),v=_.newHeight,y=_.newWidth,b=this.calculateNewMaxFromBoundary(i,a);this.props.snap&&this.props.snap.x&&(y=K_(y,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(v=K_(v,this.props.snap.y,this.props.snapGap));var x=this.calculateNewSizeFromAspectRatio(y,v,{width:b.maxWidth,height:b.maxHeight},{width:o,height:s});if(y=x.newWidth,v=x.newHeight,this.props.grid){var S=H_(y,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),C=H_(v,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),w=this.props.snapGap||0,T=w===0||Math.abs(S-y)<=w?S:y,E=w===0||Math.abs(C-v)<=w?C:v;y=T,v=E}var D={width:y-f.width,height:v-f.height};if(this.delta=D,p&&typeof p==`string`){if(p.endsWith(`%`)){var O=y/h.width*100;y=`${O}%`}else if(p.endsWith(`vw`)){var k=y/this.window.innerWidth*100;y=`${k}vw`}else if(p.endsWith(`vh`)){var A=y/this.window.innerHeight*100;y=`${A}vh`}}if(m&&typeof m==`string`){if(m.endsWith(`%`)){var O=v/h.height*100;v=`${O}%`}else if(m.endsWith(`vw`)){var k=v/this.window.innerWidth*100;v=`${k}vw`}else if(m.endsWith(`vh`)){var A=v/this.window.innerHeight*100;v=`${A}vh`}}var j={width:this.createSizeForCssProperty(y,`width`),height:this.createSizeForCssProperty(v,`height`)};this.flexDir===`row`?j.flexBasis=j.width:this.flexDir===`column`&&(j.flexBasis=j.height);var M=this.state.width!==j.width,N=this.state.height!==j.height,ee=this.state.flexBasis!==j.flexBasis,P=M||N||ee;P&&(0,n.flushSync)(function(){t.setState(j)}),this.props.onResize&&P&&this.props.onResize(e,d,this.resizable,D)}},t.prototype.onMouseUp=function(e){var t=this.state,n=t.isResizing,r=t.direction;t.original,!(!n||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(e,r,this.resizable,this.delta),this.props.size&&this.setState({width:this.props.size.width??`auto`,height:this.props.size.height??`auto`}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:z_(z_({},this.state.backgroundStyle),{cursor:`auto`})}))},t.prototype.updateSize=function(e){this.setState({width:e.width??`auto`,height:e.height??`auto`})},t.prototype.renderResizer=function(){var e=this,t=this.props,n=t.enable,i=t.handleStyles,a=t.handleClasses,o=t.handleWrapperStyle,s=t.handleWrapperClass,c=t.handleComponent;return n?(0,r.jsx)(`div`,{className:s,style:o,children:Object.keys(n).map(function(t){return n[t]===!1?null:(0,r.jsx)(L_,{direction:t,onResizeStart:e.onResizeStart,replaceStyles:i&&i[t],className:a&&a[t],children:c&&c[t]?c[t]:null},t)})}):null},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce(function(t,n){return Z_.indexOf(n)===-1&&(t[n]=e.props[n]),t},{}),n=z_(z_(z_({position:`relative`,userSelect:this.state.isResizing?`none`:`auto`},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:`border-box`,flexShrink:0});return this.state.flexBasis&&(n.flexBasis=this.state.flexBasis),(0,r.jsxs)(this.props.as||`div`,z_({style:n,className:this.props.className},t,{ref:function(t){t&&(e.resizable=t)},children:[this.state.isResizing&&(0,r.jsx)(`div`,{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:`div`,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(t.PureComponent);let ev=({children:e,element:n})=>{let{updateElement:i,removeElement:a,addElement:o,moveElement:s,state:c}=M_(),[l,u]=(0,t.useState)(!1),[d,f]=(0,t.useState)(!1),[p,m]=(0,t.useState)(n.content),[h,g]=(0,t.useState)(n.dataBinding||``),_=(0,t.useRef)(null),v=(0,t.useRef)(null),y=e=>{let t=_.current;if(t){let n=t.selectionStart,r=t.selectionEnd,i=p;m(i.substring(0,n)+`{{${e}}}`+i.substring(r)),setTimeout(()=>{t.focus();let r=n+e.length+4;t.setSelectionRange(r,r)},0)}else m(t=>t+`{{${e}}}`)},b=e=>{i(n.id,{style:{...n.style,...e}})},x=()=>{let e=c.elements.findIndex(e=>e.id===n.id);e<c.elements.length-1&&s(e,c.elements.length-1)},S=()=>{let e=c.elements.findIndex(e=>e.id===n.id);e>0&&s(e,0)},C=()=>{o({type:n.type,content:n.content,x:n.x+20,y:n.y+20,width:n.width,height:n.height,style:n.style})},w=[`#000000`,`#FFFFFF`,`#FF0000`,`#00FF00`,`#0000FF`,`#FFA500`,`#808080`,`#800080`,`transparent`];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Wm,{open:l,onOpenChange:u,children:(0,r.jsxs)(Km,{style:{maxWidth:450},children:[(0,r.jsx)(qm,{children:`Editar Texto`}),(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsx)(Dh,{ref:_,value:p,onChange:e=>m(e.target.value),placeholder:`Digite o novo texto...`,style:{height:100}}),c.availableProps&&c.availableProps.length>0&&(0,r.jsxs)(W,{direction:`column`,gap:`2`,children:[(0,r.jsx)(H,{size:`1`,color:`gray`,children:`Inserir variável:`}),(0,r.jsx)(W,{gap:`2`,wrap:`wrap`,children:c.availableProps.map(e=>(0,r.jsx)(Hp,{color:`blue`,variant:`surface`,style:{cursor:`pointer`},onClick:()=>y(e.dataName),children:e.name},e.dataName))})]}),(0,r.jsxs)(W,{gap:`3`,justify:`end`,children:[(0,r.jsx)(Ym,{children:(0,r.jsx)(Tm,{variant:`soft`,color:`gray`,children:`Cancelar`})}),(0,r.jsx)(Tm,{onClick:()=>{i(n.id,{content:p}),u(!1)},children:`Salvar`})]})]})]})}),(0,r.jsx)(Wm,{open:d,onOpenChange:f,children:(0,r.jsxs)(Km,{style:{maxWidth:450},children:[(0,r.jsx)(qm,{children:`Vincular Dados Manualmente`}),(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsx)(H,{size:`2`,children:`Nome da propriedade (ex: titulo, preco, imagem):`}),(0,r.jsx)(jh,{value:h,onChange:e=>g(e.target.value),placeholder:`propriedade`}),(0,r.jsxs)(W,{gap:`3`,justify:`end`,children:[(0,r.jsx)(Ym,{children:(0,r.jsx)(Tm,{variant:`soft`,color:`gray`,children:`Cancelar`})}),(0,r.jsx)(Tm,{onClick:()=>{let e=h,t={dataBinding:e};n.type===`text`&&(t.content=`{{${e}}}`),i(n.id,t),f(!1)},children:`Vincular`})]})]})]})}),(0,r.jsx)(`input`,{type:`file`,ref:v,style:{display:`none`},accept:`image/*`,onChange:e=>{let t=e.target.files?.[0];if(t){let e=new FileReader;e.onload=e=>{e.target?.result&&i(n.id,{content:e.target.result})},e.readAsDataURL(t)}}}),(0,r.jsxs)(Rc,{children:[(0,r.jsx)(zc,{asChild:!0,children:(0,r.jsx)(`div`,{style:{display:`contents`},children:e})}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Vc,{className:`ContextMenuContent`,children:[(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Vincular Dados`,n.dataBinding&&(0,r.jsxs)(`span`,{style:{fontSize:10,marginLeft:4,opacity:.7},children:[`(`,n.dataBinding,`)`]}),(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[c.availableProps&&c.availableProps.length>0&&(0,r.jsxs)(r.Fragment,{children:[c.availableProps.map(e=>(0,r.jsxs)(B,{className:`ContextMenuItem`,onSelect:()=>{let t={dataBinding:e.dataName};n.type===`text`&&(t.content=`{{${e.dataName}}}`),i(n.id,t)},children:[e.name,` `,(0,r.jsx)(`div`,{className:`RightSlot`,children:e.dataName})]},e.dataName)),(0,r.jsx)(Hc,{className:`ContextMenuSeparator`})]}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>{g(n.dataBinding||``),f(!0)},children:`Outro / Manual...`}),n.dataBinding&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Hc,{className:`ContextMenuSeparator`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>i(n.id,{dataBinding:void 0}),style:{color:`var(--red-9)`},children:`Remover Vínculo`})]})]})})]}),(0,r.jsx)(Hc,{className:`ContextMenuSeparator`}),n.type===`text`&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>{m(n.content),u(!0)},children:`Editar Texto...`}),(0,r.jsx)(Hc,{className:`ContextMenuSeparator`})]}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:C,children:`Duplicar`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>a(n.id),children:`Excluir`}),(0,r.jsx)(Hc,{className:`ContextMenuSeparator`}),n.type===`image`&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Alterar Imagem`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>v.current?.click(),children:`Carregar do Computador`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>{setTimeout(()=>{let e=window.prompt(`Insira a URL da imagem:`,n.content);e!==null&&i(n.id,{content:e})},10)},children:`Inserir URL`})]})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Ajuste da Imagem`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({objectFit:`cover`}),children:`Preencher (Cover)`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({objectFit:`contain`}),children:`Ajustar (Contain)`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({objectFit:`fill`}),children:`Esticar (Fill)`})]})})]}),(0,r.jsx)(Hc,{className:`ContextMenuSeparator`})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Camadas`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:x,children:`Trazer para frente`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:S,children:`Enviar para trás`})]})})]}),(0,r.jsx)(Hc,{className:`ContextMenuSeparator`}),n.type===`text`&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Fonte`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsx)(Gc,{className:`ContextMenuSubContent ContextMenuScrollable`,sideOffset:2,alignOffset:-5,children:c.availableFonts&&c.availableFonts.map(e=>(0,r.jsxs)(B,{className:`ContextMenuItem`,onSelect:()=>b({fontFamily:e}),style:{fontFamily:e},children:[e,n.style?.fontFamily===e&&(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(m_,{})})]},e))})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Tamanho da Fonte`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsx)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[12,14,16,20,24,32,48,64].map(e=>(0,r.jsxs)(B,{className:`ContextMenuItem`,onSelect:()=>b({fontSize:`${e}px`}),children:[e,`px`]},e))})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Cor do Texto`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsx)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:w.filter(e=>e!==`transparent`).map(e=>(0,r.jsxs)(B,{className:`ContextMenuItem`,onSelect:()=>b({color:e}),children:[(0,r.jsx)(`div`,{style:{width:12,height:12,backgroundColor:e,marginRight:8,border:`1px solid #ccc`}}),e]},e))})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Peso da Fonte`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({fontWeight:`normal`}),children:`Normal`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({fontWeight:`bold`}),children:`Negrito`})]})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Alinhamento`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({textAlign:`left`}),children:`Esquerda`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({textAlign:`center`}),children:`Centro`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({textAlign:`right`}),children:`Direita`})]})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Alinhamento Vertical`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsxs)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({display:`flex`,flexDirection:`column`,justifyContent:`flex-start`}),children:`Topo`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({display:`flex`,flexDirection:`column`,justifyContent:`center`}),children:`Centro`}),(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({display:`flex`,flexDirection:`column`,justifyContent:`flex-end`}),children:`Base`})]})})]})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Cor de Fundo`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsx)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:w.map(e=>(0,r.jsxs)(B,{className:`ContextMenuItem`,onSelect:()=>b({backgroundColor:e}),children:[(0,r.jsx)(`div`,{style:{width:12,height:12,backgroundColor:e,marginRight:8,border:`1px solid #ccc`}}),e===`transparent`?`Transparente`:e]},e))})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Arredondamento`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsx)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[0,4,8,12,16,24,`50%`].map(e=>(0,r.jsx)(B,{className:`ContextMenuItem`,onSelect:()=>b({borderRadius:typeof e==`number`?`${e}px`:e}),children:e===`50%`?`Círculo`:`${e}px`},e))})})]}),(0,r.jsxs)(Uc,{children:[(0,r.jsxs)(Wc,{className:`ContextMenuSubTrigger`,children:[`Espaçamento`,(0,r.jsx)(`div`,{className:`RightSlot`,children:(0,r.jsx)(g_,{})})]}),(0,r.jsx)(Bc,{children:(0,r.jsx)(Gc,{className:`ContextMenuSubContent`,sideOffset:2,alignOffset:-5,children:[0,4,8,12,16,24,32].map(e=>(0,r.jsxs)(B,{className:`ContextMenuItem`,onSelect:()=>b({padding:`${e}px`}),children:[e,`px`]},e))})})]})]})})]})]})};var tv=({element:e,isSelected:n})=>{let{selectElement:i,updateElement:a,state:o}=M_(),[s,c]=(0,t.useState)(!1),[l,u]=(0,t.useState)(!1),d=(0,t.useRef)({x:0,y:0}),f=(0,t.useRef)({x:0,y:0}),p=o.canvasHeight||150,m=(0,t.useRef)(0),h=(0,t.useRef)(0),g=(0,t.useRef)({x:0,y:0}),_=o.isList?o.mockData.length>0?o.mockData[0]:null:o.singleMockData,v=e.content;if(_){if(e.type===`text`)v=v.replace(/\{\{(.*?)\}\}/g,(e,t)=>{let n=_[t.trim()];return n==null?e:String(n)});else if(e.type===`image`)if(e.dataBinding){let t=_[e.dataBinding];t!=null&&(v=String(t))}else v=v.replace(/\{\{(.*?)\}\}/g,(e,t)=>{let n=_[t.trim()];return n==null?e:String(n)})}let y=t=>{t.stopPropagation(),i(e.id)},b=t=>{t.button===0&&(t.stopPropagation(),i(e.id),c(!0),d.current={x:t.clientX,y:t.clientY},f.current={x:e.x,y:e.y})},x=t=>{t.stopPropagation(),t.preventDefault(),u(!0);let n=t.target.closest(`.resizable-element`);if(n){let r=n.getBoundingClientRect();g.current={x:r.left+r.width/2,y:r.top+r.height/2};let i=t.clientX-g.current.x,a=t.clientY-g.current.y;m.current=Math.atan2(a,i)*(180/Math.PI),h.current=e.rotation||0}};(0,t.useEffect)(()=>{let t=t=>{if(s){let n=t.clientX-d.current.x,r=t.clientY-d.current.y,i=f.current.x+n,s=f.current.y+r;o.isList&&(s=Math.max(0,s),s+e.height>p&&(s=Math.max(0,p-e.height))),a(e.id,{x:i,y:s})}if(l){let n=t.clientX-g.current.x,r=t.clientY-g.current.y,i=Math.atan2(r,n)*(180/Math.PI)-m.current;a(e.id,{rotation:(h.current+i)%360})}},n=()=>{s&&c(!1),l&&u(!1)};return(s||l)&&(window.addEventListener(`mousemove`,t),window.addEventListener(`mouseup`,n)),()=>{window.removeEventListener(`mousemove`,t),window.removeEventListener(`mouseup`,n)}},[s,l,e.id,a]);let S={position:`absolute`,left:0,top:0,width:`100%`,height:`100%`,padding:e.type===`image`||e.type===`text`?0:`8px`,border:n?`2px solid var(--accent-9)`:`1px dashed transparent`,outline:n?`none`:`1px solid transparent`,cursor:s?`grabbing`:`grab`,borderRadius:`var(--radius-2)`,overflow:`hidden`,userSelect:`none`,...e.style};return(0,r.jsx)($_,{className:`resizable-element`,size:{width:e.width,height:e.height},maxHeight:o.isList?Math.max(10,p-e.y):void 0,onResizeStop:(t,n,r,i)=>{a(e.id,{width:e.width+i.width,height:e.height+i.height})},style:{position:`absolute`,transform:`translate(${e.x}px, ${e.y}px) rotate(${e.rotation||0}deg)`},enable:n?void 0:!1,children:(0,r.jsx)(ev,{element:e,children:(0,r.jsxs)(`div`,{style:{width:`100%`,height:`100%`,position:`relative`},children:[(0,r.jsxs)(U,{style:S,onMouseDown:b,onClick:y,onMouseEnter:e=>{n||(e.currentTarget.style.borderColor=`var(--gray-6)`)},onMouseLeave:e=>{n||(e.currentTarget.style.borderColor=`transparent`)},children:[e.type===`text`&&(0,r.jsx)(H,{style:{width:`100%`,height:`100%`},children:v}),e.type===`image`&&(v?(0,r.jsx)(`img`,{src:v,alt:`Element`,style:{width:`100%`,height:`100%`,objectFit:e.style?.objectFit||`cover`,display:`block`,pointerEvents:`none`}}):(0,r.jsx)(U,{style:{width:`100%`,height:`100%`,backgroundColor:`#eee`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,r.jsx)(H,{size:`1`,children:`Imagem Placeholder`})})),e.type===`box`&&(0,r.jsx)(U,{style:{width:`100%`,height:`100%`}})]}),n&&(0,r.jsx)(U,{style:{position:`absolute`,top:-30,left:`50%`,transform:`translateX(-50%)`,width:12,height:12,backgroundColor:`var(--accent-9)`,borderRadius:`50%`,cursor:`crosshair`,zIndex:50,boxShadow:`0 0 0 2px white`},onMouseDown:x,children:(0,r.jsx)(U,{style:{position:`absolute`,top:12,left:`50%`,width:2,height:18,backgroundColor:`var(--accent-9)`,transform:`translateX(-50%)`}})})]})})})};let nv=()=>{let{state:e,selectElement:t}=M_(),n=()=>{t(null)},i=e.canvasHeight||150;return(0,r.jsxs)(U,{onClick:n,style:{width:`100%`,height:`100%`,position:`relative`,overflow:`hidden`,backgroundColor:`var(--color-background)`,backgroundImage:`radial-gradient(var(--gray-5) 1px, transparent 1px)`,backgroundSize:`20px 20px`},children:[e.isList&&(0,r.jsx)(`div`,{style:{position:`absolute`,top:i,left:0,right:0,borderBottom:`2px dashed var(--accent-9)`,pointerEvents:`none`,zIndex:10},children:(0,r.jsxs)(`div`,{style:{position:`absolute`,right:10,bottom:2,backgroundColor:`var(--accent-9)`,color:`white`,fontSize:`10px`,padding:`2px 4px`,borderRadius:`2px`},children:[`Fim do Item (`,i,`px)`]})}),e.elements.length===0&&(0,r.jsx)(W,{align:`center`,justify:`center`,style:{height:`100%`,color:`var(--gray-8)`,pointerEvents:`none`},children:(0,r.jsx)(H,{children:`Adicione elementos e arraste livremente`})}),e.elements.map(t=>(0,r.jsx)(tv,{element:t,isSelected:e.selectedElementId===t.id},t.id))]})};var rv=(0,t.createContext)({});function iv(e){let n=(0,t.useRef)(null);return n.current===null&&(n.current=e()),n.current}var av=typeof window<`u`,ov=av?t.useLayoutEffect:t.useEffect,sv=(0,t.createContext)(null);function cv(e,t){e.indexOf(t)===-1&&e.push(t)}function lv(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var uv=(e,t,n)=>n>t?t:n<e?e:n;function dv(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}var fv=()=>{},pv=()=>{};typeof process<`u`&&process.env.NODE_ENV!==`production`&&(fv=(e,t,n)=>{!e&&typeof console<`u`&&console.warn(dv(t,n))},pv=(e,t,n)=>{if(!e)throw Error(dv(t,n))});var mv={},hv=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function gv(e){return typeof e==`object`&&!!e}var _v=e=>/^0[^.\s]+$/u.test(e);function vv(e){let t;return()=>(t===void 0&&(t=e()),t)}var yv=e=>e,bv=(e,t)=>n=>t(e(n)),xv=(...e)=>e.reduce(bv),Sv=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},Cv=class{constructor(){this.subscriptions=[]}add(e){return cv(this.subscriptions,e),()=>lv(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},wv=e=>e*1e3,Tv=e=>e/1e3;function Ev(e,t){return t?e*(1e3/t):0}var Dv=new Set;function Ov(e,t,n){e||Dv.has(t)||(console.warn(dv(t,n)),Dv.add(t))}var kv=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Av=1e-7,jv=12;function Mv(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=kv(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Av&&++s<jv);return o}function Nv(e,t,n,r){if(e===t&&n===r)return yv;let i=t=>Mv(t,0,1,e,n);return e=>e===0||e===1?e:kv(i(e),t,r)}var Pv=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Fv=e=>t=>1-e(1-t),Iv=Nv(.33,1.53,.69,.99),Lv=Fv(Iv),Rv=Pv(Lv),zv=e=>(e*=2)<1?.5*Lv(e):.5*(2-2**(-10*(e-1))),Bv=e=>1-Math.sin(Math.acos(e)),Vv=Fv(Bv),Hv=Pv(Bv),Uv=Nv(.42,0,1,1),Wv=Nv(0,0,.58,1),Gv=Nv(.42,0,.58,1),Kv=e=>Array.isArray(e)&&typeof e[0]!=`number`,qv=e=>Array.isArray(e)&&typeof e[0]==`number`,Jv={linear:yv,easeIn:Uv,easeInOut:Gv,easeOut:Wv,circIn:Bv,circInOut:Hv,circOut:Vv,backIn:Lv,backInOut:Rv,backOut:Iv,anticipate:zv},Yv=e=>typeof e==`string`,Xv=e=>{if(qv(e)){pv(e.length===4,`Cubic bezier arrays must contain four numerical values.`,`cubic-bezier-length`);let[t,n,r,i]=e;return Nv(t,n,r,i)}else if(Yv(e))return pv(Jv[e]!==void 0,`Invalid easing type '${e}'`,`invalid-easing-type`),Jv[e];return e},Zv=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],Qv={value:null,addProjectionMetrics:null};function $v(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),t&&Qv.value&&Qv.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var ey=40;function ty(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Zv.reduce((e,n)=>(e[n]=$v(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=mv.useManualTiming?i.timestamp:performance.now();n=!1,mv.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,ey),1)),i.timestamp=a,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Zv.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Zv.length;t++)o[Zv[t]].cancel(e)},state:i,steps:o}}var{schedule:q,cancel:ny,state:J,steps:ry}=ty(typeof requestAnimationFrame<`u`?requestAnimationFrame:yv,!0),iy;function ay(){iy=void 0}var oy={now:()=>(iy===void 0&&oy.set(J.isProcessing||mv.useManualTiming?J.timestamp:performance.now()),iy),set:e=>{iy=e,queueMicrotask(ay)}},sy={layout:0,mainThread:0,waapi:0},cy=e=>t=>typeof t==`string`&&t.startsWith(e),ly=cy(`--`),uy=cy(`var(--`),dy=e=>uy(e)?fy.test(e.split(`/*`)[0].trim()):!1,fy=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function py(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var my={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},hy={...my,transform:e=>uv(0,1,e)},gy={...my,default:1},_y=e=>Math.round(e*1e5)/1e5,vy=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function yy(e){return e==null}var by=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xy=(e,t)=>n=>!!(typeof n==`string`&&by.test(n)&&n.startsWith(e)||t&&!yy(n)&&Object.prototype.hasOwnProperty.call(n,t)),Sy=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(vy);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Cy=e=>uv(0,255,e),wy={...my,transform:e=>Math.round(Cy(e))},Ty={test:xy(`rgb`,`red`),parse:Sy(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+wy.transform(e)+`, `+wy.transform(t)+`, `+wy.transform(n)+`, `+_y(hy.transform(r))+`)`};function Ey(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Dy={test:xy(`#`),parse:Ey,transform:Ty.transform},Oy=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ky=Oy(`deg`),Ay=Oy(`%`),Y=Oy(`px`),jy=Oy(`vh`),My=Oy(`vw`),Ny=(()=>({...Ay,parse:e=>Ay.parse(e)/100,transform:e=>Ay.transform(e*100)}))(),Py={test:xy(`hsl`,`hue`),parse:Sy(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Ay.transform(_y(t))+`, `+Ay.transform(_y(n))+`, `+_y(hy.transform(r))+`)`},X={test:e=>Ty.test(e)||Dy.test(e)||Py.test(e),parse:e=>Ty.test(e)?Ty.parse(e):Py.test(e)?Py.parse(e):Dy.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Ty.transform(e):Py.transform(e),getAnimatableNone:e=>{let t=X.parse(e);return t.alpha=0,X.transform(t)}},Fy=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Iy(e){return isNaN(e)&&typeof e==`string`&&(e.match(vy)?.length||0)+(e.match(Fy)?.length||0)>0}var Ly=`number`,Ry=`color`,zy=`var`,By=`var(`,Vy="${}",Hy=/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 Uy(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Hy,e=>(X.test(e)?(r.color.push(a),i.push(Ry),n.push(X.parse(e))):e.startsWith(By)?(r.var.push(a),i.push(zy),n.push(e)):(r.number.push(a),i.push(Ly),n.push(parseFloat(e))),++a,Vy)).split(Vy),indexes:r,types:i}}function Wy(e){return Uy(e).values}function Gy(e){let{split:t,types:n}=Uy(e),r=t.length;return e=>{let i=``;for(let a=0;a<r;a++)if(i+=t[a],e[a]!==void 0){let t=n[a];t===Ly?i+=_y(e[a]):t===Ry?i+=X.transform(e[a]):i+=e[a]}return i}}var Ky=e=>typeof e==`number`?0:X.test(e)?X.getAnimatableNone(e):e;function qy(e){let t=Wy(e);return Gy(e)(t.map(Ky))}var Jy={test:Iy,parse:Wy,createTransformer:Gy,getAnimatableNone:qy};function Yy(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Xy({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Yy(s,r,e+1/3),a=Yy(s,r,e),o=Yy(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Zy(e,t){return n=>n>0?t:e}var Z=(e,t,n)=>e+(t-e)*n,Qy=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},$y=[Dy,Ty,Py],eb=e=>$y.find(t=>t.test(e));function tb(e){let t=eb(e);if(fv(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,`color-not-animatable`),!t)return!1;let n=t.parse(e);return t===Py&&(n=Xy(n)),n}var nb=(e,t)=>{let n=tb(e),r=tb(t);if(!n||!r)return Zy(e,t);let i={...n};return e=>(i.red=Qy(n.red,r.red,e),i.green=Qy(n.green,r.green,e),i.blue=Qy(n.blue,r.blue,e),i.alpha=Z(n.alpha,r.alpha,e),Ty.transform(i))},rb=new Set([`none`,`hidden`]);function ib(e,t){return rb.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ab(e,t){return n=>Z(e,t,n)}function ob(e){return typeof e==`number`?ab:typeof e==`string`?dy(e)?Zy:X.test(e)?nb:ub:Array.isArray(e)?sb:typeof e==`object`?X.test(e)?nb:cb:Zy}function sb(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ob(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function cb(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ob(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function lb(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var ub=(e,t)=>{let n=Jy.createTransformer(t),r=Uy(e),i=Uy(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?rb.has(e)&&!i.values.length||rb.has(t)&&!r.values.length?ib(e,t):xv(sb(lb(r,i),i.values),n):(fv(!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`),Zy(e,t))};function db(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Z(e,t,n):ob(e)(e,t)}var fb=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>q.update(t,e),stop:()=>ny(t),now:()=>J.isProcessing?J.timestamp:oy.now()}},pb=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},mb=2e4;function hb(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function gb(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(hb(r),mb);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Tv(i)}}var _b=5;function vb(e,t,n){let r=Math.max(t-_b,0);return Ev(n-e(r),t-r)}var Q={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},yb=.001;function bb({duration:e=Q.duration,bounce:t=Q.bounce,velocity:n=Q.velocity,mass:r=Q.mass}){let i,a;fv(e<=wv(Q.maxDuration),`Spring duration must be 10 seconds or less`,`spring-duration-limit`);let o=1-t;o=uv(Q.minDamping,Q.maxDamping,o),e=uv(Q.minDuration,Q.maxDuration,Tv(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Cb(t,o),c=Math.exp(-i);return yb-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Cb(t**2,o);return(-i(t)+yb>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-yb+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Sb(i,a,s);if(e=wv(e),isNaN(c))return{stiffness:Q.stiffness,damping:Q.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var xb=12;function Sb(e,t,n){let r=n;for(let n=1;n<xb;n++)r-=e(r)/t(r);return r}function Cb(e,t){return e*Math.sqrt(1-t*t)}var wb=[`duration`,`bounce`],Tb=[`stiffness`,`damping`,`mass`];function Eb(e,t){return t.some(t=>e[t]!==void 0)}function Db(e){let t={velocity:Q.velocity,stiffness:Q.stiffness,damping:Q.damping,mass:Q.mass,isResolvedFromDuration:!1,...e};if(!Eb(e,Tb)&&Eb(e,wb))if(e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*uv(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Q.mass,stiffness:i,damping:a}}else{let n=bb(e);t={...t,...n,mass:Q.mass},t.isResolvedFromDuration=!0}return t}function Ob(e=Q.visualDuration,t=Q.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Db({...n,velocity:-Tv(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Tv(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?Q.restSpeed.granular:Q.restSpeed.default,i||=v?Q.restDelta.granular:Q.restDelta.default;let y;if(h<1){let e=Cb(_,h);y=t=>o-Math.exp(-h*_*t)*((m+h*_*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(h===1)y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}let b={calculatedDuration:p&&d||null,next:e=>{let t=y(e);if(p)s.done=e>=d;else{let n=e===0?m:0;h<1&&(n=e===0?wv(m):vb(y,e,t));let a=Math.abs(n)<=r,c=Math.abs(o-t)<=i;s.done=a&&c}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(hb(b),mb),t=pb(t=>b.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return b}Ob.applyToOptions=e=>{let t=gb(e,100,Ob);return e.ease=t.ease,e.duration=wv(t.duration),e.type=`keyframes`,e};function kb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Ob({keyframes:[f.value,m(f.value)],velocity:vb(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Ab(e,t,n){let r=[],i=n||mv.mix||db,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=xv(Array.isArray(t)?t[n]||yv:t,a)),r.push(a)}return r}function jb(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(pv(a===t.length,`Both input and output ranges must be the same length`,`range-length`),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Ab(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Sv(e[r],e[r+1],n);return s[r](i)};return n?t=>l(uv(e[0],e[a-1],t)):l}function Mb(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Sv(0,t,r);e.push(Z(n,1,i))}}function Nb(e){let t=[0];return Mb(t,e.length-1),t}function Pb(e,t){return e.map(e=>e*t)}function Fb(e,t){return e.map(()=>t||Gv).splice(0,e.length-1)}function Ib({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Kv(r)?r.map(Xv):Xv(r),a={done:!1,value:t[0]},o=jb(Pb(n&&n.length===t.length?n:Nb(t),e),t,{ease:Array.isArray(i)?i:Fb(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Lb=e=>e!==null;function Rb(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Lb),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var zb={decay:kb,inertia:kb,tween:Ib,keyframes:Ib,spring:Ob};function Bb(e){typeof e.type==`string`&&(e.type=zb[e.type])}var Vb=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Hb=e=>e/100,Ub=class extends Vb{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==oy.now()&&this.tick(oy.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},sy.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Bb(e);let{type:t=Ib,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Ib;process.env.NODE_ENV!==`production`&&s!==Ib&&pv(o.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`,`spring-two-frames`),s!==Ib&&typeof o[0]!=`number`&&(this.mixKeyframes=xv(Hb,db(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=hb(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=uv(0,1,n)*o}let b=_?{done:!1,value:l[0]}:y.next(v);i&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==kb&&(b.value=Rb(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Tv(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Tv(e)}get time(){return Tv(this.currentTime)}set time(e){e=wv(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(oy.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Tv(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=fb,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,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(oy.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,sy.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Wb(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Gb=e=>e*180/Math.PI,Kb=e=>Jb(Gb(Math.atan2(e[1],e[0]))),qb={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Kb,rotateZ:Kb,skewX:e=>Gb(Math.atan(e[1])),skewY:e=>Gb(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Jb=e=>(e%=360,e<0&&(e+=360),e),Yb=Kb,Xb=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Zb=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Qb={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Xb,scaleY:Zb,scale:e=>(Xb(e)+Zb(e))/2,rotateX:e=>Jb(Gb(Math.atan2(e[6],e[5]))),rotateY:e=>Jb(Gb(Math.atan2(-e[2],e[0]))),rotateZ:Yb,rotate:Yb,skewX:e=>Gb(Math.atan(e[4])),skewY:e=>Gb(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function $b(e){return e.includes(`scale`)?1:0}function ex(e,t){if(!e||e===`none`)return $b(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Qb,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=qb,i=t}if(!i)return $b(t);let a=r[t],o=i[1].split(`,`).map(nx);return typeof a==`function`?a(o):o[a]}var tx=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return ex(n,t)};function nx(e){return parseFloat(e.trim())}var rx=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],ix=(()=>new Set(rx))(),ax=e=>e===my||e===Y,ox=new Set([`x`,`y`,`z`]),sx=rx.filter(e=>!ox.has(e));function cx(e){let t=[];return sx.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith(`scale`)?1:0))}),t}var lx={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),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})=>ex(t,`x`),y:(e,{transform:t})=>ex(t,`y`)};lx.translateX=lx.x,lx.translateY=lx.y;var ux=new Set,dx=!1,fx=!1,px=!1;function mx(){if(fx){let e=Array.from(ux).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=cx(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}fx=!1,dx=!1,ux.forEach(e=>e.complete(px)),ux.clear()}function hx(){ux.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(fx=!0)})}function gx(){px=!0,hx(),mx(),px=!1}var _x=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(ux.add(this),dx||(dx=!0,q.read(hx),q.resolveKeyframes(mx))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Wb(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ux.delete(this)}cancel(){this.state===`scheduled`&&(ux.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},vx=e=>e.startsWith(`--`);function yx(e,t,n){vx(t)?e.style.setProperty(t,n):e.style[t]=n}var bx=vv(()=>window.ScrollTimeline!==void 0),xx={};function Sx(e,t){let n=vv(e);return()=>xx[t]??n()}var Cx=Sx(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),wx=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Tx={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:wx([0,.65,.55,1]),circOut:wx([.55,0,1,.45]),backIn:wx([.31,.01,.66,-.59]),backOut:wx([.33,1.53,.69,.99])};function Ex(e,t){if(e)return typeof e==`function`?Cx()?pb(e,t):`ease-out`:qv(e)?wx(e):Array.isArray(e)?e.map(e=>Ex(e,t)||Tx.easeOut):Tx[e]}function Dx(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Ex(s,i);Array.isArray(d)&&(u.easing=d),Qv.value&&sy.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return Qv.value&&p.finished.finally(()=>{sy.waapi--}),p}function Ox(e){return typeof e==`function`&&`applyToOptions`in e}function kx({type:e,...t}){return Ox(e)&&Cx()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Ax=class extends Vb{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,pv(typeof e.type!=`string`,`Mini animate() doesn't support "type" as a string.`,`mini-spring`);let c=kx(e);this.animation=Dx(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Rb(r,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(e):yx(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Tv(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Tv(e)}get time(){return Tv(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=wv(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&bx()?(this.animation.timeline=e,yv):t(this)}},jx={anticipate:zv,backInOut:Rv,circInOut:Hv};function Mx(e){return e in jx}function Nx(e){typeof e.ease==`string`&&Mx(e.ease)&&(e.ease=jx[e.ease])}var Px=10,Fx=class extends Ax{constructor(e){Nx(e),Bb(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Ub({...a,autoplay:!1}),s=Math.max(Px,oy.now()-this.startTime),c=uv(0,Px,s-Px);t.setWithVelocity(o.sample(Math.max(0,s-c)).value,o.sample(s).value,c),o.stop()}},Ix=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Jy.test(e)||e===`0`)&&!e.startsWith(`url(`));function Lx(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Rx(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Ix(i,t),s=Ix(a,t);return fv(o===s,`You are trying to animate ${t} from "${i}" to "${a}". "${o?a:i}" is not an animatable value.`,`value-not-animatable`),!o||!s?!1:Lx(e)||(n===`spring`||Ox(n))&&r}function zx(e){e.duration=0,e.type=`keyframes`}var Bx=new Set([`opacity`,`clipPath`,`filter`,`transform`]),Vx=vv(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Hx(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:s,transformTemplate:c}=t.owner.getProps();return Vx()&&n&&Bx.has(n)&&(n!==`transform`||!c)&&!s&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Ux=40,Wx=class extends Vb{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=oy.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||_x)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=oy.now(),Rx(e,i,a,o)||((mv.instantAnimations||!s)&&l?.(Rb(e,n,t)),e[0]=e[e.length-1],zx(n),n.repeat=0);let u={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>Ux?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=!c&&Hx(u)?new Fx({...u,element:u.motionValue.owner.current}):new Ub(u);d.finished.then(()=>this.notifyFinished()).catch(yv),this.pendingTimeline&&=(this.stopTimeline=d.attachTimeline(this.pendingTimeline),void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),gx()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},Gx=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Kx(e){let t=Gx.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}var qx=4;function Jx(e,t,n=1){pv(n<=qx,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,`max-css-var-depth`);let[r,i]=Kx(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return hv(e)?parseFloat(e):e}return dy(i)?Jx(i,t,n+1):i}function Yx(e,t){return e?.[t]??e?.default??e}var Xx=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...rx]),Zx={test:e=>e===`auto`,parse:e=>e},Qx=e=>t=>t.test(e),$x=[my,Y,Ay,ky,My,jy,Zx],eS=e=>$x.find(Qx(e));function tS(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||_v(e)}var nS=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function rS(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(vy)||[];if(!r)return e;let i=n.replace(r,``),a=nS.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var iS=/\b([a-z-]*)\(.*?\)/gu,aS={...Jy,getAnimatableNone:e=>{let t=e.match(iS);return t?t.map(rS).join(` `):e}},oS={...my,transform:Math.round},sS={borderWidth:Y,borderTopWidth:Y,borderRightWidth:Y,borderBottomWidth:Y,borderLeftWidth:Y,borderRadius:Y,radius:Y,borderTopLeftRadius:Y,borderTopRightRadius:Y,borderBottomRightRadius:Y,borderBottomLeftRadius:Y,width:Y,maxWidth:Y,height:Y,maxHeight:Y,top:Y,right:Y,bottom:Y,left:Y,inset:Y,insetBlock:Y,insetBlockStart:Y,insetBlockEnd:Y,insetInline:Y,insetInlineStart:Y,insetInlineEnd:Y,padding:Y,paddingTop:Y,paddingRight:Y,paddingBottom:Y,paddingLeft:Y,paddingBlock:Y,paddingBlockStart:Y,paddingBlockEnd:Y,paddingInline:Y,paddingInlineStart:Y,paddingInlineEnd:Y,margin:Y,marginTop:Y,marginRight:Y,marginBottom:Y,marginLeft:Y,marginBlock:Y,marginBlockStart:Y,marginBlockEnd:Y,marginInline:Y,marginInlineStart:Y,marginInlineEnd:Y,backgroundPositionX:Y,backgroundPositionY:Y,rotate:ky,rotateX:ky,rotateY:ky,rotateZ:ky,scale:gy,scaleX:gy,scaleY:gy,scaleZ:gy,skew:ky,skewX:ky,skewY:ky,distance:Y,translateX:Y,translateY:Y,translateZ:Y,x:Y,y:Y,z:Y,perspective:Y,transformPerspective:Y,opacity:hy,originX:Ny,originY:Ny,originZ:Y,zIndex:oS,fillOpacity:hy,strokeOpacity:hy,numOctaves:oS},cS={...sS,color:X,backgroundColor:X,outlineColor:X,fill:X,stroke:X,borderColor:X,borderTopColor:X,borderRightColor:X,borderBottomColor:X,borderLeftColor:X,filter:aS,WebkitFilter:aS},lS=e=>cS[e];function uS(e,t){let n=lS(e);return n!==aS&&(n=Jy),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var dS=new Set([`auto`,`none`,`0`]);function fS(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!dS.has(t)&&Uy(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=uS(n,i)}var pS=class extends _x{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),dy(r))){let i=Jx(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Xx.has(n)||e.length!==2)return;let[r,i]=e,a=eS(r),o=eS(i);if(py(r)!==py(i)&&lx[n]){this.needsMeasurement=!0;return}if(a!==o)if(ax(a)&&ax(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else lx[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||tS(e[t]))&&n.push(t);n.length&&fS(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=lx[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=lx[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function mS(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}var hS=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function gS(e){return gv(e)&&`offsetHeight`in e}var _S=30,vS=e=>!isNaN(parseFloat(e)),yS={current:void 0},bS=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=oy.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=oy.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=vS(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!==`production`&&Ov(!1,`value.onChange(callback) is deprecated. Switch to value.on("change", callback).`),this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new Cv);let n=this.events[e].add(t);return e===`change`?()=>{n(),q.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return yS.current&&yS.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=oy.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>_S)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,_S);return Ev(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function xS(e,t){return new bS(e,t)}var{schedule:SS,cancel:CS}=ty(queueMicrotask,!1),wS={x:!1,y:!1};function TS(){return wS.x||wS.y}function ES(e){return e===`x`||e===`y`?wS[e]?null:(wS[e]=!0,()=>{wS[e]=!1}):wS.x||wS.y?null:(wS.x=wS.y=!0,()=>{wS.x=wS.y=!1})}function DS(e,t){let n=mS(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function OS(e){return!(e.pointerType===`touch`||TS())}function kS(e,t,n={}){let[r,i,a]=DS(e,n),o=e=>{if(!OS(e))return;let{target:n}=e,r=t(n,e);if(typeof r!=`function`||!n)return;let a=e=>{OS(e)&&(r(e),n.removeEventListener(`pointerleave`,a))};n.addEventListener(`pointerleave`,a,i)};return r.forEach(e=>{e.addEventListener(`pointerenter`,o,i)}),a}var AS=(e,t)=>t?e===t?!0:AS(e,t.parentElement):!1,jS=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,MS=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function NS(e){return MS.has(e.tagName)||e.isContentEditable===!0}var PS=new WeakSet;function FS(e){return t=>{t.key===`Enter`&&e(t)}}function IS(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var LS=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=FS(()=>{if(PS.has(n))return;IS(n,`down`);let e=FS(()=>{IS(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>IS(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function RS(e){return jS(e)&&!TS()}function zS(e,t,n={}){let[r,i,a]=DS(e,n),o=e=>{let r=e.currentTarget;if(!RS(e))return;PS.add(r);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),PS.has(r)&&PS.delete(r),RS(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||AS(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),gS(e)&&(e.addEventListener(`focus`,e=>LS(e,i)),!NS(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function BS(e){return gv(e)&&`ownerSVGElement`in e}function VS(e){return BS(e)&&e.tagName===`svg`}var HS=e=>!!(e&&e.getVelocity),US=[...$x,X,Jy],WS=e=>US.find(Qx(e)),GS=(0,t.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function KS(e=!0){let n=(0,t.useContext)(sv);if(n===null)return[!0,null];let{isPresent:r,onExitComplete:i,register:a}=n,o=(0,t.useId)();(0,t.useEffect)(()=>{if(e)return a(o)},[e]);let s=(0,t.useCallback)(()=>e&&i&&i(o),[o,i,e]);return!r&&i?[!1,s]:[!0]}var qS=(0,t.createContext)({strict:!1}),JS={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},YS={};for(let e in JS)YS[e]={isEnabled:t=>JS[e].some(e=>!!t[e])};function XS(e){for(let t in e)YS[t]={...YS[t],...e[t]}}var ZS=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.ignoreStrict.viewport`.split(`.`));function QS(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||ZS.has(e)}function $S(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var eC=u((()=>{})),tC=f({default:()=>rC}),nC,rC,iC=u((()=>{eC(),nC=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,rC=$S(function(e){return nC.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),aC=e=>!QS(e);function oC(e){typeof e==`function`&&(aC=t=>t.startsWith(`on`)?!QS(t):e(t))}try{oC((iC(),h(tC)).default)}catch{}function sC(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||(aC(i)||n===!0&&QS(i)||!t&&!QS(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var cC=(0,t.createContext)({});function lC(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function uC(e){return typeof e==`string`||Array.isArray(e)}var dC=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],fC=[`initial`,...dC];function pC(e){return lC(e.animate)||fC.some(t=>uC(e[t]))}function mC(e){return!!(pC(e)||e.variants)}function hC(e,t){if(pC(e)){let{initial:t,animate:n}=e;return{initial:t===!1||uC(t)?t:void 0,animate:uC(n)?n:void 0}}return e.inherit===!1?{}:t}function gC(e){let{initial:n,animate:r}=hC(e,(0,t.useContext)(cC));return(0,t.useMemo)(()=>({initial:n,animate:r}),[_C(n),_C(r)])}function _C(e){return Array.isArray(e)?e.join(` `):e}function vC(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var yC={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(Y.test(e))e=parseFloat(e);else return e;return`${vC(e,t.target.x)}% ${vC(e,t.target.y)}%`}},bC={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Jy.parse(e);if(i.length>5)return r;let a=Jy.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Z(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},xC={borderRadius:{...yC,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:yC,borderTopRightRadius:yC,borderBottomLeftRadius:yC,borderBottomRightRadius:yC,boxShadow:bC};function SC(e,{layout:t,layoutId:n}){return ix.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!xC[e]||e===`opacity`)}var CC={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},wC=rx.length;function TC(e,t,n){let r=``,i=!0;for(let a=0;a<wC;a++){let o=rx[a],s=e[o];if(s===void 0)continue;let c=!0;if(c=typeof s==`number`?s===(o.startsWith(`scale`)?1:0):parseFloat(s)===0,!c||n){let e=hS(s,sS[o]);if(!c){i=!1;let t=CC[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function EC(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(ix.has(e)){o=!0;continue}else if(ly(e)){i[e]=n;continue}else{let t=hS(n,sS[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=TC(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var DC=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function OC(e,t,n){for(let r in t)!HS(t[r])&&!SC(r,n)&&(e[r]=t[r])}function kC({transformTemplate:e},n){return(0,t.useMemo)(()=>{let t=DC();return EC(t,n,e),Object.assign({},t.vars,t.style)},[n])}function AC(e,t){let n=e.style||{},r={};return OC(r,n,e),Object.assign(r,kC(e,t)),r}function jC(e,t){let n={},r=AC(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var MC={offset:`stroke-dashoffset`,array:`stroke-dasharray`},NC={offset:`strokeDashoffset`,array:`strokeDasharray`};function PC(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?MC:NC;e[a.offset]=Y.transform(-r);let o=Y.transform(t),s=Y.transform(n);e[a.array]=`${o} ${s}`}var FC=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function IC(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(EC(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of FC)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&PC(d,i,a,o,!1)}var LC=()=>({...DC(),attrs:{}}),RC=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function zC(e,n,r,i){let a=(0,t.useMemo)(()=>{let t=LC();return IC(t,n,RC(i),e.transformTemplate,e.style),{...t.attrs,style:{...t.style}}},[n]);if(e.style){let t={};OC(t,e.style,e),a.style={...t,...a.style}}return a}var BC=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function VC(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(BC.indexOf(e)>-1||/[A-Z]/u.test(e))}function HC(e,n,r,{latestValues:i},a,o=!1,s){let c=(s??VC(e)?zC:jC)(n,i,a,e),l=sC(n,typeof e==`string`,o),u=e===t.Fragment?{}:{...l,...c,ref:r},{children:d}=n,f=(0,t.useMemo)(()=>HS(d)?d.get():d,[d]);return(0,t.createElement)(e,{...u,children:f})}function UC(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function WC(e,t,n,r){if(typeof t==`function`){let[i,a]=UC(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=UC(r);t=t(n===void 0?e.custom:n,i,a)}return t}function GC(e){return HS(e)?e.get():e}function KC({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:qC(n,r,i,e),renderState:t()}}function qC(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=GC(a[e]);let{initial:o,animate:s}=e,c=pC(e),l=mC(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!lC(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=WC(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var JC=e=>(n,r)=>{let i=(0,t.useContext)(cC),a=(0,t.useContext)(sv),o=()=>KC(e,n,i,a);return r?o():iv(o)};function YC(e,t,n){let{style:r}=e,i={};for(let a in r)(HS(r[a])||t.style&&HS(t.style[a])||SC(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(i[a]=r[a]);return i}var XC=JC({scrapeMotionValuesFromProps:YC,createRenderState:DC});function ZC(e,t,n){let r=YC(e,t,n);for(let n in e)if(HS(e[n])||HS(t[n])){let t=rx.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var QC=JC({scrapeMotionValuesFromProps:ZC,createRenderState:LC}),$C=Symbol.for(`motionComponentSymbol`);function ew(e,n,r){let i=(0,t.useRef)(r);(0,t.useInsertionEffect)(()=>{i.current=r});let a=(0,t.useRef)(null);return(0,t.useCallback)(t=>{t&&e.onMount?.(t),n&&(t?n.mount(t):n.unmount());let r=i.current;if(typeof r==`function`)if(t){let e=r(t);typeof e==`function`&&(a.current=e)}else a.current?(a.current(),a.current=null):r(t);else r&&(r.current=t)},[n])}var tw=e=>e.replace(/([a-z])([A-Z])/gu,`$1-$2`).toLowerCase(),nw=`data-`+tw(`framerAppearId`),rw=(0,t.createContext)({});function iw(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function aw(e,n,r,i,a,o){let{visualElement:s}=(0,t.useContext)(cC),c=(0,t.useContext)(qS),l=(0,t.useContext)(sv),u=(0,t.useContext)(GS).reducedMotion,d=(0,t.useRef)(null);i||=c.renderer,!d.current&&i&&(d.current=i(e,{visualState:n,parent:s,props:r,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,isSVG:o}));let f=d.current,p=(0,t.useContext)(rw);f&&!f.projection&&a&&(f.type===`html`||f.type===`svg`)&&ow(d.current,r,a,p);let m=(0,t.useRef)(!1);(0,t.useInsertionEffect)(()=>{f&&m.current&&f.update(r,l)});let h=r[nw],g=(0,t.useRef)(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return ov(()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),g.current&&f.animationState&&f.animationState.animateChanges())}),(0,t.useEffect)(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),!1),f.enteringChildren=void 0)}),f}function ow(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:sw(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&iw(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function sw(e){if(e)return e.options.allowProjection===!1?sw(e.parent):e.projection}function cw(e,{forwardMotionProps:n=!1,type:i}={},a,o){a&&XS(a);let s=i?i===`svg`:VC(e),c=s?QC:XC;function l(i,l){let u,d={...(0,t.useContext)(GS),...i,layoutId:lw(i)},{isStatic:f}=d,p=gC(i),m=c(i,f);if(!f&&av){uw(d,a);let t=dw(d);u=t.MeasureLayout,p.visualElement=aw(e,m,d,o,t.ProjectionNode,s)}return(0,r.jsxs)(cC.Provider,{value:p,children:[u&&p.visualElement?(0,r.jsx)(u,{visualElement:p.visualElement,...d}):null,HC(e,i,ew(m,p.visualElement,l),m,f,n,s)]})}l.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let u=(0,t.forwardRef)(l);return u[$C]=e,u}function lw({layoutId:e}){let n=(0,t.useContext)(rv).id;return n&&e!==void 0?n+`-`+e:e}function uw(e,n){let r=(0,t.useContext)(qS).strict;if(process.env.NODE_ENV!==`production`&&n&&r){let t="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?fv(!1,t,`lazy-strict-mode`):pv(!1,t,`lazy-strict-mode`)}}function dw(e){let{drag:t,layout:n}=YS;if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function fw(e,t){if(typeof Proxy>`u`)return cw;let n=new Map,r=(n,r)=>cw(n,r,e,t);return new Proxy((e,t)=>(process.env.NODE_ENV!==`production`&&Ov(!1,`motion() is deprecated. Use motion.create() instead.`),r(e,t)),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,cw(a,void 0,e,t)),n.get(a))})}function pw({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function mw({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function hw(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function gw(e){return e===void 0||e===1}function _w({scale:e,scaleX:t,scaleY:n}){return!gw(e)||!gw(t)||!gw(n)}function vw(e){return _w(e)||yw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function yw(e){return bw(e.x)||bw(e.y)}function bw(e){return e&&e!==`0%`}function xw(e,t,n){return n+t*(e-n)}function Sw(e,t,n,r,i){return i!==void 0&&(e=xw(e,i,r)),xw(e,n,r)+t}function Cw(e,t=0,n=1,r,i){e.min=Sw(e.min,t,n,r,i),e.max=Sw(e.max,t,n,r,i)}function ww(e,{x:t,y:n}){Cw(e.x,t.translate,t.scale,t.originPoint),Cw(e.y,n.translate,n.scale,n.originPoint)}var Tw=.999999999999,Ew=1.0000000000001;function Dw(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Aw(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ww(e,o)),r&&vw(a.latestValues)&&Aw(e,a.latestValues))}t.x<Ew&&t.x>Tw&&(t.x=1),t.y<Ew&&t.y>Tw&&(t.y=1)}function Ow(e,t){e.min+=t,e.max+=t}function kw(e,t,n,r,i=.5){Cw(e,t,n,Z(e.min,e.max,i),r)}function Aw(e,t){kw(e.x,t.x,t.scaleX,t.scale,t.originX),kw(e.y,t.y,t.scaleY,t.scale,t.originY)}function jw(e,t){return pw(hw(e.getBoundingClientRect(),t))}function Mw(e,t,n){let r=jw(e,n),{scroll:i}=t;return i&&(Ow(r.x,i.offset.x),Ow(r.y,i.offset.y)),r}var Nw=()=>({translate:0,scale:1,origin:0,originPoint:0}),Pw=()=>({x:Nw(),y:Nw()}),Fw=()=>({min:0,max:0}),$=()=>({x:Fw(),y:Fw()}),Iw={current:null},Lw={current:!1};function Rw(){if(Lw.current=!0,av)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Iw.current=e.matches;e.addEventListener(`change`,t),t()}else Iw.current=!1}var zw=new WeakMap;function Bw(e,t,n){for(let r in t){let i=t[r],a=n[r];if(HS(i))e.addValue(r,i);else if(HS(a))e.addValue(r,xS(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,xS(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Vw=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Hw=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=_x,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=oy.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,q.render(this.render,!1,!0))};let{latestValues:s,renderState:c}=a;this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.blockInitialAnimation=!!i,this.isControllingVariants=pC(t),this.isVariantNode=mC(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:l,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in u){let t=u[e];s[e]!==void 0&&HS(t)&&t.set(s[e])}}mount(e){this.current=e,zw.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Lw.current||Rw(),this.shouldReduceMotion=Iw.current),process.env.NODE_ENV!==`production`&&Ov(this.shouldReduceMotion!==!0,`You have Reduced Motion enabled on your device. Animations may not appear as expected.`,`reduced-motion-disabled`),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),ny(this.notifyUpdate),ny(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n=ix.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&q.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in YS){let t=YS[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):$()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Vw.length;t++){let n=Vw[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Bw(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=xS(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(hv(n)||_v(n))?n=parseFloat(n):!WS(n)&&Jy.test(t)&&(n=uS(e,t)),this.setBaseTarget(e,HS(n)?n.get():n)),HS(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=WC(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!HS(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Cv),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){SS.render(this.render)}},Uw=class extends Hw{constructor(){super(...arguments),this.KeyframeResolver=pS}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;HS(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Ww(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Gw(e){return window.getComputedStyle(e)}var Kw=class extends Uw{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Ww}readValueFromInstance(e,t){if(ix.has(t))return this.projection?.isProjecting?$b(t):tx(e,t);{let n=Gw(e),r=(ly(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return jw(e,t)}build(e,t,n){EC(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return YC(e,t,n)}},qw=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]);function Jw(e,t,n,r){for(let n in Ww(e,t,void 0,r),t.attrs)e.setAttribute(qw.has(n)?n:tw(n),t.attrs[n])}var Yw=class extends Uw{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=$}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ix.has(t)){let e=lS(t);return e&&e.default||0}return t=qw.has(t)?t:tw(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return ZC(e,t,n)}build(e,t,n){IC(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Jw(e,t,n,r)}mount(e){this.isSVGTag=RC(e.tagName),super.mount(e)}},Xw=(e,n)=>n.isSVG??VC(e)?new Yw(n):new Kw(n,{allowProjection:e!==t.Fragment});function Zw(e,t,n){let r=e.getProps();return WC(r,t,n===void 0?r.custom:n,e)}var Qw=e=>Array.isArray(e);function $w(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,xS(n))}function eT(e){return Qw(e)?e[e.length-1]||0:e}function tT(e,t){let{transitionEnd:n={},transition:r={},...i}=Zw(e,t)||{};for(let t in i={...i,...n},i)$w(e,t,eT(i[t]))}function nT(e){return!!(HS(e)&&e.add)}function rT(e,t){let n=e.getValue(`willChange`);if(nT(n))return n.add(t);if(!n&&mv.WillChange){let n=new mv.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function iT(e){return e.props[nw]}var aT=e=>e!==null;function oT(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(aT),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}var sT={type:`spring`,stiffness:500,damping:25,restSpeed:10},cT=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),lT={type:`keyframes`,duration:.8},uT={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},dT=(e,{keyframes:t})=>t.length>2?lT:ix.has(e)?e.startsWith(`scale`)?cT(t[1]):sT:uT;function fT({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}var pT=(e,t,n,r={},i,a)=>o=>{let s=Yx(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=wv(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};fT(s)||Object.assign(u,dT(e,u)),u.duration&&=wv(u.duration),u.repeatDelay&&=wv(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(zx(u),u.delay===0&&(d=!0)),(mv.instantAnimations||mv.skipAnimations)&&(d=!0,zx(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=oT(u.keyframes,s);if(e!==void 0){q.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Ub(u):new Wx(u)};function mT({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function hT(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...s}=t;r&&(a=r);let c=[],l=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||l&&mT(l,t))continue;let o={delay:n,...Yx(a||{},t)},u=r.get();if(u!==void 0&&!r.isAnimating&&!Array.isArray(i)&&i===u&&!o.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){let n=iT(e);if(n){let e=window.MotionHandoffAnimation(n,t,q);e!==null&&(o.startTime=e,d=!0)}}rT(e,t),r.start(pT(t,r,i,e.shouldReduceMotion&&Xx.has(t)?{type:!1}:o,e,d));let f=r.animation;f&&c.push(f)}return o&&Promise.all(c).then(()=>{q.update(()=>{o&&tT(e,o)})}),c}function gT(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}function _T(e,t,n={}){let r=Zw(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(hT(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return vT(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function vT(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(_T(c,t,{...o,delay:n+(typeof r==`function`?0:r)+gT(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function yT(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>_T(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=_T(e,t,n);else{let i=typeof t==`function`?Zw(e,t,n.custom):t;r=Promise.all(hT(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}function bT(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var xT=fC.length;function ST(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&ST(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<xT;n++){let r=fC[n],i=e.props[r];(uC(i)||i===!1)&&(t[r]=i)}return t}var CT=[...dC].reverse(),wT=dC.length;function TT(e){return t=>Promise.all(t.map(({animation:t,options:n})=>yT(e,t,n)))}function ET(e){let t=TT(e),n=kT(),r=!0,i=t=>(n,r)=>{let i=Zw(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function a(n){t=n(e)}function o(a){let{props:o}=e,s=ST(e.parent)||{},c=[],l=new Set,u={},d=1/0;for(let t=0;t<wT;t++){let f=CT[t],p=n[f],m=o[f]===void 0?s[f]:o[f],h=uC(m),g=f===a?p.isActive:null;g===!1&&(d=t);let _=m===s[f]&&m!==o[f]&&h;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),p.protectedKeys={...u},!p.isActive&&g===null||!m&&!p.prevProp||lC(m)||typeof m==`boolean`)continue;let v=DT(p.prevProp,m),y=v||f===a&&p.isActive&&!_&&h||t>d&&h,b=!1,x=Array.isArray(m)?m:[m],S=x.reduce(i(f),{});g===!1&&(S={});let{prevResolvedValues:C={}}=p,w={...C,...S},T=t=>{y=!0,l.has(t)&&(b=!0,l.delete(t)),p.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in w){let t=S[e],n=C[e];if(u.hasOwnProperty(e))continue;let r=!1;r=Qw(t)&&Qw(n)?!bT(t,n):t!==n,r?t==null?l.add(e):T(e):t!==void 0&&l.has(e)?T(e):p.protectedKeys[e]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(y=!1);let E=_&&v;y&&(!E||b)&&c.push(...x.map(t=>{let n={type:f};if(typeof t==`string`&&r&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Zw(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=gT(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(l.size){let t={};if(typeof o.initial!=`boolean`){let n=Zw(e,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(t.transition=n.transition)}l.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),c.push({animation:t})}let f=!!c.length;return r&&(o.initial===!1||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(f=!1),r=!1,f?t(c):Promise.resolve()}function s(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=o(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=kT()}}}function DT(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!bT(t,e):!1}function OT(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function kT(){return{animate:OT(!0),whileInView:OT(),whileHover:OT(),whileTap:OT(),whileDrag:OT(),whileFocus:OT(),exit:OT()}}var AT=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},jT=class extends AT{constructor(e){super(e),e.animationState||=ET(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();lC(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},MT=0,NT={animation:{Feature:jT},exit:{Feature:class extends AT{constructor(){super(...arguments),this.id=MT++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function PT(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function FT(e){return{point:{x:e.pageX,y:e.pageY}}}var IT=e=>t=>jS(t)&&e(t,FT(t));function LT(e,t,n,r){return PT(e,t,IT(n),r)}var RT=1e-4,zT=1-RT,BT=1+RT,VT=.01,HT=0-VT,UT=0+VT;function WT(e){return e.max-e.min}function GT(e,t,n){return Math.abs(e-t)<=n}function KT(e,t,n,r=.5){e.origin=r,e.originPoint=Z(t.min,t.max,e.origin),e.scale=WT(n)/WT(t),e.translate=Z(n.min,n.max,e.origin)-e.originPoint,(e.scale>=zT&&e.scale<=BT||isNaN(e.scale))&&(e.scale=1),(e.translate>=HT&&e.translate<=UT||isNaN(e.translate))&&(e.translate=0)}function qT(e,t,n,r){KT(e.x,t.x,n.x,r?r.originX:void 0),KT(e.y,t.y,n.y,r?r.originY:void 0)}function JT(e,t,n){e.min=n.min+t.min,e.max=e.min+WT(t)}function YT(e,t,n){JT(e.x,t.x,n.x),JT(e.y,t.y,n.y)}function XT(e,t,n){e.min=t.min-n.min,e.max=e.min+WT(t)}function ZT(e,t,n){XT(e.x,t.x,n.x),XT(e.y,t.y,n.y)}function QT(e){return[e(`x`),e(`y`)]}var $T=({current:e})=>e?e.ownerDocument.defaultView:null,eE=(e,t)=>Math.abs(e-t);function tE(e,t){let n=eE(e.x,t.x),r=eE(e.y,t.y);return Math.sqrt(n**2+r**2)}var nE=new Set([`auto`,`scroll`]),rE=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=oE(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=tE(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=J;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=iE(t,this.transformPagePoint),q.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=oE(e.type===`pointercancel`?this.lastMoveEventInfo:iE(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!jS(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=iE(FT(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=J;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,oE(s,this.history)),this.removeListeners=xv(LT(this.contextWindow,`pointermove`,this.handlePointerMove),LT(this.contextWindow,`pointerup`,this.handlePointerUp),LT(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(nE.has(e.overflowX)||nE.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener(`scroll`,this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),q.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ny(this.updatePoint)}};function iE(e,t){return t?{point:t(e.point)}:e}function aE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oE({point:e},t){return{point:e,delta:aE(e,cE(t)),offset:aE(e,sE(t)),velocity:lE(t,.1)}}function sE(e){return e[0]}function cE(e){return e[e.length-1]}function lE(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=cE(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>wv(t)));)n--;if(!r)return{x:0,y:0};let a=Tv(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function uE(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Z(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Z(n,e,r.max):Math.min(e,n)),e}function dE(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function fE(e,{top:t,left:n,bottom:r,right:i}){return{x:dE(e.x,n,i),y:dE(e.y,t,r)}}function pE(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function mE(e,t){return{x:pE(e.x,t.x),y:pE(e.y,t.y)}}function hE(e,t){let n=.5,r=WT(e),i=WT(t);return i>r?n=Sv(t.min,t.max-r,e.min):r>i&&(n=Sv(e.min,e.max-i,t.min)),uv(0,1,n)}function gE(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var _E=.35;function vE(e=_E){return e===!1?e=0:e===!0&&(e=_E),{x:yE(e,`left`,`right`),y:yE(e,`top`,`bottom`)}}function yE(e,t,n){return{min:bE(e,t),max:bE(e,n)}}function bE(e,t){return typeof e==`number`?e:e[t]||0}var xE=new WeakMap,SE=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=$(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t?(this.stopAnimation(),this.snapToCursor(FT(e).point)):this.pauseAnimation()},a=(e,t)=>{this.stopAnimation();let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ES(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),QT(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Ay.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=WT(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&q.postRender(()=>i(e,t)),rT(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=wE(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&a(e,t)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>QT(e=>this.getAnimationState(e)===`paused`&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:l}=this.getProps();this.panSession=new rE(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:$T(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&q.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!CE(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=uE(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&iw(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=fE(n.layoutBox,e):this.constraints=!1,this.elastic=vE(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&QT(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=gE(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!iw(e))return!1;let n=e.current;pv(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.",`drag-constraints-ref`);let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=Mw(n,r.root,this.visualElement.getTransformPagePoint()),a=mE(r.layout.layoutBox,i);if(t){let e=t(mw(a));this.hasMutatedConstraints=!!e,e&&(a=pw(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=QT(o=>{if(!CE(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return rT(this.visualElement,e),n.start(pT(e,n,0,t,this.visualElement,!1))}stopAnimation(){QT(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){QT(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){QT(t=>{let{drag:n}=this.getProps();if(!CE(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Z(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!iw(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};QT(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=hE({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),QT(t=>{if(!CE(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Z(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;xE.set(this.visualElement,this);let e=this.visualElement.current,t=LT(e,`pointerdown`,e=>{let{drag:t,dragListener:n=!0}=this.getProps();t&&n&&!NS(e.target)&&this.start(e)}),n=()=>{let{dragConstraints:e}=this.getProps();iw(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener(`measure`,n);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),q.read(n);let a=PT(window,`resize`,()=>this.scalePositionWithinConstraints()),o=r.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(QT(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{a(),t(),i(),o&&o()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=_E,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function CE(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function wE(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var TE=class extends AT{constructor(e){super(e),this.removeGroupControls=yv,this.removeListeners=yv,this.controls=new SE(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||yv}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}},EE=e=>(t,n)=>{e&&q.postRender(()=>e(t,n))},DE=class extends AT{constructor(){super(...arguments),this.removePointerDownListener=yv}onPointerDown(e){this.session=new rE(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$T(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:EE(e),onStart:EE(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&q.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=LT(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},OE={hasAnimatedSinceResize:!0,hasEverUpdated:!1},kE=!1,AE=class extends t.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),kE&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),OE.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,kE=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||q.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),SS.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;kE=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function jE(e){let[n,i]=KS(),a=(0,t.useContext)(rv);return(0,r.jsx)(AE,{...e,layoutGroup:a,switchLayoutGroup:(0,t.useContext)(rw),isPresent:n,safeToRemove:i})}function ME(e,t,n){let r=HS(e)?e:xS(e);return r.start(pT(``,r,t,n)),r.animation}var NE=(e,t)=>e.depth-t.depth,PE=class{constructor(){this.children=[],this.isDirty=!1}add(e){cv(this.children,e),this.isDirty=!0}remove(e){lv(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(NE),this.isDirty=!1,this.children.forEach(e)}};function FE(e,t){let n=oy.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(ny(r),e(a-t))};return q.setup(r,!0),()=>ny(r)}var IE=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],LE=IE.length,RE=e=>typeof e==`string`?parseFloat(e):e,zE=e=>typeof e==`number`||Y.test(e);function BE(e,t,n,r,i,a){i?(e.opacity=Z(0,n.opacity??1,HE(r)),e.opacityExit=Z(t.opacity??1,0,UE(r))):a&&(e.opacity=Z(t.opacity??1,n.opacity??1,r));for(let i=0;i<LE;i++){let a=`border${IE[i]}Radius`,o=VE(t,a),s=VE(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||zE(o)===zE(s)?(e[a]=Math.max(Z(RE(o),RE(s),r),0),(Ay.test(s)||Ay.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Z(t.rotate||0,n.rotate||0,r))}function VE(e,t){return e[t]===void 0?e.borderRadius:e[t]}var HE=WE(0,.5,Vv),UE=WE(.5,.95,yv);function WE(e,t,n){return r=>r<e?0:r>t?1:n(Sv(e,t,r))}function GE(e,t){e.min=t.min,e.max=t.max}function KE(e,t){GE(e.x,t.x),GE(e.y,t.y)}function qE(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function JE(e,t,n,r,i){return e-=t,e=xw(e,1/n,r),i!==void 0&&(e=xw(e,1/i,r)),e}function YE(e,t=0,n=1,r=.5,i,a=e,o=e){if(Ay.test(t)&&(t=parseFloat(t),t=Z(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Z(a.min,a.max,r);e===a&&(s-=t),e.min=JE(e.min,t,n,s,i),e.max=JE(e.max,t,n,s,i)}function XE(e,t,[n,r,i],a,o){YE(e,t[n],t[r],t[i],t.scale,a,o)}var ZE=[`x`,`scaleX`,`originX`],QE=[`y`,`scaleY`,`originY`];function $E(e,t,n,r){XE(e.x,t,ZE,n?n.x:void 0,r?r.x:void 0),XE(e.y,t,QE,n?n.y:void 0,r?r.y:void 0)}function eD(e){return e.translate===0&&e.scale===1}function tD(e){return eD(e.x)&&eD(e.y)}function nD(e,t){return e.min===t.min&&e.max===t.max}function rD(e,t){return nD(e.x,t.x)&&nD(e.y,t.y)}function iD(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aD(e,t){return iD(e.x,t.x)&&iD(e.y,t.y)}function oD(e){return WT(e.x)/WT(e.y)}function sD(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var cD=class{constructor(){this.members=[]}add(e){cv(this.members,e),e.scheduleRender()}remove(e){if(lv(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t=this.members.findIndex(t=>e===t);if(t===0)return!1;let n;for(let e=t;e>=0;e--){let t=this.members[e];if(t.isPresent!==!1){n=t;break}}return n?(this.promote(n),!0):!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:r}=e.options;r===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function lD(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var uD={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},dD=[``,`X`,`Y`,`Z`],fD=1e3,pD=0;function mD(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function hD(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=iT(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,q,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&hD(r)}function gD({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=pD++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Qv.value&&(uD.nodes=uD.calculatedTargetDeltas=uD.calculatedProjections=0),this.nodes.forEach(yD),this.nodes.forEach(ED),this.nodes.forEach(DD),this.nodes.forEach(bD),Qv.addProjectionMetrics&&Qv.addProjectionMetrics(uD)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new PE)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Cv),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=BS(t)&&!VS(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;q.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=FE(i,250),OE.hasAnimatedSinceResize&&(OE.hasAnimatedSinceResize=!1,this.nodes.forEach(TD)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||PD,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!aD(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Yx(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||TD(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ny(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(OD),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&hD(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(SD);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(CD);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(wD),this.nodes.forEach(_D),this.nodes.forEach(vD)):this.nodes.forEach(CD),this.clearAllSnapshots();let e=oy.now();J.delta=uv(0,1e3/60,e-J.timestamp),J.timestamp=e,J.isProcessing=!0,ry.update.process(J),ry.preRender.process(J),ry.render.process(J),J.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,SS.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(xD),this.sharedNodes.forEach(kD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,q.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){q.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!WT(this.snapshot.measuredBox.x)&&!WT(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=$(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!tD(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||vw(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),RD(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return $();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(BD))){let{scroll:e}=this.root;e&&(Ow(t.x,e.offset.x),Ow(t.y,e.offset.y))}return t}removeElementScroll(e){let t=$();if(KE(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&KE(t,e),Ow(t.x,i.offset.x),Ow(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=$();KE(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Aw(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),vw(r.latestValues)&&Aw(n,r.latestValues)}return vw(this.latestValues)&&Aw(n,this.latestValues),n}removeTransform(e){let t=$();KE(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!vw(n.latestValues))continue;_w(n.latestValues)&&n.updateSnapshot();let r=$();KE(r,n.measurePageBox()),$E(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return vw(this.latestValues)&&$E(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==J.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=J.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=$(),this.targetWithTransforms=$()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),YT(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):KE(this.target,this.layout.layoutBox),ww(this.target,this.targetDelta)):KE(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Qv.value&&uD.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||_w(this.parent.latestValues)||yw(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$(),this.relativeTargetOrigin=$(),ZT(this.relativeTargetOrigin,t,n),KE(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===J.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;KE(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Dw(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=$());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(qE(this.prevProjectionDelta.x,this.projectionDelta.x),qE(this.prevProjectionDelta.y,this.projectionDelta.y)),qT(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!sD(this.projectionDelta.x,this.prevProjectionDelta.x)||!sD(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Qv.value&&uD.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Pw(),this.projectionDelta=Pw(),this.projectionDeltaWithTransform=Pw()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=Pw();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=$(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(ND));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;AD(a.x,e.x,n),AD(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ZT(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),MD(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&rD(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=$(),KE(d,this.relativeTarget)),s&&(this.animationValues=i,BE(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(ny(this.pendingAnimation),void 0),this.pendingAnimation=q.update(()=>{OE.hasAnimatedSinceResize=!0,sy.layout++,this.motionValue||=xS(0),this.currentAnimation=ME(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{sy.layout--},onComplete:()=>{sy.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(fD),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&zD(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||$();let t=WT(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=WT(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}KE(t,n),Aw(t,i),qT(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new cD),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&mD(`z`,e,r,this.animationValues);for(let t=0;t<dD.length;t++)mD(`rotate${dD[t]}`,e,r,this.animationValues),mD(`skew${dD[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=GC(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=GC(t?.pointerEvents)||``),this.hasProjected&&!vw(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=lD(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;for(let t in e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit,xC){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=xC[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?GC(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(SD),this.root.sharedNodes.clear()}}}function _D(e){e.updateLayout()}function vD(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?QT(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=WT(r);r.min=n[e].min,r.max=r.min+i}):zD(i,t.layoutBox,n)&&QT(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=WT(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Pw();qT(o,n,t.layoutBox);let s=Pw();a?qT(s,e.applyTransform(r,!0),t.measuredBox):qT(s,n,t.layoutBox);let c=!tD(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=$();ZT(o,t.layoutBox,i.layoutBox);let s=$();ZT(s,n,a.layoutBox),aD(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function yD(e){Qv.value&&uD.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function bD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function xD(e){e.clearSnapshot()}function SD(e){e.clearMeasurements()}function CD(e){e.isLayoutDirty=!1}function wD(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function TD(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ED(e){e.resolveTargetDelta()}function DD(e){e.calcProjection()}function OD(e){e.resetSkewAndRotation()}function kD(e){e.removeLeadSnapshot()}function AD(e,t,n){e.translate=Z(t.translate,0,n),e.scale=Z(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function jD(e,t,n,r){e.min=Z(t.min,n.min,r),e.max=Z(t.max,n.max,r)}function MD(e,t,n,r){jD(e.x,t.x,n.x,r),jD(e.y,t.y,n.y,r)}function ND(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var PD={duration:.45,ease:[.4,0,.1,1]},FD=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ID=FD(`applewebkit/`)&&!FD(`chrome/`)?Math.round:yv;function LD(e){e.min=ID(e.min),e.max=ID(e.max)}function RD(e){LD(e.x),LD(e.y)}function zD(e,t,n){return e===`position`||e===`preserve-aspect`&&!GT(oD(t),oD(n),.2)}function BD(e){return e!==e.root&&e.scroll?.wasRoot}var VD=gD({attachResizeListener:(e,t)=>PT(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),HD={current:void 0},UD=gD({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!HD.current){let e=new VD({});e.mount(window),e.setOptions({layoutScroll:!0}),HD.current=e}return HD.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),WD={pan:{Feature:DE},drag:{Feature:TE,ProjectionNode:UD,MeasureLayout:jE}};function GD(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&q.postRender(()=>i(t,FT(t)))}var KD=class extends AT{mount(){let{current:e}=this.node;e&&(this.unmount=kS(e,(e,t)=>(GD(this.node,t,`Start`),e=>GD(this.node,e,`End`))))}unmount(){}},qD=class extends AT{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=xv(PT(this.node.current,`focus`,()=>this.onFocus()),PT(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function JD(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&q.postRender(()=>i(t,FT(t)))}var YD=class extends AT{mount(){let{current:e}=this.node;e&&(this.unmount=zS(e,(e,t)=>(JD(this.node,t,`Start`),(e,{success:t})=>JD(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}},XD=new WeakMap,ZD=new WeakMap,QD=e=>{let t=XD.get(e.target);t&&t(e)},$D=e=>{e.forEach(QD)};function eO({root:e,...t}){let n=e||document;ZD.has(n)||ZD.set(n,{});let r=ZD.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver($D,{root:e,...t})),r[i]}function tO(e,t,n){let r=eO(t);return XD.set(e,n),r.observe(e),()=>{XD.delete(e),r.unobserve(e)}}var nO={some:0,all:1},rO=class extends AT{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:nO[r]};return tO(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(iO(e,t))&&this.startObserver()}unmount(){}};function iO({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var aO={inView:{Feature:rO},tap:{Feature:YD},focus:{Feature:qD},hover:{Feature:KD}},oO={layout:{ProjectionNode:UD,MeasureLayout:jE}},sO=fw({...NT,...aO,...WD,...oO},Xw),cO=({element:e,offsetY:t=0,dataContext:n})=>{let i=e.content;if(n){if(e.type===`text`)i=i.replace(/\{\{(.*?)\}\}/g,(e,t)=>{let r=n[t.trim()];return r==null?e:String(r)});else if(e.type===`image`)if(e.dataBinding){let t=n[e.dataBinding];t!=null&&(i=String(t))}else i=i.replace(/\{\{(.*?)\}\}/g,(e,t)=>{let r=n[t.trim()];return r==null?e:String(r)})}return(0,r.jsxs)(U,{style:{position:`absolute`,left:0,top:0,width:`${e.width}px`,height:`${e.height}px`,transform:`translate(${e.x}px, ${e.y+t}px) rotate(${e.rotation||0}deg)`,padding:e.type===`image`||e.type===`text`?0:`8px`,overflow:`hidden`,...e.style},children:[e.type===`text`&&(0,r.jsx)(H,{children:i}),e.type===`image`&&(i?(0,r.jsx)(`img`,{src:i,alt:`Element`,style:{width:`100%`,height:`100%`,objectFit:e.style?.objectFit||`cover`,display:`block`}}):(0,r.jsx)(U,{style:{width:`100%`,height:`100%`,backgroundColor:`#eee`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,r.jsx)(H,{size:`1`,children:`Imagem`})})),e.type===`box`&&(0,r.jsx)(U,{style:{width:`100%`,height:`100%`}})]})},lO=({children:e,index:t,height:n})=>(0,r.jsx)(sO.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},transition:{duration:.4,delay:t*.05,ease:`easeOut`},whileHover:{scale:1.02,transition:{duration:.2}},style:{position:`relative`,height:n,width:`100%`,marginBottom:`20px`,transformOrigin:`center center`},children:e});let uO=()=>{let{state:e}=M_(),n=t.default.useMemo(()=>e.canvasHeight?e.canvasHeight:e.elements.length===0?0:Math.max(...e.elements.map(e=>e.y+e.height)),[e.elements,e.canvasHeight]);return(0,r.jsx)(U,{style:{width:`100%`,height:`100%`,position:`relative`,overflow:`hidden`,backgroundColor:`var(--color-panel-solid)`},children:(0,r.jsx)(Rm,{type:`auto`,scrollbars:`vertical`,style:{height:`100%`,width:`100%`},children:(0,r.jsx)(U,{style:{position:`relative`,minHeight:`100%`,width:`100%`},children:(()=>{if(e.elements.length===0)return(0,r.jsx)(W,{align:`center`,justify:`center`,style:{height:`100%`},children:(0,r.jsx)(H,{color:`gray`,children:`Preview vazio`})});if(e.isList){let t=e.mockData.length>0?e.mockData:Array.from({length:10}).map((e,t)=>({id:t}));if(e.listSettings.sortProp){let n=e.listSettings.sortProp,r=e.listSettings.sortOrder===`asc`?1:-1;t=[...t].sort((e,t)=>{let i=e[n],a=t[n];return i<a?-1*r:i>a?1*r:0})}return e.listSettings.newestPosition===`top`&&(t=[...t].reverse()),(0,r.jsx)(W,{direction:`column`,justify:e.listSettings.newestPosition===`top`?`start`:`end`,p:`4`,style:{width:`100%`,minHeight:`100%`},children:t.map((t,i)=>(0,r.jsx)(lO,{index:i,height:n,children:e.elements.map(e=>(0,r.jsx)(cO,{element:e,offsetY:0,dataContext:t},`${e.id}-${i}`))},i))})}return e.elements.map(t=>(0,r.jsx)(cO,{element:t,dataContext:e.singleMockData},t.id))})()})})})},dO=()=>{let{state:e,updateListSettings:n,setCanvasHeight:i}=M_(),[a,o]=(0,t.useState)(``),[s,c]=(0,t.useState)(`asc`),[l,u]=(0,t.useState)(`bottom`),[d,f]=(0,t.useState)(`down`),[p,m]=(0,t.useState)(`150`),[h,g]=(0,t.useState)(``);return(0,t.useEffect)(()=>{o(e.listSettings.sortProp||`__none__`),c(e.listSettings.sortOrder||`asc`),u(e.listSettings.newestPosition||`bottom`),f(e.listSettings.scrollDirection||`down`),g(e.listSettings.containerHeight?String(e.listSettings.containerHeight):``),m(String(e.canvasHeight||150))},[e.listSettings,e.canvasHeight]),(0,t.useEffect)(()=>{let e=parseInt(p,10);!isNaN(e)&&e>0&&i(e)},[p,i]),(0,r.jsxs)(Wm,{children:[(0,r.jsx)(Gm,{children:(0,r.jsxs)(Tm,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`center`,cursor:`pointer`},children:[(0,r.jsx)(E_,{}),` Configurações`]})}),(0,r.jsxs)(Km,{style:{maxWidth:600},children:[(0,r.jsx)(qm,{children:`Configurações do Editor`}),(0,r.jsx)(Jm,{size:`2`,mb:`4`,children:`Configure o comportamento da lista.`}),(0,r.jsx)(U,{pt:`3`,children:(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,children:`Ordenação`}),(0,r.jsxs)(W,{gap:`3`,align:`center`,children:[(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Propriedade para Ordenar (ex: data, id)`}),(0,r.jsxs)(vh,{value:a,onValueChange:e=>o(e),children:[(0,r.jsx)(yh,{style:{width:`100%`},placeholder:`Selecione...`}),(0,r.jsxs)(bh,{children:[(0,r.jsx)(xh,{value:`__none__`,children:`(Nenhum)`}),e.availableProps.map(e=>(0,r.jsx)(xh,{value:e.dataName,children:e.name},e.dataName))]})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Direção`}),(0,r.jsxs)(vh,{value:s,onValueChange:e=>c(e),children:[(0,r.jsx)(yh,{}),(0,r.jsxs)(bh,{children:[(0,r.jsx)(xh,{value:`asc`,children:`Crescente (A-Z)`}),(0,r.jsx)(xh,{value:`desc`,children:`Decrescente (Z-A)`})]})]})]})]}),(0,r.jsxs)(W,{gap:`3`,align:`center`,children:[(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Posição do Recente`}),(0,r.jsxs)(vh,{value:l,onValueChange:e=>u(e),children:[(0,r.jsx)(yh,{style:{width:`100%`}}),(0,r.jsxs)(bh,{children:[(0,r.jsx)(xh,{value:`top`,children:`Topo (Início)`}),(0,r.jsx)(xh,{value:`bottom`,children:`Base (Final)`})]})]})]}),(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Comportamento de Rolagem`}),(0,r.jsxs)(vh,{value:d,onValueChange:e=>f(e),children:[(0,r.jsx)(yh,{style:{width:`100%`}}),(0,r.jsxs)(bh,{children:[(0,r.jsx)(xh,{value:`down`,children:`Descer (Padrão)`}),(0,r.jsx)(xh,{value:`up`,children:`Subir (Chat)`})]})]})]})]}),(0,r.jsx)(H,{size:`2`,weight:`bold`,mt:`2`,children:`Dimensões`}),(0,r.jsxs)(W,{gap:`3`,align:`center`,children:[(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Altura do Item (Template) (px)`}),(0,r.jsx)(jh,{type:`number`,min:`10`,value:p,onChange:e=>m(e.target.value)}),(0,r.jsx)(H,{size:`1`,color:`gray`,children:`Altura de cada item individual na lista.`})]}),(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Altura da Lista (Container) (px)`}),(0,r.jsx)(jh,{type:`number`,min:`0`,placeholder:`Auto (100%)`,value:h,onChange:e=>g(e.target.value)}),(0,r.jsx)(H,{size:`1`,color:`gray`,children:`Altura total da lista. Se exceder, rola. Vazio = 100%.`})]})]}),(0,r.jsx)(H,{size:`1`,color:`gray`,children:`Essa propriedade será usada para ordenar os itens no modo lista.`})]})}),(0,r.jsxs)(W,{gap:`3`,mt:`4`,justify:`end`,children:[(0,r.jsx)(Ym,{children:(0,r.jsx)(Tm,{variant:`soft`,color:`gray`,children:`Cancelar`})}),(0,r.jsx)(Ym,{children:(0,r.jsx)(Tm,{onClick:()=>{let e=parseInt(h,10);n({sortProp:a===`__none__`?``:a,sortOrder:s,newestPosition:l,scrollDirection:d,containerHeight:!isNaN(e)&&e>0?e:void 0})},children:`Salvar Alterações`})})]})]})]})};var fO=({layout:e,initialState:n,onSave:i,theme:a=`light`})=>{let[o,s]=(0,t.useState)(!0),[c,l]=(0,t.useState)(!0),{addElement:u,loadState:d,state:f}=M_();t.default.useEffect(()=>{if(n)try{let e=typeof n==`string`?JSON.parse(n):n;Array.isArray(e)?d({elements:e}):e.elements&&d(e)}catch(e){console.error(`Failed to load initial state`,e)}},[n,d]);let p=e=>{console.log(`Adding element of type: ${e}`),u({type:e,content:`New ${e}`})};return(0,r.jsx)(Np,{appearance:a,accentColor:`blue`,grayColor:`slate`,radius:`medium`,scaling:`100%`,children:(0,r.jsxs)(W,{direction:`row`,style:{height:`100vh`,width:`100%`,overflow:`hidden`,backgroundColor:`var(--color-background)`},children:[c&&(0,r.jsxs)(W,{direction:`column`,width:`280px`,style:{borderRight:`1px solid var(--gray-5)`,backgroundColor:`var(--gray-2)`,flexShrink:0,height:`100%`},children:[(0,r.jsx)(U,{p:`4`,style:{borderBottom:`1px solid var(--gray-5)`,backgroundColor:`var(--gray-2)`},children:(0,r.jsx)(W,{direction:`column`,gap:`3`,children:(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,mb:`2`,as:`div`,children:`Editor`}),(0,r.jsxs)(Zm,{children:[(0,r.jsx)(Qm,{children:(0,r.jsx)(Tm,{variant:`solid`,color:`green`,size:`3`,style:{width:`100%`,cursor:`pointer`,justifyContent:`center`,marginBottom:`8px`},children:`Adicionar Novo +`})}),(0,r.jsxs)(eh,{style:{width:`240px`},children:[(0,r.jsx)(nh,{onSelect:()=>p(`text`),children:`Texto`}),(0,r.jsx)(nh,{onSelect:()=>p(`image`),children:`Imagem`}),(0,r.jsx)(nh,{onSelect:()=>p(`box`),children:`Caixa (Container)`})]})]}),(0,r.jsxs)(Tm,{variant:`soft`,color:`blue`,style:{width:`100%`,justifyContent:`center`,cursor:`pointer`},onClick:()=>{if(i){let e={elements:f.elements,isList:f.isList,mockData:f.mockData,singleMockData:f.singleMockData,listSettings:f.listSettings,canvasHeight:f.canvasHeight};i(JSON.stringify(e,null,2))}},children:[(0,r.jsx)(O_,{}),` Salvar Alterações`]}),(0,r.jsx)(U,{mt:`2`,children:(0,r.jsx)(dO,{})})]})})}),(0,r.jsx)(Rm,{type:`auto`,scrollbars:`vertical`,style:{flex:1},children:(0,r.jsx)(W,{direction:`column`,gap:`4`,p:`4`,children:(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,mb:`2`,as:`div`,children:`Variáveis Disponíveis`}),(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`2`,as:`div`,children:`Clique para copiar ou arraste (futuramente)`}),(0,r.jsxs)(W,{direction:`column`,gap:`2`,children:[e.props.map((e,t)=>(0,r.jsxs)(Hp,{color:`blue`,variant:`soft`,size:`2`,style:{padding:`8px`,justifyContent:`flex-start`},title:e.dataName,children:[e.name,(0,r.jsx)(H,{color:`gray`,style:{marginLeft:`auto`,fontSize:`10px`},children:`{{${e.dataName}}}`})]},t)),e.props.length===0&&(0,r.jsx)(H,{size:`1`,color:`gray`,style:{fontStyle:`italic`},children:`Nenhuma variável configurada.`})]})]})})})]}),(0,r.jsxs)(U,{style:{flex:1,position:`relative`,height:`100%`},children:[(0,r.jsx)(U,{style:{position:`absolute`,top:10,left:10,zIndex:10},children:(0,r.jsx)(fh,{size:`2`,variant:`soft`,color:`gray`,onClick:()=>l(!c),title:c?`Ocultar Barra Lateral`:`Mostrar Barra Lateral`,children:c?(0,r.jsx)(v_,{}):(0,r.jsx)(b_,{})})}),(0,r.jsx)(W,{style:{position:`absolute`,top:10,right:10,zIndex:10},gap:`2`,children:(0,r.jsx)(fh,{size:`2`,variant:`soft`,color:o?`blue`:`gray`,onClick:()=>s(!o),title:o?`Ocultar Preview`:`Mostrar Preview`,children:o?(0,r.jsx)(w_,{}):(0,r.jsx)(S_,{})})}),(0,r.jsxs)(i_,{orientation:`horizontal`,style:{height:`100%`,width:`100%`},children:[(0,r.jsx)(c_,{defaultSize:50,minSize:20,children:(0,r.jsx)(U,{style:{height:`100%`,width:`100%`,backgroundColor:`var(--color-background)`},children:(0,r.jsx)(nv,{})})}),o&&(0,r.jsx)(d_,{style:{width:`4px`,backgroundColor:`var(--gray-6)`,cursor:`col-resize`,transition:`background-color 0.2s`}}),o&&(0,r.jsx)(c_,{defaultSize:50,minSize:20,children:(0,r.jsx)(U,{style:{height:`100%`,width:`100%`,backgroundColor:`var(--gray-3)`,borderLeft:`1px solid var(--gray-5)`},children:(0,r.jsx)(uO,{})})})]})]})]})})};let pO=e=>(0,r.jsx)(j_,{isList:e.layout.isList,availableProps:e.layout.props,theme:e.theme,children:(0,r.jsx)(fO,{...e})}),mO=(e,t,n={})=>Function(`elements`,`data`,`options`,hO()+`
49
49
  return renderTemplate(elements, data, options);`)(e,t,n),hO=()=>`
50
50
  /**
51
51
  * Render Template
@@ -175,6 +175,7 @@ function renderTemplate(elements, data, options = {}) {
175
175
 
176
176
  // Animation Styles based on settings
177
177
  const scrollDirection = (listSettings && listSettings.scrollDirection) || 'down';
178
+ const containerHeight = (listSettings && listSettings.containerHeight) ? listSettings.containerHeight + 'px' : '100%';
178
179
 
179
180
  const justify = (listSettings && listSettings.newestPosition === 'top') ? 'flex-start' : 'flex-end';
180
181
 
@@ -187,7 +188,7 @@ function renderTemplate(elements, data, options = {}) {
187
188
  display: flex;
188
189
  flex-direction: column;
189
190
  justify-content: \${justify};
190
- height: 100%;
191
+ height: \${containerHeight};
191
192
  width: 100%;
192
193
  overflow-y: auto;
193
194
  overflow-x: hidden;