@seeqdev/qomponents 0.0.230 → 0.0.231

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.
Files changed (37) hide show
  1. package/dist/index.esm.js +1 -1
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/src/Accordion/Accordion.d.ts +2 -2
  6. package/dist/src/Alert/Alert.d.ts +2 -2
  7. package/dist/src/Badge/Badge.d.ts +2 -2
  8. package/dist/src/Button/Button.d.ts +2 -2
  9. package/dist/src/ButtonGroup/ButtonGroup.d.ts +2 -2
  10. package/dist/src/ButtonWithDropdown/ButtonWithDropdown.d.ts +3 -3
  11. package/dist/src/ButtonWithPopover/ButtonWithPopover.d.ts +2 -2
  12. package/dist/src/Carousel/Carousel.d.ts +2 -2
  13. package/dist/src/Checkbox/Checkbox.d.ts +2 -2
  14. package/dist/src/Collapse/Collapse.d.ts +2 -2
  15. package/dist/src/ColorPickerControl/ColorPickerControl.d.ts +2 -2
  16. package/dist/src/ColorSwatch/ColorSwatch.d.ts +2 -2
  17. package/dist/src/EditorPanel/EditorPanel.d.ts +2 -2
  18. package/dist/src/ExternalLink/ExternalLink.d.ts +2 -2
  19. package/dist/src/Icon/Icon.d.ts +2 -2
  20. package/dist/src/InputGroup/InputGroup.d.ts +2 -2
  21. package/dist/src/LoadingIndicator/LoadingIndicator.d.ts +2 -2
  22. package/dist/src/Modal/Modal.d.ts +2 -2
  23. package/dist/src/ProgressBar/ProgressBar.d.ts +2 -2
  24. package/dist/src/SeeqActionDropdown/SeeqActionDropdown.d.ts +2 -2
  25. package/dist/src/SeeqActionDropdown/variants.d.ts +4 -4
  26. package/dist/src/SegmentedControl/SegmentedControl.d.ts +2 -2
  27. package/dist/src/Select/Select.d.ts +2 -2
  28. package/dist/src/Slider/Slider.d.ts +2 -2
  29. package/dist/src/SvgIcon/SvgIcon.d.ts +2 -2
  30. package/dist/src/Tabs/Tabs.d.ts +2 -2
  31. package/dist/src/TextArea/TextArea.d.ts +2 -2
  32. package/dist/src/TextField/TextField.d.ts +10 -10
  33. package/dist/src/ToolbarButton/ToolbarButton.d.ts +2 -2
  34. package/dist/src/Tooltip/Qtip.d.ts +2 -2
  35. package/dist/src/Tooltip/Tooltip.d.ts +2 -2
  36. package/dist/src/TriggerWithDropdown/TriggerWithDropdown.d.ts +2 -2
  37. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -55,7 +55,7 @@ http://jedwatson.github.io/classnames
55
55
  ${f}px !important;
56
56
  top: ${l}px !important;
57
57
  }
58
- `),()=>{m.contains(p)&&m.removeChild(p)}},[t]),(0,p.jsx)(bh,{isPresent:t,childRef:a,sizeRef:o,children:f.cloneElement(e,{ref:c})})}const Sh=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,root:c})=>{let l=Tu(Ch),u=(0,f.useId)(),d=!0,m=(0,f.useMemo)(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:e=>{l.set(e,!0);for(let e of l.values())if(!e)return;r&&r()},register:e=>(l.set(e,!1),()=>l.delete(e))}),[n,l,r]);return a&&d&&(m={...m}),(0,f.useMemo)(()=>{l.forEach((e,t)=>l.set(t,!1))},[n]),f.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o===`popLayout`&&(e=(0,p.jsx)(xh,{isPresent:n,anchorX:s,root:c,children:e})),(0,p.jsx)(Ou.Provider,{value:m,children:e})};function Ch(){return new Map}function wh(e=!0){let t=(0,f.useContext)(Ou);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,f.useId)();(0,f.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,f.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const Th=e=>e.key||``;function Eh(e){let t=[];return f.Children.forEach(e,e=>{(0,f.isValidElement)(e)&&t.push(e)}),t}const Dh=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,root:c})=>{let[l,u]=wh(o),d=(0,f.useMemo)(()=>Eh(e),[e]),m=o&&!l?[]:d.map(Th),h=(0,f.useRef)(!0),g=(0,f.useRef)(d),_=Tu(()=>new Map),[v,y]=(0,f.useState)(d),[b,x]=(0,f.useState)(d);Du(()=>{h.current=!1,g.current=d;for(let e=0;e<b.length;e++){let t=Th(b[e]);m.includes(t)?_.delete(t):_.get(t)!==!0&&_.set(t,!1)}},[b,m.length,m.join(`-`)]);let S=[];if(d!==v){let e=[...d];for(let t=0;t<b.length;t++){let n=b[t],r=Th(n);m.includes(r)||(e.splice(t,0,n),S.push(n))}return a===`wait`&&S.length&&(e=S),x(Eh(e)),y(d),null}process.env.NODE_ENV!==`production`&&a===`wait`&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);let{forceRender:C}=(0,f.useContext)(wu);return(0,p.jsx)(p.Fragment,{children:b.map(e=>{let f=Th(e),v=o&&!l?!1:d===b||m.includes(f),y=()=>{if(_.has(f))_.set(f,!0);else return;let e=!0;_.forEach(t=>{t||(e=!1)}),e&&(C?.(),x(g.current),o&&u?.(),r&&r())};return(0,p.jsx)(Sh,{isPresent:v,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:c,onExitComplete:v?void 0:y,anchorX:s,children:e},f)})})},Oh=(0,f.createContext)({strict:!1}),kh={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`]},Ah={};for(let e in kh)Ah[e]={isEnabled:t=>kh[e].some(e=>!!t[e])};function jh(e){for(let t in e)Ah[t]={...Ah[t],...e[t]}}const Mh=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 Nh(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Mh.has(e)}function Ph(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Fh=o((()=>{})),Ih={};c(Ih,{default:()=>Rh});var Lh,Rh,zh=o((()=>{Fh(),Lh=/^((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)-.*))$/,Rh=Ph(function(e){return Lh.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})}));let Bh=e=>!Nh(e);function Vh(e){typeof e==`function`&&(Bh=t=>t.startsWith(`on`)?!Nh(t):e(t))}try{Vh((zh(),d(Ih)).default)}catch{}function Hh(e,t,n){let r={};for(let i in e){if(i===`values`&&typeof e.values==`object`)continue;(Bh(i)||n===!0&&Nh(i)||!t&&!Nh(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i])}return r}const Uh=(0,f.createContext)({});function Wh(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Gh(e){return typeof e==`string`||Array.isArray(e)}const Kh=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],qh=[`initial`,...Kh];function Jh(e){return Wh(e.animate)||qh.some(t=>Gh(e[t]))}function Yh(e){return!!(Jh(e)||e.variants)}function Xh(e,t){if(Jh(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Gh(t)?t:void 0,animate:Gh(n)?n:void 0}}return e.inherit===!1?{}:t}function Zh(e){let{initial:t,animate:n}=Xh(e,(0,f.useContext)(Uh));return(0,f.useMemo)(()=>({initial:t,animate:n}),[Qh(t),Qh(n)])}function Qh(e){return Array.isArray(e)?e.join(` `):e}function $h(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const eg={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(W.test(e))e=parseFloat(e);else return e;let n=$h(e,t.target.x),r=$h(e,t.target.y);return`${n}% ${r}%`}},tg={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=vf.parse(e);if(i.length>5)return r;let a=vf.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=G(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},ng={borderRadius:{...eg,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:eg,borderTopRightRadius:eg,borderBottomLeftRadius:eg,borderBottomRightRadius:eg,boxShadow:tg};function rg(e,{layout:t,layoutId:n}){return Op.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!ng[e]||e===`opacity`)}const ig={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},ag=Dp.length;function og(e,t,n){let r=``,i=!0;for(let a=0;a<ag;a++){let o=Dp[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=Bm(s,Mm[o]);if(!c){i=!1;let t=ig[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function sg(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(Op.has(e)){o=!0;continue}else if(jd(e)){i[e]=n;continue}else{let t=Bm(n,Mm[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=og(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}const cg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function lg(e,t,n){for(let r in t)!ph(t[r])&&!rg(r,n)&&(e[r]=t[r])}function ug({transformTemplate:e},t){return(0,f.useMemo)(()=>{let n=cg();return sg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function dg(e,t){let n=e.style||{},r={};return lg(r,n,e),Object.assign(r,ug(e,t)),r}function fg(e,t){let n={},r=dg(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}const pg={offset:`stroke-dashoffset`,array:`stroke-dasharray`},mg={offset:`strokeDashoffset`,array:`strokeDasharray`};function hg(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?pg:mg;e[a.offset]=W.transform(-r);let o=W.transform(t),s=W.transform(n);e[a.array]=`${o} ${s}`}function gg(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(sg(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),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&hg(d,i,a,o,!1)}const _g=()=>({...cg(),attrs:{}}),vg=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function yg(e,t,n,r){let i=(0,f.useMemo)(()=>{let n=_g();return gg(n,t,vg(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};lg(t,e.style,e),i.style={...t,...i.style}}return i}const bg=[`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 xg(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(bg.indexOf(e)>-1||/[A-Z]/u.test(e))}function Sg(e,t,n,{latestValues:r},i,a=!1){let o=xg(e)?yg:fg,s=o(t,r,i,e),c=Hh(t,typeof e==`string`,a),l=e===f.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,f.useMemo)(()=>ph(u)?u.get():u,[u]);return(0,f.createElement)(e,{...l,children:d})}function Cg(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function wg(e,t,n,r){if(typeof t==`function`){let[i,a]=Cg(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]=Cg(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Tg(e){return ph(e)?e.get():e}function Eg({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){let a={latestValues:Dg(n,r,i,e),renderState:t()};return a}function Dg(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Tg(a[e]);let{initial:o,animate:s}=e,c=Jh(e),l=Yh(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`&&!Wh(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=wg(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}const Og=e=>(t,n)=>{let r=(0,f.useContext)(Uh),i=(0,f.useContext)(Ou),a=()=>Eg(e,t,r,i);return n?a():Tu(a)};function kg(e,t,n){let{style:r}=e,i={};for(let a in r)(ph(r[a])||t.style&&ph(t.style[a])||rg(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(i[a]=r[a]);return i}const Ag=Og({scrapeMotionValuesFromProps:kg,createRenderState:cg});function jg(e,t,n){let r=kg(e,t,n);for(let n in e)if(ph(e[n])||ph(t[n])){let t=Dp.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}const Mg=Og({scrapeMotionValuesFromProps:jg,createRenderState:_g}),Ng=Symbol.for(`motionComponentSymbol`);function Pg(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Fg(e,t,n){return(0,f.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n==`function`?n(r):Pg(n)&&(n.current=r))},[t])}const Ig=e=>e.replace(/([a-z])([A-Z])/gu,`$1-$2`).toLowerCase(),Lg=`framerAppearId`,Rg=`data-`+Ig(`framerAppearId`),zg=(0,f.createContext)({});function Bg(e,t,n,r,i){let{visualElement:a}=(0,f.useContext)(Uh),o=(0,f.useContext)(Oh),s=(0,f.useContext)(Ou),c=(0,f.useContext)(gh).reducedMotion,l=(0,f.useRef)(null);r||=o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:a,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:c}));let u=l.current,d=(0,f.useContext)(zg);u&&!u.projection&&i&&(u.type===`html`||u.type===`svg`)&&Vg(l.current,n,i,d);let p=(0,f.useRef)(!1);(0,f.useInsertionEffect)(()=>{u&&p.current&&u.update(n,s)});let m=n[Rg],h=(0,f.useRef)(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return Du(()=>{u&&(p.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),h.current&&u.animationState&&u.animationState.animateChanges())}),(0,f.useEffect)(()=>{u&&(!h.current&&u.animationState&&u.animationState.animateChanges(),h.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),!1),u.enteringChildren=void 0)}),u}function Vg(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:Hg(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Pg(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function Hg(e){if(e)return e.options.allowProjection===!1?Hg(e.parent):e.projection}function Ug(e,{forwardMotionProps:t=!1}={},n,r){n&&jh(n);let i=xg(e)?Mg:Ag;function a(a,o){let s,c={...(0,f.useContext)(gh),...a,layoutId:Wg(a)},{isStatic:l}=c,u=Zh(a),d=i(a,l);if(!l&&Eu){Gg(c,n);let t=Kg(c);s=t.MeasureLayout,u.visualElement=Bg(e,d,c,r,t.ProjectionNode)}return(0,p.jsxs)(Uh.Provider,{value:u,children:[s&&u.visualElement?(0,p.jsx)(s,{visualElement:u.visualElement,...c}):null,Sg(e,a,Fg(d,u.visualElement,o),d,l,t)]})}a.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let o=(0,f.forwardRef)(a);return o[Ng]=e,o}function Wg({layoutId:e}){let t=(0,f.useContext)(wu).id;return t&&e!==void 0?t+`-`+e:e}function Gg(e,t){let n=(0,f.useContext)(Oh).strict;if(process.env.NODE_ENV!==`production`&&t&&n){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?Nu(!1,t,`lazy-strict-mode`):Pu(!1,t,`lazy-strict-mode`)}}function Kg(e){let{drag:t,layout:n}=Ah;if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function qg(e,t){if(typeof Proxy>`u`)return Ug;let n=new Map,r=(n,r)=>Ug(n,r,e,t),i=(e,t)=>(process.env.NODE_ENV!==`production`&&Yu(!1,`motion() is deprecated. Use motion.create() instead.`),r(e,t));return new Proxy(i,{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Ug(a,void 0,e,t)),n.get(a))})}function Jg({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Yg({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Xg(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 Zg(e){return e===void 0||e===1}function Qg({scale:e,scaleX:t,scaleY:n}){return!Zg(e)||!Zg(t)||!Zg(n)}function $g(e){return Qg(e)||e_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function e_(e){return t_(e.x)||t_(e.y)}function t_(e){return e&&e!==`0%`}function n_(e,t,n){let r=e-n,i=t*r;return n+i}function r_(e,t,n,r,i){return i!==void 0&&(e=n_(e,i,r)),n_(e,n,r)+t}function i_(e,t=0,n=1,r,i){e.min=r_(e.min,t,n,r,i),e.max=r_(e.max,t,n,r,i)}function a_(e,{x:t,y:n}){i_(e.x,t.translate,t.scale,t.originPoint),i_(e.y,n.translate,n.scale,n.originPoint)}const o_=.999999999999,s_=1.0000000000001;function c_(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&&d_(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,a_(e,o)),r&&$g(a.latestValues)&&d_(e,a.latestValues))}t.x<s_&&t.x>o_&&(t.x=1),t.y<s_&&t.y>o_&&(t.y=1)}function l_(e,t){e.min+=t,e.max+=t}function u_(e,t,n,r,i=.5){let a=G(e.min,e.max,i);i_(e,t,n,a,r)}function d_(e,t){u_(e.x,t.x,t.scaleX,t.scale,t.originX),u_(e.y,t.y,t.scaleY,t.scale,t.originY)}function f_(e,t){return Jg(Xg(e.getBoundingClientRect(),t))}function p_(e,t,n){let r=f_(e,n),{scroll:i}=t;return i&&(l_(r.x,i.offset.x),l_(r.y,i.offset.y)),r}const m_=()=>({translate:0,scale:1,origin:0,originPoint:0}),h_=()=>({x:m_(),y:m_()}),g_=()=>({min:0,max:0}),__=()=>({x:g_(),y:g_()}),v_={current:null},y_={current:!1};function b_(){if(y_.current=!0,Eu)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>v_.current=e.matches;e.addEventListener(`change`,t),t()}else v_.current=!1}const x_=new WeakMap;function S_(e,t,n){for(let r in t){let i=t[r],a=n[r];if(ph(i))e.addValue(r,i);else if(ph(a))e.addValue(r,Km(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,Km(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const C_=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];var w_=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=Vp,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=Od.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,U.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=Jh(t),this.isVariantNode=Yh(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&&ph(t)&&t.set(s[e])}}mount(e){this.current=e,x_.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)),y_.current||b_(),this.shouldReduceMotion=this.reducedMotionConfig===`never`?!1:this.reducedMotionConfig===`always`?!0:v_.current,process.env.NODE_ENV!==`production`&&Yu(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(),Cd(this.notifyUpdate),Cd(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=Op.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&U.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 Ah){let t=Ah[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<C_.length;t++){let n=C_[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=`on`+n,i=e[r];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=S_(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=Km(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`&&(Iu(n)||Ru(n))?n=parseFloat(n):!hh(n)&&vf.test(t)&&(n=Fm(e,t)),this.setBaseTarget(e,ph(n)?n.get():n)),ph(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=wg(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&&!ph(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 Wu),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){qm.render(this.render)}},T_=class extends w_{constructor(){super(...arguments),this.KeyframeResolver=Rm}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;ph(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function E_(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 D_(e){return window.getComputedStyle(e)}var O_=class extends T_{constructor(){super(...arguments),this.type=`html`,this.renderInstance=E_}readValueFromInstance(e,t){if(Op.has(t))return this.projection?.isProjecting?Cp(t):Tp(e,t);{let n=D_(e),r=(jd(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return f_(e,t)}build(e,t,n){sg(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return kg(e,t,n)}};const k_=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 A_(e,t,n,r){for(let n in E_(e,t,void 0,r),t.attrs)e.setAttribute(k_.has(n)?n:Ig(n),t.attrs[n])}var j_=class extends T_{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=__}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Op.has(t)){let e=Pm(t);return e&&e.default||0}return t=k_.has(t)?t:Ig(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return jg(e,t,n)}build(e,t,n){gg(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){A_(e,t,n,r)}mount(e){this.isSVGTag=vg(e.tagName),super.mount(e)}};const M_=(e,t)=>xg(e)?new j_(t):new O_(t,{allowProjection:e!==f.Fragment});function N_(e,t,n){let r=e.getProps();return wg(r,t,n===void 0?r.custom:n,e)}const P_=e=>Array.isArray(e);function F_(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Km(n))}function I_(e){return P_(e)?e[e.length-1]||0:e}function L_(e,t){let n=N_(e,t),{transitionEnd:r={},transition:i={},...a}=n||{};for(let t in a={...a,...r},a){let n=I_(a[t]);F_(e,t,n)}}function R_(e){return!!(ph(e)&&e.add)}function z_(e,t){let n=e.getValue(`willChange`);if(R_(n))return n.add(t);if(!n&&Fu.WillChange){let n=new Fu.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function B_(e){return e.props[Rg]}const V_=e=>e!==null;function H_(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(V_),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}const U_={type:`spring`,stiffness:500,damping:25,restSpeed:10},W_=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),G_={type:`keyframes`,duration:.8},K_={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},q_=(e,{keyframes:t})=>t.length>2?G_:Op.has(e)?e.startsWith(`scale`)?W_(t[1]):U_:K_;function J_({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}const Y_=(e,t,n,r={},i,a)=>o=>{let s=ym(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Gu(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};J_(s)||Object.assign(u,q_(e,u)),u.duration&&=Gu(u.duration),u.repeatDelay&&=Gu(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(lm(u),u.delay===0&&(d=!0)),(Fu.instantAnimations||Fu.skipAnimations)&&(d=!0,lm(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=H_(u.keyframes,s);if(e!==void 0){U.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new pp(u):new mm(u)};function X_({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Z_(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&&X_(l,t))continue;let o={delay:n,...ym(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=B_(e);if(n){let e=window.MotionHandoffAnimation(n,t,U);e!==null&&(o.startTime=e,d=!0)}}z_(e,t),r.start(Y_(t,r,i,e.shouldReduceMotion&&bm.has(t)?{type:!1}:o,e,d));let f=r.animation;f&&c.push(f)}return o&&Promise.all(c).then(()=>{U.update(()=>{o&&L_(e,o)})}),c}function Q_(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,c=typeof n==`function`;return c?n(a,o):i===1?a*r:s-a*r}function $_(e,t,n={}){let r=N_(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(Z_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return ev(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 ev(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($_(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Q_(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function tv(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>$_(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=$_(e,t,n);else{let i=typeof t==`function`?N_(e,t,n.custom):t;r=Promise.all(Z_(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}function nv(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}const rv=qh.length;function iv(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&iv(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<rv;n++){let r=qh[n],i=e.props[r];(Gh(i)||i===!1)&&(t[r]=i)}return t}const av=[...Kh].reverse(),ov=Kh.length;function sv(e){return t=>Promise.all(t.map(({animation:t,options:n})=>tv(e,t,n)))}function cv(e){let t=sv(e),n=dv(),r=!0,i=t=>(n,r)=>{let i=N_(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=iv(e.parent)||{},c=[],l=new Set,u={},d=1/0;for(let t=0;t<ov;t++){let f=av[t],p=n[f],m=o[f]===void 0?s[f]:o[f],h=Gh(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||Wh(m)||typeof m==`boolean`)continue;let v=lv(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=P_(t)&&P_(n)?!nv(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,D=!E||b;y&&D&&c.push(...x.map(t=>{let n={type:f};if(typeof t==`string`&&r&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=N_(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Q_(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(l.size){let t={};if(typeof o.initial!=`boolean`){let n=N_(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=dv()}}}function lv(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!nv(t,e):!1}function uv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function dv(){return{animate:uv(!0),whileInView:uv(),whileHover:uv(),whileTap:uv(),whileDrag:uv(),whileFocus:uv(),exit:uv()}}var fv=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},pv=class extends fv{constructor(e){super(e),e.animationState||=cv(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Wh(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?.()}};let mv=0;var hv=class extends fv{constructor(){super(...arguments),this.id=mv++}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(){}};const gv={animation:{Feature:pv},exit:{Feature:hv}};function _v(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function vv(e){return{point:{x:e.pageX,y:e.pageY}}}const yv=e=>t=>nh(t)&&e(t,vv(t));function bv(e,t,n,r){return _v(e,t,yv(n),r)}const xv=1e-4,Sv=1-xv,Cv=1+xv,wv=.01,Tv=0-wv,Ev=0+wv;function Dv(e){return e.max-e.min}function Ov(e,t,n){return Math.abs(e-t)<=n}function kv(e,t,n,r=.5){e.origin=r,e.originPoint=G(t.min,t.max,e.origin),e.scale=Dv(n)/Dv(t),e.translate=G(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Av(e,t,n,r){kv(e.x,t.x,n.x,r?r.originX:void 0),kv(e.y,t.y,n.y,r?r.originY:void 0)}function jv(e,t,n){e.min=n.min+t.min,e.max=e.min+Dv(t)}function Mv(e,t,n){jv(e.x,t.x,n.x),jv(e.y,t.y,n.y)}function Nv(e,t,n){e.min=t.min-n.min,e.max=e.min+Dv(t)}function Pv(e,t,n){Nv(e.x,t.x,n.x),Nv(e.y,t.y,n.y)}function Fv(e){return[e(`x`),e(`y`)]}const Iv=({current:e})=>e?e.ownerDocument.defaultView:null,Lv=(e,t)=>Math.abs(e-t);function Rv(e,t){let n=Lv(e.x,t.x),r=Lv(e.y,t.y);return Math.sqrt(n**2+r**2)}var zv=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=Hv(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Rv(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=wd;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=Bv(t,this.transformPagePoint),U.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Hv(e.type===`pointercancel`?this.lastMoveEventInfo:Bv(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!nh(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let o=vv(e),s=Bv(o,this.transformPagePoint),{point:c}=s,{timestamp:l}=wd;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Hv(s,this.history)),this.removeListeners=Hu(bv(this.contextWindow,`pointermove`,this.handlePointerMove),bv(this.contextWindow,`pointerup`,this.handlePointerUp),bv(this.contextWindow,`pointercancel`,this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Cd(this.updatePoint)}};function Bv(e,t){return t?{point:t(e.point)}:e}function Vv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Hv({point:e},t){return{point:e,delta:Vv(e,Wv(t)),offset:Vv(e,Uv(t)),velocity:Gv(t,.1)}}function Uv(e){return e[0]}function Wv(e){return e[e.length-1]}function Gv(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Wv(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Gu(t)));)n--;if(!r)return{x:0,y:0};let a=Ku(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 Kv(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?G(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?G(n,e,r.max):Math.min(e,n)),e}function qv(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 Jv(e,{top:t,left:n,bottom:r,right:i}){return{x:qv(e.x,n,i),y:qv(e.y,t,r)}}function Yv(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 Xv(e,t){return{x:Yv(e.x,t.x),y:Yv(e.y,t.y)}}function Zv(e,t){let n=.5,r=Dv(e),i=Dv(t);return i>r?n=Uu(t.min,t.max-r,e.min):r>i&&(n=Uu(e.min,e.max-i,t.min)),ju(0,1,n)}function Qv(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}const $v=.35;function ey(e=$v){return e===!1?e=0:e===!0&&(e=$v),{x:ty(e,`left`,`right`),y:ty(e,`top`,`bottom`)}}function ty(e,t,n){return{min:ny(e,t),max:ny(e,n)}}function ny(e,t){return typeof e==`number`?e:e[t]||0}const ry=new WeakMap;var iy=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=>{let{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(vv(e).point)},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Zm(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),Fv(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Zd.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];if(r){let e=Dv(r);t=e*(parseFloat(t)/100)}}}this.originPoint[e]=t}),i&&U.postRender(()=>i(e,t)),z_(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=oy(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=()=>Fv(e=>this.getAnimationState(e)===`paused`&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:l}=this.getProps();this.panSession=new zv(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Iv(this.visualElement)})}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&&U.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||!ay(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Kv(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&&Pg(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Jv(n.layoutBox,e):this.constraints=!1,this.elastic=ey(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Fv(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Qv(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Pg(e))return!1;let n=e.current;Pu(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=p_(n,r.root,this.visualElement.getTransformPagePoint()),a=Xv(r.layout.layoutBox,i);if(t){let e=t(Yg(a));this.hasMutatedConstraints=!!e,e&&(a=Jg(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Fv(o=>{if(!ay(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 z_(this.visualElement,e),n.start(Y_(e,n,0,t,this.visualElement,!1))}stopAnimation(){Fv(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Fv(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(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Fv(t=>{let{drag:n}=this.getProps();if(!ay(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];i.set(e[t]-G(n,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Pg(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};Fv(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Zv({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(),Fv(t=>{if(!ay(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(G(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;ry.set(this.visualElement,this);let e=this.visualElement.current,t=bv(e,`pointerdown`,e=>{let{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),n=()=>{let{dragConstraints:e}=this.getProps();Pg(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()),U.read(n);let a=_v(window,`resize`,()=>this.scalePositionWithinConstraints()),o=r.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Fv(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=$v,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function ay(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function oy(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var sy=class extends fv{constructor(e){super(e),this.removeGroupControls=Bu,this.removeListeners=Bu,this.controls=new iy(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Bu}unmount(){this.removeGroupControls(),this.removeListeners()}};const cy=e=>(t,n)=>{e&&U.postRender(()=>e(t,n))};var ly=class extends fv{constructor(){super(...arguments),this.removePointerDownListener=Bu}onPointerDown(e){this.session=new zv(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Iv(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:cy(e),onStart:cy(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&U.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=bv(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};const uy={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let dy=!1;var fy=class extends f.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),dy&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),uy.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,dy=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||U.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),qm.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;dy=!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 py(e){let[t,n]=wh(),r=(0,f.useContext)(wu);return(0,p.jsx)(fy,{...e,layoutGroup:r,switchLayoutGroup:(0,f.useContext)(zg),isPresent:t,safeToRemove:n})}function my(e,t,n){let r=ph(e)?e:Km(e);return r.start(Y_(``,r,t,n)),r.animation}const hy=(e,t)=>e.depth-t.depth;var gy=class{constructor(){this.children=[],this.isDirty=!1}add(e){ku(this.children,e),this.isDirty=!0}remove(e){Au(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(hy),this.isDirty=!1,this.children.forEach(e)}};function _y(e,t){let n=Od.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Cd(r),e(a-t))};return U.setup(r,!0),()=>Cd(r)}const vy=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],yy=vy.length,by=e=>typeof e==`string`?parseFloat(e):e,xy=e=>typeof e==`number`||W.test(e);function Sy(e,t,n,r,i,a){i?(e.opacity=G(0,n.opacity??1,wy(r)),e.opacityExit=G(t.opacity??1,0,Ty(r))):a&&(e.opacity=G(t.opacity??1,n.opacity??1,r));for(let i=0;i<yy;i++){let a=`border${vy[i]}Radius`,o=Cy(t,a),s=Cy(n,a);if(o===void 0&&s===void 0)continue;o||=0,s||=0;let c=o===0||s===0||xy(o)===xy(s);c?(e[a]=Math.max(G(by(o),by(s),r),0),(Zd.test(s)||Zd.test(o))&&(e[a]+=`%`)):e[a]=s}(t.rotate||n.rotate)&&(e.rotate=G(t.rotate||0,n.rotate||0,r))}function Cy(e,t){return e[t]===void 0?e.borderRadius:e[t]}const wy=Ey(0,.5,cd),Ty=Ey(.5,.95,Bu);function Ey(e,t,n){return r=>r<e?0:r>t?1:n(Uu(e,t,r))}function Dy(e,t){e.min=t.min,e.max=t.max}function Oy(e,t){Dy(e.x,t.x),Dy(e.y,t.y)}function ky(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ay(e,t,n,r,i){return e-=t,e=n_(e,1/n,r),i!==void 0&&(e=n_(e,1/i,r)),e}function jy(e,t=0,n=1,r=.5,i,a=e,o=e){if(Zd.test(t)){t=parseFloat(t);let e=G(o.min,o.max,t/100);t=e-o.min}if(typeof t!=`number`)return;let s=G(a.min,a.max,r);e===a&&(s-=t),e.min=Ay(e.min,t,n,s,i),e.max=Ay(e.max,t,n,s,i)}function My(e,t,[n,r,i],a,o){jy(e,t[n],t[r],t[i],t.scale,a,o)}const Ny=[`x`,`scaleX`,`originX`],Py=[`y`,`scaleY`,`originY`];function Fy(e,t,n,r){My(e.x,t,Ny,n?n.x:void 0,r?r.x:void 0),My(e.y,t,Py,n?n.y:void 0,r?r.y:void 0)}function Iy(e){return e.translate===0&&e.scale===1}function Ly(e){return Iy(e.x)&&Iy(e.y)}function Ry(e,t){return e.min===t.min&&e.max===t.max}function zy(e,t){return Ry(e.x,t.x)&&Ry(e.y,t.y)}function By(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Vy(e,t){return By(e.x,t.x)&&By(e.y,t.y)}function Hy(e){return Dv(e.x)/Dv(e.y)}function Uy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Wy=class{constructor(){this.members=[]}add(e){ku(this.members,e),e.scheduleRender()}remove(e){if(Au(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 Gy(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`}const Ky={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},qy=[``,`X`,`Y`,`Z`],Jy=1e3;let Yy=0;function Xy(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Zy(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=B_(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,U,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Zy(r)}function Qy({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Yy++,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,yd.value&&(Ky.nodes=Ky.calculatedTargetDeltas=Ky.calculatedProjections=0),this.nodes.forEach(tb),this.nodes.forEach(cb),this.nodes.forEach(lb),this.nodes.forEach(nb),yd.addProjectionMetrics&&yd.addProjectionMetrics(Ky)},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 gy)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Wu),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=dh(t)&&!fh(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;U.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=_y(i,250),uy.hasAnimatedSinceResize&&(uy.hasAnimatedSinceResize=!1,this.nodes.forEach(sb)))})}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()||gb,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Vy(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={...ym(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||sb(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(),Cd(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(ub),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&&Zy(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(){this.updateScheduled=!1;let e=this.isUpdateBlocked();if(e){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ib);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ab);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ob),this.nodes.forEach($y),this.nodes.forEach(eb)):this.nodes.forEach(ab),this.clearAllSnapshots();let t=Od.now();wd.delta=ju(0,1e3/60,t-wd.timestamp),wd.timestamp=t,wd.isProcessing=!0,Td.update.process(wd),Td.preRender.process(wd),Td.render.process(wd),wd.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rb),this.sharedNodes.forEach(db)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,U.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){U.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dv(this.snapshot.measuredBox.x)&&!Dv(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++){let t=this.path[e];t.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&&!Ly(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||$g(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)),bb(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(),n=this.scroll?.wasRoot||this.path.some(Sb);if(!n){let{scroll:e}=this.root;e&&(l_(t.x,e.offset.x),l_(t.y,e.offset.y))}return t}removeElementScroll(e){let t=__();if(Oy(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&&Oy(t,e),l_(t.x,i.offset.x),l_(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=__();Oy(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&&d_(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),$g(r.latestValues)&&d_(n,r.latestValues)}return $g(this.latestValues)&&d_(n,this.latestValues),n}removeTransform(e){let t=__();Oy(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!$g(n.latestValues))continue;Qg(n.latestValues)&&n.updateSnapshot();let r=__(),i=n.measurePageBox();Oy(r,i),Fy(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return $g(this.latestValues)&&Fy(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!==wd.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,r=!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize);if(r)return;let{layout:i,layoutId:a}=this.options;if(!this.layout||!(i||a))return;this.resolvedRelativeTargetAt=wd.timestamp;let o=this.getClosestProjectingParent();o&&this.linkedParentVersion!==o.layoutVersion&&!o.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(o&&o.layout?this.createRelativeTarget(o,this.layout.layoutBox,o.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(),Mv(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Oy(this.target,this.layout.layoutBox),a_(this.target,this.targetDelta)):Oy(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,o&&!!o.resumingFrom==!!this.resumingFrom&&!o.options.layoutScroll&&o.target&&this.animationProgress!==1?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0),yd.value&&Ky.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Qg(this.parent.latestValues)||e_(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=__(),Pv(this.relativeTargetOrigin,t,n),Oy(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===wd.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;Oy(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;c_(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():(ky(this.prevProjectionDelta.x,this.projectionDelta.x),ky(this.prevProjectionDelta.y,this.projectionDelta.y)),Av(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Uy(this.projectionDelta.x,this.prevProjectionDelta.x)||!Uy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),yd.value&&Ky.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=h_(),this.projectionDelta=h_(),this.projectionDeltaWithTransform=h_()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=h_();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=__(),s=n?n.source:void 0,c=this.layout?this.layout.source:void 0,l=s!==c,u=this.getStack(),d=!u||u.members.length<=1,f=!!(l&&!d&&this.options.crossfade===!0&&!this.path.some(hb));this.animationProgress=0;let p;this.mixTargetDelta=t=>{let n=t/1e3;fb(a.x,e.x,n),fb(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Pv(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mb(this.relativeTarget,this.relativeTargetOrigin,o,n),p&&zy(this.relativeTarget,p)&&(this.isProjectionDirty=!1),p||=__(),Oy(p,this.relativeTarget)),l&&(this.animationValues=i,Sy(i,r,this.latestValues,n,f,d)),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&&=(Cd(this.pendingAnimation),void 0),this.pendingAnimation=U.update(()=>{uy.hasAnimatedSinceResize=!0,kd.layout++,this.motionValue||=Km(0),this.currentAnimation=my(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{kd.layout--},onComplete:()=>{kd.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(1e3),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&&xb(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||__();let t=Dv(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Dv(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Oy(t,n),d_(t,i),Av(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Wy);let n=this.sharedNodes.get(e);n.add(t);let r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.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&&Xy(`z`,e,r,this.animationValues);for(let t=0;t<qy.length;t++)Xy(`rotate${qy[t]}`,e,r,this.animationValues),Xy(`skew${qy[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=Tg(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=Tg(t?.pointerEvents)||``),this.hasProjected&&!$g(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Gy(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,ng){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=ng[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?Tg(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(ib),this.root.sharedNodes.clear()}}}function $y(e){e.updateLayout()}function eb(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`?Fv(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Dv(r);r.min=n[e].min,r.max=r.min+i}):xb(i,t.layoutBox,n)&&Fv(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Dv(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=h_();Av(o,n,t.layoutBox);let s=h_();a?Av(s,e.applyTransform(r,!0),t.measuredBox):Av(s,n,t.layoutBox);let c=!Ly(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=__();Pv(o,t.layoutBox,i.layoutBox);let s=__();Pv(s,n,a.layoutBox),Vy(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 tb(e){yd.value&&Ky.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 nb(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function rb(e){e.clearSnapshot()}function ib(e){e.clearMeasurements()}function ab(e){e.isLayoutDirty=!1}function ob(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function sb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function cb(e){e.resolveTargetDelta()}function lb(e){e.calcProjection()}function ub(e){e.resetSkewAndRotation()}function db(e){e.removeLeadSnapshot()}function fb(e,t,n){e.translate=G(t.translate,0,n),e.scale=G(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function pb(e,t,n,r){e.min=G(t.min,n.min,r),e.max=G(t.max,n.max,r)}function mb(e,t,n,r){pb(e.x,t.x,n.x,r),pb(e.y,t.y,n.y,r)}function hb(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const gb={duration:.45,ease:[.4,0,.1,1]},_b=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),vb=_b(`applewebkit/`)&&!_b(`chrome/`)?Math.round:Bu;function yb(e){e.min=vb(e.min),e.max=vb(e.max)}function bb(e){yb(e.x),yb(e.y)}function xb(e,t,n){return e===`position`||e===`preserve-aspect`&&!Ov(Hy(t),Hy(n),.2)}function Sb(e){return e!==e.root&&e.scroll?.wasRoot}const Cb=Qy({attachResizeListener:(e,t)=>_v(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),wb={current:void 0},Tb=Qy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!wb.current){let e=new Cb({});e.mount(window),e.setOptions({layoutScroll:!0}),wb.current=e}return wb.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Eb={pan:{Feature:ly},drag:{Feature:sy,ProjectionNode:Tb,MeasureLayout:py}};function Db(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=`onHover`+n,a=r[i];a&&U.postRender(()=>a(t,vv(t)))}var Ob=class extends fv{mount(){let{current:e}=this.node;e&&(this.unmount=eh(e,(e,t)=>(Db(this.node,t,`Start`),e=>Db(this.node,e,`End`))))}unmount(){}},kb=class extends fv{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=Hu(_v(this.node.current,`focus`,()=>this.onFocus()),_v(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Ab(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=`onTap`+(n===`End`?``:n),a=r[i];a&&U.postRender(()=>a(t,vv(t)))}var jb=class extends fv{mount(){let{current:e}=this.node;e&&(this.unmount=uh(e,(e,t)=>(Ab(this.node,t,`Start`),(e,{success:t})=>Ab(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};const Mb=new WeakMap,Nb=new WeakMap,Pb=e=>{let t=Mb.get(e.target);t&&t(e)},Fb=e=>{e.forEach(Pb)};function Ib({root:e,...t}){let n=e||document;Nb.has(n)||Nb.set(n,{});let r=Nb.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Fb,{root:e,...t})),r[i]}function Lb(e,t,n){let r=Ib(t);return Mb.set(e,n),r.observe(e),()=>{Mb.delete(e),r.unobserve(e)}}const Rb={some:0,all:1};var zb=class extends fv{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:Rb[r]},o=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)};return Lb(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node,n=[`amount`,`margin`,`root`].some(Bb(e,t));n&&this.startObserver()}unmount(){}};function Bb({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Vb={inView:{Feature:zb},tap:{Feature:jb},focus:{Feature:kb},hover:{Feature:Ob}},Hb={layout:{ProjectionNode:Tb,MeasureLayout:py}},Ub={...gv,...Vb,...Eb,...Hb},Wb=qg(Ub,M_),Gb=({testId:e=`carousel-id`,activeIndex:t=0,extraClassNames:n=``,onSlide:r=()=>{},autoSlide:i,showIndicators:a=!0,continuous:o=!0,interval:s=4e3,prevIcon:c=`fc-arrow-dropdown tw:rotate-90`,nextIcon:l=`fc-arrow-dropdown tw:rotate-270`,showArrows:u=!0,iconExtraClassNames:d=``,carouselItems:m=[]})=>{let[h,g]=(0,f.useState)(t),_=e=>{let t=(e+m.length)%m.length;g(t),r(t,t>h?`right`:`left`)};(0,f.useEffect)(()=>{if(i){let e=setInterval(()=>{o||h<m.length-1?_(h+1):clearInterval(e)},s);return()=>clearInterval(e)}},[i,h,o,s,m.length]),(0,f.useEffect)(()=>{t!==h&&g(t)},[t]);let v=()=>{if(h===0&&!o)return;let e=h-1;e<0&&(e=m.length-1),_(e)},y=()=>{if(h===m.length-1){if(!o)return;_(0)}else _(h+1)},b={type:`spring`,damping:20,stiffness:100},x={initial:e=>({x:e>0?`100%`:`-100%`,opacity:0}),animate:{x:0,opacity:1,transition:b},exit:e=>({x:e>0?`-100%`:`100%`,opacity:0,transition:b})};return(0,p.jsxs)(`div`,{"data-testid":e,className:`tw:flex tw:flex-col tw:items-center tw:justify-center tw:w-full tw:overflow-hidden ${n}`,children:[(0,p.jsxs)(`div`,{className:`tw:flex tw:items-center tw:w-full tw:h-max tw:gap-1`,children:[u&&(0,p.jsx)(Pt,{icon:c,size:`lg`,variant:`no-border`,testId:`carousel-prev`,extraClassNames:`${h===0&&!o?`tw:invisible`:``} ${d} tw:animate-fadeIn`,onClick:v}),(0,p.jsx)(`div`,{className:`tw:h-full tw:w-full tw:overflow-hidden`,children:(0,p.jsx)(Wb.div,{custom:1,initial:`initial`,animate:`animate`,exit:`exit`,variants:x,className:`tw:w-full`,children:m[h]},h)}),u&&(0,p.jsx)(Pt,{icon:l,testId:`carousel-next`,size:`lg`,variant:`no-border`,extraClassNames:`${h===m.length-1&&!o?`tw:invisible`:``} ${d} tw:animate-fadeIn`,onClick:y})]}),a&&(0,p.jsx)(`div`,{className:`tw:flex tw:gap-1 tw:mt-2`,children:m.map((e,t)=>(0,p.jsx)(`div`,{className:`tw:w-2 tw:h-2 tw:rounded-full tw:cursor-pointer ${t===h?`tw:bg-sq-theme-dark`:`tw:bg-sq-darkish-gray`}`,onClick:()=>_(t)},t))})]})};var Kb=Gb;const qb=`tw:flex`,Jb=`tw:ml-1.5 tw:text-sm tw:-mt-0.5`,Yb=`tw:appearance-none tw:border tw:h-3.5 tw:w-3.5 tw:shrink-0 tw:focus:ring-0 tw:focus:ring-offset-0 tw:outline-none tw:focus:outline-none tw:dark:bg-sq-dark-background tw:dark:border-sq-dark-text tw:dark:enabled:hover:bg-sq-dark-background tw:checked:text-white tw:checked:border-sq-text-color tw:checked:enabled:hover:border-sq-theme-dark tw:checked:active:border-sq-theme-darker tw:checked:focus:border-sq-theme-dark tw:disabled:border-sq-disabled-gray tw:dark:disabled:border-sq-fairly-dark-gray tw:dark:checked:focus:bg-sq-dark-background`,Xb=`tw:rounded ${Yb}`,Zb=`tw:rounded-full ${Yb}`,Qb=e=>{let{type:t=`checkbox`,value:n,disabled:r=!1,label:i,onChange:a,onClick:o,onKeyDown:s,checked:c,defaultChecked:l,id:u,name:d,extraClassNames:m=``,extraLabelClassNames:h,testId:g,..._}=e,v=(0,f.useId)(),y=u??`checkbox${v}`,b=at(_);return(0,p.jsxs)(`span`,{className:`tw:flex ${m}`,children:[(0,p.jsx)(`input`,{value:n,type:t,"data-testid":g,name:d,id:y,readOnly:!a,checked:c,defaultChecked:l,className:`${t===`checkbox`?Xb:Zb} ${r?`tw:cursor-not-allowed`:`tw:cursor-pointer`}`,disabled:r,onClick:o,onChange:a,onKeyDown:s,...b}),i&&(0,p.jsx)(`label`,{htmlFor:y,className:`tw:ml-1.5 tw:text-sm tw:-mt-0.5 ${h} ${r?`tw:cursor-not-allowed tw:dark:text-sq-fairly-dark-gray tw:text-sq-fairly-dark-gray`:`tw:cursor-pointer tw:text-sq-text-color tw:dark:text-sq-dark-text`}`,children:i})]})},$b=({isVisible:e,children:t})=>{let n=(0,f.useRef)(null),[r,i]=(0,f.useState)(0);return(0,f.useEffect)(()=>{n.current&&setTimeout(()=>{i((n.current?.scrollHeight??0)+5)},0)},[t]),(0,p.jsx)(Dh,{initial:!1,children:e&&(0,p.jsx)(Wb.div,{initial:{height:0,opacity:0},animate:{height:r,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,damping:20,stiffness:100},children:(0,p.jsx)(`div`,{ref:n,children:t})})})};var ex=$b;const tx=`tw:cursor-pointer tw:border tw:border-gray-700 tw:dark:border-gray-500 tw:shadow-sm tw:focus-visible:outline-none`,nx={sm:`tw:h-5 tw:w-5 tw:rounded`,md:`tw:h-6 tw:w-6 tw:rounded-md`,lg:`tw:h-8 tw:w-8 tw:rounded-lg`},rx=(0,f.forwardRef)(function({color:e,onClick:t,"aria-label":n,size:r=`lg`,extraClassNames:i=``,id:a,testId:o},s){return(0,p.jsx)(`button`,{ref:s,"aria-label":n,className:`tw:cursor-pointer tw:border tw:border-gray-700 tw:dark:border-gray-500 tw:shadow-sm tw:focus-visible:outline-none ${nx[r]} ${i}`,"data-testid":o,id:a,onClick:t,style:{backgroundColor:e},type:`button`})});var ix=rx;const ax=[`tw:bg-sq-white tw:dark:bg-sq-dark-background`,`tw:border tw:border-solid tw:rounded-[0.5rem] tw:border-sq-disabled-gray tw:dark:border-gray-500`,`tw:relative tw:z-[1200] tw:min-w-6`,`tw:focus-visible:outline-none tw:outline-none`,`tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out`,`tw:data-[side=top]:animate-slideDownAndFade tw:data-[side=right]:animate-slideLeftAndFade`,`tw:data-[side=bottom]:animate-slideUpAndFade tw:data-[side=left]:animate-slideRightAndFade`,`tw:text-sq-text-color tw:dark:text-sq-text-color-dark`].join(` `);function ox({color:e,label:t,children:n,placement:r=`bottom`,align:i=`start`,extraClassNames:a=``,id:o,testId:s,onOpen:c}){let l=(0,f.useId)(),u=(0,p.jsx)(`label`,{className:`tw:cursor-pointer tw:whitespace-nowrap tw:text-sm tw:text-sq-text-color tw:dark:text-sq-text-color-dark`,htmlFor:l,children:t}),d=(0,p.jsx)(ix,{"aria-label":t,color:e,id:o??l,size:`sm`,onClick:c});return n?(0,p.jsxs)(`div`,{className:`tw:flex tw:items-center tw:gap-2 ${a}`,children:[u,(0,p.jsxs)(mu,{children:[(0,p.jsx)(hu,{asChild:!0,children:d}),(0,p.jsx)(_u,{align:i,className:ax,"data-testid":s,side:r,sideOffset:2,children:n})]})]}):(0,p.jsxs)(`div`,{className:`tw:flex tw:items-center tw:gap-2 ${a}`,children:[(0,p.jsx)(`span`,{className:`tw:cursor-pointer tw:whitespace-nowrap tw:text-sm tw:text-sq-text-color tw:dark:text-sq-text-color-dark`,children:t}),d]})}var sx=ox;const cx=`tw:mt-3 tw:mb-1 tw:flex tw:w-full tw:max-w-md tw:flex-col tw:items-start tw:rounded-3xl tw:border tw:border-sq-tool-btn-border tw:dark:border-gray-500 tw:bg-sq-surface tw:dark:bg-sq-tools-background-dark tw:px-4 tw:py-3 tw:shadow-sm`,lx={normal:`tw:gap-2`,spacious:`tw:gap-3`},ux=`tw:text-xs tw:font-bold tw:uppercase tw:tracking-wide tw:text-sq-theme-dark`,dx=`tw:flex tw:w-full tw:max-w-full tw:flex-wrap tw:items-center tw:justify-end tw:gap-2`,fx=({title:e,children:t,onApply:n,onCancel:r,isApplyDisabled:i=!1,applyLabel:a=`Apply`,cancelLabel:o=`Cancel`,spacing:s=`normal`,extraClassNames:c=``,id:l,testId:u})=>(0,p.jsxs)(`div`,{className:`tw:mt-3 tw:mb-1 tw:flex tw:w-full tw:max-w-md tw:flex-col tw:items-start tw:rounded-3xl tw:border tw:border-sq-tool-btn-border tw:dark:border-gray-500 tw:bg-sq-surface tw:dark:bg-sq-tools-background-dark tw:px-4 tw:py-3 tw:shadow-sm ${lx[s]} ${c}`,"data-testid":u,id:l,children:[(0,p.jsx)(`span`,{className:`tw:text-xs tw:font-bold tw:uppercase tw:tracking-wide tw:text-sq-theme-dark`,children:e}),t,(0,p.jsxs)(`div`,{className:`tw:flex tw:w-full tw:max-w-full tw:flex-wrap tw:items-center tw:justify-end tw:gap-2`,children:[r&&(0,p.jsx)(Pt,{label:o,onClick:r,size:`sm`,variant:`outline`}),n&&(0,p.jsx)(Pt,{disabled:i,label:a,onClick:n,size:`sm`,variant:`theme`})]})]});var px=fx,mx=u(bt());const hx=`tw:inline-flex tw:text-sq-theme-link tw:underline tw:underline-offset-2 tw:transition-colors hover:tw:text-sq-theme-dark focus-visible:tw:outline-none focus-visible:tw:ring-2 focus-visible:tw:ring-sq-theme-link focus-visible:tw:ring-offset-2`,gx=``,_x=`tw:text-sq-text-color tw:dark:text-sq-text-color-dark tw:shrink-0`,vx={link:`tw:inline-flex tw:text-sq-theme-link tw:underline tw:underline-offset-2 tw:transition-colors hover:tw:text-sq-theme-dark focus-visible:tw:outline-none focus-visible:tw:ring-2 focus-visible:tw:ring-sq-theme-link focus-visible:tw:ring-offset-2`,icon:``},yx=({variant:e=`link`,label:t,href:n,children:r,extraClassNames:i=``,testId:a})=>(0,p.jsxs)(p.Fragment,{children:[t&&(0,p.jsx)(`span`,{className:`tw:text-sq-text-color tw:dark:text-sq-text-color-dark tw:shrink-0`,children:t}),(0,p.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener`,className:(0,mx.default)(vx[e],i),"data-testid":a,children:r})]});var bx=yx;function xx(e,t){if(typeof e==`function`)return e(t);typeof e==`object`&&e&&`current`in e&&(e.current=t)}function Sx(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=xx(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&typeof n==`function`?n():xx(e,null)}),t.clear()}}}function Cx(...e){return(0,f.useCallback)(Sx(...e),e)}const wx=(e,t)=>{let n;return typeof e==`number`&&e>0&&(n={width:`${e}px`}),typeof t==`number`&&t>0&&(n||={},n.height=`${t}px`),n},Tx=`tw:border-sq-danger`,Ex=[`tw:border-sq-disabled-gray`,`tw:dark:border-sq-dark-disabled-gray`,`tw:hover:border-sq-theme-dark`,`tw:dark:hover:border-sq-theme-dark-dark`,`tw:dark:focus:border-sq-theme-dark-dark`,`tw:dark:active:border-sq-theme-darker`,`tw:focus:border-sq-theme-dark`,`tw:active:border-sq-theme-dark`].join(` `),Dx=`tw:h-8.5 tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:disabled:pointer-events-none tw:disabled:bg-sq-light-gray tw:disabled:dark:bg-sq-dark-disabled-gray tw:disabled:cursor-not-allowed tw:p-1 tw:border-solid tw:border tw:placeholder-gray-400! tw:dark:placeholder-sq-dark-text/30! specTextField`,Ox=`tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-dark-text/30`,kx=`tw:text-sq-text-color tw:disabled:text-sq-darkish-gray`,Ax={sm:`tw:text-sm`,lg:`tw:text-xl`},jx=(0,f.forwardRef)((e,t)=>{let{readonly:n=!1,disabled:r=!1,onChange:i,onPaste:a,onKeyUp:o,onFocus:s,onBlur:c,onKeyDown:l,id:u,name:d,size:m=`sm`,value:h,placeholder:g,extraClassNames:_,testId:v,type:y=`text`,inputGroup:b,step:x,showError:S,errorText:C,min:w,max:T,maxLength:E,minLength:D,required:O=!1,autoComplete:k=`off`,inputWidth:A=void 0,inputHeight:j=void 0,autoFocus:M=!1,...N}=e,P=(0,f.useRef)(null),ee=Cx(t,P),[F,I]=(0,f.useState)(null),L=at(N),R=(0,f.useRef)(M);(0,f.useEffect)(()=>{R.current&&setTimeout(()=>{P.current?.focus()},0)},[]),(0,f.useEffect)(()=>{let e=P.current;e&&y!==`number`&&y!==`email`&&e.setSelectionRange(F,F)},[t,F,h,y]);let z=e=>{I(e.target.selectionStart),i&&i(e)};(0,f.useEffect)(()=>{h!=null&&h!==P.current?.value&&P.current&&(P.current.value=`${h}`)},[h]);let B=`tw:rounded-md`;b===`left`?B=`tw:rounded-l-md tw:border-r-0 tw:focus:border-r tw:active:border-r`:b===`right`&&(B=`tw:rounded-r-md tw:border-l-0 tw:focus:border-l tw:active:border-l`);let te=`tw:h-8.5 tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:disabled:pointer-events-none tw:disabled:bg-sq-light-gray tw:disabled:dark:bg-sq-dark-disabled-gray tw:disabled:cursor-not-allowed tw:p-1 tw:border-solid tw:border tw:placeholder-gray-400! tw:dark:placeholder-sq-dark-text/30! specTextField ${Ax[m]} ${_} tw:text-sq-text-color tw:disabled:text-sq-darkish-gray tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-dark-text/30 ${B} ${S?`tw:border-sq-danger`:Ex} `,ne=wx(A,j)?{style:wx(A,j)}:{},re={};return E&&(re.maxLength=E),D&&(re.minLength=D),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`input`,{ref:ee,"data-testid":v,name:d,id:u,type:y,value:h,className:te,placeholder:g,disabled:r,readOnly:n,autoComplete:k,onChange:z,onPaste:a,onFocus:s,onBlur:c,onKeyDown:l,onKeyUp:o,step:x,required:O,min:w,max:T,...re,...ne,...L}),C&&S&&(0,p.jsx)(`div`,{className:`tw:text-sq-danger tw:text-xs tw:mt-1`,children:C})]})});jx.displayName=`TextField`;const Mx=`tw:flex tw:outline-none tw:rounded-md tw:w-full tw:relative tw:flex-wrap`,Nx=`tw:border-sq-danger`,Px=[`tw:border-sq-disabled-gray`,`tw:dark:border-sq-dark-disabled-gray`,`tw:dark:focus:border-sq-theme-darker`,`tw:dark:active:border-sq-theme-darker`,`tw:focus:border-sq-theme-dark`,`tw:active:border-sq-theme-dark`].join(` `),Fx=`tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:p-1 tw:border-solid tw:border`,Ix=`tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-disabled-gray`,Lx=`tw:text-sq-text-color tw:disabled:text-sq-darkish-gray`,Rx=(0,f.forwardRef)((e,t)=>{let{readonly:n=!1,onChange:r,onKeyUp:i,onFocus:a,onBlur:o,onKeyDown:s,name:c,value:l,placeholder:u,append:d=[],extraClassNames:m=``,id:h,testId:g,showError:_,required:v,autoComplete:y,autoFocus:b,disabled:x,type:S,step:C,min:w,max:T,field:E,maxLength:D,minLength:O,inputGroup:k,...A}=e,j=at(A),M=`tw:flex tw:outline-none tw:rounded-md tw:w-full tw:relative tw:flex-wrap ${m}`,N=d.filter(Boolean),P=k??(N.length>0?`left`:void 0),ee=P===`left`?`tw:rounded-l-md tw:rounded-r-none`:P===`right`?`tw:rounded-r-md tw:rounded-l-none`:`tw:rounded-md`,F=`tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:p-1 tw:border-solid tw:border ${m} tw:text-sq-text-color tw:disabled:text-sq-darkish-gray tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-disabled-gray ${ee} ${_?`tw:border-sq-danger`:Px} `,I=(0,f.isValidElement)(E)&&typeof E.type!=`string`,L=I?(0,f.cloneElement)(E,{inputGroup:P}):E;return(0,p.jsxs)(`div`,{id:`input-group-${h}`,className:M,children:[E?(0,p.jsx)(`div`,{"data-testid":g,className:`tw:flex tw:flex-1 tw:cursor-pointer tw:active:z-50 ${F}`,children:L}):(0,p.jsx)(jx,{testId:g,readonly:n,onChange:r,onKeyUp:i,onFocus:a,onBlur:o,onKeyDown:s,name:c,ref:t,showError:_,value:l,required:v,placeholder:u,autoComplete:y,autoFocus:b,id:h,type:S,disabled:x,step:C,min:w,max:T,maxLength:D,minLength:O,inputGroup:P,extraClassNames:`tw:flex tw:flex-1 tw:w-full tw:focus:z-30 ${m}`,...j}),N.map((e,t)=>e?.variant===`button`?(0,p.jsx)(Pt,{extraClassNames:`$
58
+ `),()=>{m.contains(p)&&m.removeChild(p)}},[t]),(0,p.jsx)(bh,{isPresent:t,childRef:a,sizeRef:o,children:f.cloneElement(e,{ref:c})})}const Sh=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,root:c})=>{let l=Tu(Ch),u=(0,f.useId)(),d=!0,m=(0,f.useMemo)(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:e=>{l.set(e,!0);for(let e of l.values())if(!e)return;r&&r()},register:e=>(l.set(e,!1),()=>l.delete(e))}),[n,l,r]);return a&&d&&(m={...m}),(0,f.useMemo)(()=>{l.forEach((e,t)=>l.set(t,!1))},[n]),f.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o===`popLayout`&&(e=(0,p.jsx)(xh,{isPresent:n,anchorX:s,root:c,children:e})),(0,p.jsx)(Ou.Provider,{value:m,children:e})};function Ch(){return new Map}function wh(e=!0){let t=(0,f.useContext)(Ou);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,f.useId)();(0,f.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,f.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const Th=e=>e.key||``;function Eh(e){let t=[];return f.Children.forEach(e,e=>{(0,f.isValidElement)(e)&&t.push(e)}),t}const Dh=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,root:c})=>{let[l,u]=wh(o),d=(0,f.useMemo)(()=>Eh(e),[e]),m=o&&!l?[]:d.map(Th),h=(0,f.useRef)(!0),g=(0,f.useRef)(d),_=Tu(()=>new Map),[v,y]=(0,f.useState)(d),[b,x]=(0,f.useState)(d);Du(()=>{h.current=!1,g.current=d;for(let e=0;e<b.length;e++){let t=Th(b[e]);m.includes(t)?_.delete(t):_.get(t)!==!0&&_.set(t,!1)}},[b,m.length,m.join(`-`)]);let S=[];if(d!==v){let e=[...d];for(let t=0;t<b.length;t++){let n=b[t],r=Th(n);m.includes(r)||(e.splice(t,0,n),S.push(n))}return a===`wait`&&S.length&&(e=S),x(Eh(e)),y(d),null}process.env.NODE_ENV!==`production`&&a===`wait`&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);let{forceRender:C}=(0,f.useContext)(wu);return(0,p.jsx)(p.Fragment,{children:b.map(e=>{let f=Th(e),v=o&&!l?!1:d===b||m.includes(f),y=()=>{if(_.has(f))_.set(f,!0);else return;let e=!0;_.forEach(t=>{t||(e=!1)}),e&&(C?.(),x(g.current),o&&u?.(),r&&r())};return(0,p.jsx)(Sh,{isPresent:v,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:c,onExitComplete:v?void 0:y,anchorX:s,children:e},f)})})},Oh=(0,f.createContext)({strict:!1}),kh={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`]},Ah={};for(let e in kh)Ah[e]={isEnabled:t=>kh[e].some(e=>!!t[e])};function jh(e){for(let t in e)Ah[t]={...Ah[t],...e[t]}}const Mh=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 Nh(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Mh.has(e)}function Ph(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Fh=o((()=>{})),Ih={};c(Ih,{default:()=>Rh});var Lh,Rh,zh=o((()=>{Fh(),Lh=/^((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)-.*))$/,Rh=Ph(function(e){return Lh.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})}));let Bh=e=>!Nh(e);function Vh(e){typeof e==`function`&&(Bh=t=>t.startsWith(`on`)?!Nh(t):e(t))}try{Vh((zh(),d(Ih)).default)}catch{}function Hh(e,t,n){let r={};for(let i in e){if(i===`values`&&typeof e.values==`object`)continue;(Bh(i)||n===!0&&Nh(i)||!t&&!Nh(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i])}return r}const Uh=(0,f.createContext)({});function Wh(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Gh(e){return typeof e==`string`||Array.isArray(e)}const Kh=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],qh=[`initial`,...Kh];function Jh(e){return Wh(e.animate)||qh.some(t=>Gh(e[t]))}function Yh(e){return!!(Jh(e)||e.variants)}function Xh(e,t){if(Jh(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Gh(t)?t:void 0,animate:Gh(n)?n:void 0}}return e.inherit===!1?{}:t}function Zh(e){let{initial:t,animate:n}=Xh(e,(0,f.useContext)(Uh));return(0,f.useMemo)(()=>({initial:t,animate:n}),[Qh(t),Qh(n)])}function Qh(e){return Array.isArray(e)?e.join(` `):e}function $h(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const eg={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(W.test(e))e=parseFloat(e);else return e;let n=$h(e,t.target.x),r=$h(e,t.target.y);return`${n}% ${r}%`}},tg={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=vf.parse(e);if(i.length>5)return r;let a=vf.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=G(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},ng={borderRadius:{...eg,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:eg,borderTopRightRadius:eg,borderBottomLeftRadius:eg,borderBottomRightRadius:eg,boxShadow:tg};function rg(e,{layout:t,layoutId:n}){return Op.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!ng[e]||e===`opacity`)}const ig={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},ag=Dp.length;function og(e,t,n){let r=``,i=!0;for(let a=0;a<ag;a++){let o=Dp[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=Bm(s,Mm[o]);if(!c){i=!1;let t=ig[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function sg(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(Op.has(e)){o=!0;continue}else if(jd(e)){i[e]=n;continue}else{let t=Bm(n,Mm[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=og(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}const cg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function lg(e,t,n){for(let r in t)!ph(t[r])&&!rg(r,n)&&(e[r]=t[r])}function ug({transformTemplate:e},t){return(0,f.useMemo)(()=>{let n=cg();return sg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function dg(e,t){let n=e.style||{},r={};return lg(r,n,e),Object.assign(r,ug(e,t)),r}function fg(e,t){let n={},r=dg(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}const pg={offset:`stroke-dashoffset`,array:`stroke-dasharray`},mg={offset:`strokeDashoffset`,array:`strokeDasharray`};function hg(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?pg:mg;e[a.offset]=W.transform(-r);let o=W.transform(t),s=W.transform(n);e[a.array]=`${o} ${s}`}function gg(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(sg(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),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&hg(d,i,a,o,!1)}const _g=()=>({...cg(),attrs:{}}),vg=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function yg(e,t,n,r){let i=(0,f.useMemo)(()=>{let n=_g();return gg(n,t,vg(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};lg(t,e.style,e),i.style={...t,...i.style}}return i}const bg=[`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 xg(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(bg.indexOf(e)>-1||/[A-Z]/u.test(e))}function Sg(e,t,n,{latestValues:r},i,a=!1){let o=xg(e)?yg:fg,s=o(t,r,i,e),c=Hh(t,typeof e==`string`,a),l=e===f.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,f.useMemo)(()=>ph(u)?u.get():u,[u]);return(0,f.createElement)(e,{...l,children:d})}function Cg(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function wg(e,t,n,r){if(typeof t==`function`){let[i,a]=Cg(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]=Cg(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Tg(e){return ph(e)?e.get():e}function Eg({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){let a={latestValues:Dg(n,r,i,e),renderState:t()};return a}function Dg(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Tg(a[e]);let{initial:o,animate:s}=e,c=Jh(e),l=Yh(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`&&!Wh(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=wg(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}const Og=e=>(t,n)=>{let r=(0,f.useContext)(Uh),i=(0,f.useContext)(Ou),a=()=>Eg(e,t,r,i);return n?a():Tu(a)};function kg(e,t,n){let{style:r}=e,i={};for(let a in r)(ph(r[a])||t.style&&ph(t.style[a])||rg(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(i[a]=r[a]);return i}const Ag=Og({scrapeMotionValuesFromProps:kg,createRenderState:cg});function jg(e,t,n){let r=kg(e,t,n);for(let n in e)if(ph(e[n])||ph(t[n])){let t=Dp.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}const Mg=Og({scrapeMotionValuesFromProps:jg,createRenderState:_g}),Ng=Symbol.for(`motionComponentSymbol`);function Pg(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Fg(e,t,n){return(0,f.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n==`function`?n(r):Pg(n)&&(n.current=r))},[t])}const Ig=e=>e.replace(/([a-z])([A-Z])/gu,`$1-$2`).toLowerCase(),Lg=`framerAppearId`,Rg=`data-`+Ig(`framerAppearId`),zg=(0,f.createContext)({});function Bg(e,t,n,r,i){let{visualElement:a}=(0,f.useContext)(Uh),o=(0,f.useContext)(Oh),s=(0,f.useContext)(Ou),c=(0,f.useContext)(gh).reducedMotion,l=(0,f.useRef)(null);r||=o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:a,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:c}));let u=l.current,d=(0,f.useContext)(zg);u&&!u.projection&&i&&(u.type===`html`||u.type===`svg`)&&Vg(l.current,n,i,d);let p=(0,f.useRef)(!1);(0,f.useInsertionEffect)(()=>{u&&p.current&&u.update(n,s)});let m=n[Rg],h=(0,f.useRef)(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return Du(()=>{u&&(p.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),h.current&&u.animationState&&u.animationState.animateChanges())}),(0,f.useEffect)(()=>{u&&(!h.current&&u.animationState&&u.animationState.animateChanges(),h.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),!1),u.enteringChildren=void 0)}),u}function Vg(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:Hg(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Pg(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function Hg(e){if(e)return e.options.allowProjection===!1?Hg(e.parent):e.projection}function Ug(e,{forwardMotionProps:t=!1}={},n,r){n&&jh(n);let i=xg(e)?Mg:Ag;function a(a,o){let s,c={...(0,f.useContext)(gh),...a,layoutId:Wg(a)},{isStatic:l}=c,u=Zh(a),d=i(a,l);if(!l&&Eu){Gg(c,n);let t=Kg(c);s=t.MeasureLayout,u.visualElement=Bg(e,d,c,r,t.ProjectionNode)}return(0,p.jsxs)(Uh.Provider,{value:u,children:[s&&u.visualElement?(0,p.jsx)(s,{visualElement:u.visualElement,...c}):null,Sg(e,a,Fg(d,u.visualElement,o),d,l,t)]})}a.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let o=(0,f.forwardRef)(a);return o[Ng]=e,o}function Wg({layoutId:e}){let t=(0,f.useContext)(wu).id;return t&&e!==void 0?t+`-`+e:e}function Gg(e,t){let n=(0,f.useContext)(Oh).strict;if(process.env.NODE_ENV!==`production`&&t&&n){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?Nu(!1,t,`lazy-strict-mode`):Pu(!1,t,`lazy-strict-mode`)}}function Kg(e){let{drag:t,layout:n}=Ah;if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function qg(e,t){if(typeof Proxy>`u`)return Ug;let n=new Map,r=(n,r)=>Ug(n,r,e,t),i=(e,t)=>(process.env.NODE_ENV!==`production`&&Yu(!1,`motion() is deprecated. Use motion.create() instead.`),r(e,t));return new Proxy(i,{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Ug(a,void 0,e,t)),n.get(a))})}function Jg({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Yg({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Xg(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 Zg(e){return e===void 0||e===1}function Qg({scale:e,scaleX:t,scaleY:n}){return!Zg(e)||!Zg(t)||!Zg(n)}function $g(e){return Qg(e)||e_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function e_(e){return t_(e.x)||t_(e.y)}function t_(e){return e&&e!==`0%`}function n_(e,t,n){let r=e-n,i=t*r;return n+i}function r_(e,t,n,r,i){return i!==void 0&&(e=n_(e,i,r)),n_(e,n,r)+t}function i_(e,t=0,n=1,r,i){e.min=r_(e.min,t,n,r,i),e.max=r_(e.max,t,n,r,i)}function a_(e,{x:t,y:n}){i_(e.x,t.translate,t.scale,t.originPoint),i_(e.y,n.translate,n.scale,n.originPoint)}const o_=.999999999999,s_=1.0000000000001;function c_(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&&d_(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,a_(e,o)),r&&$g(a.latestValues)&&d_(e,a.latestValues))}t.x<s_&&t.x>o_&&(t.x=1),t.y<s_&&t.y>o_&&(t.y=1)}function l_(e,t){e.min+=t,e.max+=t}function u_(e,t,n,r,i=.5){let a=G(e.min,e.max,i);i_(e,t,n,a,r)}function d_(e,t){u_(e.x,t.x,t.scaleX,t.scale,t.originX),u_(e.y,t.y,t.scaleY,t.scale,t.originY)}function f_(e,t){return Jg(Xg(e.getBoundingClientRect(),t))}function p_(e,t,n){let r=f_(e,n),{scroll:i}=t;return i&&(l_(r.x,i.offset.x),l_(r.y,i.offset.y)),r}const m_=()=>({translate:0,scale:1,origin:0,originPoint:0}),h_=()=>({x:m_(),y:m_()}),g_=()=>({min:0,max:0}),__=()=>({x:g_(),y:g_()}),v_={current:null},y_={current:!1};function b_(){if(y_.current=!0,Eu)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>v_.current=e.matches;e.addEventListener(`change`,t),t()}else v_.current=!1}const x_=new WeakMap;function S_(e,t,n){for(let r in t){let i=t[r],a=n[r];if(ph(i))e.addValue(r,i);else if(ph(a))e.addValue(r,Km(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,Km(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const C_=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];var w_=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=Vp,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=Od.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,U.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=Jh(t),this.isVariantNode=Yh(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&&ph(t)&&t.set(s[e])}}mount(e){this.current=e,x_.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)),y_.current||b_(),this.shouldReduceMotion=this.reducedMotionConfig===`never`?!1:this.reducedMotionConfig===`always`?!0:v_.current,process.env.NODE_ENV!==`production`&&Yu(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(),Cd(this.notifyUpdate),Cd(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=Op.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&U.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 Ah){let t=Ah[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<C_.length;t++){let n=C_[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=`on`+n,i=e[r];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=S_(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=Km(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`&&(Iu(n)||Ru(n))?n=parseFloat(n):!hh(n)&&vf.test(t)&&(n=Fm(e,t)),this.setBaseTarget(e,ph(n)?n.get():n)),ph(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=wg(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&&!ph(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 Wu),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){qm.render(this.render)}},T_=class extends w_{constructor(){super(...arguments),this.KeyframeResolver=Rm}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;ph(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function E_(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 D_(e){return window.getComputedStyle(e)}var O_=class extends T_{constructor(){super(...arguments),this.type=`html`,this.renderInstance=E_}readValueFromInstance(e,t){if(Op.has(t))return this.projection?.isProjecting?Cp(t):Tp(e,t);{let n=D_(e),r=(jd(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return f_(e,t)}build(e,t,n){sg(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return kg(e,t,n)}};const k_=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 A_(e,t,n,r){for(let n in E_(e,t,void 0,r),t.attrs)e.setAttribute(k_.has(n)?n:Ig(n),t.attrs[n])}var j_=class extends T_{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=__}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Op.has(t)){let e=Pm(t);return e&&e.default||0}return t=k_.has(t)?t:Ig(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return jg(e,t,n)}build(e,t,n){gg(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){A_(e,t,n,r)}mount(e){this.isSVGTag=vg(e.tagName),super.mount(e)}};const M_=(e,t)=>xg(e)?new j_(t):new O_(t,{allowProjection:e!==f.Fragment});function N_(e,t,n){let r=e.getProps();return wg(r,t,n===void 0?r.custom:n,e)}const P_=e=>Array.isArray(e);function F_(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Km(n))}function I_(e){return P_(e)?e[e.length-1]||0:e}function L_(e,t){let n=N_(e,t),{transitionEnd:r={},transition:i={},...a}=n||{};for(let t in a={...a,...r},a){let n=I_(a[t]);F_(e,t,n)}}function R_(e){return!!(ph(e)&&e.add)}function z_(e,t){let n=e.getValue(`willChange`);if(R_(n))return n.add(t);if(!n&&Fu.WillChange){let n=new Fu.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function B_(e){return e.props[Rg]}const V_=e=>e!==null;function H_(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(V_),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}const U_={type:`spring`,stiffness:500,damping:25,restSpeed:10},W_=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),G_={type:`keyframes`,duration:.8},K_={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},q_=(e,{keyframes:t})=>t.length>2?G_:Op.has(e)?e.startsWith(`scale`)?W_(t[1]):U_:K_;function J_({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}const Y_=(e,t,n,r={},i,a)=>o=>{let s=ym(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Gu(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};J_(s)||Object.assign(u,q_(e,u)),u.duration&&=Gu(u.duration),u.repeatDelay&&=Gu(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(lm(u),u.delay===0&&(d=!0)),(Fu.instantAnimations||Fu.skipAnimations)&&(d=!0,lm(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=H_(u.keyframes,s);if(e!==void 0){U.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new pp(u):new mm(u)};function X_({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Z_(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&&X_(l,t))continue;let o={delay:n,...ym(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=B_(e);if(n){let e=window.MotionHandoffAnimation(n,t,U);e!==null&&(o.startTime=e,d=!0)}}z_(e,t),r.start(Y_(t,r,i,e.shouldReduceMotion&&bm.has(t)?{type:!1}:o,e,d));let f=r.animation;f&&c.push(f)}return o&&Promise.all(c).then(()=>{U.update(()=>{o&&L_(e,o)})}),c}function Q_(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,c=typeof n==`function`;return c?n(a,o):i===1?a*r:s-a*r}function $_(e,t,n={}){let r=N_(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(Z_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return ev(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 ev(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($_(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Q_(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function tv(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>$_(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=$_(e,t,n);else{let i=typeof t==`function`?N_(e,t,n.custom):t;r=Promise.all(Z_(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}function nv(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}const rv=qh.length;function iv(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&iv(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<rv;n++){let r=qh[n],i=e.props[r];(Gh(i)||i===!1)&&(t[r]=i)}return t}const av=[...Kh].reverse(),ov=Kh.length;function sv(e){return t=>Promise.all(t.map(({animation:t,options:n})=>tv(e,t,n)))}function cv(e){let t=sv(e),n=dv(),r=!0,i=t=>(n,r)=>{let i=N_(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=iv(e.parent)||{},c=[],l=new Set,u={},d=1/0;for(let t=0;t<ov;t++){let f=av[t],p=n[f],m=o[f]===void 0?s[f]:o[f],h=Gh(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||Wh(m)||typeof m==`boolean`)continue;let v=lv(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=P_(t)&&P_(n)?!nv(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,D=!E||b;y&&D&&c.push(...x.map(t=>{let n={type:f};if(typeof t==`string`&&r&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=N_(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Q_(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(l.size){let t={};if(typeof o.initial!=`boolean`){let n=N_(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=dv()}}}function lv(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!nv(t,e):!1}function uv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function dv(){return{animate:uv(!0),whileInView:uv(),whileHover:uv(),whileTap:uv(),whileDrag:uv(),whileFocus:uv(),exit:uv()}}var fv=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},pv=class extends fv{constructor(e){super(e),e.animationState||=cv(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Wh(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?.()}};let mv=0;var hv=class extends fv{constructor(){super(...arguments),this.id=mv++}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(){}};const gv={animation:{Feature:pv},exit:{Feature:hv}};function _v(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function vv(e){return{point:{x:e.pageX,y:e.pageY}}}const yv=e=>t=>nh(t)&&e(t,vv(t));function bv(e,t,n,r){return _v(e,t,yv(n),r)}const xv=1e-4,Sv=1-xv,Cv=1+xv,wv=.01,Tv=0-wv,Ev=0+wv;function Dv(e){return e.max-e.min}function Ov(e,t,n){return Math.abs(e-t)<=n}function kv(e,t,n,r=.5){e.origin=r,e.originPoint=G(t.min,t.max,e.origin),e.scale=Dv(n)/Dv(t),e.translate=G(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Av(e,t,n,r){kv(e.x,t.x,n.x,r?r.originX:void 0),kv(e.y,t.y,n.y,r?r.originY:void 0)}function jv(e,t,n){e.min=n.min+t.min,e.max=e.min+Dv(t)}function Mv(e,t,n){jv(e.x,t.x,n.x),jv(e.y,t.y,n.y)}function Nv(e,t,n){e.min=t.min-n.min,e.max=e.min+Dv(t)}function Pv(e,t,n){Nv(e.x,t.x,n.x),Nv(e.y,t.y,n.y)}function Fv(e){return[e(`x`),e(`y`)]}const Iv=({current:e})=>e?e.ownerDocument.defaultView:null,Lv=(e,t)=>Math.abs(e-t);function Rv(e,t){let n=Lv(e.x,t.x),r=Lv(e.y,t.y);return Math.sqrt(n**2+r**2)}var zv=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=Hv(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Rv(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=wd;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=Bv(t,this.transformPagePoint),U.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Hv(e.type===`pointercancel`?this.lastMoveEventInfo:Bv(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!nh(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let o=vv(e),s=Bv(o,this.transformPagePoint),{point:c}=s,{timestamp:l}=wd;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Hv(s,this.history)),this.removeListeners=Hu(bv(this.contextWindow,`pointermove`,this.handlePointerMove),bv(this.contextWindow,`pointerup`,this.handlePointerUp),bv(this.contextWindow,`pointercancel`,this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Cd(this.updatePoint)}};function Bv(e,t){return t?{point:t(e.point)}:e}function Vv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Hv({point:e},t){return{point:e,delta:Vv(e,Wv(t)),offset:Vv(e,Uv(t)),velocity:Gv(t,.1)}}function Uv(e){return e[0]}function Wv(e){return e[e.length-1]}function Gv(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Wv(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Gu(t)));)n--;if(!r)return{x:0,y:0};let a=Ku(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 Kv(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?G(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?G(n,e,r.max):Math.min(e,n)),e}function qv(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 Jv(e,{top:t,left:n,bottom:r,right:i}){return{x:qv(e.x,n,i),y:qv(e.y,t,r)}}function Yv(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 Xv(e,t){return{x:Yv(e.x,t.x),y:Yv(e.y,t.y)}}function Zv(e,t){let n=.5,r=Dv(e),i=Dv(t);return i>r?n=Uu(t.min,t.max-r,e.min):r>i&&(n=Uu(e.min,e.max-i,t.min)),ju(0,1,n)}function Qv(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}const $v=.35;function ey(e=$v){return e===!1?e=0:e===!0&&(e=$v),{x:ty(e,`left`,`right`),y:ty(e,`top`,`bottom`)}}function ty(e,t,n){return{min:ny(e,t),max:ny(e,n)}}function ny(e,t){return typeof e==`number`?e:e[t]||0}const ry=new WeakMap;var iy=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=>{let{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(vv(e).point)},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Zm(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),Fv(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Zd.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];if(r){let e=Dv(r);t=e*(parseFloat(t)/100)}}}this.originPoint[e]=t}),i&&U.postRender(()=>i(e,t)),z_(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=oy(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=()=>Fv(e=>this.getAnimationState(e)===`paused`&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:l}=this.getProps();this.panSession=new zv(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Iv(this.visualElement)})}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&&U.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||!ay(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Kv(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&&Pg(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Jv(n.layoutBox,e):this.constraints=!1,this.elastic=ey(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Fv(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Qv(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Pg(e))return!1;let n=e.current;Pu(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=p_(n,r.root,this.visualElement.getTransformPagePoint()),a=Xv(r.layout.layoutBox,i);if(t){let e=t(Yg(a));this.hasMutatedConstraints=!!e,e&&(a=Jg(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Fv(o=>{if(!ay(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 z_(this.visualElement,e),n.start(Y_(e,n,0,t,this.visualElement,!1))}stopAnimation(){Fv(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Fv(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(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Fv(t=>{let{drag:n}=this.getProps();if(!ay(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];i.set(e[t]-G(n,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Pg(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};Fv(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Zv({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(),Fv(t=>{if(!ay(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(G(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;ry.set(this.visualElement,this);let e=this.visualElement.current,t=bv(e,`pointerdown`,e=>{let{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),n=()=>{let{dragConstraints:e}=this.getProps();Pg(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()),U.read(n);let a=_v(window,`resize`,()=>this.scalePositionWithinConstraints()),o=r.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Fv(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=$v,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function ay(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function oy(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var sy=class extends fv{constructor(e){super(e),this.removeGroupControls=Bu,this.removeListeners=Bu,this.controls=new iy(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Bu}unmount(){this.removeGroupControls(),this.removeListeners()}};const cy=e=>(t,n)=>{e&&U.postRender(()=>e(t,n))};var ly=class extends fv{constructor(){super(...arguments),this.removePointerDownListener=Bu}onPointerDown(e){this.session=new zv(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Iv(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:cy(e),onStart:cy(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&U.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=bv(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};const uy={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let dy=!1;var fy=class extends f.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),dy&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),uy.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,dy=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||U.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),qm.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;dy=!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 py(e){let[t,n]=wh(),r=(0,f.useContext)(wu);return(0,p.jsx)(fy,{...e,layoutGroup:r,switchLayoutGroup:(0,f.useContext)(zg),isPresent:t,safeToRemove:n})}function my(e,t,n){let r=ph(e)?e:Km(e);return r.start(Y_(``,r,t,n)),r.animation}const hy=(e,t)=>e.depth-t.depth;var gy=class{constructor(){this.children=[],this.isDirty=!1}add(e){ku(this.children,e),this.isDirty=!0}remove(e){Au(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(hy),this.isDirty=!1,this.children.forEach(e)}};function _y(e,t){let n=Od.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Cd(r),e(a-t))};return U.setup(r,!0),()=>Cd(r)}const vy=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],yy=vy.length,by=e=>typeof e==`string`?parseFloat(e):e,xy=e=>typeof e==`number`||W.test(e);function Sy(e,t,n,r,i,a){i?(e.opacity=G(0,n.opacity??1,wy(r)),e.opacityExit=G(t.opacity??1,0,Ty(r))):a&&(e.opacity=G(t.opacity??1,n.opacity??1,r));for(let i=0;i<yy;i++){let a=`border${vy[i]}Radius`,o=Cy(t,a),s=Cy(n,a);if(o===void 0&&s===void 0)continue;o||=0,s||=0;let c=o===0||s===0||xy(o)===xy(s);c?(e[a]=Math.max(G(by(o),by(s),r),0),(Zd.test(s)||Zd.test(o))&&(e[a]+=`%`)):e[a]=s}(t.rotate||n.rotate)&&(e.rotate=G(t.rotate||0,n.rotate||0,r))}function Cy(e,t){return e[t]===void 0?e.borderRadius:e[t]}const wy=Ey(0,.5,cd),Ty=Ey(.5,.95,Bu);function Ey(e,t,n){return r=>r<e?0:r>t?1:n(Uu(e,t,r))}function Dy(e,t){e.min=t.min,e.max=t.max}function Oy(e,t){Dy(e.x,t.x),Dy(e.y,t.y)}function ky(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ay(e,t,n,r,i){return e-=t,e=n_(e,1/n,r),i!==void 0&&(e=n_(e,1/i,r)),e}function jy(e,t=0,n=1,r=.5,i,a=e,o=e){if(Zd.test(t)){t=parseFloat(t);let e=G(o.min,o.max,t/100);t=e-o.min}if(typeof t!=`number`)return;let s=G(a.min,a.max,r);e===a&&(s-=t),e.min=Ay(e.min,t,n,s,i),e.max=Ay(e.max,t,n,s,i)}function My(e,t,[n,r,i],a,o){jy(e,t[n],t[r],t[i],t.scale,a,o)}const Ny=[`x`,`scaleX`,`originX`],Py=[`y`,`scaleY`,`originY`];function Fy(e,t,n,r){My(e.x,t,Ny,n?n.x:void 0,r?r.x:void 0),My(e.y,t,Py,n?n.y:void 0,r?r.y:void 0)}function Iy(e){return e.translate===0&&e.scale===1}function Ly(e){return Iy(e.x)&&Iy(e.y)}function Ry(e,t){return e.min===t.min&&e.max===t.max}function zy(e,t){return Ry(e.x,t.x)&&Ry(e.y,t.y)}function By(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Vy(e,t){return By(e.x,t.x)&&By(e.y,t.y)}function Hy(e){return Dv(e.x)/Dv(e.y)}function Uy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Wy=class{constructor(){this.members=[]}add(e){ku(this.members,e),e.scheduleRender()}remove(e){if(Au(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 Gy(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`}const Ky={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},qy=[``,`X`,`Y`,`Z`],Jy=1e3;let Yy=0;function Xy(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Zy(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=B_(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,U,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Zy(r)}function Qy({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Yy++,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,yd.value&&(Ky.nodes=Ky.calculatedTargetDeltas=Ky.calculatedProjections=0),this.nodes.forEach(tb),this.nodes.forEach(cb),this.nodes.forEach(lb),this.nodes.forEach(nb),yd.addProjectionMetrics&&yd.addProjectionMetrics(Ky)},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 gy)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Wu),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=dh(t)&&!fh(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;U.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=_y(i,250),uy.hasAnimatedSinceResize&&(uy.hasAnimatedSinceResize=!1,this.nodes.forEach(sb)))})}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()||gb,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Vy(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={...ym(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||sb(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(),Cd(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(ub),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&&Zy(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(){this.updateScheduled=!1;let e=this.isUpdateBlocked();if(e){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ib);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ab);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ob),this.nodes.forEach($y),this.nodes.forEach(eb)):this.nodes.forEach(ab),this.clearAllSnapshots();let t=Od.now();wd.delta=ju(0,1e3/60,t-wd.timestamp),wd.timestamp=t,wd.isProcessing=!0,Td.update.process(wd),Td.preRender.process(wd),Td.render.process(wd),wd.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rb),this.sharedNodes.forEach(db)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,U.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){U.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dv(this.snapshot.measuredBox.x)&&!Dv(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++){let t=this.path[e];t.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&&!Ly(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||$g(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)),bb(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(),n=this.scroll?.wasRoot||this.path.some(Sb);if(!n){let{scroll:e}=this.root;e&&(l_(t.x,e.offset.x),l_(t.y,e.offset.y))}return t}removeElementScroll(e){let t=__();if(Oy(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&&Oy(t,e),l_(t.x,i.offset.x),l_(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=__();Oy(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&&d_(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),$g(r.latestValues)&&d_(n,r.latestValues)}return $g(this.latestValues)&&d_(n,this.latestValues),n}removeTransform(e){let t=__();Oy(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!$g(n.latestValues))continue;Qg(n.latestValues)&&n.updateSnapshot();let r=__(),i=n.measurePageBox();Oy(r,i),Fy(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return $g(this.latestValues)&&Fy(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!==wd.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,r=!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize);if(r)return;let{layout:i,layoutId:a}=this.options;if(!this.layout||!(i||a))return;this.resolvedRelativeTargetAt=wd.timestamp;let o=this.getClosestProjectingParent();o&&this.linkedParentVersion!==o.layoutVersion&&!o.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(o&&o.layout?this.createRelativeTarget(o,this.layout.layoutBox,o.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(),Mv(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Oy(this.target,this.layout.layoutBox),a_(this.target,this.targetDelta)):Oy(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,o&&!!o.resumingFrom==!!this.resumingFrom&&!o.options.layoutScroll&&o.target&&this.animationProgress!==1?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0),yd.value&&Ky.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Qg(this.parent.latestValues)||e_(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=__(),Pv(this.relativeTargetOrigin,t,n),Oy(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===wd.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;Oy(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;c_(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():(ky(this.prevProjectionDelta.x,this.projectionDelta.x),ky(this.prevProjectionDelta.y,this.projectionDelta.y)),Av(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Uy(this.projectionDelta.x,this.prevProjectionDelta.x)||!Uy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),yd.value&&Ky.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=h_(),this.projectionDelta=h_(),this.projectionDeltaWithTransform=h_()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=h_();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=__(),s=n?n.source:void 0,c=this.layout?this.layout.source:void 0,l=s!==c,u=this.getStack(),d=!u||u.members.length<=1,f=!!(l&&!d&&this.options.crossfade===!0&&!this.path.some(hb));this.animationProgress=0;let p;this.mixTargetDelta=t=>{let n=t/1e3;fb(a.x,e.x,n),fb(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Pv(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mb(this.relativeTarget,this.relativeTargetOrigin,o,n),p&&zy(this.relativeTarget,p)&&(this.isProjectionDirty=!1),p||=__(),Oy(p,this.relativeTarget)),l&&(this.animationValues=i,Sy(i,r,this.latestValues,n,f,d)),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&&=(Cd(this.pendingAnimation),void 0),this.pendingAnimation=U.update(()=>{uy.hasAnimatedSinceResize=!0,kd.layout++,this.motionValue||=Km(0),this.currentAnimation=my(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{kd.layout--},onComplete:()=>{kd.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(1e3),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&&xb(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||__();let t=Dv(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Dv(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Oy(t,n),d_(t,i),Av(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Wy);let n=this.sharedNodes.get(e);n.add(t);let r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.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&&Xy(`z`,e,r,this.animationValues);for(let t=0;t<qy.length;t++)Xy(`rotate${qy[t]}`,e,r,this.animationValues),Xy(`skew${qy[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=Tg(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=Tg(t?.pointerEvents)||``),this.hasProjected&&!$g(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Gy(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,ng){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=ng[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?Tg(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(ib),this.root.sharedNodes.clear()}}}function $y(e){e.updateLayout()}function eb(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`?Fv(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Dv(r);r.min=n[e].min,r.max=r.min+i}):xb(i,t.layoutBox,n)&&Fv(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Dv(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=h_();Av(o,n,t.layoutBox);let s=h_();a?Av(s,e.applyTransform(r,!0),t.measuredBox):Av(s,n,t.layoutBox);let c=!Ly(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=__();Pv(o,t.layoutBox,i.layoutBox);let s=__();Pv(s,n,a.layoutBox),Vy(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 tb(e){yd.value&&Ky.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 nb(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function rb(e){e.clearSnapshot()}function ib(e){e.clearMeasurements()}function ab(e){e.isLayoutDirty=!1}function ob(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function sb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function cb(e){e.resolveTargetDelta()}function lb(e){e.calcProjection()}function ub(e){e.resetSkewAndRotation()}function db(e){e.removeLeadSnapshot()}function fb(e,t,n){e.translate=G(t.translate,0,n),e.scale=G(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function pb(e,t,n,r){e.min=G(t.min,n.min,r),e.max=G(t.max,n.max,r)}function mb(e,t,n,r){pb(e.x,t.x,n.x,r),pb(e.y,t.y,n.y,r)}function hb(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const gb={duration:.45,ease:[.4,0,.1,1]},_b=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),vb=_b(`applewebkit/`)&&!_b(`chrome/`)?Math.round:Bu;function yb(e){e.min=vb(e.min),e.max=vb(e.max)}function bb(e){yb(e.x),yb(e.y)}function xb(e,t,n){return e===`position`||e===`preserve-aspect`&&!Ov(Hy(t),Hy(n),.2)}function Sb(e){return e!==e.root&&e.scroll?.wasRoot}const Cb=Qy({attachResizeListener:(e,t)=>_v(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),wb={current:void 0},Tb=Qy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!wb.current){let e=new Cb({});e.mount(window),e.setOptions({layoutScroll:!0}),wb.current=e}return wb.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Eb={pan:{Feature:ly},drag:{Feature:sy,ProjectionNode:Tb,MeasureLayout:py}};function Db(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=`onHover`+n,a=r[i];a&&U.postRender(()=>a(t,vv(t)))}var Ob=class extends fv{mount(){let{current:e}=this.node;e&&(this.unmount=eh(e,(e,t)=>(Db(this.node,t,`Start`),e=>Db(this.node,e,`End`))))}unmount(){}},kb=class extends fv{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=Hu(_v(this.node.current,`focus`,()=>this.onFocus()),_v(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Ab(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=`onTap`+(n===`End`?``:n),a=r[i];a&&U.postRender(()=>a(t,vv(t)))}var jb=class extends fv{mount(){let{current:e}=this.node;e&&(this.unmount=uh(e,(e,t)=>(Ab(this.node,t,`Start`),(e,{success:t})=>Ab(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};const Mb=new WeakMap,Nb=new WeakMap,Pb=e=>{let t=Mb.get(e.target);t&&t(e)},Fb=e=>{e.forEach(Pb)};function Ib({root:e,...t}){let n=e||document;Nb.has(n)||Nb.set(n,{});let r=Nb.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Fb,{root:e,...t})),r[i]}function Lb(e,t,n){let r=Ib(t);return Mb.set(e,n),r.observe(e),()=>{Mb.delete(e),r.unobserve(e)}}const Rb={some:0,all:1};var zb=class extends fv{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:Rb[r]},o=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)};return Lb(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node,n=[`amount`,`margin`,`root`].some(Bb(e,t));n&&this.startObserver()}unmount(){}};function Bb({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Vb={inView:{Feature:zb},tap:{Feature:jb},focus:{Feature:kb},hover:{Feature:Ob}},Hb={layout:{ProjectionNode:Tb,MeasureLayout:py}},Ub={...gv,...Vb,...Eb,...Hb},Wb=qg(Ub,M_),Gb=({testId:e=`carousel-id`,activeIndex:t=0,extraClassNames:n=``,onSlide:r=()=>{},autoSlide:i,showIndicators:a=!0,continuous:o=!0,interval:s=4e3,prevIcon:c=`fc-arrow-dropdown tw:rotate-90`,nextIcon:l=`fc-arrow-dropdown tw:rotate-270`,showArrows:u=!0,iconExtraClassNames:d=``,carouselItems:m=[]})=>{let[h,g]=(0,f.useState)(t),_=e=>{let t=(e+m.length)%m.length;g(t),r(t,t>h?`right`:`left`)};(0,f.useEffect)(()=>{if(i){let e=setInterval(()=>{o||h<m.length-1?_(h+1):clearInterval(e)},s);return()=>clearInterval(e)}},[i,h,o,s,m.length]),(0,f.useEffect)(()=>{t!==h&&g(t)},[t]);let v=()=>{if(h===0&&!o)return;let e=h-1;e<0&&(e=m.length-1),_(e)},y=()=>{if(h===m.length-1){if(!o)return;_(0)}else _(h+1)},b={type:`spring`,damping:20,stiffness:100},x={initial:e=>({x:e>0?`100%`:`-100%`,opacity:0}),animate:{x:0,opacity:1,transition:b},exit:e=>({x:e>0?`-100%`:`100%`,opacity:0,transition:b})};return(0,p.jsxs)(`div`,{"data-testid":e,className:`tw:flex tw:flex-col tw:items-center tw:justify-center tw:w-full tw:overflow-hidden ${n}`,children:[(0,p.jsxs)(`div`,{className:`tw:flex tw:items-center tw:w-full tw:h-max tw:gap-1`,children:[u&&(0,p.jsx)(Pt,{icon:c,size:`lg`,variant:`no-border`,testId:`carousel-prev`,extraClassNames:`${h===0&&!o?`tw:invisible`:``} ${d} tw:animate-fadeIn`,onClick:v}),(0,p.jsx)(`div`,{className:`tw:h-full tw:w-full tw:overflow-hidden`,children:(0,p.jsx)(Wb.div,{custom:1,initial:`initial`,animate:`animate`,exit:`exit`,variants:x,className:`tw:w-full`,children:m[h]},h)}),u&&(0,p.jsx)(Pt,{icon:l,testId:`carousel-next`,size:`lg`,variant:`no-border`,extraClassNames:`${h===m.length-1&&!o?`tw:invisible`:``} ${d} tw:animate-fadeIn`,onClick:y})]}),a&&(0,p.jsx)(`div`,{className:`tw:flex tw:gap-1 tw:mt-2`,children:m.map((e,t)=>(0,p.jsx)(`div`,{className:`tw:w-2 tw:h-2 tw:rounded-full tw:cursor-pointer ${t===h?`tw:bg-sq-theme-dark`:`tw:bg-sq-darkish-gray`}`,onClick:()=>_(t)},t))})]})};var Kb=Gb;const qb=`tw:flex`,Jb=`tw:ml-1.5 tw:text-sm tw:-mt-0.5`,Yb=`tw:appearance-none tw:border tw:h-3.5 tw:w-3.5 tw:shrink-0 tw:focus:ring-0 tw:focus:ring-offset-0 tw:outline-none tw:focus:outline-none tw:dark:bg-sq-dark-background tw:dark:border-sq-dark-text tw:dark:enabled:hover:bg-sq-dark-background tw:checked:text-white tw:checked:border-sq-text-color tw:checked:enabled:hover:border-sq-theme-dark tw:checked:active:border-sq-theme-darker tw:checked:focus:border-sq-theme-dark tw:disabled:border-sq-disabled-gray tw:dark:disabled:border-sq-fairly-dark-gray tw:dark:checked:focus:bg-sq-dark-background`,Xb=`tw:rounded ${Yb}`,Zb=`tw:rounded-full ${Yb}`,Qb=e=>{let{type:t=`checkbox`,value:n,disabled:r=!1,label:i,onChange:a,onClick:o,onKeyDown:s,checked:c,defaultChecked:l,id:u,name:d,extraClassNames:m=``,extraLabelClassNames:h,testId:g,..._}=e,v=(0,f.useId)(),y=u??`checkbox${v}`,b=at(_);return(0,p.jsxs)(`span`,{className:`tw:flex ${m}`,children:[(0,p.jsx)(`input`,{value:n,type:t,"data-testid":g,name:d,id:y,readOnly:!a,checked:c,defaultChecked:l,className:`${t===`checkbox`?Xb:Zb} ${r?`tw:cursor-not-allowed`:`tw:cursor-pointer`}`,disabled:r,onClick:o,onChange:a,onKeyDown:s,...b}),i&&(0,p.jsx)(`label`,{htmlFor:y,className:`tw:ml-1.5 tw:text-sm tw:-mt-0.5 ${h} ${r?`tw:cursor-not-allowed tw:dark:text-sq-fairly-dark-gray tw:text-sq-fairly-dark-gray`:`tw:cursor-pointer tw:text-sq-text-color tw:dark:text-sq-dark-text`}`,children:i})]})},$b=({isVisible:e,children:t})=>{let n=(0,f.useRef)(null),[r,i]=(0,f.useState)(0);return(0,f.useEffect)(()=>{n.current&&setTimeout(()=>{i((n.current?.scrollHeight??0)+5)},0)},[t]),(0,p.jsx)(Dh,{initial:!1,children:e&&(0,p.jsx)(Wb.div,{initial:{height:0,opacity:0},animate:{height:r,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,damping:20,stiffness:100},children:(0,p.jsx)(`div`,{ref:n,children:t})})})};var ex=$b;const tx=`tw:cursor-pointer tw:border tw:border-gray-700 tw:dark:border-gray-500 tw:shadow-sm tw:focus-visible:outline-none`,nx={sm:`tw:h-5 tw:w-5 tw:rounded`,md:`tw:h-6 tw:w-6 tw:rounded-md`,lg:`tw:h-8 tw:w-8 tw:rounded-lg`},rx=(0,f.forwardRef)(function({color:e,onClick:t,"aria-label":n,size:r=`lg`,extraClassNames:i=``,id:a,testId:o},s){return(0,p.jsx)(`button`,{ref:s,"aria-label":n,className:`tw:cursor-pointer tw:border tw:border-gray-700 tw:dark:border-gray-500 tw:shadow-sm tw:focus-visible:outline-none ${nx[r]} ${i}`,"data-testid":o,id:a,onClick:t,style:{backgroundColor:e},type:`button`})});var ix=rx;const ax=[`tw:bg-sq-white tw:dark:bg-sq-dark-background`,`tw:border tw:border-solid tw:rounded-[0.5rem] tw:border-sq-disabled-gray tw:dark:border-gray-500`,`tw:relative tw:z-[1200] tw:min-w-6`,`tw:focus-visible:outline-none tw:outline-none`,`tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out`,`tw:data-[side=top]:animate-slideDownAndFade tw:data-[side=right]:animate-slideLeftAndFade`,`tw:data-[side=bottom]:animate-slideUpAndFade tw:data-[side=left]:animate-slideRightAndFade`,`tw:text-sq-text-color tw:dark:text-sq-text-color-dark`].join(` `);function ox({color:e,label:t,children:n,placement:r=`bottom`,align:i=`start`,extraClassNames:a=``,id:o,testId:s,onOpen:c}){let l=(0,f.useId)(),u=(0,p.jsx)(`label`,{className:`tw:cursor-pointer tw:whitespace-nowrap tw:text-sm tw:text-sq-text-color tw:dark:text-sq-text-color-dark`,htmlFor:l,children:t}),d=(0,p.jsx)(ix,{"aria-label":t,color:e,id:o??l,size:`sm`,onClick:c});return n?(0,p.jsxs)(`div`,{className:`tw:flex tw:items-center tw:gap-2 ${a}`,children:[u,(0,p.jsxs)(mu,{children:[(0,p.jsx)(hu,{asChild:!0,children:d}),(0,p.jsx)(_u,{align:i,className:ax,"data-testid":s,side:r,sideOffset:2,children:n})]})]}):(0,p.jsxs)(`div`,{className:`tw:flex tw:items-center tw:gap-2 ${a}`,children:[(0,p.jsx)(`span`,{className:`tw:cursor-pointer tw:whitespace-nowrap tw:text-sm tw:text-sq-text-color tw:dark:text-sq-text-color-dark`,children:t}),d]})}var sx=ox;const cx=`tw:mt-3 tw:mb-1 tw:flex tw:w-full tw:max-w-md tw:flex-col tw:items-start tw:rounded-3xl tw:border tw:border-sq-tool-btn-border tw:dark:border-gray-500 tw:bg-sq-surface tw:dark:bg-sq-tools-background-dark tw:px-4 tw:py-3 tw:shadow-sm`,lx={normal:`tw:gap-2`,spacious:`tw:gap-3`},ux=`tw:text-xs tw:font-bold tw:uppercase tw:tracking-wide tw:text-sq-theme-dark`,dx=`tw:flex tw:w-full tw:max-w-full tw:flex-wrap tw:items-center tw:justify-end tw:gap-2`,fx=({title:e,children:t,onApply:n,onCancel:r,isApplyDisabled:i=!1,applyLabel:a=`Apply`,cancelLabel:o=`Cancel`,spacing:s=`normal`,extraClassNames:c=``,id:l,testId:u})=>(0,p.jsxs)(`div`,{className:`tw:mt-3 tw:mb-1 tw:flex tw:w-full tw:max-w-md tw:flex-col tw:items-start tw:rounded-3xl tw:border tw:border-sq-tool-btn-border tw:dark:border-gray-500 tw:bg-sq-surface tw:dark:bg-sq-tools-background-dark tw:px-4 tw:py-3 tw:shadow-sm ${lx[s]} ${c}`,"data-testid":u,id:l,children:[(0,p.jsx)(`span`,{className:`tw:text-xs tw:font-bold tw:uppercase tw:tracking-wide tw:text-sq-theme-dark`,children:e}),t,(0,p.jsxs)(`div`,{className:`tw:flex tw:w-full tw:max-w-full tw:flex-wrap tw:items-center tw:justify-end tw:gap-2`,children:[r&&(0,p.jsx)(Pt,{label:o,onClick:r,size:`sm`,variant:`outline`}),n&&(0,p.jsx)(Pt,{disabled:i,label:a,onClick:n,size:`sm`,variant:`theme`})]})]});var px=fx,mx=u(bt());const hx=`tw:inline-flex tw:text-sq-theme-link tw:underline tw:underline-offset-2 tw:transition-colors hover:tw:text-sq-theme-dark focus-visible:tw:outline-none focus-visible:tw:ring-2 focus-visible:tw:ring-sq-theme-link focus-visible:tw:ring-offset-2`,gx=``,_x=`tw:text-sq-text-color tw:dark:text-sq-text-color-dark tw:shrink-0`,vx={link:`tw:inline-flex tw:text-sq-theme-link tw:underline tw:underline-offset-2 tw:transition-colors hover:tw:text-sq-theme-dark focus-visible:tw:outline-none focus-visible:tw:ring-2 focus-visible:tw:ring-sq-theme-link focus-visible:tw:ring-offset-2`,icon:``},yx=({variant:e=`link`,label:t,href:n,children:r,extraClassNames:i=``,testId:a})=>(0,p.jsxs)(p.Fragment,{children:[t&&(0,p.jsx)(`span`,{className:`tw:text-sq-text-color tw:dark:text-sq-text-color-dark tw:shrink-0`,children:t}),(0,p.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener`,className:(0,mx.default)(vx[e],i),"data-testid":a,children:r})]});var bx=yx;function xx(e,t){if(typeof e==`function`)return e(t);typeof e==`object`&&e&&`current`in e&&(e.current=t)}function Sx(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=xx(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&typeof n==`function`?n():xx(e,null)}),t.clear()}}}function Cx(...e){return(0,f.useCallback)(Sx(...e),e)}const wx=(e,t)=>{let n;return typeof e==`number`&&e>0&&(n={width:`${e}px`}),typeof t==`number`&&t>0&&(n||={},n.height=`${t}px`),n},Tx=`tw:border-sq-danger`,Ex=[`tw:border-sq-disabled-gray`,`tw:dark:border-sq-dark-disabled-gray`,`tw:hover:border-sq-theme-dark`,`tw:dark:hover:border-sq-theme-dark-dark`,`tw:dark:focus:border-sq-theme-dark-dark`,`tw:dark:active:border-sq-theme-darker`,`tw:focus:border-sq-theme-dark`,`tw:active:border-sq-theme-dark`].join(` `),Dx=`tw:h-8.5 tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:disabled:pointer-events-none tw:disabled:bg-sq-light-gray tw:disabled:dark:bg-sq-dark-disabled-gray tw:disabled:cursor-not-allowed tw:p-1 tw:border-solid tw:border tw:placeholder-gray-400! tw:dark:placeholder-sq-dark-text/30! specTextField`,Ox=`tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-dark-text/30`,kx=`tw:text-sq-text-color tw:disabled:text-sq-darkish-gray`,Ax={sm:`tw:text-sm`,lg:`tw:text-xl`},jx=(0,f.forwardRef)((e,t)=>{let{readonly:n=!1,disabled:r=!1,onChange:i,onPaste:a,onKeyUp:o,onFocus:s,onBlur:c,onKeyDown:l,id:u,name:d,size:m=`sm`,value:h,placeholder:g,extraClassNames:_,testId:v,type:y=`text`,inputGroup:b,step:x,showError:S,errorText:C,min:w,max:T,maxLength:E,minLength:D,required:O=!1,autoComplete:k=`off`,inputWidth:A=void 0,inputHeight:j=void 0,autoFocus:M=!1,...N}=e,P=(0,f.useRef)(null),ee=Cx(t,P),[F,I]=(0,f.useState)(null),L=at(N),R=(0,f.useRef)(M);(0,f.useEffect)(()=>{R.current&&setTimeout(()=>{P.current?.focus()},0)},[]),(0,f.useEffect)(()=>{let e=P.current;e&&y!==`number`&&y!==`email`&&e.setSelectionRange(F,F)},[t,F,h,y]);let z=e=>{I(e.target.selectionStart),i&&i(e)},B=()=>y===`number`?w===void 0?!0:w%Number(x??1)===0:!1,te=e=>{if(B()){let t=e.currentTarget,n=t.value;t.defaultValue=``,t.value=t.validity.valid&&h!=null?`${h}`:n}c?.(e)};(0,f.useEffect)(()=>{let e=P.current;y===`number`&&h!=null&&h!==e?.value&&e&&(e.value=`${h}`)},[h,y]);let ne=`tw:rounded-md`;b===`left`?ne=`tw:rounded-l-md tw:border-r-0 tw:focus:border-r tw:active:border-r`:b===`right`&&(ne=`tw:rounded-r-md tw:border-l-0 tw:focus:border-l tw:active:border-l`);let re=`tw:h-8.5 tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:disabled:pointer-events-none tw:disabled:bg-sq-light-gray tw:disabled:dark:bg-sq-dark-disabled-gray tw:disabled:cursor-not-allowed tw:p-1 tw:border-solid tw:border tw:placeholder-gray-400! tw:dark:placeholder-sq-dark-text/30! specTextField ${Ax[m]} ${_} tw:text-sq-text-color tw:disabled:text-sq-darkish-gray tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-dark-text/30 ${ne} ${S?`tw:border-sq-danger`:Ex} `,ie=wx(A,j)?{style:wx(A,j)}:{},V={};E&&(V.maxLength=E),D&&(V.minLength=D);let ae=y===`number`?{defaultValue:h}:{value:h};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`input`,{ref:ee,"data-testid":v,name:d,id:u,type:y,...ae,className:re,placeholder:g,disabled:r,readOnly:n,autoComplete:k,onChange:z,onPaste:a,onFocus:s,onBlur:te,onKeyDown:l,onKeyUp:o,step:x,required:O,min:w,max:T,...V,...ie,...L}),C&&S&&(0,p.jsx)(`div`,{className:`tw:text-sq-danger tw:text-xs tw:mt-1`,children:C})]})});jx.displayName=`TextField`;const Mx=`tw:flex tw:outline-none tw:rounded-md tw:w-full tw:relative tw:flex-wrap`,Nx=`tw:border-sq-danger`,Px=[`tw:border-sq-disabled-gray`,`tw:dark:border-sq-dark-disabled-gray`,`tw:dark:focus:border-sq-theme-darker`,`tw:dark:active:border-sq-theme-darker`,`tw:focus:border-sq-theme-dark`,`tw:active:border-sq-theme-dark`].join(` `),Fx=`tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:p-1 tw:border-solid tw:border`,Ix=`tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-disabled-gray`,Lx=`tw:text-sq-text-color tw:disabled:text-sq-darkish-gray`,Rx=(0,f.forwardRef)((e,t)=>{let{readonly:n=!1,onChange:r,onKeyUp:i,onFocus:a,onBlur:o,onKeyDown:s,name:c,value:l,placeholder:u,append:d=[],extraClassNames:m=``,id:h,testId:g,showError:_,required:v,autoComplete:y,autoFocus:b,disabled:x,type:S,step:C,min:w,max:T,field:E,maxLength:D,minLength:O,inputGroup:k,...A}=e,j=at(A),M=`tw:flex tw:outline-none tw:rounded-md tw:w-full tw:relative tw:flex-wrap ${m}`,N=d.filter(Boolean),P=k??(N.length>0?`left`:void 0),ee=P===`left`?`tw:rounded-l-md tw:rounded-r-none`:P===`right`?`tw:rounded-r-md tw:rounded-l-none`:`tw:rounded-md`,F=`tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:p-1 tw:border-solid tw:border ${m} tw:text-sq-text-color tw:disabled:text-sq-darkish-gray tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-disabled-gray ${ee} ${_?`tw:border-sq-danger`:Px} `,I=(0,f.isValidElement)(E)&&typeof E.type!=`string`,L=I?(0,f.cloneElement)(E,{inputGroup:P}):E;return(0,p.jsxs)(`div`,{id:`input-group-${h}`,className:M,children:[E?(0,p.jsx)(`div`,{"data-testid":g,className:`tw:flex tw:flex-1 tw:cursor-pointer tw:active:z-50 ${F}`,children:L}):(0,p.jsx)(jx,{testId:g,readonly:n,onChange:r,onKeyUp:i,onFocus:a,onBlur:o,onKeyDown:s,name:c,ref:t,showError:_,value:l,required:v,placeholder:u,autoComplete:y,autoFocus:b,id:h,type:S,disabled:x,step:C,min:w,max:T,maxLength:D,minLength:O,inputGroup:P,extraClassNames:`tw:flex tw:flex-1 tw:w-full tw:focus:z-30 ${m}`,...j}),N.map((e,t)=>e?.variant===`button`?(0,p.jsx)(Pt,{extraClassNames:`$
59
59
  index ? 'tw:-ml-px' : 'tw:ml-0'
60
60
  } tw:focus:z-40 tw:focus:border tw:rounded-none tw:last:rounded-r-md`,...e.buttonProps},t):(0,p.jsx)(`div`,{className:`${Px} ${t?`tw:-ml-px`:`tw:ml-0`} tw:flex tw:items-center tw:justify-center tw:rounded-none tw:last:rounded-r-md tw:active:z-30 tw:active:border tw:border`,children:e?.element},t))]})});Rx.displayName=`InputGroup`;var zx=u(es(),1),Bx=u(Na(),1),Vx=`Dialog`,[Hx,Ux]=g(Vx),[Wx,Gx]=Hx(Vx),Kx=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=f.useRef(null),c=f.useRef(null),[l,u]=M({prop:r,defaultProp:i??!1,onChange:a,caller:Vx});return(0,p.jsx)(Wx,{scope:t,triggerRef:s,contentRef:c,contentId:V(),titleId:V(),descriptionId:V(),open:l,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Kx.displayName=Vx;var qx=`DialogTrigger`,Jx=f.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Gx(qx,n),a=b(t,i.triggerRef);return(0,p.jsx)(I.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":mS(i.open),...r,ref:a,onClick:k(e.onClick,i.onOpenToggle)})});Jx.displayName=qx;var Yx=`DialogPortal`,[Xx,Zx]=Hx(Yx,{forceMount:void 0}),Qx=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Gx(Yx,t);return(0,p.jsx)(Xx,{scope:t,forceMount:n,children:f.Children.map(r,e=>(0,p.jsx)(z,{present:n||a.open,children:(0,p.jsx)(da,{asChild:!0,container:i,children:e})}))})};Qx.displayName=Yx;var $x=`DialogOverlay`,eS=f.forwardRef((e,t)=>{let n=Zx($x,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Gx($x,e.__scopeDialog);return a.modal?(0,p.jsx)(z,{present:r||a.open,children:(0,p.jsx)(nS,{...i,ref:t})}):null});eS.displayName=$x;var tS=x(`DialogOverlay.RemoveScroll`),nS=f.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Gx($x,n);return(0,p.jsx)(zx.RemoveScroll,{as:tS,allowPinchZoom:!0,shards:[i.contentRef],children:(0,p.jsx)(I.div,{"data-state":mS(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),rS=`DialogContent`,iS=f.forwardRef((e,t)=>{let n=Zx(rS,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Gx(rS,e.__scopeDialog);return(0,p.jsx)(z,{present:r||a.open,children:a.modal?(0,p.jsx)(aS,{...i,ref:t}):(0,p.jsx)(oS,{...i,ref:t})})});iS.displayName=rS;var aS=f.forwardRef((e,t)=>{let n=Gx(rS,e.__scopeDialog),r=f.useRef(null),i=b(t,n.contentRef,r);return f.useEffect(()=>{let e=r.current;if(e)return(0,Bx.hideOthers)(e)},[]),(0,p.jsx)(sS,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:k(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:k(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;r&&e.preventDefault()}),onFocusOutside:k(e.onFocusOutside,e=>e.preventDefault())})}),oS=f.forwardRef((e,t)=>{let n=Gx(rS,e.__scopeDialog),r=f.useRef(!1),i=f.useRef(!1);return(0,p.jsx)(sS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target,o=n.triggerRef.current?.contains(a);o&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),sS=f.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Gx(rS,n),c=f.useRef(null),l=b(t,c);return tn(),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(cn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,p.jsx)(qt,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":mS(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(vS,{titleId:s.titleId}),(0,p.jsx)(bS,{contentRef:c,descriptionId:s.descriptionId})]})]})}),cS=`DialogTitle`,lS=f.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Gx(cS,n);return(0,p.jsx)(I.h2,{id:i.titleId,...r,ref:t})});lS.displayName=cS;var uS=`DialogDescription`,dS=f.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Gx(uS,n);return(0,p.jsx)(I.p,{id:i.descriptionId,...r,ref:t})});dS.displayName=uS;var fS=`DialogClose`,pS=f.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Gx(fS,n);return(0,p.jsx)(I.button,{type:`button`,...r,ref:t,onClick:k(e.onClick,()=>i.onOpenChange(!1))})});pS.displayName=fS;function mS(e){return e?`open`:`closed`}var hS=`DialogTitleWarning`,[gS,_S]=h(hS,{contentName:rS,titleName:cS,docsSlug:`dialog`}),vS=({titleId:e})=>{let t=_S(hS),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
61
61