@3sc/common-component 0.0.356 → 0.0.358

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -299,7 +299,7 @@ const theme2 = createTheme({ palette: {
299
299
  ${p}px !important;
300
300
  top: ${u}px !important;
301
301
  }
302
- `),()=>{document.head.removeChild(h)}},[t]),y.jsx(G5,{isPresent:t,childRef:o,sizeRef:i,children:C.cloneElement(e,{ref:o})})}const X5=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:a,anchorX:l})=>{const c=Sd(Z5),u=D.useId(),d=D.useCallback(p=>{c.set(p,!0);for(const h of c.values())if(!h)return;r&&r()},[c,r]),f=D.useMemo(()=>({id:u,initial:t,isPresent:n,custom:o,onExitComplete:d,register:p=>(c.set(p,!1),()=>c.delete(p))}),i?[Math.random(),d]:[n,d]);return D.useMemo(()=>{c.forEach((p,h)=>c.set(h,!1))},[n]),C.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),a==="popLayout"&&(e=y.jsx(K5,{isPresent:n,anchorX:l,children:e})),y.jsx(Ll.Provider,{value:f,children:e})};function Z5(){return new Map}function ey(e=!0){const t=D.useContext(Ll);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=D.useId();D.useEffect(()=>{if(e)return o(i)},[e]);const a=D.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const Vl=e=>e.key||"";function ty(e){const t=[];return D.Children.forEach(e,n=>{D.isValidElement(n)&&t.push(n)}),t}const J5=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:a=!1,anchorX:l="left"})=>{const[c,u]=ey(a),d=D.useMemo(()=>ty(e),[e]),f=a&&!c?[]:d.map(Vl),p=D.useRef(!0),h=D.useRef(d),g=Sd(()=>new Map),[m,v]=D.useState(d),[x,w]=D.useState(d);Qg(()=>{p.current=!1,h.current=d;for(let b=0;b<x.length;b++){const O=Vl(x[b]);f.includes(O)?g.delete(O):g.get(O)!==!0&&g.set(O,!1)}},[x,f.length,f.join("-")]);const T=[];if(d!==m){let b=[...d];for(let O=0;O<x.length;O++){const E=x[O],M=Vl(E);f.includes(M)||(b.splice(O,0,E),T.push(E))}return i==="wait"&&T.length&&(b=T),w(ty(b)),v(d),null}process.env.NODE_ENV!=="production"&&i==="wait"&&x.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.`);const{forceRender:k}=D.useContext(Cd);return y.jsx(y.Fragment,{children:x.map(b=>{const O=Vl(b),E=a&&!c?!1:d===x||f.includes(O),M=()=>{if(g.has(O))g.set(O,!0);else return;let I=!0;g.forEach(N=>{N||(I=!1)}),I&&(k==null||k(),w(h.current),a&&(u==null||u()),r&&r())};return y.jsx(X5,{isPresent:E,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,onExitComplete:E?void 0:M,anchorX:l,children:b},O)})})};function Od(e,t){e.indexOf(t)===-1&&e.push(t)}function Ed(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let ds=()=>{},Wr=()=>{};process.env.NODE_ENV!=="production"&&(ds=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Wr=(e,t)=>{if(!e)throw new Error(t)});const Pd={useManualTiming:!1};function Md(e){let t;return()=>(t===void 0&&(t=e()),t)}const Bn=e=>e,Mi=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Rd{constructor(){this.subscriptions=[]}add(t){return Od(this.subscriptions,t),()=>Ed(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const a=this.subscriptions[i];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const qn=e=>e*1e3,ir=e=>e/1e3;function ny(e,t){return t?e*(1e3/t):0}const ry=new Set;function Wl(e,t,n){e||ry.has(t)||(console.warn(t),ry.add(t))}const Q5=Md(()=>window.ScrollTimeline!==void 0);class eI{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(o=>{if(Q5()&&o.attachTimeline)return o.attachTimeline(t);if(typeof n=="function")return n(o)});return()=>{r.forEach((o,i)=>{o&&o(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class tI extends eI{then(t,n){return this.finished.finally(t).then(()=>{})}}const oy={value:null},Dd=e=>Array.isArray(e)&&typeof e[0]=="number",nI={};function rI(e,t){const n=Md(e);return()=>nI[t]??n()}const Ri=rI(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),sy=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=e(i/(o-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Di=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Id={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Di([0,.65,.55,1]),circOut:Di([.55,0,1,.45]),backIn:Di([.31,.01,.66,-.59]),backOut:Di([.33,1.53,.69,.99])};function iy(e,t){if(e)return typeof e=="function"&&Ri()?sy(e,t):Dd(e)?Di(e):Array.isArray(e)?e.map(n=>iy(n,t)||Id.easeOut):Id[e]}function oI(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:a="loop",ease:l="easeInOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=iy(l,o);return Array.isArray(f)&&(d.easing=f),e.animate(d,{delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal",pseudoElement:u})}function Ad(e){return typeof e=="function"&&"applyToOptions"in e}function Nd(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const zl=2e4;function jd(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<zl;)t+=n,r=e.next(t);return t>=zl?1/0:t}function sI(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(jd(r),zl);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:ir(o)}}function ay(e){return!!(typeof e=="function"&&Ri()||!e||typeof e=="string"&&(e in Id||Ri())||Dd(e)||Array.isArray(e)&&e.every(ay))}function ly(e,t){e.timeline=t,e.onfinish=null}const Ul=["read","resolveKeyframes","update","preRender","render","postRender"];function iI(e,t){let n=new Set,r=new Set,o=!1,i=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(f){a.has(f)&&(d.schedule(f),e()),c++,f(l)}const d={schedule:(f,p=!1,h=!1)=>{const m=h&&o?n:r;return p&&a.add(f),m.has(f)||m.add(f),f},cancel:f=>{r.delete(f),a.delete(f)},process:f=>{if(l=f,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(u),t&&oy.value&&oy.value.frameloop[t].push(c),c=0,n.clear(),o=!1,i&&(i=!1,d.process(f))}};return d}const aI=40;function cy(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Ul.reduce((x,w)=>(x[w]=iI(i,t?w:void 0),x),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:p}=a,h=()=>{const x=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(x-o.timestamp,aI),1),o.timestamp=x,o.isProcessing=!0,l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),p.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,o.isProcessing||e(h)};return{schedule:Ul.reduce((x,w)=>{const T=a[w];return x[w]=(k,b=!1,O=!1)=>(n||g(),T.schedule(k,b,O)),x},{}),cancel:x=>{for(let w=0;w<Ul.length;w++)a[Ul[w]].cancel(x)},state:o,steps:a}}const{schedule:$d}=cy(queueMicrotask,!1),{schedule:wt,cancel:zr,state:qt,steps:Fd}=cy(typeof requestAnimationFrame<"u"?requestAnimationFrame:Bn,!0);let Hl;function lI(){Hl=void 0}const ar={now:()=>(Hl===void 0&&ar.set(qt.isProcessing||Pd.useManualTiming?qt.timestamp:performance.now()),Hl),set:e=>{Hl=e,queueMicrotask(lI)}},Yn={x:!1,y:!1};function uy(){return Yn.x||Yn.y}function cI(e){return e==="x"||e==="y"?Yn[e]?null:(Yn[e]=!0,()=>{Yn[e]=!1}):Yn.x||Yn.y?null:(Yn.x=Yn.y=!0,()=>{Yn.x=Yn.y=!1})}function uI(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function dy(e,t){const n=uI(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function fy(e){return!(e.pointerType==="touch"||uy())}function dI(e,t,n={}){const[r,o,i]=dy(e,n),a=l=>{if(!fy(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{fy(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,o)};return r.forEach(l=>{l.addEventListener("pointerenter",a,o)}),i}const py=(e,t)=>t?e===t?!0:py(e,t.parentElement):!1,_d=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,fI=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pI(e){return fI.has(e.tagName)||e.tabIndex!==-1}const Ii=new WeakSet;function hy(e){return t=>{t.key==="Enter"&&e(t)}}function Bd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const hI=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=hy(()=>{if(Ii.has(n))return;Bd(n,"down");const o=hy(()=>{Bd(n,"up")}),i=()=>Bd(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function my(e){return _d(e)&&!uy()}function mI(e,t,n={}){const[r,o,i]=dy(e,n),a=l=>{const c=l.currentTarget;if(!my(l)||Ii.has(c))return;Ii.add(c);const u=t(c,l),d=(h,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",p),!(!my(h)||!Ii.has(c))&&(Ii.delete(c),typeof u=="function"&&u(h,{success:g}))},f=h=>{d(h,c===window||c===document||n.useGlobalTarget||py(c,h.target))},p=h=>{d(h,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",p,o)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,o),l instanceof HTMLElement&&(l.addEventListener("focus",u=>hI(u,o)),!pI(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}const gy=30,gI=e=>!isNaN(parseFloat(e));class yI{constructor(t,n={}){this.version="12.7.3",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{const i=ar.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ar.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=gI(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Wl(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Rd);const r=this.events[t].add(n);return t==="change"?()=>{r(),wt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ar.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>gy)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,gy);return ny(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ai(e,t){return new yI(e,t)}const yy=D.createContext({strict:!1}),by={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"]},fs={};for(const e in by)fs[e]={isEnabled:t=>by[e].some(n=>!!t[n])};function bI(e){for(const t in e)fs[t]={...fs[t],...e[t]}}const vI=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"]);function ql(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||vI.has(e)}let vy=e=>!ql(e);function xI(e){e&&(vy=t=>t.startsWith("on")?!ql(t):e(t))}try{xI(require("@emotion/is-prop-valid").default)}catch{}function wI(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(vy(o)||n===!0&&ql(o)||!t&&!ql(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function CI(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Wl(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const Yl=D.createContext({});function Gl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ni(e){return typeof e=="string"||Array.isArray(e)}const Ld=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Vd=["initial",...Ld];function Kl(e){return Gl(e.animate)||Vd.some(t=>Ni(e[t]))}function xy(e){return!!(Kl(e)||e.variants)}function SI(e,t){if(Kl(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ni(n)?n:void 0,animate:Ni(r)?r:void 0}}return e.inherit!==!1?t:{}}function TI(e){const{initial:t,animate:n}=SI(e,D.useContext(Yl));return D.useMemo(()=>({initial:t,animate:n}),[wy(t),wy(n)])}function wy(e){return Array.isArray(e)?e.join(" "):e}const kI=Symbol.for("motionComponentSymbol");function ps(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function OI(e,t,n){return D.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):ps(n)&&(n.current=r))},[t])}const Wd=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Cy="data-"+Wd("framerAppearId"),Sy=D.createContext({});function EI(e,t,n,r,o){var m,v;const{visualElement:i}=D.useContext(Yl),a=D.useContext(yy),l=D.useContext(Ll),c=D.useContext(kd).reducedMotion,u=D.useRef(null);r=r||a.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=D.useContext(Sy);d&&!d.projection&&o&&(d.type==="html"||d.type==="svg")&&PI(u.current,n,o,f);const p=D.useRef(!1);D.useInsertionEffect(()=>{d&&p.current&&d.update(n,l)});const h=n[Cy],g=D.useRef(!!h&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,h))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,h)));return Qg(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),$d.render(d.render),g.current&&d.animationState&&d.animationState.animateChanges())}),D.useEffect(()=>{d&&(!g.current&&d.animationState&&d.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)==null||x.call(window,h)}),g.current=!1))}),d}function PI(e,t,n,r){const{layoutId:o,layout:i,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ty(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!a||l&&ps(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function Ty(e){if(e)return e.options.allowProjection!==!1?e.projection:Ty(e.parent)}function MI({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&bI(e);function i(l,c){let u;const d={...D.useContext(kd),...l,layoutId:RI(l)},{isStatic:f}=d,p=TI(l),h=r(l,f);if(!f&&Td){DI(d,e);const g=II(d);u=g.MeasureLayout,p.visualElement=EI(o,h,d,t,g.ProjectionNode)}return y.jsxs(Yl.Provider,{value:p,children:[u&&p.visualElement?y.jsx(u,{visualElement:p.visualElement,...d}):null,n(o,l,OI(h,p.visualElement,c),h,f,p.visualElement)]})}i.displayName=`motion.${typeof o=="string"?o:`create(${o.displayName??o.name??""})`}`;const a=D.forwardRef(i);return a[kI]=o,a}function RI({layoutId:e}){const t=D.useContext(Cd).id;return t&&e!==void 0?t+"-"+e:e}function DI(e,t){const n=D.useContext(yy).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?ds(!1,r):Wr(!1,r)}}function II(e){const{drag:t,layout:n}=fs;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const ky=e=>t=>typeof t=="string"&&t.startsWith(e),zd=ky("--"),AI=ky("var(--"),Ud=e=>AI(e)?NI.test(e.split("/*")[0].trim()):!1,NI=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ji={};function jI(e){for(const t in e)ji[t]=e[t],zd(t)&&(ji[t].isCSSVariable=!0)}const hs=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],co=new Set(hs);function Oy(e,{layout:t,layoutId:n}){return co.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ji[e]||e==="opacity")}const Xt=e=>!!(e&&e.getVelocity),Ey=(e,t)=>t&&typeof e=="number"?t.transform(e):e,kr=(e,t,n)=>n>t?t:n<e?e:n,ms={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},$i={...ms,transform:e=>kr(0,1,e)},Xl={...ms,default:1},Fi=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ur=Fi("deg"),lr=Fi("%"),_e=Fi("px"),$I=Fi("vh"),FI=Fi("vw"),Py={...lr,parse:e=>lr.parse(e)/100,transform:e=>lr.transform(e*100)},_I={borderWidth:_e,borderTopWidth:_e,borderRightWidth:_e,borderBottomWidth:_e,borderLeftWidth:_e,borderRadius:_e,radius:_e,borderTopLeftRadius:_e,borderTopRightRadius:_e,borderBottomRightRadius:_e,borderBottomLeftRadius:_e,width:_e,maxWidth:_e,height:_e,maxHeight:_e,top:_e,right:_e,bottom:_e,left:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,backgroundPositionX:_e,backgroundPositionY:_e},BI={rotate:Ur,rotateX:Ur,rotateY:Ur,rotateZ:Ur,scale:Xl,scaleX:Xl,scaleY:Xl,scaleZ:Xl,skew:Ur,skewX:Ur,skewY:Ur,distance:_e,translateX:_e,translateY:_e,translateZ:_e,x:_e,y:_e,z:_e,perspective:_e,transformPerspective:_e,opacity:$i,originX:Py,originY:Py,originZ:_e},My={...ms,transform:Math.round},Hd={..._I,...BI,zIndex:My,size:_e,fillOpacity:$i,strokeOpacity:$i,numOctaves:My},LI={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},VI=hs.length;function WI(e,t,n){let r="",o=!0;for(let i=0;i<VI;i++){const a=hs[i],l=e[a];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(a.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=Ey(l,Hd[a]);if(!c){o=!1;const d=LI[a]||a;r+=`${d}(${u}) `}n&&(t[a]=u)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function qd(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let a=!1,l=!1;for(const c in t){const u=t[c];if(co.has(c)){a=!0;continue}else if(zd(c)){o[c]=u;continue}else{const d=Ey(u,Hd[c]);c.startsWith("origin")?(l=!0,i[c]=d):r[c]=d}}if(t.transform||(a||n?r.transform=WI(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=i;r.transformOrigin=`${c} ${u} ${d}`}}const Yd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ry(e,t,n){for(const r in t)!Xt(t[r])&&!Oy(r,n)&&(e[r]=t[r])}function zI({transformTemplate:e},t){return D.useMemo(()=>{const n=Yd();return qd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function UI(e,t){const n=e.style||{},r={};return Ry(r,n,e),Object.assign(r,zI(e,t)),r}function HI(e,t){const n={},r=UI(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 qI=["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 Gd(e){return typeof e!="string"||e.includes("-")?!1:!!(qI.indexOf(e)>-1||/[A-Z]/u.test(e))}const YI={offset:"stroke-dashoffset",array:"stroke-dasharray"},GI={offset:"strokeDashoffset",array:"strokeDasharray"};function KI(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?YI:GI;e[i.offset]=_e.transform(-r);const a=_e.transform(t),l=_e.transform(n);e[i.array]=`${a} ${l}`}function Dy(e,t,n){return typeof e=="string"?e:_e.transform(t+n*e)}function XI(e,t,n){const r=Dy(t,e.x,e.width),o=Dy(n,e.y,e.height);return`${r} ${o}`}function Kd(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:a,pathSpacing:l=1,pathOffset:c=0,...u},d,f){if(qd(e,u,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:h,dimensions:g}=e;p.transform&&(g&&(h.transform=p.transform),delete p.transform),g&&(o!==void 0||i!==void 0||h.transform)&&(h.transformOrigin=XI(g,o!==void 0?o:.5,i!==void 0?i:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),a!==void 0&&KI(p,a,l,c,!1)}const Iy=()=>({...Yd(),attrs:{}}),Xd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ZI(e,t,n,r){const o=D.useMemo(()=>{const i=Iy();return Kd(i,t,Xd(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Ry(i,e.style,e),o.style={...i,...o.style}}return o}function JI(e=!1){return(n,r,o,{latestValues:i},a)=>{const c=(Gd(n)?ZI:HI)(r,i,a,n),u=wI(r,typeof n=="string",e),d=n!==D.Fragment?{...u,...c,ref:o}:{},{children:f}=r,p=D.useMemo(()=>Xt(f)?f.get():f,[f]);return D.createElement(n,{...d,children:p})}}function Ay(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Zd(e,t,n,r){if(typeof t=="function"){const[o,i]=Ay(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=Ay(r);t=t(n!==void 0?n:e.custom,o,i)}return t}const Jd=e=>Array.isArray(e),QI=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),eA=e=>Jd(e)?e[e.length-1]||0:e;function Zl(e){const t=Xt(e)?e.get():e;return QI(t)?t.toValue():t}function tA({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,i){const a={latestValues:nA(r,o,i,e),renderState:t()};return n&&(a.onMount=l=>n({props:r,current:l,...a}),a.onUpdate=l=>n(l)),a}const Ny=e=>(t,n)=>{const r=D.useContext(Yl),o=D.useContext(Ll),i=()=>tA(e,t,r,o);return n?i():Sd(i)};function nA(e,t,n,r){const o={},i=r(e,{});for(const p in i)o[p]=Zl(i[p]);let{initial:a,animate:l}=e;const c=Kl(e),u=xy(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!Gl(f)){const p=Array.isArray(f)?f:[f];for(let h=0;h<p.length;h++){const g=Zd(e,p[h]);if(g){const{transitionEnd:m,transition:v,...x}=g;for(const w in x){let T=x[w];if(Array.isArray(T)){const k=d?T.length-1:0;T=T[k]}T!==null&&(o[w]=T)}for(const w in m)o[w]=m[w]}}}return o}function Qd(e,t,n){var i;const{style:r}=e,o={};for(const a in r)(Xt(r[a])||t.style&&Xt(t.style[a])||Oy(a,e)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(o[a]=r[a]);return o}const rA={useVisualState:Ny({scrapeMotionValuesFromProps:Qd,createRenderState:Yd})};function jy(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function $y(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const Fy=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 _y(e,t,n,r){$y(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Fy.has(o)?o:Wd(o),t.attrs[o])}function By(e,t,n){const r=Qd(e,t,n);for(const o in e)if(Xt(e[o])||Xt(t[o])){const i=hs.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const Ly=["x","y","width","height","cx","cy","r"],oA={useVisualState:Ny({scrapeMotionValuesFromProps:By,createRenderState:Iy,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in o)if(co.has(l)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let l=0;l<Ly.length;l++){const c=Ly[l];e[c]!==t[c]&&(a=!0)}a&&wt.read(()=>{jy(n,r),wt.render(()=>{Kd(r,o,Xd(n.tagName),e.transformTemplate),_y(n,r)})})}})};function sA(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const a={...Gd(r)?oA:rA,preloadedFeatures:e,useRender:JI(o),createVisualElement:t,Component:r};return MI(a)}}function _i(e,t,n){const r=e.getProps();return Zd(r,t,n!==void 0?n:r.custom,e)}const Vy=new Set(["width","height","top","left","right","bottom",...hs]);function iA(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ai(n))}function aA(e,t){const n=_i(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const a in i){const l=eA(i[a]);iA(e,a,l)}}function lA(e){return!!(Xt(e)&&e.add)}function ef(e,t){const n=e.getValue("willChange");if(lA(n))return n.add(t);if(!n&&Pd.WillChange){const r=new Pd.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Wy(e){return e.props[Cy]}const zy=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,cA=1e-7,uA=12;function dA(e,t,n,r,o){let i,a,l=0;do a=t+(n-t)/2,i=zy(a,r,o)-e,i>0?n=a:t=a;while(Math.abs(i)>cA&&++l<uA);return a}function Bi(e,t,n,r){if(e===t&&n===r)return Bn;const o=i=>dA(i,0,1,e,n);return i=>i===0||i===1?i:zy(o(i),t,r)}const Uy=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Hy=e=>t=>1-e(1-t),qy=Bi(.33,1.53,.69,.99),tf=Hy(qy),Yy=Uy(tf),Gy=e=>(e*=2)<1?.5*tf(e):.5*(2-Math.pow(2,-10*(e-1))),nf=e=>1-Math.sin(Math.acos(e)),Ky=Hy(nf),Xy=Uy(nf),Zy=e=>/^0[^.\s]+$/u.test(e);function fA(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Zy(e):!0}const Li=e=>Math.round(e*1e5)/1e5,rf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function pA(e){return e==null}const hA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,of=(e,t)=>n=>!!(typeof n=="string"&&hA.test(n)&&n.startsWith(e)||t&&!pA(n)&&Object.prototype.hasOwnProperty.call(n,t)),Jy=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,a,l]=r.match(rf);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},mA=e=>kr(0,255,e),sf={...ms,transform:e=>Math.round(mA(e))},uo={test:of("rgb","red"),parse:Jy("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+sf.transform(e)+", "+sf.transform(t)+", "+sf.transform(n)+", "+Li($i.transform(r))+")"};function gA(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const af={test:of("#"),parse:gA,transform:uo.transform},gs={test:of("hsl","hue"),parse:Jy("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+lr.transform(Li(t))+", "+lr.transform(Li(n))+", "+Li($i.transform(r))+")"},Zt={test:e=>uo.test(e)||af.test(e)||gs.test(e),parse:e=>uo.test(e)?uo.parse(e):gs.test(e)?gs.parse(e):af.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?uo.transform(e):gs.transform(e)},yA=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function bA(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(rf))==null?void 0:t.length)||0)+(((n=e.match(yA))==null?void 0:n.length)||0)>0}const Qy="number",eb="color",vA="var",xA="var(",tb="${}",wA=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Vi(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const l=t.replace(wA,c=>(Zt.test(c)?(r.color.push(i),o.push(eb),n.push(Zt.parse(c))):c.startsWith(xA)?(r.var.push(i),o.push(vA),n.push(c)):(r.number.push(i),o.push(Qy),n.push(parseFloat(c))),++i,tb)).split(tb);return{values:n,split:l,indexes:r,types:o}}function nb(e){return Vi(e).values}function rb(e){const{split:t,types:n}=Vi(e),r=t.length;return o=>{let i="";for(let a=0;a<r;a++)if(i+=t[a],o[a]!==void 0){const l=n[a];l===Qy?i+=Li(o[a]):l===eb?i+=Zt.transform(o[a]):i+=o[a]}return i}}const CA=e=>typeof e=="number"?0:e;function SA(e){const t=nb(e);return rb(e)(t.map(CA))}const Hr={test:bA,parse:nb,createTransformer:rb,getAnimatableNone:SA},TA=new Set(["brightness","contrast","saturate","opacity"]);function kA(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(rf)||[];if(!r)return e;const o=n.replace(r,"");let i=TA.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const OA=/\b([a-z-]*)\(.*?\)/gu,lf={...Hr,getAnimatableNone:e=>{const t=e.match(OA);return t?t.map(kA).join(" "):e}},EA={...Hd,color:Zt,backgroundColor:Zt,outlineColor:Zt,fill:Zt,stroke:Zt,borderColor:Zt,borderTopColor:Zt,borderRightColor:Zt,borderBottomColor:Zt,borderLeftColor:Zt,filter:lf,WebkitFilter:lf},ob=e=>EA[e];function sb(e,t){let n=ob(e);return n!==lf&&(n=Hr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const PA=new Set(["auto","none","0"]);function MA(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!PA.has(i)&&Vi(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=sb(n,o)}const fo=e=>e*180/Math.PI,cf=e=>{const t=fo(Math.atan2(e[1],e[0]));return uf(t)},RA={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:cf,rotateZ:cf,skewX:e=>fo(Math.atan(e[1])),skewY:e=>fo(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},uf=e=>(e=e%360,e<0&&(e+=360),e),ib=cf,ab=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),lb=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),DA={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ab,scaleY:lb,scale:e=>(ab(e)+lb(e))/2,rotateX:e=>uf(fo(Math.atan2(e[6],e[5]))),rotateY:e=>uf(fo(Math.atan2(-e[2],e[0]))),rotateZ:ib,rotate:ib,skewX:e=>fo(Math.atan(e[4])),skewY:e=>fo(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function cb(e){return e.includes("scale")?1:0}function df(e,t){if(!e||e==="none")return cb(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=DA,o=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=RA,o=l}if(!o)return cb(t);const i=r[t],a=o[1].split(",").map(AA);return typeof i=="function"?i(a):a[i]}const IA=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return df(n,t)};function AA(e){return parseFloat(e.trim())}const ub=e=>e===ms||e===_e,NA=new Set(["x","y","z"]),jA=hs.filter(e=>!NA.has(e));function $A(e){const t=[];return jA.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const ys={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>df(t,"x"),y:(e,{transform:t})=>df(t,"y")};ys.translateX=ys.x,ys.translateY=ys.y;const po=new Set;let ff=!1,pf=!1;function db(){if(pf){const e=Array.from(po).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=$A(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,a])=>{var l;(l=r.getValue(i))==null||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}pf=!1,ff=!1,po.forEach(e=>e.complete()),po.clear()}function fb(){po.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(pf=!0)})}function FA(){fb(),db()}class hf{constructor(t,n,r,o,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(po.add(this),ff||(ff=!0,wt.read(fb),wt.resolveKeyframes(db))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const a=o==null?void 0:o.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),o&&a===void 0&&o.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),po.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,po.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const pb=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),_A=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function BA(e){const t=_A.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const LA=4;function hb(e,t,n=1){Wr(n<=LA,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=BA(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return pb(a)?parseFloat(a):a}return Ud(o)?hb(o,t,n+1):o}const mb=e=>t=>t.test(e),gb=[ms,_e,lr,Ur,FI,$I,{test:e=>e==="auto",parse:e=>e}],yb=e=>gb.find(mb(e));class bb extends hf{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),Ud(u))){const d=hb(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Vy.has(r)||t.length!==2)return;const[o,i]=t,a=yb(o),l=yb(i);if(a!==l)if(ub(a)&&ub(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)fA(t[o])&&r.push(o);r.length&&MA(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ys[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,a=r[i];r[i]=ys[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const vb=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Hr.test(e)||e==="0")&&!e.startsWith("url("));function VA(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function WA(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],a=vb(o,t),l=vb(i,t);return ds(a===l,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!a||!l?!1:VA(e)||(n==="spring"||Ad(n))&&r}const zA=e=>e!==null;function Jl(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(zA),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return!i||r===void 0?o[i]:r}const UA=40;class xb{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ar.now(),this.options={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>UA?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&FA(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=ar.now(),this.hasAttemptedResolve=!0;const{name:r,type:o,velocity:i,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!WA(t,r,o,i))if(a)this.options.duration=0;else{c&&c(Jl(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Et=(e,t,n)=>e+(t-e)*n;function mf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function HA({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,a=0;if(!t)o=i=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;o=mf(c,l,e+1/3),i=mf(c,l,e),a=mf(c,l,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Ql(e,t){return n=>n>0?t:e}const gf=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},qA=[af,uo,gs],YA=e=>qA.find(t=>t.test(e));function wb(e){const t=YA(e);if(ds(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===gs&&(n=HA(n)),n}const Cb=(e,t)=>{const n=wb(e),r=wb(t);if(!n||!r)return Ql(e,t);const o={...n};return i=>(o.red=gf(n.red,r.red,i),o.green=gf(n.green,r.green,i),o.blue=gf(n.blue,r.blue,i),o.alpha=Et(n.alpha,r.alpha,i),uo.transform(o))},GA=(e,t)=>n=>t(e(n)),Wi=(...e)=>e.reduce(GA),yf=new Set(["none","hidden"]);function KA(e,t){return yf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function XA(e,t){return n=>Et(e,t,n)}function bf(e){return typeof e=="number"?XA:typeof e=="string"?Ud(e)?Ql:Zt.test(e)?Cb:QA:Array.isArray(e)?Sb:typeof e=="object"?Zt.test(e)?Cb:ZA:Ql}function Sb(e,t){const n=[...e],r=n.length,o=e.map((i,a)=>bf(i)(i,t[a]));return i=>{for(let a=0;a<r;a++)n[a]=o[a](i);return n}}function ZA(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=bf(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function JA(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],a=e.indexes[i][r[i]],l=e.values[a]??0;n[o]=l,r[i]++}return n}const QA=(e,t)=>{const n=Hr.createTransformer(t),r=Vi(e),o=Vi(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?yf.has(e)&&!o.values.length||yf.has(t)&&!r.values.length?KA(e,t):Wi(Sb(JA(r,o),o.values),n):(ds(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Ql(e,t))};function Tb(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Et(e,t,n):bf(e)(e,t)}const eN=5;function kb(e,t,n){const r=Math.max(t-eN,0);return ny(n-e(r),t-r)}const Pt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ob=.001;function tN({duration:e=Pt.duration,bounce:t=Pt.bounce,velocity:n=Pt.velocity,mass:r=Pt.mass}){let o,i;ds(e<=qn(Pt.maxDuration),"Spring duration must be 10 seconds or less");let a=1-t;a=kr(Pt.minDamping,Pt.maxDamping,a),e=kr(Pt.minDuration,Pt.maxDuration,ir(e)),a<1?(o=u=>{const d=u*a,f=d*e,p=d-n,h=vf(u,a),g=Math.exp(-f);return Ob-p/h*g},i=u=>{const f=u*a*e,p=f*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,g=Math.exp(-f),m=vf(Math.pow(u,2),a);return(-o(u)+Ob>0?-1:1)*((p-h)*g)/m}):(o=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-.001+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=rN(o,i,l);if(e=qn(e),isNaN(c))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const nN=12;function rN(e,t,n){let r=n;for(let o=1;o<nN;o++)r=r-e(r)/t(r);return r}function vf(e,t){return e*Math.sqrt(1-t*t)}const oN=["duration","bounce"],sN=["stiffness","damping","mass"];function Eb(e,t){return t.some(n=>e[n]!==void 0)}function iN(e){let t={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...e};if(!Eb(e,sN)&&Eb(e,oN))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*kr(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Pt.mass,stiffness:o,damping:i}}else{const n=tN(e);t={...t,...n,mass:Pt.mass},t.isResolvedFromDuration=!0}return t}function ec(e=Pt.visualDuration,t=Pt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:f,velocity:p,isResolvedFromDuration:h}=iN({...n,velocity:-ir(n.velocity||0)}),g=p||0,m=u/(2*Math.sqrt(c*d)),v=a-i,x=ir(Math.sqrt(c/d)),w=Math.abs(v)<5;r||(r=w?Pt.restSpeed.granular:Pt.restSpeed.default),o||(o=w?Pt.restDelta.granular:Pt.restDelta.default);let T;if(m<1){const b=vf(x,m);T=O=>{const E=Math.exp(-m*x*O);return a-E*((g+m*x*v)/b*Math.sin(b*O)+v*Math.cos(b*O))}}else if(m===1)T=b=>a-Math.exp(-x*b)*(v+(g+x*v)*b);else{const b=x*Math.sqrt(m*m-1);T=O=>{const E=Math.exp(-m*x*O),M=Math.min(b*O,300);return a-E*((g+m*x*v)*Math.sinh(M)+b*v*Math.cosh(M))/b}}const k={calculatedDuration:h&&f||null,next:b=>{const O=T(b);if(h)l.done=b>=f;else{let E=0;m<1&&(E=b===0?qn(g):kb(T,b,O));const M=Math.abs(E)<=r,I=Math.abs(a-O)<=o;l.done=M&&I}return l.value=l.done?a:O,l},toString:()=>{const b=Math.min(jd(k),zl),O=sy(E=>k.next(b*E).value,b,30);return b+"ms "+O},toTransition:()=>{}};return k}ec.applyToOptions=e=>{const t=sI(e,100,ec);return e.ease=Ri()?t.ease:"easeOut",e.duration=qn(t.duration),e.type="keyframes",e};function Pb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],p={done:!1,value:f},h=M=>l!==void 0&&M<l||c!==void 0&&M>c,g=M=>l===void 0?c:c===void 0||Math.abs(l-M)<Math.abs(c-M)?l:c;let m=n*t;const v=f+m,x=a===void 0?v:a(v);x!==v&&(m=x-f);const w=M=>-m*Math.exp(-M/r),T=M=>x+w(M),k=M=>{const I=w(M),N=T(M);p.done=Math.abs(I)<=u,p.value=p.done?x:N};let b,O;const E=M=>{h(p.value)&&(b=M,O=ec({keyframes:[p.value,g(p.value)],velocity:kb(T,M,p.value),damping:o,stiffness:i,restDelta:u,restSpeed:d}))};return E(0),{calculatedDuration:null,next:M=>{let I=!1;return!O&&b===void 0&&(I=!0,k(M),E(M)),b!==void 0&&M>=b?O.next(M-b):(!I&&k(M),p)}}}const aN=Bi(.42,0,1,1),lN=Bi(0,0,.58,1),Mb=Bi(.42,0,.58,1),cN=e=>Array.isArray(e)&&typeof e[0]!="number",Rb={linear:Bn,easeIn:aN,easeInOut:Mb,easeOut:lN,circIn:nf,circInOut:Xy,circOut:Ky,backIn:tf,backInOut:Yy,backOut:qy,anticipate:Gy},Db=e=>{if(Dd(e)){Wr(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Bi(t,n,r,o)}else if(typeof e=="string")return Wr(Rb[e]!==void 0,`Invalid easing type '${e}'`),Rb[e];return e};function uN(e,t,n){const r=[],o=n||Tb,i=e.length-1;for(let a=0;a<i;a++){let l=o(e[a],e[a+1]);if(t){const c=Array.isArray(t)?t[a]||Bn:t;l=Wi(c,l)}r.push(l)}return r}function dN(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Wr(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=uN(t,r,o),c=l.length,u=d=>{if(a&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const p=Mi(e[f],e[f+1],d);return l[f](p)};return n?d=>u(kr(e[0],e[i-1],d)):u}function fN(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Mi(0,t,r);e.push(Et(n,1,o))}}function pN(e){const t=[0];return fN(t,e.length-1),t}function hN(e,t){return e.map(n=>n*t)}function mN(e,t){return e.map(()=>t||Mb).splice(0,e.length-1)}function zi({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=cN(r)?r.map(Db):Db(r),i={done:!1,value:t[0]},a=hN(n&&n.length===t.length?n:pN(t),e),l=dN(a,t,{ease:Array.isArray(o)?o:mN(t,o)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const gN=e=>{const t=({timestamp:n})=>e(n);return{start:()=>wt.update(t,!0),stop:()=>zr(t),now:()=>qt.isProcessing?qt.timestamp:ar.now()}},yN={decay:Pb,inertia:Pb,tween:zi,keyframes:zi,spring:ec},bN=e=>e/100;class xf extends xb{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:o,keyframes:i}=this.options,a=(o==null?void 0:o.KeyframeResolver)||hf,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(i,l,n,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:a=0}=this.options,l=Ad(n)?n:yN[n]||zi;let c,u;process.env.NODE_ENV!=="production"&&l!==zi&&Wr(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==zi&&typeof t[0]!="number"&&(c=Wi(bN,Tb(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});i==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=jd(d));const{calculatedDuration:f}=d,p=f+o,h=p*(r+1)-o;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:p,totalDuration:h}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:M}=this.options;return{done:!0,value:M[M.length-1]}}const{finalKeyframe:o,generator:i,mirroredGenerator:a,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:p,repeat:h,repeatType:g,repeatDelay:m,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const x=this.currentTime-p*(this.speed>=0?1:-1),w=this.speed>=0?x<0:x>d;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let T=this.currentTime,k=i;if(h){const M=Math.min(this.currentTime,d)/f;let I=Math.floor(M),N=M%1;!N&&M>=1&&(N=1),N===1&&I--,I=Math.min(I,h+1),!!(I%2)&&(g==="reverse"?(N=1-N,m&&(N-=m/f)):g==="mirror"&&(k=a)),T=kr(0,1,N)*f}const b=w?{done:!1,value:c[0]}:k.next(T);l&&(b.value=l(b.value));let{done:O}=b;!w&&u!==null&&(O=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return E&&o!==void 0&&(b.value=Jl(c,this.options,o)),v&&v(b.value),E&&this.finish(),b}get duration(){const{resolved:t}=this;return t?ir(t.calculatedDuration):0}get time(){return ir(this.currentTime)}set time(t){t=qn(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ir(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=gN,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}get finished(){return this.currentFinishedPromise}}const vN=new Set(["opacity","clipPath","filter","transform"]),xN=Md(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),tc=10,wN=2e4;function CN(e){return Ad(e.type)||e.type==="spring"||!ay(e.ease)}function SN(e,t){const n=new xf({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<wN;)r=n.sample(i),o.push(r.value),i+=tc;return{times:void 0,keyframes:o,duration:i-tc,ease:"linear"}}const Ib={anticipate:Gy,backInOut:Yy,circInOut:Xy};function TN(e){return e in Ib}class Ab extends xb{constructor(t){super(t);const{name:n,motionValue:r,element:o,keyframes:i}=this.options;this.resolver=new bb(i,(a,l)=>this.onKeyframesResolved(a,l),n,r,o),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:o,ease:i,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Ri()&&TN(i)&&(i=Ib[i]),CN(this.options)){const{onComplete:f,onUpdate:p,motionValue:h,element:g,...m}=this.options,v=SN(t,m);t=v.keyframes,t.length===1&&(t[1]=t[0]),r=v.duration,o=v.times,i=v.ease,a="keyframes"}const d=oI(l.owner.current,c,t,{...this.options,duration:r,times:o,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(ly(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Jl(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:a,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ir(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ir(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=qn(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Bn;const{animation:r}=n;ly(r,t)}return Bn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:o,type:i,ease:a,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:p,...h}=this.options,g=new xf({...h,keyframes:r,duration:o,type:i,ease:a,times:l,isGenerator:!0}),m=qn(this.time);u.setWithVelocity(g.sample(m-tc).value,g.sample(m).value,tc)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:o,repeatType:i,damping:a,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return xN()&&r&&vN.has(r)&&(r!=="transform"||!u)&&!c&&!o&&i!=="mirror"&&a!==0&&l!=="inertia"}}const kN={type:"spring",stiffness:500,damping:25,restSpeed:10},ON=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),EN={type:"keyframes",duration:.8},PN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},MN=(e,{keyframes:t})=>t.length>2?EN:co.has(e)?e.startsWith("scale")?ON(t[1]):kN:PN;function RN({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const wf=(e,t,n,r={},o,i)=>a=>{const l=Nd(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-qn(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:p=>{t.set(p),l.onUpdate&&l.onUpdate(p)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:o};RN(l)||(d={...d,...MN(e,d)}),d.duration&&(d.duration=qn(d.duration)),d.repeatDelay&&(d.repeatDelay=qn(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),d.allowFlatten=!l.type&&!l.ease,f&&!i&&t.get()!==void 0){const p=Jl(d.keyframes,l);if(p!==void 0)return wt.update(()=>{d.onUpdate(p),d.onComplete()}),new tI([])}return!i&&Ab.supports(d)?new Ab(d):new xf(d)};function DN({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Nb(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(i=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const d in l){const f=e.getValue(d,e.latestValues[d]??null),p=l[d];if(p===void 0||u&&DN(u,d))continue;const h={delay:n,...Nd(i||{},d)};let g=!1;if(window.MotionHandoffAnimation){const v=Wy(e);if(v){const x=window.MotionHandoffAnimation(v,d,wt);x!==null&&(h.startTime=x,g=!0)}}ef(e,d),f.start(wf(d,f,p,e.shouldReduceMotion&&Vy.has(d)?{type:!1}:h,e,g));const m=f.animation;m&&c.push(m)}return a&&Promise.all(c).then(()=>{wt.update(()=>{a&&aA(e,a)})}),c}function Cf(e,t,n={}){var c;const r=_i(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(Nb(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:p}=o;return IN(e,t,d+u,f,p,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,d]=l==="beforeChildren"?[i,a]:[a,i];return u().then(()=>d())}else return Promise.all([i(),a(n.delay)])}function IN(e,t,n=0,r=0,o=1,i){const a=[],l=(e.variantChildren.size-1)*r,c=o===1?(u=0)=>u*r:(u=0)=>l-u*r;return Array.from(e.variantChildren).sort(AN).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(Cf(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function AN(e,t){return e.sortNodePosition(t)}function NN(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>Cf(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=Cf(e,t,n);else{const o=typeof t=="function"?_i(e,t,n.custom):t;r=Promise.all(Nb(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function jb(e,t){if(!Array.isArray(t))return!1;const 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 jN=Vd.length;function $b(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?$b(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<jN;n++){const r=Vd[n],o=e.props[r];(Ni(o)||o===!1)&&(t[r]=o)}return t}const $N=[...Ld].reverse(),FN=Ld.length;function _N(e){return t=>Promise.all(t.map(({animation:n,options:r})=>NN(e,n,r)))}function BN(e){let t=_N(e),n=Fb(),r=!0;const o=c=>(u,d)=>{var p;const f=_i(e,d,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:h,transitionEnd:g,...m}=f;u={...u,...m,...g}}return u};function i(c){t=c(e)}function a(c){const{props:u}=e,d=$b(e.parent)||{},f=[],p=new Set;let h={},g=1/0;for(let v=0;v<FN;v++){const x=$N[v],w=n[x],T=u[x]!==void 0?u[x]:d[x],k=Ni(T),b=x===c?w.isActive:null;b===!1&&(g=v);let O=T===d[x]&&T!==u[x]&&k;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),w.protectedKeys={...h},!w.isActive&&b===null||!T&&!w.prevProp||Gl(T)||typeof T=="boolean")continue;const E=LN(w.prevProp,T);let M=E||x===c&&w.isActive&&!O&&k||v>g&&k,I=!1;const N=Array.isArray(T)?T:[T];let $=N.reduce(o(x),{});b===!1&&($={});const{prevResolvedValues:R={}}=w,V={...R,...$},F=B=>{M=!0,p.has(B)&&(I=!0,p.delete(B)),w.needsAnimating[B]=!0;const W=e.getValue(B);W&&(W.liveStyle=!1)};for(const B in V){const W=$[B],P=R[B];if(h.hasOwnProperty(B))continue;let j=!1;Jd(W)&&Jd(P)?j=!jb(W,P):j=W!==P,j?W!=null?F(B):p.add(B):W!==void 0&&p.has(B)?F(B):w.protectedKeys[B]=!0}w.prevProp=T,w.prevResolvedValues=$,w.isActive&&(h={...h,...$}),r&&e.blockInitialAnimation&&(M=!1),M&&(!(O&&E)||I)&&f.push(...N.map(B=>({animation:B,options:{type:x}})))}if(p.size){const v={};if(typeof u.initial!="boolean"){const x=_i(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(v.transition=x.transition)}p.forEach(x=>{const w=e.getBaseTarget(x),T=e.getValue(x);T&&(T.liveStyle=!0),v[x]=w??null}),f.push({animation:v})}let m=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(p=>{var h;return(h=p.animationState)==null?void 0:h.setActive(c,u)}),n[c].isActive=u;const d=a(c);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:a,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Fb(),r=!0}}}function LN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!jb(t,e):!1}function ho(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Fb(){return{animate:ho(!0),whileInView:ho(),whileHover:ho(),whileTap:ho(),whileDrag:ho(),whileFocus:ho(),exit:ho()}}class qr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class VN extends qr{constructor(t){super(t),t.animationState||(t.animationState=BN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Gl(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let WN=0;class zN extends qr{constructor(){super(...arguments),this.id=WN++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const UN={animation:{Feature:VN},exit:{Feature:zN}};function Ui(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Hi(e){return{point:{x:e.pageX,y:e.pageY}}}const HN=e=>t=>_d(t)&&e(t,Hi(t));function qi(e,t,n,r){return Ui(e,t,HN(n),r)}function _b({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function qN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function YN(e,t){if(!t)return e;const 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}}const Bb=1e-4,GN=1-Bb,KN=1+Bb,Lb=.01,XN=0-Lb,ZN=0+Lb;function on(e){return e.max-e.min}function JN(e,t,n){return Math.abs(e-t)<=n}function Vb(e,t,n,r=.5){e.origin=r,e.originPoint=Et(t.min,t.max,e.origin),e.scale=on(n)/on(t),e.translate=Et(n.min,n.max,e.origin)-e.originPoint,(e.scale>=GN&&e.scale<=KN||isNaN(e.scale))&&(e.scale=1),(e.translate>=XN&&e.translate<=ZN||isNaN(e.translate))&&(e.translate=0)}function Yi(e,t,n,r){Vb(e.x,t.x,n.x,r?r.originX:void 0),Vb(e.y,t.y,n.y,r?r.originY:void 0)}function Wb(e,t,n){e.min=n.min+t.min,e.max=e.min+on(t)}function QN(e,t,n){Wb(e.x,t.x,n.x),Wb(e.y,t.y,n.y)}function zb(e,t,n){e.min=t.min-n.min,e.max=e.min+on(t)}function Gi(e,t,n){zb(e.x,t.x,n.x),zb(e.y,t.y,n.y)}const Ub=()=>({translate:0,scale:1,origin:0,originPoint:0}),bs=()=>({x:Ub(),y:Ub()}),Hb=()=>({min:0,max:0}),Ft=()=>({x:Hb(),y:Hb()});function Ln(e){return[e("x"),e("y")]}function Sf(e){return e===void 0||e===1}function Tf({scale:e,scaleX:t,scaleY:n}){return!Sf(e)||!Sf(t)||!Sf(n)}function mo(e){return Tf(e)||qb(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function qb(e){return Yb(e.x)||Yb(e.y)}function Yb(e){return e&&e!=="0%"}function nc(e,t,n){const r=e-n,o=t*r;return n+o}function Gb(e,t,n,r,o){return o!==void 0&&(e=nc(e,o,r)),nc(e,n,r)+t}function kf(e,t=0,n=1,r,o){e.min=Gb(e.min,t,n,r,o),e.max=Gb(e.max,t,n,r,o)}function Kb(e,{x:t,y:n}){kf(e.x,t.translate,t.scale,t.originPoint),kf(e.y,n.translate,n.scale,n.originPoint)}const Xb=.999999999999,Zb=1.0000000000001;function ej(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,a;for(let l=0;l<o;l++){i=n[l],a=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&xs(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,Kb(e,a)),r&&mo(i.latestValues)&&xs(e,i.latestValues))}t.x<Zb&&t.x>Xb&&(t.x=1),t.y<Zb&&t.y>Xb&&(t.y=1)}function vs(e,t){e.min=e.min+t,e.max=e.max+t}function Jb(e,t,n,r,o=.5){const i=Et(e.min,e.max,o);kf(e,t,n,i,r)}function xs(e,t){Jb(e.x,t.x,t.scaleX,t.scale,t.originX),Jb(e.y,t.y,t.scaleY,t.scale,t.originY)}function Qb(e,t){return _b(YN(e.getBoundingClientRect(),t))}function tj(e,t,n){const r=Qb(e,n),{scroll:o}=t;return o&&(vs(r.x,o.offset.x),vs(r.y,o.offset.y)),r}const ev=({current:e})=>e?e.ownerDocument.defaultView:null,tv=(e,t)=>Math.abs(e-t);function nj(e,t){const n=tv(e.x,t.x),r=tv(e.y,t.y);return Math.sqrt(n**2+r**2)}class nv{constructor(t,n,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Ef(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,h=nj(f.offset,{x:0,y:0})>=3;if(!p&&!h)return;const{point:g}=f,{timestamp:m}=qt;this.history.push({...g,timestamp:m});const{onStart:v,onMove:x}=this.handlers;p||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Of(p,this.transformPagePoint),wt.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:h,onSessionEnd:g,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Ef(f.type==="pointercancel"?this.lastMoveEventInfo:Of(p,this.transformPagePoint),this.history);this.startEvent&&h&&h(f,v),g&&g(f,v)},!_d(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=o||window;const a=Hi(t),l=Of(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=qt;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Ef(l,this.history)),this.removeListeners=Wi(qi(this.contextWindow,"pointermove",this.handlePointerMove),qi(this.contextWindow,"pointerup",this.handlePointerUp),qi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),zr(this.updatePoint)}}function Of(e,t){return t?{point:t(e.point)}:e}function rv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ef({point:e},t){return{point:e,delta:rv(e,ov(t)),offset:rv(e,rj(t)),velocity:oj(t,.1)}}function rj(e){return e[0]}function ov(e){return e[e.length-1]}function oj(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=ov(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>qn(t)));)n--;if(!r)return{x:0,y:0};const i=ir(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function sj(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Et(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Et(n,e,r.max):Math.min(e,n)),e}function sv(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function ij(e,{top:t,left:n,bottom:r,right:o}){return{x:sv(e.x,n,o),y:sv(e.y,t,r)}}function iv(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 aj(e,t){return{x:iv(e.x,t.x),y:iv(e.y,t.y)}}function lj(e,t){let n=.5;const r=on(e),o=on(t);return o>r?n=Mi(t.min,t.max-r,e.min):r>o&&(n=Mi(e.min,e.max-o,t.min)),kr(0,1,n)}function cj(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Pf=.35;function uj(e=Pf){return e===!1?e=0:e===!0&&(e=Pf),{x:av(e,"left","right"),y:av(e,"top","bottom")}}function av(e,t,n){return{min:lv(e,t),max:lv(e,n)}}function lv(e,t){return typeof e=="number"?e:e[t]||0}const dj=new WeakMap;class fj{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ft(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Hi(d).point)},i=(d,f)=>{const{drag:p,dragPropagation:h,onDragStart:g}=this.getProps();if(p&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=cI(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ln(v=>{let x=this.getAxisMotionValue(v).get()||0;if(lr.test(x)){const{projection:w}=this.visualElement;if(w&&w.layout){const T=w.layout.layoutBox[v];T&&(x=on(T)*(parseFloat(x)/100))}}this.originPoint[v]=x}),g&&wt.postRender(()=>g(d,f)),ef(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:p,dragDirectionLock:h,onDirectionLock:g,onDrag:m}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:v}=f;if(h&&this.currentDirection===null){this.currentDirection=pj(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),m&&m(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Ln(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)==null?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new nv(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:ev(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&wt.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!rc(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=sj(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,o=this.constraints;t&&ps(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=ij(r.layoutBox,t):this.constraints=!1,this.elastic=uj(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ln(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=cj(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ps(t))return!1;const r=t.current;Wr(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=tj(r,o.root,this.visualElement.getTransformPagePoint());let a=aj(o.layout.layoutBox,i);if(n){const l=n(qN(a));this.hasMutatedConstraints=!!l,l&&(a=_b(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Ln(d=>{if(!rc(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const p=o?200:1e6,h=o?40:1e7,g={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ef(this.visualElement,t),r.start(wf(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ln(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ln(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ln(n=>{const{drag:r}=this.getProps();if(!rc(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:a,max:l}=o.layout.layoutBox[n];i.set(t[n]-Et(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ps(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ln(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();o[a]=lj({min:c,max:c},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ln(a=>{if(!rc(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(Et(c,u,o[a]))})}addListeners(){if(!this.visualElement.current)return;dj.set(this.visualElement,this);const t=this.visualElement.current,n=qi(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();ps(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),wt.read(r);const a=Ui(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ln(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:a=Pf,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function rc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function pj(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class hj extends qr{constructor(t){super(t),this.removeGroupControls=Bn,this.removeListeners=Bn,this.controls=new fj(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Bn}unmount(){this.removeGroupControls(),this.removeListeners()}}const cv=e=>(t,n)=>{e&&wt.postRender(()=>e(t,n))};class mj extends qr{constructor(){super(...arguments),this.removePointerDownListener=Bn}onPointerDown(t){this.session=new nv(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ev(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:cv(t),onStart:cv(n),onMove:r,onEnd:(i,a)=>{delete this.session,o&&wt.postRender(()=>o(i,a))}}}mount(){this.removePointerDownListener=qi(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const oc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function uv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ki={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=uv(e,t.target.x),r=uv(e,t.target.y);return`${n}% ${r}%`}},gj={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Hr.parse(e);if(o.length>5)return r;const i=Hr.createTransformer(e),a=typeof o[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;o[0+a]/=l,o[1+a]/=c;const u=Et(l,c,.5);return typeof o[2+a]=="number"&&(o[2+a]/=u),typeof o[3+a]=="number"&&(o[3+a]/=u),i(o)}};class yj extends D.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;jI(bj),i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),oc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,a=r.projection;return a&&(a.isPresent=i,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||wt.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),$d.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function dv(e){const[t,n]=ey(),r=D.useContext(Cd);return y.jsx(yj,{...e,layoutGroup:r,switchLayoutGroup:D.useContext(Sy),isPresent:t,safeToRemove:n})}const bj={borderRadius:{...Ki,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ki,borderTopRightRadius:Ki,borderBottomLeftRadius:Ki,borderBottomRightRadius:Ki,boxShadow:gj};function vj(e,t,n){const r=Xt(e)?e:Ai(e);return r.start(wf("",r,t,n)),r.animation}function xj(e){return e instanceof SVGElement&&e.tagName!=="svg"}const wj=(e,t)=>e.depth-t.depth;class Cj{constructor(){this.children=[],this.isDirty=!1}add(t){Od(this.children,t),this.isDirty=!0}remove(t){Ed(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(wj),this.isDirty=!1,this.children.forEach(t)}}function Sj(e,t){const n=ar.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(zr(r),e(i-t))};return wt.read(r,!0),()=>zr(r)}const fv=["TopLeft","TopRight","BottomLeft","BottomRight"],Tj=fv.length,pv=e=>typeof e=="string"?parseFloat(e):e,hv=e=>typeof e=="number"||_e.test(e);function kj(e,t,n,r,o,i){o?(e.opacity=Et(0,n.opacity??1,Oj(r)),e.opacityExit=Et(t.opacity??1,0,Ej(r))):i&&(e.opacity=Et(t.opacity??1,n.opacity??1,r));for(let a=0;a<Tj;a++){const l=`border${fv[a]}Radius`;let c=mv(t,l),u=mv(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||hv(c)===hv(u)?(e[l]=Math.max(Et(pv(c),pv(u),r),0),(lr.test(u)||lr.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=Et(t.rotate||0,n.rotate||0,r))}function mv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Oj=gv(0,.5,Ky),Ej=gv(.5,.95,Bn);function gv(e,t,n){return r=>r<e?0:r>t?1:n(Mi(e,t,r))}function yv(e,t){e.min=t.min,e.max=t.max}function Vn(e,t){yv(e.x,t.x),yv(e.y,t.y)}function bv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function vv(e,t,n,r,o){return e-=t,e=nc(e,1/n,r),o!==void 0&&(e=nc(e,1/o,r)),e}function Pj(e,t=0,n=1,r=.5,o,i=e,a=e){if(lr.test(t)&&(t=parseFloat(t),t=Et(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=Et(i.min,i.max,r);e===i&&(l-=t),e.min=vv(e.min,t,n,l,o),e.max=vv(e.max,t,n,l,o)}function xv(e,t,[n,r,o],i,a){Pj(e,t[n],t[r],t[o],t.scale,i,a)}const Mj=["x","scaleX","originX"],Rj=["y","scaleY","originY"];function wv(e,t,n,r){xv(e.x,t,Mj,n?n.x:void 0,r?r.x:void 0),xv(e.y,t,Rj,n?n.y:void 0,r?r.y:void 0)}function Cv(e){return e.translate===0&&e.scale===1}function Sv(e){return Cv(e.x)&&Cv(e.y)}function Tv(e,t){return e.min===t.min&&e.max===t.max}function Dj(e,t){return Tv(e.x,t.x)&&Tv(e.y,t.y)}function kv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ov(e,t){return kv(e.x,t.x)&&kv(e.y,t.y)}function Ev(e){return on(e.x)/on(e.y)}function Pv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ij{constructor(){this.members=[]}add(t){Od(this.members,t),t.scheduleRender()}remove(t){if(Ed(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Aj(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((o||i||a)&&(r=`translate3d(${o}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:p,skewX:h,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),p&&(r+=`rotateY(${p}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Mf=["","X","Y","Z"],Nj={visibility:"hidden"},Mv=1e3;let jj=0;function Rf(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Rv(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Wy(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",wt,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Rv(r)}function Dv({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(a={},l=t==null?void 0:t()){this.id=jj++,this.animationId=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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(_j),this.nodes.forEach(zj),this.nodes.forEach(Uj),this.nodes.forEach(Bj)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Cj)}addEventListener(a,l){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new Rd),this.eventHandlers.get(a).add(l)}notifyListeners(a,...l){const c=this.eventHandlers.get(a);c&&c.notify(...l)}hasListeners(a){return this.eventHandlers.has(a)}mount(a,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=xj(a),this.instance=a;const{layoutId:c,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(u||c)&&(this.isLayoutDirty=!0),e){let f;const p=()=>this.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Sj(p,250),oc.hasAnimatedSinceResize&&(oc.hasAnimatedSinceResize=!1,this.nodes.forEach(Av))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeLayoutChanged:h,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||d.getDefaultTransition()||Kj,{onLayoutAnimationStart:v,onLayoutAnimationComplete:x}=d.getProps(),w=!this.targetLayout||!Ov(this.targetLayout,g),T=!p&&h;if(this.options.layoutRoot||this.resumeFrom||T||p&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,T);const k={...Nd(m,"layout"),onPlay:v,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else p||Av(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,zr(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(Hj),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Rv(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Iv);return}this.isUpdating||this.nodes.forEach(Vj),this.isUpdating=!1,this.nodes.forEach(Wj),this.nodes.forEach($j),this.nodes.forEach(Fj),this.clearAllSnapshots();const l=ar.now();qt.delta=kr(0,1e3/60,l-qt.timestamp),qt.timestamp=l,qt.isProcessing=!0,Fd.update.process(qt),Fd.preRender.process(qt),Fd.render.process(qt),qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,$d.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Lj),this.sharedNodes.forEach(qj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!on(this.snapshot.measuredBox.x)&&!on(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ft(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(l=!1),l){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!Sv(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;a&&(l||mo(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return a&&(c=this.removeTransform(c)),Xj(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return Ft();const l=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Zj))){const{scroll:d}=this.root;d&&(vs(l.x,d.offset.x),vs(l.y,d.offset.y))}return l}removeElementScroll(a){var c;const l=Ft();if(Vn(l,a),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:p}=d;d!==this.root&&f&&p.layoutScroll&&(f.wasRoot&&Vn(l,a),vs(l.x,f.offset.x),vs(l.y,f.offset.y))}return l}applyTransform(a,l=!1){const c=Ft();Vn(c,a);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&xs(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),mo(d.latestValues)&&xs(c,d.latestValues)}return mo(this.latestValues)&&xs(c,this.latestValues),c}removeTransform(a){const l=Ft();Vn(l,a);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!mo(u.latestValues))continue;Tf(u.latestValues)&&u.updateSnapshot();const d=Ft(),f=u.measurePageBox();Vn(d,f),wv(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return mo(this.latestValues)&&wv(l,this.latestValues),l}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}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!==qt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var p;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=qt.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ft(),this.relativeTargetOrigin=Ft(),Gi(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),Vn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ft(),this.targetWithTransforms=Ft()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),QN(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Vn(this.target,this.layout.layoutBox),Kb(this.target,this.targetDelta)):Vn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ft(),this.relativeTargetOrigin=Ft(),Gi(this.relativeTargetOrigin,this.target,h.target),Vn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Tf(this.parent.latestValues)||qb(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var g;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===qt.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Vn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;ej(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Ft());const{target:h}=a;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(bv(this.prevProjectionDelta.x,this.projectionDelta.x),bv(this.prevProjectionDelta.y,this.projectionDelta.y)),Yi(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!Pv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Pv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bs(),this.projectionDelta=bs(),this.projectionDeltaWithTransform=bs()}setAnimationOrigin(a,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=bs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const p=Ft(),h=c?c.source:void 0,g=this.layout?this.layout.source:void 0,m=h!==g,v=this.getStack(),x=!v||v.members.length<=1,w=!!(m&&!x&&this.options.crossfade===!0&&!this.path.some(Gj));this.animationProgress=0;let T;this.mixTargetDelta=k=>{const b=k/1e3;Nv(f.x,a.x,b),Nv(f.y,a.y,b),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Gi(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Yj(this.relativeTarget,this.relativeTargetOrigin,p,b),T&&Dj(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Ft()),Vn(T,this.relativeTarget)),m&&(this.animationValues=d,kj(d,u,this.latestValues,b,w,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(zr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wt.update(()=>{oc.hasAnimatedSinceResize=!0,this.currentAnimation=vj(0,Mv,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.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);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Mv),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&Bv(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Ft();const f=on(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const p=on(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+p}Vn(l,c),xs(l,d),Yi(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new Ij),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var l;const{layoutId:a}=this.options;return a?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:a}=this.options;return a?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Rf("z",a,u,this.animationValues);for(let d=0;d<Mf.length;d++)Rf(`rotate${Mf[d]}`,a,u,this.animationValues),Rf(`skew${Mf[d]}`,a,u,this.animationValues);a.render();for(const d in u)a.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);a.scheduleRender()}getProjectionStyles(a){if(!this.instance||this.isSVG)return;if(!this.isVisible)return Nj;const l={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=Zl(a==null?void 0:a.pointerEvents)||"",l.transform=c?c(this.latestValues,""):"none",l;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const h={};return this.options.layoutId&&(h.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,h.pointerEvents=Zl(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!mo(this.latestValues)&&(h.transform=c?c({},""):"none",this.hasProjected=!1),h}const d=u.animationValues||u.latestValues;this.applyTransformsToTarget(),l.transform=Aj(this.projectionDeltaWithTransform,this.treeScale,d),c&&(l.transform=c(d,l.transform));const{x:f,y:p}=this.projectionDelta;l.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,u.animationValues?l.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:l.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const h in ji){if(d[h]===void 0)continue;const{correct:g,applyTo:m,isCSSVariable:v}=ji[h],x=l.transform==="none"?d[h]:g(d[h],u);if(m){const w=m.length;for(let T=0;T<w;T++)l[m[T]]=x}else v?this.options.visualElement.renderState.vars[h]=x:l[h]=x}return this.options.layoutId&&(l.pointerEvents=u===this?Zl(a==null?void 0:a.pointerEvents)||"":"none"),l}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var l;return(l=a.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(Iv),this.root.sharedNodes.clear()}}}function $j(e){e.updateLayout()}function Fj(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i==="size"?Ln(f=>{const p=a?t.measuredBox[f]:t.layoutBox[f],h=on(p);p.min=r[f].min,p.max=p.min+h}):Bv(i,t.layoutBox,r)&&Ln(f=>{const p=a?t.measuredBox[f]:t.layoutBox[f],h=on(r[f]);p.max=p.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const l=bs();Yi(l,r,t.layoutBox);const c=bs();a?Yi(c,e.applyTransform(o,!0),t.measuredBox):Yi(c,r,t.layoutBox);const u=!Sv(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:h}=f;if(p&&h){const g=Ft();Gi(g,t.layoutBox,p.layoutBox);const m=Ft();Gi(m,r,h.layoutBox),Ov(g,m)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function _j(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Bj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Lj(e){e.clearSnapshot()}function Iv(e){e.clearMeasurements()}function Vj(e){e.isLayoutDirty=!1}function Wj(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Av(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zj(e){e.resolveTargetDelta()}function Uj(e){e.calcProjection()}function Hj(e){e.resetSkewAndRotation()}function qj(e){e.removeLeadSnapshot()}function Nv(e,t,n){e.translate=Et(t.translate,0,n),e.scale=Et(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function jv(e,t,n,r){e.min=Et(t.min,n.min,r),e.max=Et(t.max,n.max,r)}function Yj(e,t,n,r){jv(e.x,t.x,n.x,r),jv(e.y,t.y,n.y,r)}function Gj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Kj={duration:.45,ease:[.4,0,.1,1]},$v=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Fv=$v("applewebkit/")&&!$v("chrome/")?Math.round:Bn;function _v(e){e.min=Fv(e.min),e.max=Fv(e.max)}function Xj(e){_v(e.x),_v(e.y)}function Bv(e,t,n){return e==="position"||e==="preserve-aspect"&&!JN(Ev(t),Ev(n),.2)}function Zj(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Jj=Dv({attachResizeListener:(e,t)=>Ui(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Df={current:void 0},Lv=Dv({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Df.current){const e=new Jj({});e.mount(window),e.setOptions({layoutScroll:!0}),Df.current=e}return Df.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Qj={pan:{Feature:mj},drag:{Feature:hj,ProjectionNode:Lv,MeasureLayout:dv}};function Vv(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&wt.postRender(()=>i(t,Hi(t)))}class e6 extends qr{mount(){const{current:t}=this.node;t&&(this.unmount=dI(t,(n,r)=>(Vv(this.node,r,"Start"),o=>Vv(this.node,o,"End"))))}unmount(){}}class t6 extends qr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Wi(Ui(this.node.current,"focus",()=>this.onFocus()),Ui(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Wv(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&wt.postRender(()=>i(t,Hi(t)))}class n6 extends qr{mount(){const{current:t}=this.node;t&&(this.unmount=mI(t,(n,r)=>(Wv(this.node,r,"Start"),(o,{success:i})=>Wv(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const If=new WeakMap,Af=new WeakMap,r6=e=>{const t=If.get(e.target);t&&t(e)},o6=e=>{e.forEach(r6)};function s6({root:e,...t}){const n=e||document;Af.has(n)||Af.set(n,{});const r=Af.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(o6,{root:e,...t})),r[o]}function i6(e,t,n){const r=s6(t);return If.set(e,n),r.observe(e),()=>{If.delete(e),r.unobserve(e)}}const a6={some:0,all:1};class l6 extends qr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:a6[o]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),p=u?d:f;p&&p(c)};return i6(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(c6(t,n))&&this.startObserver()}unmount(){}}function c6({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const u6={inView:{Feature:l6},tap:{Feature:n6},focus:{Feature:t6},hover:{Feature:e6}},d6={layout:{ProjectionNode:Lv,MeasureLayout:dv}},Nf={current:null},zv={current:!1};function f6(){if(zv.current=!0,!!Td)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Nf.current=e.matches;e.addListener(t),t()}else Nf.current=!1}const p6=[...gb,Zt,Hr],h6=e=>p6.find(mb(e)),m6=new WeakMap;function g6(e,t,n){for(const r in t){const o=t[r],i=n[r];if(Xt(o))e.addValue(r,o),process.env.NODE_ENV==="development"&&Wl(o.version==="12.7.3",`Attempting to mix Motion versions ${o.version} with 12.7.3 may not work as expected.`);else if(Xt(i))e.addValue(r,Ai(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(o):a.hasAnimated||a.set(o)}else{const a=e.getStaticValue(r);e.addValue(r,Ai(a!==void 0?a:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Uv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class y6{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=hf,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=()=>{const h=ar.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,wt.render(this.render,!1,!0))};const{latestValues:c,renderState:u,onUpdate:d}=a;this.onUpdate=d,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=Kl(n),this.isVariantNode=xy(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in p){const g=p[h];c[h]!==void 0&&Xt(g)&&g.set(c[h],!1)}}mount(t){this.current=t,m6.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),zv.current||f6(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Nf.current,process.env.NODE_ENV!=="production"&&Wl(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),zr(this.notifyUpdate),zr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=co.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&wt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in fs){const n=fs[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ft()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Uv.length;r++){const o=Uv[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,a=t[i];a&&(this.propEventSubscriptions[o]=this.on(o,a))}this.prevMotionValues=g6(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ai(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(pb(r)||Zy(r))?r=parseFloat(r):!h6(r)&&Hr.test(n)&&(r=sb(t,n)),this.setBaseTarget(t,Xt(r)?r.get():r)),Xt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=Zd(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Xt(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Rd),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Hv extends y6{constructor(){super(...arguments),this.KeyframeResolver=bb}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Xt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function b6(e){return window.getComputedStyle(e)}class v6 extends Hv{constructor(){super(...arguments),this.type="html",this.renderInstance=$y}readValueFromInstance(t,n){if(co.has(n))return IA(t,n);{const r=b6(t),o=(zd(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Qb(t,n)}build(t,n,r){qd(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Qd(t,n,r)}}class x6 extends Hv{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ft,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&jy(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(co.has(n)){const r=ob(n);return r&&r.default||0}return n=Fy.has(n)?n:Wd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return By(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&wt.postRender(this.updateDimensions)}build(t,n,r){Kd(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,o){_y(t,n,r,o)}mount(t){this.isSVGTag=Xd(t.tagName),super.mount(t)}}const w6=(e,t)=>Gd(e)?new x6(t):new v6(t,{allowProjection:e!==D.Fragment}),C6=sA({...UN,...u6,...Qj,...d6},w6),Xi=CI(C6),hn=({name:e,size:t=24,url:n,color:r="currentColor",style:o={},...i})=>{const{isPrimary:a}=i,l=n||Ge[e],u=It().palette.mode==="dark",d=a?"invert(0%) brightness(200%)":u?"invert(100%) sepia(0%) saturate(0%) hue-rotate(93deg) brightness(103%) contrast(103%)":"invert(48%) sepia(0%) saturate(0%) hue-rotate(181deg) brightness(95%) contrast(90%)";return l?y.jsx("img",{src:l,alt:`${e}-icon`,draggable:!1,style:{filter:d,...o},...i}):null},S6=({showOptions:e,setShowOptions:t,buttonRef:n,options:r,onClick:o})=>{const i=D.useRef(null);return D.useEffect(()=>{let a;return e&&(a=setTimeout(()=>{const l=c=>{i!=null&&i.current&&!(i!=null&&i.current.contains(c.target))&&!(n!=null&&n.contains(c.target))&&t(!1)};document.addEventListener("mousedown",l),document._customLabelClickOutside=l},0)),()=>{clearTimeout(a),document._customLabelClickOutside&&(document.removeEventListener("mousedown",document._customLabelClickOutside),delete document._customLabelClickOutside)}},[e]),y.jsx(os,{open:e,anchorEl:n,placement:"bottom",transition:!0,modifiers:[{name:"offset",options:{offset:[0,0]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:a})=>{a.styles.popper.width=`${a.rects.reference.width}px`}}],style:{zIndex:1300},ref:i,children:({TransitionProps:a})=>y.jsx($r,{...a,timeout:100,children:y.jsx(Ce,{sx:{background:l=>l.palette.primary.appBackground,border:l=>`1px solid ${l.palette.primary.notifyBorderColor}`,borderRadius:"0.7rem",width:"100%",padding:"0.3rem",maxHeight:"20rem",overflowY:"auto"},children:y.jsx(Ce,{children:r==null?void 0:r.map((l,c)=>y.jsx(Br,{sx:{opacity:1,pointerEvents:"auto",padding:"0rem",borderTop:c!==0?u=>`0.1rem solid ${u.palette.primary.notifyBorderColor}`:"none"},onClick:u=>{u.stopPropagation(),o(l)},children:y.jsx(ft,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{p:"0.5rem"},children:y.jsx(ft,{direction:"row",alignItems:"center",gap:"1rem",children:y.jsx(ot,{component:"h3",sx:{color:u=>u.palette.primary.notifyActiveText,fontWeight:"300",fontSize:"1.1rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l.label})})})},c))})})})})},qv=({styles:e,label:t,disabled:n,onClick:r,...o})=>{var g,m;const i=It();let a=(t==null?void 0:t.length)*((t==null?void 0:t.length)>=10?6.5:7.5)+38||0;a=o!=null&&o.options?a+15:a;const[l,c]=D.useState(!1),u=D.useRef(null),[d,f]=D.useState(!1),[p,h]=D.useState(e==null?void 0:e.isAnimate);return y.jsxs(Xi.button,{ref:u,onMouseEnter:()=>p&&c(!0),onMouseLeave:()=>p&&c(!1),initial:{width:(e==null?void 0:e.width)||(!p&&t?`${a/10}rem`:"3.2rem"),borderRadius:"0.7rem"},animate:{width:p?`${l?a/10:3.2}rem`:t?`${a/10}rem`:"3.2rem"},whileHover:{backgroundColor:(g=e==null?void 0:e.hover)==null?void 0:g.backgroundColor,color:(m=e==null?void 0:e.hover)==null?void 0:m.color},transition:{duration:.2,ease:"easeInOut"},style:{height:"3.2rem",outline:"none",overflow:"hidden",backgroundColor:(e==null?void 0:e.variant)!=="outlined"?(e==null?void 0:e.colorType)==="secondary"?i.palette.brandColor.blue:(e==null?void 0:e.colorType)==="danger"?i.palette.brandColor.red:(e==null?void 0:e.colorType)==="empty"?i.palette.primary.notifyButtonBackground:i.palette.brandColor.orange:i.palette.primary.notifyBackground,border:(e==null?void 0:e.variant)==="outlined"||(e==null?void 0:e.colorType)==="empty"?`0.1rem solid ${i.palette.primary.notifyBorderColor}`:"none",display:"flex",alignItems:"center",gap:l||!p?"0.5rem":0,color:(e==null?void 0:e.variant)==="outlined"||(e==null?void 0:e.colorType)==="empty"?i.palette.primary.notifyTextColor:"white",justifyContent:l?"flex-start":"center",padding:l||!p?"1.2rem":"0.8rem",whiteSpace:"nowrap",opacity:n?.6:1,cursor:n?"auto":"pointer",...e},disabled:n,layout:!0,onClick:()=>{!(o!=null&&o.options)&&r(),o!=null&&o.options&&(f(v=>!v),h(d))},...o,children:[(e==null?void 0:e.icon)&&(!(e!=null&&e.iconPosition)||(e==null?void 0:e.iconPosition)==="start")&&y.jsx(hn,{url:e==null?void 0:e.icon,isPrimary:e==null?void 0:e.iconPrimary}),t&&y.jsxs(Xi.div,{layout:!0,initial:{opacity:0,width:0},animate:{opacity:l||!p?1:0,width:l||!p?"auto":0},transition:{duration:.2,ease:"easeInOut",delay:l?.1:0},style:{overflow:"hidden",whiteSpace:"nowrap",display:"flex",justifyContent:"center",gap:"0.8rem"},children:[y.jsx(ot,{sx:{fontSize:"1.1rem"},children:t}),(o==null?void 0:o.options)&&(d?y.jsx(hn,{url:Ge.ArrowUpLight}):y.jsx(hn,{url:Ge.ArrowDownLight}))]}),(e==null?void 0:e.iconPosition)==="end"&&y.jsx(hn,{url:e==null?void 0:e.icon,isPrimary:e==null?void 0:e.iconPrimary}),y.jsx(S6,{showOptions:d,buttonRef:u==null?void 0:u.current,setShowOptions:f,options:o==null?void 0:o.options,onClick:r})]})};qv.propTypes={styles:s.object.isRequired,label:s.string};function go({...e}){return y.jsx(_n,{children:y.jsx(qv,{...e})})}function sc({...e}){return y.jsx(_n,{children:y.jsx(U0,{id:e==null?void 0:e.id,icon:y.jsx(Ce,{component:"img",src:Ge.Uncheck}),checkedIcon:y.jsx(Ce,{component:"img",src:Ge.Check}),...e})})}const Yv=new Set;function T6(e,t="warning"){if(process.env.NODE_ENV==="production")return;const n=Array.isArray(e)?e.join(`
302
+ `),()=>{document.head.removeChild(h)}},[t]),y.jsx(G5,{isPresent:t,childRef:o,sizeRef:i,children:C.cloneElement(e,{ref:o})})}const X5=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:a,anchorX:l})=>{const c=Sd(Z5),u=D.useId(),d=D.useCallback(p=>{c.set(p,!0);for(const h of c.values())if(!h)return;r&&r()},[c,r]),f=D.useMemo(()=>({id:u,initial:t,isPresent:n,custom:o,onExitComplete:d,register:p=>(c.set(p,!1),()=>c.delete(p))}),i?[Math.random(),d]:[n,d]);return D.useMemo(()=>{c.forEach((p,h)=>c.set(h,!1))},[n]),C.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),a==="popLayout"&&(e=y.jsx(K5,{isPresent:n,anchorX:l,children:e})),y.jsx(Ll.Provider,{value:f,children:e})};function Z5(){return new Map}function ey(e=!0){const t=D.useContext(Ll);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=D.useId();D.useEffect(()=>{if(e)return o(i)},[e]);const a=D.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const Vl=e=>e.key||"";function ty(e){const t=[];return D.Children.forEach(e,n=>{D.isValidElement(n)&&t.push(n)}),t}const J5=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:a=!1,anchorX:l="left"})=>{const[c,u]=ey(a),d=D.useMemo(()=>ty(e),[e]),f=a&&!c?[]:d.map(Vl),p=D.useRef(!0),h=D.useRef(d),g=Sd(()=>new Map),[m,v]=D.useState(d),[x,w]=D.useState(d);Qg(()=>{p.current=!1,h.current=d;for(let b=0;b<x.length;b++){const O=Vl(x[b]);f.includes(O)?g.delete(O):g.get(O)!==!0&&g.set(O,!1)}},[x,f.length,f.join("-")]);const T=[];if(d!==m){let b=[...d];for(let O=0;O<x.length;O++){const E=x[O],M=Vl(E);f.includes(M)||(b.splice(O,0,E),T.push(E))}return i==="wait"&&T.length&&(b=T),w(ty(b)),v(d),null}process.env.NODE_ENV!=="production"&&i==="wait"&&x.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.`);const{forceRender:k}=D.useContext(Cd);return y.jsx(y.Fragment,{children:x.map(b=>{const O=Vl(b),E=a&&!c?!1:d===x||f.includes(O),M=()=>{if(g.has(O))g.set(O,!0);else return;let I=!0;g.forEach(N=>{N||(I=!1)}),I&&(k==null||k(),w(h.current),a&&(u==null||u()),r&&r())};return y.jsx(X5,{isPresent:E,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,onExitComplete:E?void 0:M,anchorX:l,children:b},O)})})};function Od(e,t){e.indexOf(t)===-1&&e.push(t)}function Ed(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let ds=()=>{},Wr=()=>{};process.env.NODE_ENV!=="production"&&(ds=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Wr=(e,t)=>{if(!e)throw new Error(t)});const Pd={useManualTiming:!1};function Md(e){let t;return()=>(t===void 0&&(t=e()),t)}const Bn=e=>e,Mi=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Rd{constructor(){this.subscriptions=[]}add(t){return Od(this.subscriptions,t),()=>Ed(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const a=this.subscriptions[i];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const qn=e=>e*1e3,ir=e=>e/1e3;function ny(e,t){return t?e*(1e3/t):0}const ry=new Set;function Wl(e,t,n){e||ry.has(t)||(console.warn(t),ry.add(t))}const Q5=Md(()=>window.ScrollTimeline!==void 0);class eI{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(o=>{if(Q5()&&o.attachTimeline)return o.attachTimeline(t);if(typeof n=="function")return n(o)});return()=>{r.forEach((o,i)=>{o&&o(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class tI extends eI{then(t,n){return this.finished.finally(t).then(()=>{})}}const oy={value:null},Dd=e=>Array.isArray(e)&&typeof e[0]=="number",nI={};function rI(e,t){const n=Md(e);return()=>nI[t]??n()}const Ri=rI(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),sy=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=e(i/(o-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Di=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Id={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Di([0,.65,.55,1]),circOut:Di([.55,0,1,.45]),backIn:Di([.31,.01,.66,-.59]),backOut:Di([.33,1.53,.69,.99])};function iy(e,t){if(e)return typeof e=="function"&&Ri()?sy(e,t):Dd(e)?Di(e):Array.isArray(e)?e.map(n=>iy(n,t)||Id.easeOut):Id[e]}function oI(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:a="loop",ease:l="easeInOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=iy(l,o);return Array.isArray(f)&&(d.easing=f),e.animate(d,{delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal",pseudoElement:u})}function Ad(e){return typeof e=="function"&&"applyToOptions"in e}function Nd(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const zl=2e4;function jd(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<zl;)t+=n,r=e.next(t);return t>=zl?1/0:t}function sI(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(jd(r),zl);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:ir(o)}}function ay(e){return!!(typeof e=="function"&&Ri()||!e||typeof e=="string"&&(e in Id||Ri())||Dd(e)||Array.isArray(e)&&e.every(ay))}function ly(e,t){e.timeline=t,e.onfinish=null}const Ul=["read","resolveKeyframes","update","preRender","render","postRender"];function iI(e,t){let n=new Set,r=new Set,o=!1,i=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(f){a.has(f)&&(d.schedule(f),e()),c++,f(l)}const d={schedule:(f,p=!1,h=!1)=>{const m=h&&o?n:r;return p&&a.add(f),m.has(f)||m.add(f),f},cancel:f=>{r.delete(f),a.delete(f)},process:f=>{if(l=f,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(u),t&&oy.value&&oy.value.frameloop[t].push(c),c=0,n.clear(),o=!1,i&&(i=!1,d.process(f))}};return d}const aI=40;function cy(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Ul.reduce((x,w)=>(x[w]=iI(i,t?w:void 0),x),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:p}=a,h=()=>{const x=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(x-o.timestamp,aI),1),o.timestamp=x,o.isProcessing=!0,l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),p.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,o.isProcessing||e(h)};return{schedule:Ul.reduce((x,w)=>{const T=a[w];return x[w]=(k,b=!1,O=!1)=>(n||g(),T.schedule(k,b,O)),x},{}),cancel:x=>{for(let w=0;w<Ul.length;w++)a[Ul[w]].cancel(x)},state:o,steps:a}}const{schedule:$d}=cy(queueMicrotask,!1),{schedule:wt,cancel:zr,state:qt,steps:Fd}=cy(typeof requestAnimationFrame<"u"?requestAnimationFrame:Bn,!0);let Hl;function lI(){Hl=void 0}const ar={now:()=>(Hl===void 0&&ar.set(qt.isProcessing||Pd.useManualTiming?qt.timestamp:performance.now()),Hl),set:e=>{Hl=e,queueMicrotask(lI)}},Yn={x:!1,y:!1};function uy(){return Yn.x||Yn.y}function cI(e){return e==="x"||e==="y"?Yn[e]?null:(Yn[e]=!0,()=>{Yn[e]=!1}):Yn.x||Yn.y?null:(Yn.x=Yn.y=!0,()=>{Yn.x=Yn.y=!1})}function uI(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function dy(e,t){const n=uI(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function fy(e){return!(e.pointerType==="touch"||uy())}function dI(e,t,n={}){const[r,o,i]=dy(e,n),a=l=>{if(!fy(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{fy(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,o)};return r.forEach(l=>{l.addEventListener("pointerenter",a,o)}),i}const py=(e,t)=>t?e===t?!0:py(e,t.parentElement):!1,_d=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,fI=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pI(e){return fI.has(e.tagName)||e.tabIndex!==-1}const Ii=new WeakSet;function hy(e){return t=>{t.key==="Enter"&&e(t)}}function Bd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const hI=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=hy(()=>{if(Ii.has(n))return;Bd(n,"down");const o=hy(()=>{Bd(n,"up")}),i=()=>Bd(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function my(e){return _d(e)&&!uy()}function mI(e,t,n={}){const[r,o,i]=dy(e,n),a=l=>{const c=l.currentTarget;if(!my(l)||Ii.has(c))return;Ii.add(c);const u=t(c,l),d=(h,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",p),!(!my(h)||!Ii.has(c))&&(Ii.delete(c),typeof u=="function"&&u(h,{success:g}))},f=h=>{d(h,c===window||c===document||n.useGlobalTarget||py(c,h.target))},p=h=>{d(h,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",p,o)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,o),l instanceof HTMLElement&&(l.addEventListener("focus",u=>hI(u,o)),!pI(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}const gy=30,gI=e=>!isNaN(parseFloat(e));class yI{constructor(t,n={}){this.version="12.7.3",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{const i=ar.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ar.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=gI(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Wl(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Rd);const r=this.events[t].add(n);return t==="change"?()=>{r(),wt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ar.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>gy)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,gy);return ny(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ai(e,t){return new yI(e,t)}const yy=D.createContext({strict:!1}),by={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"]},fs={};for(const e in by)fs[e]={isEnabled:t=>by[e].some(n=>!!t[n])};function bI(e){for(const t in e)fs[t]={...fs[t],...e[t]}}const vI=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"]);function ql(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||vI.has(e)}let vy=e=>!ql(e);function xI(e){e&&(vy=t=>t.startsWith("on")?!ql(t):e(t))}try{xI(require("@emotion/is-prop-valid").default)}catch{}function wI(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(vy(o)||n===!0&&ql(o)||!t&&!ql(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function CI(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Wl(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const Yl=D.createContext({});function Gl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ni(e){return typeof e=="string"||Array.isArray(e)}const Ld=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Vd=["initial",...Ld];function Kl(e){return Gl(e.animate)||Vd.some(t=>Ni(e[t]))}function xy(e){return!!(Kl(e)||e.variants)}function SI(e,t){if(Kl(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ni(n)?n:void 0,animate:Ni(r)?r:void 0}}return e.inherit!==!1?t:{}}function TI(e){const{initial:t,animate:n}=SI(e,D.useContext(Yl));return D.useMemo(()=>({initial:t,animate:n}),[wy(t),wy(n)])}function wy(e){return Array.isArray(e)?e.join(" "):e}const kI=Symbol.for("motionComponentSymbol");function ps(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function OI(e,t,n){return D.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):ps(n)&&(n.current=r))},[t])}const Wd=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Cy="data-"+Wd("framerAppearId"),Sy=D.createContext({});function EI(e,t,n,r,o){var m,v;const{visualElement:i}=D.useContext(Yl),a=D.useContext(yy),l=D.useContext(Ll),c=D.useContext(kd).reducedMotion,u=D.useRef(null);r=r||a.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=D.useContext(Sy);d&&!d.projection&&o&&(d.type==="html"||d.type==="svg")&&PI(u.current,n,o,f);const p=D.useRef(!1);D.useInsertionEffect(()=>{d&&p.current&&d.update(n,l)});const h=n[Cy],g=D.useRef(!!h&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,h))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,h)));return Qg(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),$d.render(d.render),g.current&&d.animationState&&d.animationState.animateChanges())}),D.useEffect(()=>{d&&(!g.current&&d.animationState&&d.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)==null||x.call(window,h)}),g.current=!1))}),d}function PI(e,t,n,r){const{layoutId:o,layout:i,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ty(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!a||l&&ps(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function Ty(e){if(e)return e.options.allowProjection!==!1?e.projection:Ty(e.parent)}function MI({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&bI(e);function i(l,c){let u;const d={...D.useContext(kd),...l,layoutId:RI(l)},{isStatic:f}=d,p=TI(l),h=r(l,f);if(!f&&Td){DI(d,e);const g=II(d);u=g.MeasureLayout,p.visualElement=EI(o,h,d,t,g.ProjectionNode)}return y.jsxs(Yl.Provider,{value:p,children:[u&&p.visualElement?y.jsx(u,{visualElement:p.visualElement,...d}):null,n(o,l,OI(h,p.visualElement,c),h,f,p.visualElement)]})}i.displayName=`motion.${typeof o=="string"?o:`create(${o.displayName??o.name??""})`}`;const a=D.forwardRef(i);return a[kI]=o,a}function RI({layoutId:e}){const t=D.useContext(Cd).id;return t&&e!==void 0?t+"-"+e:e}function DI(e,t){const n=D.useContext(yy).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?ds(!1,r):Wr(!1,r)}}function II(e){const{drag:t,layout:n}=fs;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const ky=e=>t=>typeof t=="string"&&t.startsWith(e),zd=ky("--"),AI=ky("var(--"),Ud=e=>AI(e)?NI.test(e.split("/*")[0].trim()):!1,NI=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ji={};function jI(e){for(const t in e)ji[t]=e[t],zd(t)&&(ji[t].isCSSVariable=!0)}const hs=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],co=new Set(hs);function Oy(e,{layout:t,layoutId:n}){return co.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ji[e]||e==="opacity")}const Xt=e=>!!(e&&e.getVelocity),Ey=(e,t)=>t&&typeof e=="number"?t.transform(e):e,kr=(e,t,n)=>n>t?t:n<e?e:n,ms={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},$i={...ms,transform:e=>kr(0,1,e)},Xl={...ms,default:1},Fi=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ur=Fi("deg"),lr=Fi("%"),_e=Fi("px"),$I=Fi("vh"),FI=Fi("vw"),Py={...lr,parse:e=>lr.parse(e)/100,transform:e=>lr.transform(e*100)},_I={borderWidth:_e,borderTopWidth:_e,borderRightWidth:_e,borderBottomWidth:_e,borderLeftWidth:_e,borderRadius:_e,radius:_e,borderTopLeftRadius:_e,borderTopRightRadius:_e,borderBottomRightRadius:_e,borderBottomLeftRadius:_e,width:_e,maxWidth:_e,height:_e,maxHeight:_e,top:_e,right:_e,bottom:_e,left:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,backgroundPositionX:_e,backgroundPositionY:_e},BI={rotate:Ur,rotateX:Ur,rotateY:Ur,rotateZ:Ur,scale:Xl,scaleX:Xl,scaleY:Xl,scaleZ:Xl,skew:Ur,skewX:Ur,skewY:Ur,distance:_e,translateX:_e,translateY:_e,translateZ:_e,x:_e,y:_e,z:_e,perspective:_e,transformPerspective:_e,opacity:$i,originX:Py,originY:Py,originZ:_e},My={...ms,transform:Math.round},Hd={..._I,...BI,zIndex:My,size:_e,fillOpacity:$i,strokeOpacity:$i,numOctaves:My},LI={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},VI=hs.length;function WI(e,t,n){let r="",o=!0;for(let i=0;i<VI;i++){const a=hs[i],l=e[a];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(a.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=Ey(l,Hd[a]);if(!c){o=!1;const d=LI[a]||a;r+=`${d}(${u}) `}n&&(t[a]=u)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function qd(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let a=!1,l=!1;for(const c in t){const u=t[c];if(co.has(c)){a=!0;continue}else if(zd(c)){o[c]=u;continue}else{const d=Ey(u,Hd[c]);c.startsWith("origin")?(l=!0,i[c]=d):r[c]=d}}if(t.transform||(a||n?r.transform=WI(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=i;r.transformOrigin=`${c} ${u} ${d}`}}const Yd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ry(e,t,n){for(const r in t)!Xt(t[r])&&!Oy(r,n)&&(e[r]=t[r])}function zI({transformTemplate:e},t){return D.useMemo(()=>{const n=Yd();return qd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function UI(e,t){const n=e.style||{},r={};return Ry(r,n,e),Object.assign(r,zI(e,t)),r}function HI(e,t){const n={},r=UI(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 qI=["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 Gd(e){return typeof e!="string"||e.includes("-")?!1:!!(qI.indexOf(e)>-1||/[A-Z]/u.test(e))}const YI={offset:"stroke-dashoffset",array:"stroke-dasharray"},GI={offset:"strokeDashoffset",array:"strokeDasharray"};function KI(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?YI:GI;e[i.offset]=_e.transform(-r);const a=_e.transform(t),l=_e.transform(n);e[i.array]=`${a} ${l}`}function Dy(e,t,n){return typeof e=="string"?e:_e.transform(t+n*e)}function XI(e,t,n){const r=Dy(t,e.x,e.width),o=Dy(n,e.y,e.height);return`${r} ${o}`}function Kd(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:a,pathSpacing:l=1,pathOffset:c=0,...u},d,f){if(qd(e,u,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:h,dimensions:g}=e;p.transform&&(g&&(h.transform=p.transform),delete p.transform),g&&(o!==void 0||i!==void 0||h.transform)&&(h.transformOrigin=XI(g,o!==void 0?o:.5,i!==void 0?i:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),a!==void 0&&KI(p,a,l,c,!1)}const Iy=()=>({...Yd(),attrs:{}}),Xd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ZI(e,t,n,r){const o=D.useMemo(()=>{const i=Iy();return Kd(i,t,Xd(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Ry(i,e.style,e),o.style={...i,...o.style}}return o}function JI(e=!1){return(n,r,o,{latestValues:i},a)=>{const c=(Gd(n)?ZI:HI)(r,i,a,n),u=wI(r,typeof n=="string",e),d=n!==D.Fragment?{...u,...c,ref:o}:{},{children:f}=r,p=D.useMemo(()=>Xt(f)?f.get():f,[f]);return D.createElement(n,{...d,children:p})}}function Ay(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Zd(e,t,n,r){if(typeof t=="function"){const[o,i]=Ay(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=Ay(r);t=t(n!==void 0?n:e.custom,o,i)}return t}const Jd=e=>Array.isArray(e),QI=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),eA=e=>Jd(e)?e[e.length-1]||0:e;function Zl(e){const t=Xt(e)?e.get():e;return QI(t)?t.toValue():t}function tA({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,i){const a={latestValues:nA(r,o,i,e),renderState:t()};return n&&(a.onMount=l=>n({props:r,current:l,...a}),a.onUpdate=l=>n(l)),a}const Ny=e=>(t,n)=>{const r=D.useContext(Yl),o=D.useContext(Ll),i=()=>tA(e,t,r,o);return n?i():Sd(i)};function nA(e,t,n,r){const o={},i=r(e,{});for(const p in i)o[p]=Zl(i[p]);let{initial:a,animate:l}=e;const c=Kl(e),u=xy(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!Gl(f)){const p=Array.isArray(f)?f:[f];for(let h=0;h<p.length;h++){const g=Zd(e,p[h]);if(g){const{transitionEnd:m,transition:v,...x}=g;for(const w in x){let T=x[w];if(Array.isArray(T)){const k=d?T.length-1:0;T=T[k]}T!==null&&(o[w]=T)}for(const w in m)o[w]=m[w]}}}return o}function Qd(e,t,n){var i;const{style:r}=e,o={};for(const a in r)(Xt(r[a])||t.style&&Xt(t.style[a])||Oy(a,e)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(o[a]=r[a]);return o}const rA={useVisualState:Ny({scrapeMotionValuesFromProps:Qd,createRenderState:Yd})};function jy(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function $y(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const Fy=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 _y(e,t,n,r){$y(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Fy.has(o)?o:Wd(o),t.attrs[o])}function By(e,t,n){const r=Qd(e,t,n);for(const o in e)if(Xt(e[o])||Xt(t[o])){const i=hs.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const Ly=["x","y","width","height","cx","cy","r"],oA={useVisualState:Ny({scrapeMotionValuesFromProps:By,createRenderState:Iy,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in o)if(co.has(l)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let l=0;l<Ly.length;l++){const c=Ly[l];e[c]!==t[c]&&(a=!0)}a&&wt.read(()=>{jy(n,r),wt.render(()=>{Kd(r,o,Xd(n.tagName),e.transformTemplate),_y(n,r)})})}})};function sA(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const a={...Gd(r)?oA:rA,preloadedFeatures:e,useRender:JI(o),createVisualElement:t,Component:r};return MI(a)}}function _i(e,t,n){const r=e.getProps();return Zd(r,t,n!==void 0?n:r.custom,e)}const Vy=new Set(["width","height","top","left","right","bottom",...hs]);function iA(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ai(n))}function aA(e,t){const n=_i(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const a in i){const l=eA(i[a]);iA(e,a,l)}}function lA(e){return!!(Xt(e)&&e.add)}function ef(e,t){const n=e.getValue("willChange");if(lA(n))return n.add(t);if(!n&&Pd.WillChange){const r=new Pd.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Wy(e){return e.props[Cy]}const zy=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,cA=1e-7,uA=12;function dA(e,t,n,r,o){let i,a,l=0;do a=t+(n-t)/2,i=zy(a,r,o)-e,i>0?n=a:t=a;while(Math.abs(i)>cA&&++l<uA);return a}function Bi(e,t,n,r){if(e===t&&n===r)return Bn;const o=i=>dA(i,0,1,e,n);return i=>i===0||i===1?i:zy(o(i),t,r)}const Uy=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Hy=e=>t=>1-e(1-t),qy=Bi(.33,1.53,.69,.99),tf=Hy(qy),Yy=Uy(tf),Gy=e=>(e*=2)<1?.5*tf(e):.5*(2-Math.pow(2,-10*(e-1))),nf=e=>1-Math.sin(Math.acos(e)),Ky=Hy(nf),Xy=Uy(nf),Zy=e=>/^0[^.\s]+$/u.test(e);function fA(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Zy(e):!0}const Li=e=>Math.round(e*1e5)/1e5,rf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function pA(e){return e==null}const hA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,of=(e,t)=>n=>!!(typeof n=="string"&&hA.test(n)&&n.startsWith(e)||t&&!pA(n)&&Object.prototype.hasOwnProperty.call(n,t)),Jy=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,a,l]=r.match(rf);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},mA=e=>kr(0,255,e),sf={...ms,transform:e=>Math.round(mA(e))},uo={test:of("rgb","red"),parse:Jy("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+sf.transform(e)+", "+sf.transform(t)+", "+sf.transform(n)+", "+Li($i.transform(r))+")"};function gA(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const af={test:of("#"),parse:gA,transform:uo.transform},gs={test:of("hsl","hue"),parse:Jy("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+lr.transform(Li(t))+", "+lr.transform(Li(n))+", "+Li($i.transform(r))+")"},Zt={test:e=>uo.test(e)||af.test(e)||gs.test(e),parse:e=>uo.test(e)?uo.parse(e):gs.test(e)?gs.parse(e):af.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?uo.transform(e):gs.transform(e)},yA=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function bA(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(rf))==null?void 0:t.length)||0)+(((n=e.match(yA))==null?void 0:n.length)||0)>0}const Qy="number",eb="color",vA="var",xA="var(",tb="${}",wA=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Vi(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const l=t.replace(wA,c=>(Zt.test(c)?(r.color.push(i),o.push(eb),n.push(Zt.parse(c))):c.startsWith(xA)?(r.var.push(i),o.push(vA),n.push(c)):(r.number.push(i),o.push(Qy),n.push(parseFloat(c))),++i,tb)).split(tb);return{values:n,split:l,indexes:r,types:o}}function nb(e){return Vi(e).values}function rb(e){const{split:t,types:n}=Vi(e),r=t.length;return o=>{let i="";for(let a=0;a<r;a++)if(i+=t[a],o[a]!==void 0){const l=n[a];l===Qy?i+=Li(o[a]):l===eb?i+=Zt.transform(o[a]):i+=o[a]}return i}}const CA=e=>typeof e=="number"?0:e;function SA(e){const t=nb(e);return rb(e)(t.map(CA))}const Hr={test:bA,parse:nb,createTransformer:rb,getAnimatableNone:SA},TA=new Set(["brightness","contrast","saturate","opacity"]);function kA(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(rf)||[];if(!r)return e;const o=n.replace(r,"");let i=TA.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const OA=/\b([a-z-]*)\(.*?\)/gu,lf={...Hr,getAnimatableNone:e=>{const t=e.match(OA);return t?t.map(kA).join(" "):e}},EA={...Hd,color:Zt,backgroundColor:Zt,outlineColor:Zt,fill:Zt,stroke:Zt,borderColor:Zt,borderTopColor:Zt,borderRightColor:Zt,borderBottomColor:Zt,borderLeftColor:Zt,filter:lf,WebkitFilter:lf},ob=e=>EA[e];function sb(e,t){let n=ob(e);return n!==lf&&(n=Hr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const PA=new Set(["auto","none","0"]);function MA(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!PA.has(i)&&Vi(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=sb(n,o)}const fo=e=>e*180/Math.PI,cf=e=>{const t=fo(Math.atan2(e[1],e[0]));return uf(t)},RA={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:cf,rotateZ:cf,skewX:e=>fo(Math.atan(e[1])),skewY:e=>fo(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},uf=e=>(e=e%360,e<0&&(e+=360),e),ib=cf,ab=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),lb=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),DA={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ab,scaleY:lb,scale:e=>(ab(e)+lb(e))/2,rotateX:e=>uf(fo(Math.atan2(e[6],e[5]))),rotateY:e=>uf(fo(Math.atan2(-e[2],e[0]))),rotateZ:ib,rotate:ib,skewX:e=>fo(Math.atan(e[4])),skewY:e=>fo(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function cb(e){return e.includes("scale")?1:0}function df(e,t){if(!e||e==="none")return cb(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=DA,o=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=RA,o=l}if(!o)return cb(t);const i=r[t],a=o[1].split(",").map(AA);return typeof i=="function"?i(a):a[i]}const IA=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return df(n,t)};function AA(e){return parseFloat(e.trim())}const ub=e=>e===ms||e===_e,NA=new Set(["x","y","z"]),jA=hs.filter(e=>!NA.has(e));function $A(e){const t=[];return jA.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const ys={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>df(t,"x"),y:(e,{transform:t})=>df(t,"y")};ys.translateX=ys.x,ys.translateY=ys.y;const po=new Set;let ff=!1,pf=!1;function db(){if(pf){const e=Array.from(po).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=$A(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,a])=>{var l;(l=r.getValue(i))==null||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}pf=!1,ff=!1,po.forEach(e=>e.complete()),po.clear()}function fb(){po.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(pf=!0)})}function FA(){fb(),db()}class hf{constructor(t,n,r,o,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(po.add(this),ff||(ff=!0,wt.read(fb),wt.resolveKeyframes(db))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const a=o==null?void 0:o.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),o&&a===void 0&&o.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),po.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,po.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const pb=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),_A=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function BA(e){const t=_A.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const LA=4;function hb(e,t,n=1){Wr(n<=LA,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=BA(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return pb(a)?parseFloat(a):a}return Ud(o)?hb(o,t,n+1):o}const mb=e=>t=>t.test(e),gb=[ms,_e,lr,Ur,FI,$I,{test:e=>e==="auto",parse:e=>e}],yb=e=>gb.find(mb(e));class bb extends hf{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),Ud(u))){const d=hb(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Vy.has(r)||t.length!==2)return;const[o,i]=t,a=yb(o),l=yb(i);if(a!==l)if(ub(a)&&ub(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)fA(t[o])&&r.push(o);r.length&&MA(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ys[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,a=r[i];r[i]=ys[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const vb=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Hr.test(e)||e==="0")&&!e.startsWith("url("));function VA(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function WA(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],a=vb(o,t),l=vb(i,t);return ds(a===l,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!a||!l?!1:VA(e)||(n==="spring"||Ad(n))&&r}const zA=e=>e!==null;function Jl(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(zA),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return!i||r===void 0?o[i]:r}const UA=40;class xb{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ar.now(),this.options={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>UA?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&FA(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=ar.now(),this.hasAttemptedResolve=!0;const{name:r,type:o,velocity:i,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!WA(t,r,o,i))if(a)this.options.duration=0;else{c&&c(Jl(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Et=(e,t,n)=>e+(t-e)*n;function mf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function HA({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,a=0;if(!t)o=i=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;o=mf(c,l,e+1/3),i=mf(c,l,e),a=mf(c,l,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Ql(e,t){return n=>n>0?t:e}const gf=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},qA=[af,uo,gs],YA=e=>qA.find(t=>t.test(e));function wb(e){const t=YA(e);if(ds(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===gs&&(n=HA(n)),n}const Cb=(e,t)=>{const n=wb(e),r=wb(t);if(!n||!r)return Ql(e,t);const o={...n};return i=>(o.red=gf(n.red,r.red,i),o.green=gf(n.green,r.green,i),o.blue=gf(n.blue,r.blue,i),o.alpha=Et(n.alpha,r.alpha,i),uo.transform(o))},GA=(e,t)=>n=>t(e(n)),Wi=(...e)=>e.reduce(GA),yf=new Set(["none","hidden"]);function KA(e,t){return yf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function XA(e,t){return n=>Et(e,t,n)}function bf(e){return typeof e=="number"?XA:typeof e=="string"?Ud(e)?Ql:Zt.test(e)?Cb:QA:Array.isArray(e)?Sb:typeof e=="object"?Zt.test(e)?Cb:ZA:Ql}function Sb(e,t){const n=[...e],r=n.length,o=e.map((i,a)=>bf(i)(i,t[a]));return i=>{for(let a=0;a<r;a++)n[a]=o[a](i);return n}}function ZA(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=bf(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function JA(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],a=e.indexes[i][r[i]],l=e.values[a]??0;n[o]=l,r[i]++}return n}const QA=(e,t)=>{const n=Hr.createTransformer(t),r=Vi(e),o=Vi(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?yf.has(e)&&!o.values.length||yf.has(t)&&!r.values.length?KA(e,t):Wi(Sb(JA(r,o),o.values),n):(ds(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Ql(e,t))};function Tb(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Et(e,t,n):bf(e)(e,t)}const eN=5;function kb(e,t,n){const r=Math.max(t-eN,0);return ny(n-e(r),t-r)}const Pt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ob=.001;function tN({duration:e=Pt.duration,bounce:t=Pt.bounce,velocity:n=Pt.velocity,mass:r=Pt.mass}){let o,i;ds(e<=qn(Pt.maxDuration),"Spring duration must be 10 seconds or less");let a=1-t;a=kr(Pt.minDamping,Pt.maxDamping,a),e=kr(Pt.minDuration,Pt.maxDuration,ir(e)),a<1?(o=u=>{const d=u*a,f=d*e,p=d-n,h=vf(u,a),g=Math.exp(-f);return Ob-p/h*g},i=u=>{const f=u*a*e,p=f*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,g=Math.exp(-f),m=vf(Math.pow(u,2),a);return(-o(u)+Ob>0?-1:1)*((p-h)*g)/m}):(o=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-.001+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=rN(o,i,l);if(e=qn(e),isNaN(c))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const nN=12;function rN(e,t,n){let r=n;for(let o=1;o<nN;o++)r=r-e(r)/t(r);return r}function vf(e,t){return e*Math.sqrt(1-t*t)}const oN=["duration","bounce"],sN=["stiffness","damping","mass"];function Eb(e,t){return t.some(n=>e[n]!==void 0)}function iN(e){let t={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...e};if(!Eb(e,sN)&&Eb(e,oN))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*kr(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Pt.mass,stiffness:o,damping:i}}else{const n=tN(e);t={...t,...n,mass:Pt.mass},t.isResolvedFromDuration=!0}return t}function ec(e=Pt.visualDuration,t=Pt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:f,velocity:p,isResolvedFromDuration:h}=iN({...n,velocity:-ir(n.velocity||0)}),g=p||0,m=u/(2*Math.sqrt(c*d)),v=a-i,x=ir(Math.sqrt(c/d)),w=Math.abs(v)<5;r||(r=w?Pt.restSpeed.granular:Pt.restSpeed.default),o||(o=w?Pt.restDelta.granular:Pt.restDelta.default);let T;if(m<1){const b=vf(x,m);T=O=>{const E=Math.exp(-m*x*O);return a-E*((g+m*x*v)/b*Math.sin(b*O)+v*Math.cos(b*O))}}else if(m===1)T=b=>a-Math.exp(-x*b)*(v+(g+x*v)*b);else{const b=x*Math.sqrt(m*m-1);T=O=>{const E=Math.exp(-m*x*O),M=Math.min(b*O,300);return a-E*((g+m*x*v)*Math.sinh(M)+b*v*Math.cosh(M))/b}}const k={calculatedDuration:h&&f||null,next:b=>{const O=T(b);if(h)l.done=b>=f;else{let E=0;m<1&&(E=b===0?qn(g):kb(T,b,O));const M=Math.abs(E)<=r,I=Math.abs(a-O)<=o;l.done=M&&I}return l.value=l.done?a:O,l},toString:()=>{const b=Math.min(jd(k),zl),O=sy(E=>k.next(b*E).value,b,30);return b+"ms "+O},toTransition:()=>{}};return k}ec.applyToOptions=e=>{const t=sI(e,100,ec);return e.ease=Ri()?t.ease:"easeOut",e.duration=qn(t.duration),e.type="keyframes",e};function Pb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],p={done:!1,value:f},h=M=>l!==void 0&&M<l||c!==void 0&&M>c,g=M=>l===void 0?c:c===void 0||Math.abs(l-M)<Math.abs(c-M)?l:c;let m=n*t;const v=f+m,x=a===void 0?v:a(v);x!==v&&(m=x-f);const w=M=>-m*Math.exp(-M/r),T=M=>x+w(M),k=M=>{const I=w(M),N=T(M);p.done=Math.abs(I)<=u,p.value=p.done?x:N};let b,O;const E=M=>{h(p.value)&&(b=M,O=ec({keyframes:[p.value,g(p.value)],velocity:kb(T,M,p.value),damping:o,stiffness:i,restDelta:u,restSpeed:d}))};return E(0),{calculatedDuration:null,next:M=>{let I=!1;return!O&&b===void 0&&(I=!0,k(M),E(M)),b!==void 0&&M>=b?O.next(M-b):(!I&&k(M),p)}}}const aN=Bi(.42,0,1,1),lN=Bi(0,0,.58,1),Mb=Bi(.42,0,.58,1),cN=e=>Array.isArray(e)&&typeof e[0]!="number",Rb={linear:Bn,easeIn:aN,easeInOut:Mb,easeOut:lN,circIn:nf,circInOut:Xy,circOut:Ky,backIn:tf,backInOut:Yy,backOut:qy,anticipate:Gy},Db=e=>{if(Dd(e)){Wr(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Bi(t,n,r,o)}else if(typeof e=="string")return Wr(Rb[e]!==void 0,`Invalid easing type '${e}'`),Rb[e];return e};function uN(e,t,n){const r=[],o=n||Tb,i=e.length-1;for(let a=0;a<i;a++){let l=o(e[a],e[a+1]);if(t){const c=Array.isArray(t)?t[a]||Bn:t;l=Wi(c,l)}r.push(l)}return r}function dN(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Wr(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=uN(t,r,o),c=l.length,u=d=>{if(a&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const p=Mi(e[f],e[f+1],d);return l[f](p)};return n?d=>u(kr(e[0],e[i-1],d)):u}function fN(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Mi(0,t,r);e.push(Et(n,1,o))}}function pN(e){const t=[0];return fN(t,e.length-1),t}function hN(e,t){return e.map(n=>n*t)}function mN(e,t){return e.map(()=>t||Mb).splice(0,e.length-1)}function zi({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=cN(r)?r.map(Db):Db(r),i={done:!1,value:t[0]},a=hN(n&&n.length===t.length?n:pN(t),e),l=dN(a,t,{ease:Array.isArray(o)?o:mN(t,o)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const gN=e=>{const t=({timestamp:n})=>e(n);return{start:()=>wt.update(t,!0),stop:()=>zr(t),now:()=>qt.isProcessing?qt.timestamp:ar.now()}},yN={decay:Pb,inertia:Pb,tween:zi,keyframes:zi,spring:ec},bN=e=>e/100;class xf extends xb{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:o,keyframes:i}=this.options,a=(o==null?void 0:o.KeyframeResolver)||hf,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(i,l,n,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:a=0}=this.options,l=Ad(n)?n:yN[n]||zi;let c,u;process.env.NODE_ENV!=="production"&&l!==zi&&Wr(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==zi&&typeof t[0]!="number"&&(c=Wi(bN,Tb(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});i==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=jd(d));const{calculatedDuration:f}=d,p=f+o,h=p*(r+1)-o;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:p,totalDuration:h}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:M}=this.options;return{done:!0,value:M[M.length-1]}}const{finalKeyframe:o,generator:i,mirroredGenerator:a,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:p,repeat:h,repeatType:g,repeatDelay:m,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const x=this.currentTime-p*(this.speed>=0?1:-1),w=this.speed>=0?x<0:x>d;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let T=this.currentTime,k=i;if(h){const M=Math.min(this.currentTime,d)/f;let I=Math.floor(M),N=M%1;!N&&M>=1&&(N=1),N===1&&I--,I=Math.min(I,h+1),!!(I%2)&&(g==="reverse"?(N=1-N,m&&(N-=m/f)):g==="mirror"&&(k=a)),T=kr(0,1,N)*f}const b=w?{done:!1,value:c[0]}:k.next(T);l&&(b.value=l(b.value));let{done:O}=b;!w&&u!==null&&(O=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return E&&o!==void 0&&(b.value=Jl(c,this.options,o)),v&&v(b.value),E&&this.finish(),b}get duration(){const{resolved:t}=this;return t?ir(t.calculatedDuration):0}get time(){return ir(this.currentTime)}set time(t){t=qn(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ir(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=gN,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}get finished(){return this.currentFinishedPromise}}const vN=new Set(["opacity","clipPath","filter","transform"]),xN=Md(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),tc=10,wN=2e4;function CN(e){return Ad(e.type)||e.type==="spring"||!ay(e.ease)}function SN(e,t){const n=new xf({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<wN;)r=n.sample(i),o.push(r.value),i+=tc;return{times:void 0,keyframes:o,duration:i-tc,ease:"linear"}}const Ib={anticipate:Gy,backInOut:Yy,circInOut:Xy};function TN(e){return e in Ib}class Ab extends xb{constructor(t){super(t);const{name:n,motionValue:r,element:o,keyframes:i}=this.options;this.resolver=new bb(i,(a,l)=>this.onKeyframesResolved(a,l),n,r,o),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:o,ease:i,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Ri()&&TN(i)&&(i=Ib[i]),CN(this.options)){const{onComplete:f,onUpdate:p,motionValue:h,element:g,...m}=this.options,v=SN(t,m);t=v.keyframes,t.length===1&&(t[1]=t[0]),r=v.duration,o=v.times,i=v.ease,a="keyframes"}const d=oI(l.owner.current,c,t,{...this.options,duration:r,times:o,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(ly(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Jl(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:a,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ir(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ir(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=qn(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Bn;const{animation:r}=n;ly(r,t)}return Bn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:o,type:i,ease:a,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:p,...h}=this.options,g=new xf({...h,keyframes:r,duration:o,type:i,ease:a,times:l,isGenerator:!0}),m=qn(this.time);u.setWithVelocity(g.sample(m-tc).value,g.sample(m).value,tc)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:o,repeatType:i,damping:a,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return xN()&&r&&vN.has(r)&&(r!=="transform"||!u)&&!c&&!o&&i!=="mirror"&&a!==0&&l!=="inertia"}}const kN={type:"spring",stiffness:500,damping:25,restSpeed:10},ON=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),EN={type:"keyframes",duration:.8},PN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},MN=(e,{keyframes:t})=>t.length>2?EN:co.has(e)?e.startsWith("scale")?ON(t[1]):kN:PN;function RN({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const wf=(e,t,n,r={},o,i)=>a=>{const l=Nd(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-qn(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:p=>{t.set(p),l.onUpdate&&l.onUpdate(p)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:o};RN(l)||(d={...d,...MN(e,d)}),d.duration&&(d.duration=qn(d.duration)),d.repeatDelay&&(d.repeatDelay=qn(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),d.allowFlatten=!l.type&&!l.ease,f&&!i&&t.get()!==void 0){const p=Jl(d.keyframes,l);if(p!==void 0)return wt.update(()=>{d.onUpdate(p),d.onComplete()}),new tI([])}return!i&&Ab.supports(d)?new Ab(d):new xf(d)};function DN({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Nb(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(i=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const d in l){const f=e.getValue(d,e.latestValues[d]??null),p=l[d];if(p===void 0||u&&DN(u,d))continue;const h={delay:n,...Nd(i||{},d)};let g=!1;if(window.MotionHandoffAnimation){const v=Wy(e);if(v){const x=window.MotionHandoffAnimation(v,d,wt);x!==null&&(h.startTime=x,g=!0)}}ef(e,d),f.start(wf(d,f,p,e.shouldReduceMotion&&Vy.has(d)?{type:!1}:h,e,g));const m=f.animation;m&&c.push(m)}return a&&Promise.all(c).then(()=>{wt.update(()=>{a&&aA(e,a)})}),c}function Cf(e,t,n={}){var c;const r=_i(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(Nb(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:p}=o;return IN(e,t,d+u,f,p,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,d]=l==="beforeChildren"?[i,a]:[a,i];return u().then(()=>d())}else return Promise.all([i(),a(n.delay)])}function IN(e,t,n=0,r=0,o=1,i){const a=[],l=(e.variantChildren.size-1)*r,c=o===1?(u=0)=>u*r:(u=0)=>l-u*r;return Array.from(e.variantChildren).sort(AN).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(Cf(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function AN(e,t){return e.sortNodePosition(t)}function NN(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>Cf(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=Cf(e,t,n);else{const o=typeof t=="function"?_i(e,t,n.custom):t;r=Promise.all(Nb(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function jb(e,t){if(!Array.isArray(t))return!1;const 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 jN=Vd.length;function $b(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?$b(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<jN;n++){const r=Vd[n],o=e.props[r];(Ni(o)||o===!1)&&(t[r]=o)}return t}const $N=[...Ld].reverse(),FN=Ld.length;function _N(e){return t=>Promise.all(t.map(({animation:n,options:r})=>NN(e,n,r)))}function BN(e){let t=_N(e),n=Fb(),r=!0;const o=c=>(u,d)=>{var p;const f=_i(e,d,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:h,transitionEnd:g,...m}=f;u={...u,...m,...g}}return u};function i(c){t=c(e)}function a(c){const{props:u}=e,d=$b(e.parent)||{},f=[],p=new Set;let h={},g=1/0;for(let v=0;v<FN;v++){const x=$N[v],w=n[x],T=u[x]!==void 0?u[x]:d[x],k=Ni(T),b=x===c?w.isActive:null;b===!1&&(g=v);let O=T===d[x]&&T!==u[x]&&k;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),w.protectedKeys={...h},!w.isActive&&b===null||!T&&!w.prevProp||Gl(T)||typeof T=="boolean")continue;const E=LN(w.prevProp,T);let M=E||x===c&&w.isActive&&!O&&k||v>g&&k,I=!1;const N=Array.isArray(T)?T:[T];let $=N.reduce(o(x),{});b===!1&&($={});const{prevResolvedValues:R={}}=w,V={...R,...$},F=B=>{M=!0,p.has(B)&&(I=!0,p.delete(B)),w.needsAnimating[B]=!0;const W=e.getValue(B);W&&(W.liveStyle=!1)};for(const B in V){const W=$[B],P=R[B];if(h.hasOwnProperty(B))continue;let j=!1;Jd(W)&&Jd(P)?j=!jb(W,P):j=W!==P,j?W!=null?F(B):p.add(B):W!==void 0&&p.has(B)?F(B):w.protectedKeys[B]=!0}w.prevProp=T,w.prevResolvedValues=$,w.isActive&&(h={...h,...$}),r&&e.blockInitialAnimation&&(M=!1),M&&(!(O&&E)||I)&&f.push(...N.map(B=>({animation:B,options:{type:x}})))}if(p.size){const v={};if(typeof u.initial!="boolean"){const x=_i(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(v.transition=x.transition)}p.forEach(x=>{const w=e.getBaseTarget(x),T=e.getValue(x);T&&(T.liveStyle=!0),v[x]=w??null}),f.push({animation:v})}let m=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(p=>{var h;return(h=p.animationState)==null?void 0:h.setActive(c,u)}),n[c].isActive=u;const d=a(c);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:a,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Fb(),r=!0}}}function LN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!jb(t,e):!1}function ho(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Fb(){return{animate:ho(!0),whileInView:ho(),whileHover:ho(),whileTap:ho(),whileDrag:ho(),whileFocus:ho(),exit:ho()}}class qr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class VN extends qr{constructor(t){super(t),t.animationState||(t.animationState=BN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Gl(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let WN=0;class zN extends qr{constructor(){super(...arguments),this.id=WN++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const UN={animation:{Feature:VN},exit:{Feature:zN}};function Ui(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Hi(e){return{point:{x:e.pageX,y:e.pageY}}}const HN=e=>t=>_d(t)&&e(t,Hi(t));function qi(e,t,n,r){return Ui(e,t,HN(n),r)}function _b({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function qN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function YN(e,t){if(!t)return e;const 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}}const Bb=1e-4,GN=1-Bb,KN=1+Bb,Lb=.01,XN=0-Lb,ZN=0+Lb;function on(e){return e.max-e.min}function JN(e,t,n){return Math.abs(e-t)<=n}function Vb(e,t,n,r=.5){e.origin=r,e.originPoint=Et(t.min,t.max,e.origin),e.scale=on(n)/on(t),e.translate=Et(n.min,n.max,e.origin)-e.originPoint,(e.scale>=GN&&e.scale<=KN||isNaN(e.scale))&&(e.scale=1),(e.translate>=XN&&e.translate<=ZN||isNaN(e.translate))&&(e.translate=0)}function Yi(e,t,n,r){Vb(e.x,t.x,n.x,r?r.originX:void 0),Vb(e.y,t.y,n.y,r?r.originY:void 0)}function Wb(e,t,n){e.min=n.min+t.min,e.max=e.min+on(t)}function QN(e,t,n){Wb(e.x,t.x,n.x),Wb(e.y,t.y,n.y)}function zb(e,t,n){e.min=t.min-n.min,e.max=e.min+on(t)}function Gi(e,t,n){zb(e.x,t.x,n.x),zb(e.y,t.y,n.y)}const Ub=()=>({translate:0,scale:1,origin:0,originPoint:0}),bs=()=>({x:Ub(),y:Ub()}),Hb=()=>({min:0,max:0}),Ft=()=>({x:Hb(),y:Hb()});function Ln(e){return[e("x"),e("y")]}function Sf(e){return e===void 0||e===1}function Tf({scale:e,scaleX:t,scaleY:n}){return!Sf(e)||!Sf(t)||!Sf(n)}function mo(e){return Tf(e)||qb(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function qb(e){return Yb(e.x)||Yb(e.y)}function Yb(e){return e&&e!=="0%"}function nc(e,t,n){const r=e-n,o=t*r;return n+o}function Gb(e,t,n,r,o){return o!==void 0&&(e=nc(e,o,r)),nc(e,n,r)+t}function kf(e,t=0,n=1,r,o){e.min=Gb(e.min,t,n,r,o),e.max=Gb(e.max,t,n,r,o)}function Kb(e,{x:t,y:n}){kf(e.x,t.translate,t.scale,t.originPoint),kf(e.y,n.translate,n.scale,n.originPoint)}const Xb=.999999999999,Zb=1.0000000000001;function ej(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,a;for(let l=0;l<o;l++){i=n[l],a=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&xs(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,Kb(e,a)),r&&mo(i.latestValues)&&xs(e,i.latestValues))}t.x<Zb&&t.x>Xb&&(t.x=1),t.y<Zb&&t.y>Xb&&(t.y=1)}function vs(e,t){e.min=e.min+t,e.max=e.max+t}function Jb(e,t,n,r,o=.5){const i=Et(e.min,e.max,o);kf(e,t,n,i,r)}function xs(e,t){Jb(e.x,t.x,t.scaleX,t.scale,t.originX),Jb(e.y,t.y,t.scaleY,t.scale,t.originY)}function Qb(e,t){return _b(YN(e.getBoundingClientRect(),t))}function tj(e,t,n){const r=Qb(e,n),{scroll:o}=t;return o&&(vs(r.x,o.offset.x),vs(r.y,o.offset.y)),r}const ev=({current:e})=>e?e.ownerDocument.defaultView:null,tv=(e,t)=>Math.abs(e-t);function nj(e,t){const n=tv(e.x,t.x),r=tv(e.y,t.y);return Math.sqrt(n**2+r**2)}class nv{constructor(t,n,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Ef(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,h=nj(f.offset,{x:0,y:0})>=3;if(!p&&!h)return;const{point:g}=f,{timestamp:m}=qt;this.history.push({...g,timestamp:m});const{onStart:v,onMove:x}=this.handlers;p||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Of(p,this.transformPagePoint),wt.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:h,onSessionEnd:g,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Ef(f.type==="pointercancel"?this.lastMoveEventInfo:Of(p,this.transformPagePoint),this.history);this.startEvent&&h&&h(f,v),g&&g(f,v)},!_d(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=o||window;const a=Hi(t),l=Of(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=qt;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Ef(l,this.history)),this.removeListeners=Wi(qi(this.contextWindow,"pointermove",this.handlePointerMove),qi(this.contextWindow,"pointerup",this.handlePointerUp),qi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),zr(this.updatePoint)}}function Of(e,t){return t?{point:t(e.point)}:e}function rv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ef({point:e},t){return{point:e,delta:rv(e,ov(t)),offset:rv(e,rj(t)),velocity:oj(t,.1)}}function rj(e){return e[0]}function ov(e){return e[e.length-1]}function oj(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=ov(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>qn(t)));)n--;if(!r)return{x:0,y:0};const i=ir(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function sj(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Et(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Et(n,e,r.max):Math.min(e,n)),e}function sv(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function ij(e,{top:t,left:n,bottom:r,right:o}){return{x:sv(e.x,n,o),y:sv(e.y,t,r)}}function iv(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 aj(e,t){return{x:iv(e.x,t.x),y:iv(e.y,t.y)}}function lj(e,t){let n=.5;const r=on(e),o=on(t);return o>r?n=Mi(t.min,t.max-r,e.min):r>o&&(n=Mi(e.min,e.max-o,t.min)),kr(0,1,n)}function cj(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Pf=.35;function uj(e=Pf){return e===!1?e=0:e===!0&&(e=Pf),{x:av(e,"left","right"),y:av(e,"top","bottom")}}function av(e,t,n){return{min:lv(e,t),max:lv(e,n)}}function lv(e,t){return typeof e=="number"?e:e[t]||0}const dj=new WeakMap;class fj{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ft(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Hi(d).point)},i=(d,f)=>{const{drag:p,dragPropagation:h,onDragStart:g}=this.getProps();if(p&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=cI(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ln(v=>{let x=this.getAxisMotionValue(v).get()||0;if(lr.test(x)){const{projection:w}=this.visualElement;if(w&&w.layout){const T=w.layout.layoutBox[v];T&&(x=on(T)*(parseFloat(x)/100))}}this.originPoint[v]=x}),g&&wt.postRender(()=>g(d,f)),ef(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:p,dragDirectionLock:h,onDirectionLock:g,onDrag:m}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:v}=f;if(h&&this.currentDirection===null){this.currentDirection=pj(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),m&&m(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Ln(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)==null?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new nv(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:ev(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&wt.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!rc(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=sj(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,o=this.constraints;t&&ps(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=ij(r.layoutBox,t):this.constraints=!1,this.elastic=uj(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ln(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=cj(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ps(t))return!1;const r=t.current;Wr(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=tj(r,o.root,this.visualElement.getTransformPagePoint());let a=aj(o.layout.layoutBox,i);if(n){const l=n(qN(a));this.hasMutatedConstraints=!!l,l&&(a=_b(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Ln(d=>{if(!rc(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const p=o?200:1e6,h=o?40:1e7,g={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ef(this.visualElement,t),r.start(wf(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ln(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ln(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ln(n=>{const{drag:r}=this.getProps();if(!rc(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:a,max:l}=o.layout.layoutBox[n];i.set(t[n]-Et(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ps(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ln(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();o[a]=lj({min:c,max:c},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ln(a=>{if(!rc(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(Et(c,u,o[a]))})}addListeners(){if(!this.visualElement.current)return;dj.set(this.visualElement,this);const t=this.visualElement.current,n=qi(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();ps(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),wt.read(r);const a=Ui(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ln(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:a=Pf,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function rc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function pj(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class hj extends qr{constructor(t){super(t),this.removeGroupControls=Bn,this.removeListeners=Bn,this.controls=new fj(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Bn}unmount(){this.removeGroupControls(),this.removeListeners()}}const cv=e=>(t,n)=>{e&&wt.postRender(()=>e(t,n))};class mj extends qr{constructor(){super(...arguments),this.removePointerDownListener=Bn}onPointerDown(t){this.session=new nv(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ev(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:cv(t),onStart:cv(n),onMove:r,onEnd:(i,a)=>{delete this.session,o&&wt.postRender(()=>o(i,a))}}}mount(){this.removePointerDownListener=qi(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const oc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function uv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ki={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=uv(e,t.target.x),r=uv(e,t.target.y);return`${n}% ${r}%`}},gj={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Hr.parse(e);if(o.length>5)return r;const i=Hr.createTransformer(e),a=typeof o[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;o[0+a]/=l,o[1+a]/=c;const u=Et(l,c,.5);return typeof o[2+a]=="number"&&(o[2+a]/=u),typeof o[3+a]=="number"&&(o[3+a]/=u),i(o)}};class yj extends D.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;jI(bj),i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),oc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,a=r.projection;return a&&(a.isPresent=i,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||wt.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),$d.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function dv(e){const[t,n]=ey(),r=D.useContext(Cd);return y.jsx(yj,{...e,layoutGroup:r,switchLayoutGroup:D.useContext(Sy),isPresent:t,safeToRemove:n})}const bj={borderRadius:{...Ki,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ki,borderTopRightRadius:Ki,borderBottomLeftRadius:Ki,borderBottomRightRadius:Ki,boxShadow:gj};function vj(e,t,n){const r=Xt(e)?e:Ai(e);return r.start(wf("",r,t,n)),r.animation}function xj(e){return e instanceof SVGElement&&e.tagName!=="svg"}const wj=(e,t)=>e.depth-t.depth;class Cj{constructor(){this.children=[],this.isDirty=!1}add(t){Od(this.children,t),this.isDirty=!0}remove(t){Ed(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(wj),this.isDirty=!1,this.children.forEach(t)}}function Sj(e,t){const n=ar.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(zr(r),e(i-t))};return wt.read(r,!0),()=>zr(r)}const fv=["TopLeft","TopRight","BottomLeft","BottomRight"],Tj=fv.length,pv=e=>typeof e=="string"?parseFloat(e):e,hv=e=>typeof e=="number"||_e.test(e);function kj(e,t,n,r,o,i){o?(e.opacity=Et(0,n.opacity??1,Oj(r)),e.opacityExit=Et(t.opacity??1,0,Ej(r))):i&&(e.opacity=Et(t.opacity??1,n.opacity??1,r));for(let a=0;a<Tj;a++){const l=`border${fv[a]}Radius`;let c=mv(t,l),u=mv(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||hv(c)===hv(u)?(e[l]=Math.max(Et(pv(c),pv(u),r),0),(lr.test(u)||lr.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=Et(t.rotate||0,n.rotate||0,r))}function mv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Oj=gv(0,.5,Ky),Ej=gv(.5,.95,Bn);function gv(e,t,n){return r=>r<e?0:r>t?1:n(Mi(e,t,r))}function yv(e,t){e.min=t.min,e.max=t.max}function Vn(e,t){yv(e.x,t.x),yv(e.y,t.y)}function bv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function vv(e,t,n,r,o){return e-=t,e=nc(e,1/n,r),o!==void 0&&(e=nc(e,1/o,r)),e}function Pj(e,t=0,n=1,r=.5,o,i=e,a=e){if(lr.test(t)&&(t=parseFloat(t),t=Et(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=Et(i.min,i.max,r);e===i&&(l-=t),e.min=vv(e.min,t,n,l,o),e.max=vv(e.max,t,n,l,o)}function xv(e,t,[n,r,o],i,a){Pj(e,t[n],t[r],t[o],t.scale,i,a)}const Mj=["x","scaleX","originX"],Rj=["y","scaleY","originY"];function wv(e,t,n,r){xv(e.x,t,Mj,n?n.x:void 0,r?r.x:void 0),xv(e.y,t,Rj,n?n.y:void 0,r?r.y:void 0)}function Cv(e){return e.translate===0&&e.scale===1}function Sv(e){return Cv(e.x)&&Cv(e.y)}function Tv(e,t){return e.min===t.min&&e.max===t.max}function Dj(e,t){return Tv(e.x,t.x)&&Tv(e.y,t.y)}function kv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ov(e,t){return kv(e.x,t.x)&&kv(e.y,t.y)}function Ev(e){return on(e.x)/on(e.y)}function Pv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ij{constructor(){this.members=[]}add(t){Od(this.members,t),t.scheduleRender()}remove(t){if(Ed(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Aj(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((o||i||a)&&(r=`translate3d(${o}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:p,skewX:h,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),p&&(r+=`rotateY(${p}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Mf=["","X","Y","Z"],Nj={visibility:"hidden"},Mv=1e3;let jj=0;function Rf(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Rv(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Wy(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",wt,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Rv(r)}function Dv({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(a={},l=t==null?void 0:t()){this.id=jj++,this.animationId=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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(_j),this.nodes.forEach(zj),this.nodes.forEach(Uj),this.nodes.forEach(Bj)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Cj)}addEventListener(a,l){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new Rd),this.eventHandlers.get(a).add(l)}notifyListeners(a,...l){const c=this.eventHandlers.get(a);c&&c.notify(...l)}hasListeners(a){return this.eventHandlers.has(a)}mount(a,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=xj(a),this.instance=a;const{layoutId:c,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(u||c)&&(this.isLayoutDirty=!0),e){let f;const p=()=>this.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Sj(p,250),oc.hasAnimatedSinceResize&&(oc.hasAnimatedSinceResize=!1,this.nodes.forEach(Av))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeLayoutChanged:h,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||d.getDefaultTransition()||Kj,{onLayoutAnimationStart:v,onLayoutAnimationComplete:x}=d.getProps(),w=!this.targetLayout||!Ov(this.targetLayout,g),T=!p&&h;if(this.options.layoutRoot||this.resumeFrom||T||p&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,T);const k={...Nd(m,"layout"),onPlay:v,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else p||Av(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,zr(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(Hj),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Rv(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Iv);return}this.isUpdating||this.nodes.forEach(Vj),this.isUpdating=!1,this.nodes.forEach(Wj),this.nodes.forEach($j),this.nodes.forEach(Fj),this.clearAllSnapshots();const l=ar.now();qt.delta=kr(0,1e3/60,l-qt.timestamp),qt.timestamp=l,qt.isProcessing=!0,Fd.update.process(qt),Fd.preRender.process(qt),Fd.render.process(qt),qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,$d.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Lj),this.sharedNodes.forEach(qj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!on(this.snapshot.measuredBox.x)&&!on(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ft(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(l=!1),l){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!Sv(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;a&&(l||mo(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return a&&(c=this.removeTransform(c)),Xj(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return Ft();const l=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Zj))){const{scroll:d}=this.root;d&&(vs(l.x,d.offset.x),vs(l.y,d.offset.y))}return l}removeElementScroll(a){var c;const l=Ft();if(Vn(l,a),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:p}=d;d!==this.root&&f&&p.layoutScroll&&(f.wasRoot&&Vn(l,a),vs(l.x,f.offset.x),vs(l.y,f.offset.y))}return l}applyTransform(a,l=!1){const c=Ft();Vn(c,a);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&xs(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),mo(d.latestValues)&&xs(c,d.latestValues)}return mo(this.latestValues)&&xs(c,this.latestValues),c}removeTransform(a){const l=Ft();Vn(l,a);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!mo(u.latestValues))continue;Tf(u.latestValues)&&u.updateSnapshot();const d=Ft(),f=u.measurePageBox();Vn(d,f),wv(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return mo(this.latestValues)&&wv(l,this.latestValues),l}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}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!==qt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var p;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=qt.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ft(),this.relativeTargetOrigin=Ft(),Gi(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),Vn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ft(),this.targetWithTransforms=Ft()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),QN(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Vn(this.target,this.layout.layoutBox),Kb(this.target,this.targetDelta)):Vn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ft(),this.relativeTargetOrigin=Ft(),Gi(this.relativeTargetOrigin,this.target,h.target),Vn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Tf(this.parent.latestValues)||qb(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var g;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===qt.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Vn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;ej(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Ft());const{target:h}=a;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(bv(this.prevProjectionDelta.x,this.projectionDelta.x),bv(this.prevProjectionDelta.y,this.projectionDelta.y)),Yi(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!Pv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Pv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bs(),this.projectionDelta=bs(),this.projectionDeltaWithTransform=bs()}setAnimationOrigin(a,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=bs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const p=Ft(),h=c?c.source:void 0,g=this.layout?this.layout.source:void 0,m=h!==g,v=this.getStack(),x=!v||v.members.length<=1,w=!!(m&&!x&&this.options.crossfade===!0&&!this.path.some(Gj));this.animationProgress=0;let T;this.mixTargetDelta=k=>{const b=k/1e3;Nv(f.x,a.x,b),Nv(f.y,a.y,b),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Gi(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Yj(this.relativeTarget,this.relativeTargetOrigin,p,b),T&&Dj(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Ft()),Vn(T,this.relativeTarget)),m&&(this.animationValues=d,kj(d,u,this.latestValues,b,w,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(zr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wt.update(()=>{oc.hasAnimatedSinceResize=!0,this.currentAnimation=vj(0,Mv,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.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);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Mv),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&Bv(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Ft();const f=on(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const p=on(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+p}Vn(l,c),xs(l,d),Yi(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new Ij),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var l;const{layoutId:a}=this.options;return a?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:a}=this.options;return a?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Rf("z",a,u,this.animationValues);for(let d=0;d<Mf.length;d++)Rf(`rotate${Mf[d]}`,a,u,this.animationValues),Rf(`skew${Mf[d]}`,a,u,this.animationValues);a.render();for(const d in u)a.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);a.scheduleRender()}getProjectionStyles(a){if(!this.instance||this.isSVG)return;if(!this.isVisible)return Nj;const l={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=Zl(a==null?void 0:a.pointerEvents)||"",l.transform=c?c(this.latestValues,""):"none",l;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const h={};return this.options.layoutId&&(h.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,h.pointerEvents=Zl(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!mo(this.latestValues)&&(h.transform=c?c({},""):"none",this.hasProjected=!1),h}const d=u.animationValues||u.latestValues;this.applyTransformsToTarget(),l.transform=Aj(this.projectionDeltaWithTransform,this.treeScale,d),c&&(l.transform=c(d,l.transform));const{x:f,y:p}=this.projectionDelta;l.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,u.animationValues?l.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:l.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const h in ji){if(d[h]===void 0)continue;const{correct:g,applyTo:m,isCSSVariable:v}=ji[h],x=l.transform==="none"?d[h]:g(d[h],u);if(m){const w=m.length;for(let T=0;T<w;T++)l[m[T]]=x}else v?this.options.visualElement.renderState.vars[h]=x:l[h]=x}return this.options.layoutId&&(l.pointerEvents=u===this?Zl(a==null?void 0:a.pointerEvents)||"":"none"),l}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var l;return(l=a.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(Iv),this.root.sharedNodes.clear()}}}function $j(e){e.updateLayout()}function Fj(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i==="size"?Ln(f=>{const p=a?t.measuredBox[f]:t.layoutBox[f],h=on(p);p.min=r[f].min,p.max=p.min+h}):Bv(i,t.layoutBox,r)&&Ln(f=>{const p=a?t.measuredBox[f]:t.layoutBox[f],h=on(r[f]);p.max=p.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const l=bs();Yi(l,r,t.layoutBox);const c=bs();a?Yi(c,e.applyTransform(o,!0),t.measuredBox):Yi(c,r,t.layoutBox);const u=!Sv(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:h}=f;if(p&&h){const g=Ft();Gi(g,t.layoutBox,p.layoutBox);const m=Ft();Gi(m,r,h.layoutBox),Ov(g,m)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function _j(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Bj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Lj(e){e.clearSnapshot()}function Iv(e){e.clearMeasurements()}function Vj(e){e.isLayoutDirty=!1}function Wj(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Av(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zj(e){e.resolveTargetDelta()}function Uj(e){e.calcProjection()}function Hj(e){e.resetSkewAndRotation()}function qj(e){e.removeLeadSnapshot()}function Nv(e,t,n){e.translate=Et(t.translate,0,n),e.scale=Et(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function jv(e,t,n,r){e.min=Et(t.min,n.min,r),e.max=Et(t.max,n.max,r)}function Yj(e,t,n,r){jv(e.x,t.x,n.x,r),jv(e.y,t.y,n.y,r)}function Gj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Kj={duration:.45,ease:[.4,0,.1,1]},$v=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Fv=$v("applewebkit/")&&!$v("chrome/")?Math.round:Bn;function _v(e){e.min=Fv(e.min),e.max=Fv(e.max)}function Xj(e){_v(e.x),_v(e.y)}function Bv(e,t,n){return e==="position"||e==="preserve-aspect"&&!JN(Ev(t),Ev(n),.2)}function Zj(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Jj=Dv({attachResizeListener:(e,t)=>Ui(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Df={current:void 0},Lv=Dv({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Df.current){const e=new Jj({});e.mount(window),e.setOptions({layoutScroll:!0}),Df.current=e}return Df.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Qj={pan:{Feature:mj},drag:{Feature:hj,ProjectionNode:Lv,MeasureLayout:dv}};function Vv(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&wt.postRender(()=>i(t,Hi(t)))}class e6 extends qr{mount(){const{current:t}=this.node;t&&(this.unmount=dI(t,(n,r)=>(Vv(this.node,r,"Start"),o=>Vv(this.node,o,"End"))))}unmount(){}}class t6 extends qr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Wi(Ui(this.node.current,"focus",()=>this.onFocus()),Ui(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Wv(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&wt.postRender(()=>i(t,Hi(t)))}class n6 extends qr{mount(){const{current:t}=this.node;t&&(this.unmount=mI(t,(n,r)=>(Wv(this.node,r,"Start"),(o,{success:i})=>Wv(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const If=new WeakMap,Af=new WeakMap,r6=e=>{const t=If.get(e.target);t&&t(e)},o6=e=>{e.forEach(r6)};function s6({root:e,...t}){const n=e||document;Af.has(n)||Af.set(n,{});const r=Af.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(o6,{root:e,...t})),r[o]}function i6(e,t,n){const r=s6(t);return If.set(e,n),r.observe(e),()=>{If.delete(e),r.unobserve(e)}}const a6={some:0,all:1};class l6 extends qr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:a6[o]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),p=u?d:f;p&&p(c)};return i6(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(c6(t,n))&&this.startObserver()}unmount(){}}function c6({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const u6={inView:{Feature:l6},tap:{Feature:n6},focus:{Feature:t6},hover:{Feature:e6}},d6={layout:{ProjectionNode:Lv,MeasureLayout:dv}},Nf={current:null},zv={current:!1};function f6(){if(zv.current=!0,!!Td)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Nf.current=e.matches;e.addListener(t),t()}else Nf.current=!1}const p6=[...gb,Zt,Hr],h6=e=>p6.find(mb(e)),m6=new WeakMap;function g6(e,t,n){for(const r in t){const o=t[r],i=n[r];if(Xt(o))e.addValue(r,o),process.env.NODE_ENV==="development"&&Wl(o.version==="12.7.3",`Attempting to mix Motion versions ${o.version} with 12.7.3 may not work as expected.`);else if(Xt(i))e.addValue(r,Ai(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(o):a.hasAnimated||a.set(o)}else{const a=e.getStaticValue(r);e.addValue(r,Ai(a!==void 0?a:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Uv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class y6{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=hf,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=()=>{const h=ar.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,wt.render(this.render,!1,!0))};const{latestValues:c,renderState:u,onUpdate:d}=a;this.onUpdate=d,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=Kl(n),this.isVariantNode=xy(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in p){const g=p[h];c[h]!==void 0&&Xt(g)&&g.set(c[h],!1)}}mount(t){this.current=t,m6.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),zv.current||f6(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Nf.current,process.env.NODE_ENV!=="production"&&Wl(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),zr(this.notifyUpdate),zr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=co.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&wt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in fs){const n=fs[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ft()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Uv.length;r++){const o=Uv[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,a=t[i];a&&(this.propEventSubscriptions[o]=this.on(o,a))}this.prevMotionValues=g6(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ai(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(pb(r)||Zy(r))?r=parseFloat(r):!h6(r)&&Hr.test(n)&&(r=sb(t,n)),this.setBaseTarget(t,Xt(r)?r.get():r)),Xt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=Zd(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Xt(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Rd),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Hv extends y6{constructor(){super(...arguments),this.KeyframeResolver=bb}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Xt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function b6(e){return window.getComputedStyle(e)}class v6 extends Hv{constructor(){super(...arguments),this.type="html",this.renderInstance=$y}readValueFromInstance(t,n){if(co.has(n))return IA(t,n);{const r=b6(t),o=(zd(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Qb(t,n)}build(t,n,r){qd(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Qd(t,n,r)}}class x6 extends Hv{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ft,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&jy(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(co.has(n)){const r=ob(n);return r&&r.default||0}return n=Fy.has(n)?n:Wd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return By(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&wt.postRender(this.updateDimensions)}build(t,n,r){Kd(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,o){_y(t,n,r,o)}mount(t){this.isSVGTag=Xd(t.tagName),super.mount(t)}}const w6=(e,t)=>Gd(e)?new x6(t):new v6(t,{allowProjection:e!==D.Fragment}),C6=sA({...UN,...u6,...Qj,...d6},w6),Xi=CI(C6),hn=({name:e,size:t=24,url:n,color:r="currentColor",style:o={},...i})=>{const{isPrimary:a}=i,l=n||Ge[e],u=It().palette.mode==="dark",d=a?"invert(0%) brightness(200%)":u?"invert(100%) sepia(0%) saturate(0%) hue-rotate(93deg) brightness(103%) contrast(103%)":"invert(48%) sepia(0%) saturate(0%) hue-rotate(181deg) brightness(95%) contrast(90%)";return l?y.jsx("img",{src:l,alt:`${e}-icon`,draggable:!1,style:{filter:d,...o},...i}):null},S6=({showOptions:e,setShowOptions:t,buttonRef:n,options:r,onClick:o})=>{const i=D.useRef(null);return D.useEffect(()=>{let a;return e&&(a=setTimeout(()=>{const l=c=>{i!=null&&i.current&&!(i!=null&&i.current.contains(c.target))&&!(n!=null&&n.contains(c.target))&&t(!1)};document.addEventListener("mousedown",l),document._customLabelClickOutside=l},0)),()=>{clearTimeout(a),document._customLabelClickOutside&&(document.removeEventListener("mousedown",document._customLabelClickOutside),delete document._customLabelClickOutside)}},[e]),y.jsx(os,{open:e,anchorEl:n,placement:"bottom",transition:!0,modifiers:[{name:"offset",options:{offset:[0,0]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:a})=>{a.styles.popper.width=`${a.rects.reference.width}px`}}],style:{zIndex:1300},ref:i,children:({TransitionProps:a})=>y.jsx($r,{...a,timeout:100,children:y.jsx(Ce,{sx:{background:l=>l.palette.primary.appBackground,border:l=>`1px solid ${l.palette.primary.notifyBorderColor}`,borderRadius:"0.7rem",width:"100%",padding:"0.3rem",maxHeight:"20rem",overflowY:"auto"},children:y.jsx(Ce,{children:r==null?void 0:r.map((l,c)=>y.jsx(Br,{sx:{opacity:1,pointerEvents:"auto",padding:"0rem",borderTop:c!==0?u=>`0.1rem solid ${u.palette.primary.notifyBorderColor}`:"none"},onClick:u=>{u.stopPropagation(),o(l)},children:y.jsx(ft,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{p:"0.5rem"},children:y.jsx(ft,{direction:"row",alignItems:"center",gap:"1rem",children:y.jsx(ot,{component:"h3",sx:{color:u=>u.palette.primary.notifyActiveText,fontWeight:"300",fontSize:"1.1rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l.label})})})},c))})})})})},qv=({styles:e,label:t,disabled:n,onClick:r,...o})=>{var g,m;const i=It();let a=(t==null?void 0:t.length)*((t==null?void 0:t.length)>=10?6.5:7.5)+38||0;a=o!=null&&o.options?a+15:a;const[l,c]=D.useState(!1),u=D.useRef(null),[d,f]=D.useState(!1),[p,h]=D.useState(e==null?void 0:e.isAnimate);return y.jsxs(Xi.button,{ref:u,onMouseEnter:()=>p&&c(!0),onMouseLeave:()=>p&&c(!1),initial:{width:(e==null?void 0:e.width)||(!p&&t?`${a/10}rem`:"3.2rem"),borderRadius:"0.7rem"},animate:{width:p?`${l?a/10:3.2}rem`:t?`${a/10}rem`:"3.2rem"},whileHover:{backgroundColor:(g=e==null?void 0:e.hover)==null?void 0:g.backgroundColor,color:(m=e==null?void 0:e.hover)==null?void 0:m.color},transition:{duration:.2,ease:"easeInOut"},style:{height:"3.2rem",outline:"none",overflow:"hidden",backgroundColor:(e==null?void 0:e.variant)!=="outlined"?(e==null?void 0:e.colorType)==="secondary"?i.palette.brandColor.blue:(e==null?void 0:e.colorType)==="danger"?i.palette.brandColor.red:(e==null?void 0:e.colorType)==="empty"?i.palette.primary.notifyButtonBackground:i.palette.brandColor.orange:i.palette.primary.notifyBackground,border:(e==null?void 0:e.variant)==="outlined"||(e==null?void 0:e.colorType)==="empty"?`0.1rem solid ${i.palette.primary.notifyBorderColor}`:"none",display:"flex",alignItems:"center",gap:l||!p?"0.5rem":0,color:(e==null?void 0:e.variant)==="outlined"||(e==null?void 0:e.colorType)==="empty"?i.palette.primary.notifyTextColor:"white",justifyContent:l?"flex-start":"center",padding:l||!p?"1.2rem":"0.8rem",whiteSpace:"nowrap",opacity:n?.6:1,cursor:n?"auto":"pointer",...e},disabled:n,layout:!0,onClick:()=>{!(o!=null&&o.options)&&r(),o!=null&&o.options&&(f(v=>!v),h(d))},...o,children:[(e==null?void 0:e.icon)&&(!(e!=null&&e.iconPosition)||(e==null?void 0:e.iconPosition)==="start")&&y.jsx(hn,{url:e==null?void 0:e.icon,isPrimary:e==null?void 0:e.iconPrimary}),t&&y.jsxs(Xi.div,{layout:!0,initial:{opacity:0,width:0},animate:{opacity:l||!p?1:0,width:l||!p?"auto":0},transition:{duration:.2,ease:"easeInOut",delay:l?.1:0},style:{overflow:"hidden",whiteSpace:"nowrap",display:"flex",justifyContent:"center",gap:"0.8rem"},children:[y.jsx(ot,{sx:{fontSize:"1.1rem"},children:t}),(o==null?void 0:o.options)&&(d?y.jsx(hn,{url:Ge.ArrowUpLight}):y.jsx(hn,{url:Ge.ArrowDownLight}))]}),(e==null?void 0:e.iconPosition)==="end"&&y.jsx(hn,{url:e==null?void 0:e.icon,isPrimary:e==null?void 0:e.iconPrimary}),y.jsx(S6,{showOptions:d,buttonRef:u==null?void 0:u.current,setShowOptions:f,options:o==null?void 0:o.options,onClick:r})]})};qv.propTypes={styles:s.object.isRequired,label:s.string};function go({...e}){return y.jsx(_n,{children:y.jsx(qv,{...e})})}function sc({...e}){return y.jsx(_n,{children:y.jsx(U0,{sx:{p:"0!important"},id:e==null?void 0:e.id,icon:y.jsx(Ce,{component:"img",src:Ge.Uncheck}),checkedIcon:y.jsx(Ce,{component:"img",src:Ge.Check}),...e})})}const Yv=new Set;function T6(e,t="warning"){if(process.env.NODE_ENV==="production")return;const n=Array.isArray(e)?e.join(`
303
303
  `):e;Yv.has(n)||(Yv.add(n),t==="error"?console.error(n):console.warn(n))}function k6(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const Or=s.oneOfType([s.func,s.object]);function O6(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":k6(7));return e.charAt(0).toUpperCase()+e.slice(1)}function jf(e){return e&&e.ownerDocument||document}const cr=typeof window<"u"?C.useLayoutEffect:C.useEffect;let Gv=0;function E6(e){const[t,n]=C.useState(e),r=e||t;return C.useEffect(()=>{t==null&&(Gv+=1,n(`mui-${Gv}`))},[t]),r}const Kv={...C}.useId;function ic(e){if(Kv!==void 0){const t=Kv();return e??t}return E6(e)}function ws({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=C.useRef(e!==void 0),[i,a]=C.useState(t),l=o?e:i;if(process.env.NODE_ENV!=="production"){C.useEffect(()=>{o!==(e!==void 0)&&console.error([`MUI: A component is changing the ${o?"":"un"}controlled ${r} state of ${n} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
304
304
  `))},[r,n,e]);const{current:u}=C.useRef(t);C.useEffect(()=>{!o&&!Object.is(u,t)&&console.error([`MUI: A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
305
305
  `))},[JSON.stringify(t)])}const c=C.useCallback(u=>{o||a(u)},[]);return[l,c]}function ke(e){const t=C.useRef(e);return cr(()=>{t.current=e}),C.useRef((...n)=>(0,t.current)(...n)).current}function mn(...e){const t=C.useRef(void 0),n=C.useCallback(r=>{const o=e.map(i=>{if(i==null)return null;if(typeof i=="function"){const a=i,l=a(r);return typeof l=="function"?l:()=>{a(null)}}return i.current=r,()=>{i.current=null}});return()=>{o.forEach(i=>i==null?void 0:i())}},e);return C.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const Xv={};function P6(e,t){const n=C.useRef(Xv);return n.current===Xv&&(n.current=e(t)),n}const M6=[];function R6(e){C.useEffect(e,M6)}class $f{constructor(){Vc(this,"currentId",null);Vc(this,"clear",()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});Vc(this,"disposeEffect",()=>this.clear)}static create(){return new $f}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function Cs(){const e=P6($f.create).current;return R6(e.disposeEffect),e}const D6={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function At(e,t,n=void 0){const r={};for(const o in e){const i=e[o];let a="",l=!0;for(let c=0;c<i.length;c+=1){const u=i[c];u&&(a+=(l===!0?"":" ")+t(u),l=!1,n&&n[u]&&(a+=" "+n[u]))}r[o]=a}return r}const Zv=e=>e,I6=(()=>{let e=Zv;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Zv}}})(),A6={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Lt(e,t,n="Mui"){const r=A6[t];return r?`${n}-${r}`:`${I6.generate(e)}-${t}`}function Vt(e,t,n="Mui"){const r={};return t.forEach(o=>{r[o]=Lt(e,o,n)}),r}function N6(e){return typeof e=="string"}function j6(e,t,n){return e===void 0||N6(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function $6(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function Jv(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function F6(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const h=fe(n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),g={...n==null?void 0:n.style,...o==null?void 0:o.style,...r==null?void 0:r.style},m={...n,...o,...r};return h.length>0&&(m.className=h),Object.keys(g).length>0&&(m.style=g),{props:m,internalRef:void 0}}const a=$6({...o,...r}),l=Jv(r),c=Jv(o),u=t(a),d=fe(u==null?void 0:u.className,n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),f={...u==null?void 0:u.style,...n==null?void 0:n.style,...o==null?void 0:o.style,...r==null?void 0:r.style},p={...u,...n,...c,...l};return d.length>0&&(p.className=d),Object.keys(f).length>0&&(p.style=f),{props:p,internalRef:u.ref}}function Zi(e,t,n){return typeof e=="function"?e(t,n):e}function dt(e){var f;const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:o=!1,...i}=e,a=o?{}:Zi(n,r),{props:l,internalRef:c}=F6({...i,externalSlotProps:a}),u=mn(c,a==null?void 0:a.ref,(f=e.additionalProps)==null?void 0:f.ref);return j6(t,{...l,ref:u},r)}const Ji=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),_6=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const o=n??r;let i;if(e!=null)i=e;else if(o.includes(t))i=t;else if(o.length>0)i=o[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:i}},ac=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},Qi=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:o,isDateDisabled:i,utils:a,timezone:l})=>{const c=ac(a,a.date(void 0,l),e);n&&a.isBefore(o,c)&&(o=c),t&&a.isAfter(r,c)&&(r=c);let u=e,d=e;for(a.isBefore(e,o)&&(u=o,d=null),a.isAfter(e,r)&&(d&&(d=r),u=null);u||d;){if(u&&a.isAfter(u,r)&&(u=null),d&&a.isBefore(d,o)&&(d=null),u){if(!i(u))return u;u=a.addDays(u,1)}if(d){if(!i(d))return d;d=a.addDays(d,-1)}}return null},B6=(e,t)=>e.isValid(t)?t:null,Qv=(e,t,n)=>t==null||!e.isValid(t)?n:t,L6=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),Ff=(e,t)=>{const r=[e.startOfYear(t)];for(;r.length<12;){const o=r[r.length-1];r.push(e.addMonths(o,1))}return r},e2=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),V6=["year","month","day"],t2=e=>V6.includes(e),_f=(e,{format:t,views:n},r)=>{if(t!=null)return t;const o=e.formats;return Ji(n,["year"])?o.year:Ji(n,["month"])?o.month:Ji(n,["day"])?o.dayOfMonth:Ji(n,["month","year"])?`${o.month} ${o.year}`:Ji(n,["day","month"])?`${o.month} ${o.dayOfMonth}`:r?/en/.test(e.getCurrentLocaleCode())?o.normalDateWithWeekday:o.normalDate:o.keyboardDate},W6=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},z6=["hours","minutes","seconds"],U6=e=>z6.includes(e),n2=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),H6=(e,t)=>(n,r)=>e?t.isAfter(n,r):n2(n,t)>n2(r,t),ur={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},q6=e=>Math.max(...e.map(t=>ur[t.type]??1)),ea=(e,t,n)=>{if(t===ur.year)return e.startOfYear(n);if(t===ur.month)return e.startOfMonth(n);if(t===ur.day)return e.startOfDay(n);let r=n;return t<ur.minutes&&(r=e.setMinutes(r,0)),t<ur.seconds&&(r=e.setSeconds(r,0)),t<ur.milliseconds&&(r=e.setMilliseconds(r,0)),r},Y6=({props:e,utils:t,granularity:n,timezone:r,getTodayDate:o})=>{let i=o?o():ea(t,n,e2(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,i)&&(i=ea(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,i)&&(i=ea(t,n,e.maxDate));const a=H6(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&a(e.minTime,i)&&(i=ea(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:ac(t,i,e.minTime))),e.maxTime!=null&&a(i,e.maxTime)&&(i=ea(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:ac(t,i,e.maxTime))),i},Bf=(e,t)=>{const n=e.formatTokenMap[t];if(n==null)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(`
@@ -323,5 +323,5 @@ const theme2 = createTheme({ palette: {
323
323
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[D1]=this[D1]={accessors:{}}).accessors,o=this.prototype;function i(a){const l=wa(a);r[l]||($8(o,a),r[l]=!0)}return te.isArray(t)?t.forEach(i):i(t),this}};gn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),te.reduceDescriptors(gn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),te.freezeMethods(gn);function kp(e,t){const n=this||xa,r=t||n,o=gn.from(r.headers);let i=r.data;return te.forEach(e,function(l){i=l.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function I1(e){return!!(e&&e.__CANCEL__)}function Ns(e,t,n){Ue.call(this,e??"canceled",Ue.ERR_CANCELED,t,n),this.name="CanceledError"}te.inherits(Ns,Ue,{__CANCEL__:!0});function A1(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ue("Request failed with status code "+n.status,[Ue.ERR_BAD_REQUEST,Ue.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function F8(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function _8(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,a;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=r[i];a||(a=u),n[o]=c,r[o]=u;let f=i,p=0;for(;f!==o;)p+=n[f++],f=f%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-a<t)return;const h=d&&u-d;return h?Math.round(p*1e3/h):void 0}}function B8(e,t){let n=0,r=1e3/t,o,i;const a=(u,d=Date.now())=>{n=d,o=null,i&&(clearTimeout(i),i=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-n;f>=r?a(u,d):(o=u,i||(i=setTimeout(()=>{i=null,a(o)},r-f)))},()=>o&&a(o)]}const Dc=(e,t,n=3)=>{let r=0;const o=_8(50,250);return B8(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,c=a-r,u=o(c),d=a<=l;r=a;const f={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-a)/u:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},N1=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},j1=e=>(...t)=>te.asap(()=>e(...t)),L8=en.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,en.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(en.origin),en.navigator&&/(msie|trident)/i.test(en.navigator.userAgent)):()=>!0,V8=en.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];te.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),te.isString(r)&&a.push("path="+r),te.isString(o)&&a.push("domain="+o),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function W8(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function z8(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function $1(e,t,n){let r=!W8(t);return e&&(r||n==!1)?z8(e,t):t}const F1=e=>e instanceof gn?{...e}:e;function To(e,t){t=t||{};const n={};function r(u,d,f,p){return te.isPlainObject(u)&&te.isPlainObject(d)?te.merge.call({caseless:p},u,d):te.isPlainObject(d)?te.merge({},d):te.isArray(d)?d.slice():d}function o(u,d,f,p){if(te.isUndefined(d)){if(!te.isUndefined(u))return r(void 0,u,f,p)}else return r(u,d,f,p)}function i(u,d){if(!te.isUndefined(d))return r(void 0,d)}function a(u,d){if(te.isUndefined(d)){if(!te.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function l(u,d,f){if(f in t)return r(u,d);if(f in e)return r(void 0,u)}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(u,d,f)=>o(F1(u),F1(d),f,!0)};return te.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=c[d]||o,p=f(e[d],t[d],d);te.isUndefined(p)&&f!==l||(n[d]=p)}),n}const _1=e=>{const t=To({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:l}=t;t.headers=a=gn.from(a),t.url=E1($1(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(te.isFormData(n)){if(en.hasStandardBrowserEnv||en.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...d].join("; "))}}if(en.hasStandardBrowserEnv&&(r&&te.isFunction(r)&&(r=r(t)),r||r!==!1&&L8(t.url))){const u=o&&i&&V8.read(i);u&&a.set(o,u)}return t},U8=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=_1(e);let i=o.data;const a=gn.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=o,d,f,p,h,g;function m(){h&&h(),g&&g(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let v=new XMLHttpRequest;v.open(o.method.toUpperCase(),o.url,!0),v.timeout=o.timeout;function x(){if(!v)return;const T=gn.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),b={data:!l||l==="text"||l==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:T,config:e,request:v};A1(function(E){n(E),m()},function(E){r(E),m()},b),v=null}"onloadend"in v?v.onloadend=x:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(x)},v.onabort=function(){v&&(r(new Ue("Request aborted",Ue.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new Ue("Network Error",Ue.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let k=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const b=o.transitional||M1;o.timeoutErrorMessage&&(k=o.timeoutErrorMessage),r(new Ue(k,b.clarifyTimeoutError?Ue.ETIMEDOUT:Ue.ECONNABORTED,e,v)),v=null},i===void 0&&a.setContentType(null),"setRequestHeader"in v&&te.forEach(a.toJSON(),function(k,b){v.setRequestHeader(b,k)}),te.isUndefined(o.withCredentials)||(v.withCredentials=!!o.withCredentials),l&&l!=="json"&&(v.responseType=o.responseType),u&&([p,g]=Dc(u,!0),v.addEventListener("progress",p)),c&&v.upload&&([f,h]=Dc(c),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(d=T=>{v&&(r(!T||T.type?new Ns(null,e,v):T),v.abort(),v=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));const w=F8(o.url);if(w&&en.protocols.indexOf(w)===-1){r(new Ue("Unsupported protocol "+w+":",Ue.ERR_BAD_REQUEST,e));return}v.send(i||null)})},H8=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const i=function(u){if(!o){o=!0,l();const d=u instanceof Error?u:this.reason;r.abort(d instanceof Ue?d:new Ns(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,i(new Ue(`timeout ${t} of ms exceeded`,Ue.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>te.asap(l),c}},q8=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},Y8=async function*(e,t){for await(const n of G8(e))yield*q8(n,t)},G8=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},B1=(e,t,n,r)=>{const o=Y8(e,t);let i=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await o.next();if(u){l(),c.close();return}let f=d.byteLength;if(n){let p=i+=f;n(p)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Ic=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",L1=Ic&&typeof ReadableStream=="function",K8=Ic&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),V1=(e,...t)=>{try{return!!e(...t)}catch{return!1}},X8=L1&&V1(()=>{let e=!1;const t=new Request(en.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),W1=64*1024,Op=L1&&V1(()=>te.isReadableStream(new Response("").body)),Ac={stream:Op&&(e=>e.body)};Ic&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ac[t]&&(Ac[t]=te.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Ue(`Response type '${t}' is not supported`,Ue.ERR_NOT_SUPPORT,r)})})})(new Response);const Z8=async e=>{if(e==null)return 0;if(te.isBlob(e))return e.size;if(te.isSpecCompliantForm(e))return(await new Request(en.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(te.isArrayBufferView(e)||te.isArrayBuffer(e))return e.byteLength;if(te.isURLSearchParams(e)&&(e=e+""),te.isString(e))return(await K8(e)).byteLength},J8=async(e,t)=>{const n=te.toFiniteNumber(e.getContentLength());return n??Z8(t)},Ep={http:v8,xhr:U8,fetch:Ic&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:p}=_1(e);u=u?(u+"").toLowerCase():"text";let h=H8([o,i&&i.toAbortSignal()],a),g;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let v;try{if(c&&X8&&n!=="get"&&n!=="head"&&(v=await J8(d,r))!==0){let b=new Request(t,{method:"POST",body:r,duplex:"half"}),O;if(te.isFormData(r)&&(O=b.headers.get("content-type"))&&d.setContentType(O),b.body){const[E,M]=N1(v,Dc(j1(c)));r=B1(b.body,W1,E,M)}}te.isString(f)||(f=f?"include":"omit");const x="credentials"in Request.prototype;g=new Request(t,{...p,signal:h,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:x?f:void 0});let w=await fetch(g);const T=Op&&(u==="stream"||u==="response");if(Op&&(l||T&&m)){const b={};["status","statusText","headers"].forEach(I=>{b[I]=w[I]});const O=te.toFiniteNumber(w.headers.get("content-length")),[E,M]=l&&N1(O,Dc(j1(l),!0))||[];w=new Response(B1(w.body,W1,E,()=>{M&&M(),m&&m()}),b)}u=u||"text";let k=await Ac[te.findKey(Ac,u)||"text"](w,e);return!T&&m&&m(),await new Promise((b,O)=>{A1(b,O,{data:k,headers:gn.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:g})})}catch(x){throw m&&m(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new Ue("Network Error",Ue.ERR_NETWORK,e,g),{cause:x.cause||x}):Ue.from(x,x&&x.code,e,g)}})};te.forEach(Ep,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const z1=e=>`- ${e}`,Q8=e=>te.isFunction(e)||e===null||e===!1,U1={getAdapter:e=>{e=te.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let a;if(r=n,!Q8(n)&&(r=Ep[(a=String(n)).toLowerCase()],r===void 0))throw new Ue(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+i]=r}if(!r){const i=Object.entries(o).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?i.length>1?`since :
324
324
  `+i.map(z1).join(`
325
325
  `):" "+z1(i[0]):"as no adapter specified";throw new Ue("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Ep};function Pp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ns(null,e)}function H1(e){return Pp(e),e.headers=gn.from(e.headers),e.data=kp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),U1.getAdapter(e.adapter||xa.adapter)(e).then(function(r){return Pp(e),r.data=kp.call(e,e.transformResponse,r),r.headers=gn.from(r.headers),r},function(r){return I1(r)||(Pp(e),r&&r.response&&(r.response.data=kp.call(e,e.transformResponse,r.response),r.response.headers=gn.from(r.response.headers))),Promise.reject(r)})}const q1="1.8.4",Nc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Nc[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Y1={};Nc.transitional=function(t,n,r){function o(i,a){return"[Axios v"+q1+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,l)=>{if(t===!1)throw new Ue(o(a," has been removed"+(n?" in "+n:"")),Ue.ERR_DEPRECATED);return n&&!Y1[a]&&(Y1[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,l):!0}},Nc.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function e7(e,t,n){if(typeof e!="object")throw new Ue("options must be an object",Ue.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const l=e[i],c=l===void 0||a(l,i,e);if(c!==!0)throw new Ue("option "+i+" must be "+c,Ue.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ue("Unknown option "+i,Ue.ERR_BAD_OPTION)}}const jc={assertOptions:e7,validators:Nc},mr=jc.validators;let ko=class{constructor(t){this.defaults=t,this.interceptors={request:new P1,response:new P1}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
326
- `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=To(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&jc.assertOptions(r,{silentJSONParsing:mr.transitional(mr.boolean),forcedJSONParsing:mr.transitional(mr.boolean),clarifyTimeoutError:mr.transitional(mr.boolean)},!1),o!=null&&(te.isFunction(o)?n.paramsSerializer={serialize:o}:jc.assertOptions(o,{encode:mr.function,serialize:mr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),jc.assertOptions(n,{baseUrl:mr.spelling("baseURL"),withXsrfToken:mr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&te.merge(i.common,i[n.method]);i&&te.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),n.headers=gn.concat(a,i);const l=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,p;if(!c){const g=[H1.bind(this),void 0];for(g.unshift.apply(g,l),g.push.apply(g,u),p=g.length,d=Promise.resolve(n);f<p;)d=d.then(g[f++],g[f++]);return d}p=l.length;let h=n;for(f=0;f<p;){const g=l[f++],m=l[f++];try{h=g(h)}catch(v){m.call(this,v);break}}try{d=H1.call(this,h)}catch(g){return Promise.reject(g)}for(f=0,p=u.length;f<p;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=To(this.defaults,t);const n=$1(t.baseURL,t.url,t.allowAbsoluteUrls);return E1(n,t.params,t.paramsSerializer)}};te.forEach(["delete","get","head","options"],function(t){ko.prototype[t]=function(n,r){return this.request(To(r||{},{method:t,url:n,data:(r||{}).data}))}}),te.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,l){return this.request(To(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}ko.prototype[t]=n(),ko.prototype[t+"Form"]=n(!0)});let t7=class Pw{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(l=>{r.subscribe(l),i=l}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,l){r.reason||(r.reason=new Ns(i,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Pw(function(o){t=o}),cancel:t}}};function n7(e){return function(n){return e.apply(null,n)}}function r7(e){return te.isObject(e)&&e.isAxiosError===!0}const Mp={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Mp).forEach(([e,t])=>{Mp[t]=e});function G1(e){const t=new ko(e),n=p1(ko.prototype.request,t);return te.extend(n,ko.prototype,t,{allOwnKeys:!0}),te.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return G1(To(e,o))},n}const St=G1(xa);St.Axios=ko,St.CanceledError=Ns,St.CancelToken=t7,St.isCancel=I1,St.VERSION=q1,St.toFormData=Mc,St.AxiosError=Ue,St.Cancel=St.CanceledError,St.all=function(t){return Promise.all(t)},St.spread=n7,St.isAxiosError=r7,St.mergeConfig=To,St.AxiosHeaders=gn,St.formToJSON=e=>R1(te.isHTMLForm(e)?new FormData(e):e),St.getAdapter=U1.getAdapter,St.HttpStatusCode=Mp,St.default=St;const{Axios:YW,AxiosError:GW,CanceledError:KW,isCancel:XW,CancelToken:ZW,VERSION:JW,all:QW,Cancel:ez,isAxiosError:tz,spread:nz,toFormData:rz,AxiosHeaders:oz,HttpStatusCode:sz,formToJSON:iz,getAdapter:az,mergeConfig:lz}=St,Rp={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"},Ca={headers:{"Content-Type":"application/json"},withCredentials:!0},K1=St.create({baseURL:Rp.BASE_URL,axiosConfig:Ca});K1.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),K1.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const Rr={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},X1={TENANT_ID:"tenant_id",BU_ID:"bu_id",SNOP_ID:"snop_id"},o7=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),s7=[10,25,50,100],Z1={MARK_ALL_READ:"MARK_ALL_READ"},i7=s7.map(e=>({label:e,value:e})),J1={PRIMARY:"PRIMARY",SECONDARY:"SECONDARY"},$c={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"};/*! js-cookie v3.0.5 | MIT */function Fc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var a7={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Dp(e,t){function n(o,i,a){if(!(typeof document>"u")){a=Fc({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var c in a)a[c]&&(l+="; "+c,a[c]!==!0&&(l+="="+a[c].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+l}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],a={},l=0;l<i.length;l++){var c=i[l].split("="),u=c.slice(1).join("=");try{var d=decodeURIComponent(c[0]);if(a[d]=e.read(u,d),o===d)break}catch{}}return o?a[o]:a}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",Fc({},i,{expires:-1}))},withAttributes:function(o){return Dp(this.converter,Fc({},this.attributes,o))},withConverter:function(o){return Dp(Fc({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var l7=Dp(a7,{path:"/"});const Ip=wc(Rr.SNOP),Ap=wc(Rr.SELECTED_BU),Np=wc(Rr.USER);wc(Rr.SETTINGS);const Q1={BU_IDS:Ap==null?void 0:Ap.business_unit_id,TOKEN:JSON.parse(l7.get(Rr.TOKEN)||null),TENANT_IDS:Np==null?void 0:Np.tenant_id,SNOP_IDS:Ip==null?void 0:Ip.snop_id},{TENANT_ID:c7,BU_ID:u7}=X1,{TENANT_IDS:d7,BU_IDS:f7}=Q1,_c=async({baseUrl:e,payload:t})=>{try{const n=`${e}${$c.SETTING}/v1?${c7}=${d7}&${u7}=${f7}`;return await St.post(n,t,Ca)}catch(n){return n}},p7=({columns:e,gridPath:t,baseUrl:n,isDefaultConfig:r,pageSize:o=10,childUniqueKey:i})=>{var x,w,T;let{definitions:a,defaultUserSettings:l,labels:c}=e;const u=Dr(c),d=t.split("/").filter(Boolean),f=JSON.parse(localStorage.getItem(Rr.SETTINGS));let p=d.reduce((k,b)=>k==null?void 0:k[b],f)||null;const h=Dr((p==null?void 0:p.columns)||[]);if(!r&&t){let k=(l&&jp({childUniqueKey:i}))??jp({definitions:a,childUniqueKey:i});k.filter(O=>!h[O.key]);const b=p&&((x=p==null?void 0:p.columns)==null?void 0:x.some(O=>(O==null?void 0:O.children)&&O.children[i]));if(!p||b==!1){if(b==!1){const O=Dr(k);k=(w=p==null?void 0:p.columns)==null?void 0:w.map(E=>{var M;return E!=null&&E.children&&!E.children[i]?{...E,children:{...E.children,[i]:(M=O==null?void 0:O[E==null?void 0:E.key])==null?void 0:M.children[i]}}:E})}(async()=>{try{const E={...f||{platform:{theme:"light"}}},M=(p==null?void 0:p.pageSize)??o;let I=E;for(let N=0;N<d.length;N++){const $=d[N];N===d.length-1?I[$]={columns:k,pageSize:M}:(I[$]={...I[$]||{}},I=I[$])}localStorage.setItem(Rr.SETTINGS,JSON.stringify(E)),await _c({baseUrl:n,payload:E})}catch(O){console.error(O)}})()}}l=((p==null?void 0:p.columns)&&m7(h,l,i))??l??jp({definitions:a});const g=[],m=Dr(l);for(const k of a){const b=m[k.key]||{},O=u[k.key]||{},E=Dr(b.children||[]),M=Dr(O.children||[]);let I={...k,...b,...O};(T=k.children)!=null&&T.length&&(I.children=k.children.map(N=>({...N,...E[N.key],...M[N.key]}))),g.push(I)}return g.sort((k,b)=>k.sequenceId-b.sequenceId)},h7=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),Sa=(e,t)=>e==null?void 0:e.map(n=>({id:n.id,key:n.key,sequenceId:n.sequenceId||n.id,isHidden:n.isHidden||!1,style:n.style||{},...(n==null?void 0:n.children)&&{children:t?{[t]:Sa(n.children)}:Sa(n.children)}})),Dr=e=>Array.isArray(e)&&(e==null?void 0:e.reduce((t,n)=>(t[n.key]=n,t),{})),jp=({definitions:e,childUniqueKey:t})=>Sa(e,t),m7=(e,t,n)=>t.map(o=>{const i=e[o.key],a=o.children?o.children.map(l=>{var d;const c=Dr(Array.isArray(i==null?void 0:i.children)?i==null?void 0:i.children:(d=i==null?void 0:i.children)==null?void 0:d[n]),u=c==null?void 0:c[l.key];return{...l,sequenceId:(u==null?void 0:u.sequenceId)||l.sequenceId,isHidden:(u==null?void 0:u.isHidden)??l.isHidden}}):void 0;return{...o,sequenceId:(i==null?void 0:i.sequenceId)||o.sequenceId,isHidden:(i==null?void 0:i.isHidden)??o.isHidden,...a?{children:a}:{}}}),g7=()=>({definitions:[{id:1,key:"sku_name",isSortable:!0,isMandatory:!0},{id:2,key:"node",isSortable:!0,isMandatory:!0},{id:3,key:"channel_name",isSortable:!0,isMandatory:!0}],defaultUserSettings:[{id:1,key:"sku_name",sequenceId:1,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}},{id:2,key:"node",sequenceId:2,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}},{id:3,key:"channel_name",sequenceId:3,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}}],labels:[{id:1,key:"sku_name",label:"SKU",isLocalizable:!1},{id:2,key:"node",label:"Node",isLocalizable:!1},{id:3,key:"channel_name",label:"Channel",isLocalizable:!1}]});class $p extends D.Component{constructor(t){super(t),this.startDrag=this.startDrag.bind(this),this.endDrag=this.endDrag.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.dragging=!1,this.mouseX=0,this.startPos=0,this.startWidthPrev=0,this.lastDraggedWidth=0,this.draggedCol=null,this.resizeRef=D.createRef()}startDrag(){if(!this.props.disabled&&(this.draggedCol=this.props.id,this.props.resizeStart&&this.draggedCol===this.props.id&&this.props.resizeStart(),this.dragging=!0,this.startPos=this.mouseX,this.startWidthPrev=0,this.resizeRef.current)){let t=this.resizeRef.current.previousSibling;t&&(this.startWidthPrev=t.clientWidth)}}endDrag(){this.props.disabled||(this.dragging=!1,this.props.resizeEnd&&this.draggedCol===this.props.id&&this.props.resizeEnd(this.lastDraggedWidth),this.draggedCol=null)}onMouseMove(t){if(this.props.disabled||(this.mouseX=t.touches?t.touches[0].screenX:t.screenX,!this.dragging))return;const n=this.resizeRef.current,r=this.startPos-this.mouseX;let o=this.startWidthPrev-r;(!this.props.minWidth||o>=this.props.minWidth)&&(!this.props.maxWidth||o<=this.props.maxWidth)&&(n.previousSibling.style.width=o+"px",n.previousSibling.style.minWidth=o+"px",n.previousSibling.style.maxWidth=o+"px",n.previousSibling.style.setProperty("--column_resize_before_width",o+"px"),this.lastDraggedWidth=o)}componentDidMount(){const t=this.resizeRef.current;if(t&&(this.props.defaultWidth?(t.previousSibling.style.minWidth=this.props.defaultWidth+"px",t.previousSibling.style.width=this.props.defaultWidth+"px",t.previousSibling.style.maxWidth=this.props.defaultWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.defaultWidth+"px")):this.props.minWidth&&(t.previousSibling.style.minWidth=this.props.minWidth+"px",t.previousSibling.style.width=this.props.minWidth+"px",t.previousSibling.style.maxWidth=this.props.minWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.minWidth+"px"))),this.props.disabled){this.props.defaultWidth&&t&&(t.previousSibling.style.minWidth=this.props.defaultWidth+"px",t.previousSibling.style.width=this.props.defaultWidth+"px",t.previousSibling.style.maxWidth=this.props.defaultWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.defaultWidth+"px")),this.props.maxWidth&&t&&(t.previousSibling.style.maxWidth=this.props.maxWidth+"px");return}this.addEventListenersToDocument()}componentWillUnmount(){this.props.disabled||this.removeEventListenersFromDocument()}componentDidUpdate(t,n){t.disabled&&!this.props.disabled&&this.addEventListenersToDocument(),!t.disabled&&this.props.disabled&&this.removeEventListenersFromDocument()}addEventListenersToDocument(){document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.endDrag),document.addEventListener("touchmove",this.onMouseMove),document.addEventListener("touchend",this.endDrag)}removeEventListenersFromDocument(){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.endDrag),document.removeEventListener("touchmove",this.onMouseMove),document.removeEventListener("touchend",this.endDrag)}render(){var t={userSelect:"none"};return this.props.disabled||(t.cursor="ew-resize"),this.props.className===""&&(t.width="6px",t.backgroundColor="rgba(0, 0, 0, 0.1)"),D.createElement("th",{ref:this.resizeRef,style:t,disabled:this.props.disabled,rowSpan:this.props.rowSpan?this.props.rowSpan:1,colSpan:this.props.colSpan?this.props.colSpan:1,className:`column_resizer_own_class ${this.props.disabled?"disabled_column_resize":""} ${this.props.className}`,onMouseDown:this.props.disabled?null:this.startDrag,onTouchStart:this.props.disabled?null:this.startDrag})}}$p.defaultProps={disabled:!1,minWidth:0,className:""},$p.propTypes={disabled:"boolean",minWidth:"number",className:"string"};const y7=(e,t,n,r,o,i)=>{const[a,l]=D.useState({isOpen:!1,column:null}),c=(p,h,g)=>{l({isOpen:p.currentTarget,column:h,isChild:!!g})},u=()=>{l({isOpen:!1,column:null,isChild:!1})},d=async()=>{u();const p=e.map(h=>{var g;if(a!=null&&a.isChild&&Array.isArray(h.children)){const m=h.children.map(x=>{var w;return x.key===((w=a.column)==null?void 0:w.key)?{...x,isHidden:!0}:x}),v=m.every(x=>x.isHidden);return{...h,isHidden:v?!0:h.isHidden,children:m}}return h.key===((g=a.column)==null?void 0:g.key)?{...h,isHidden:!0}:h});f({updatedColumns:p})},f=async({updatedColumns:p})=>{t({type:He.SET_GRID_DATA,payload:{visibleGridColumns:p}});const h=r.split("/").filter(Boolean),g=JSON.parse(localStorage.getItem(Rr.SETTINGS));let m=h.reduce((O,E)=>O==null?void 0:O[E],g)||null,v=Sa(p,i);const x=Dr(m==null?void 0:m.columns);v=v==null?void 0:v.map(O=>{var I;const E=(O==null?void 0:O.children)||{},M=((I=x==null?void 0:x[O==null?void 0:O.key])==null?void 0:I.children)||{};return{...O,children:{...M,[i]:E==null?void 0:E[i]}}});const T={...g||{platform:{theme:"light"}}},k=(m==null?void 0:m.pageSize)??o;let b=T;for(let O=0;O<h.length;O++){const E=h[O];O===h.length-1?b[E]={columns:v,pageSize:k}:(b[E]={...b[E]||{}},b=b[E])}localStorage.setItem(Rr.SETTINGS,JSON.stringify(T)),await _c({baseUrl:n,payload:T})};return{selectedColumn:a,handleMenuClick:c,handleClose:u,handleHideClick:d,columnUpdaterFunction:f}},ew=({pagination:e,gridPath:t,baseUrl:n})=>{const{selectedPage:r,rowPerPage:o,totalRecords:i,onPageChange:a,onPageSizeChange:l}=e,c=It(),u=async(d,f)=>{if(!f)return;const p=f.split("/").filter(Boolean),h="settings",m={...JSON.parse(localStorage.getItem(h))||{}};let v=m;for(let x=0;x<p.length;x++){const w=p[x];x===p.length-1?v[w]={...v[w]||{},pageSize:d}:(v[w]={...v[w]||{}},v=v[w])}localStorage.setItem(h,JSON.stringify(m)),await _c({baseUrl:n,payload:m})};return y.jsxs(Ce,{sx:{display:"flex",p:"1rem 1.5rem"},children:[y.jsxs(Ce,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"0.5rem",width:"100%"},children:[y.jsx(ot,{sx:{fontSize:"1.1rem",color:c.palette.primary.notifyTextColor},children:`Showing ${Math.min(r*o,i)} of ${i} rows`}),y.jsx(Ce,{sx:{"& .MuiInputBase-input":{padding:"0rem 0.8rem!important"},width:"6rem"},children:y.jsx(Tc,{options:i7,value:o,onChange:async d=>{l(d),u(d==null?void 0:d.value,t)}})})]}),y.jsx(Tg,{count:Math.ceil(i/o),page:r,onChange:async(d,f)=>{a(f)},siblingCount:0,shape:"rounded",sx:{width:"100%","& .MuiPagination-ul":{width:"100%",display:"flex",justifyContent:"flex-end","& li:first-of-type":{border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,color:c.palette.primary.notifyActiveText,marginRight:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"},"& li:last-child":{border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,color:c.palette.primary.notifyActiveText,marginLeft:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"}},"& .MuiPaginationItem-root":{color:"#595959",fontSize:"1.1rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex","& .MuiSvgIcon-root":{fontSize:"2.2rem"}},"& .Mui-selected":{color:c.palette.primary.notifyActiveText,backgroundColor:`${c.palette.brandColor.paginationBc} !important`}}})]})};ew.propTypes={pagination:s.object.isRequired};function Fp({isRenderCellContent:e,column:t,row:n,parent:r}){const o=n[t.key];return y.jsx(y.Fragment,{children:e?y.jsx(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},children:t==null?void 0:t.cellRenderer(n,{column:t,parent:r})}):y.jsx(Ag,{title:(o==null?void 0:o.length)>20?o:"",arrow:!0,children:y.jsx(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},id:t.key,component:"label",children:hV(o)})})})}Fp.propTypes={isRenderCellContent:s.bool,column:s.object,row:s.object};const tw=({menuOpen:e,handleClose:t,onHideClick:n})=>{const r=It();return y.jsx(ki,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:y.jsx(Ce,{sx:{backgroundColor:r.palette.primary.notifyBackground,border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:y.jsx(Hn,{onClick:n,disableRipple:!0,sx:{textTransform:"none",fontSize:"1.1rem",p:"0.4rem 1rem",minHeight:"unset",fontWeight:500,color:r.palette.primary.notifyTextColor,backgroundColor:"transparent","&:hover":{backgroundColor:"transparent"},"&:active":{backgroundColor:"transparent"},"&:focus":{backgroundColor:"transparent"}},children:"Hide Column"})})})};tw.propTypes={menuOpen:s.object,handleClose:s.func,onHideClick:s.func},Y(Ol)(({theme:e})=>({"& .MuiPaper-root":{borderRadius:8,border:`1px solid ${e.palette.primary.notifyBorderColor}`,boxShadow:e.shadows[4],padding:"1rem 1rem 0rem 1rem",backgroundColor:e.palette.primary.notifyBackground}}));const Oo=Y(ot)(({theme:e})=>({color:e.palette.primary.notifyTextColor,fontSize:"1.1rem"})),b7=Y(Ng)(({theme:e})=>({width:28,height:16,padding:0,display:"flex","&:active":{"& .MuiSwitch-thumb":{width:15},"& .MuiSwitch-switchBase.Mui-checked":{transform:"translateX(9px)"}},"& .MuiSwitch-switchBase":{padding:2,"&.Mui-checked":{transform:"translateX(12px)",color:"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:"#1890ff",...e.applyStyles("dark",{backgroundColor:"#177ddc"})}}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px 0 rgb(0 35 11 / 20%)",width:12,height:12,borderRadius:6,transition:e.transitions.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:16/2,opacity:1,backgroundColor:"rgba(0,0,0,.25)",boxSizing:"border-box",...e.applyStyles("dark",{backgroundColor:"rgba(255,255,255,.35)"})}})),v7=Y(vi)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),x7=Y(rd)(({theme:e})=>({"& .MuiBadge-badge":{right:3.5,top:1.8,border:`0.1rem solid ${e.palette.primary.notifyBackground}`,padding:"0 1.3px",borderRadius:"50%",backgroundColor:"#D44E40",fontSize:"0.725rem",minWidth:"0.7rem",height:"0.7rem"}}));Y(_l)(({theme:e})=>({"& .MuiInputBase-root":{height:"3.52rem"},"& .MuiFormLabel-root":{color:`${e.palette.primary.notifyBorderColor} !important`,fontSize:"1rem",marginTop:"0.4rem"},"& label.Mui-focused":{color:e.palette.primary.notifyTextColor},"& .MuiInput-underline:after":{borderBottomColor:e.palette.primary.notifyBorderColor,borderBottomWidth:"0.1rem"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&:hover fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&.Mui-focused fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"}}}));const w7=Y(Jg)(({theme:e})=>({minHeight:"2rem","& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveText}})),_p=Y(jg)(({theme:e})=>({color:e.palette.primary.notifyActiveText,textTransform:"none",fontWeight:"normal",padding:0,fontSize:"1rem",minHeight:"2rem",paddingBottom:"1rem","&.Mui-selected":{fontWeight:"bold",color:e.palette.primary.notifyActiveText}})),Bc=Y(ed)(({theme:e})=>({"&.MuiChip-outlined":{borderColor:e.palette.primary.notifyBorderColor,color:e.palette.primary.notifyActiveText},height:"2rem",fontSize:"0.9rem",fontWeight:"300",borderColor:e.palette.primary.notifyBorderColor,color:e.palette.primary.notifyActiveText,borderRadius:"0.6rem",padding:"0.2rem","&:hover":{backgroundColor:`${e.palette.brandColor.orange} !important`,color:`${e.palette.brandColor.white} !important`}})),nw=({sortKey:e,sortField:t,sortDir:n,handleSortClick:r})=>{const o=i=>y.jsx(Ar,{onClick:r,sx:{padding:"0.5rem"},draggable:!1,children:y.jsx(hn,{url:i})});return y.jsx(y.Fragment,{children:o(t===e?n==="asc"?Ge.AscSort:Ge.DescSort:Ge.Unsort)})};nw.propTypes={sortKey:s.string.isRequired,sortField:s.string,sortDir:s.string,handleSortClick:s.func};function rw({parent:e,column:t,sort:n,handleMenuClick:r,isManageable:o}){const i=o&&(!(t!=null&&t.isMandatory)||(t==null?void 0:t.isMandatory)&&(t==null?void 0:t.showHide)===!0),a=t==null?void 0:t.label,l=t==null?void 0:t.isSortable,c=n==null?void 0:n.sortField,u=n==null?void 0:n.sortDir,d=n==null?void 0:n.onSort;return y.jsxs(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",textAlign:"center",whiteSpace:"normal"},draggable:!1,children:[a,y.jsxs(Ce,{sx:{display:"flex",alignItems:"center"},draggable:!1,children:[l&&y.jsx(nw,{sortKey:e?`${e==null?void 0:e.key}|${t==null?void 0:t.key}`:t==null?void 0:t.key,sortField:c,sortDir:u,handleSortClick:()=>d({column:t,sortDir:u,sortField:c,parent:e})}),i&&y.jsx(Ar,{draggable:!1,onClick:f=>r(f,t,e),sx:{padding:"0.5rem 0.2rem"},children:y.jsx(hn,{url:Ge.Menu})})]})]})}rw.propTypes={column:s.object.isRequired,sort:s.object.isRequired,handleMenuClick:s.func,isManageable:s.bool};const C7=Y($l)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:"2rem",display:"table-cell",[`&.${xd.head}`]:{color:e.palette.primary.notifyTextColor,backgroundColor:e.palette.primary.notifyBackground,borderColor:e.palette.primary.notifyBorderColor,padding:"0rem",textAlign:"center"},[`&.${xd.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0rem",textAlign:"center"}}));function Ta({children:e,...t}){return y.jsx(C7,{...t,children:e})}Ta.propTypes={children:s.node};const S7=Y(Hg)(()=>({"&:last-child td":{borderBottom:0}}));function js({children:e,...t}){return y.jsx(S7,{...t,children:e})}js.propTypes={children:s.node};function ow({rows:e,sort:t,data:n,pagination:r,columns:o,nested:i,baseUrl:a,gridPath:l,childUniqueKey:c}){var U;const u=It(),{visibleGridColumns:d}=D.useContext(Sc),f=D.useContext(ya),{selectedColumn:p,handleMenuClick:h,handleClose:g,handleHideClick:m,columnUpdaterFunction:v}=y7(d,f,a,l,r==null?void 0:r.rowPerPage,c),x=o==null?void 0:o.isManageable,w=o==null?void 0:o.isResizable,T=(n==null?void 0:n.length)>0,k=D.useRef(null),[b,O]=D.useState(null),[E,M]=D.useState(null),[I,N]=D.useState(null);let $=null;const R=D.useRef(0),V=D.useRef(!1),F=D.useRef(null),L=h7(((U=i==null?void 0:i.column)==null?void 0:U.definitions)||[]),_=i==null?void 0:i.isNested,B=(i==null?void 0:i.data)||[],W=i==null?void 0:i.hashKey,[P,j]=D.useState(0),[z,ee]=D.useState(null);if(D.useEffect(()=>{if(k.current){const A=()=>{j(k.current.offsetHeight)};return A(),window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)}},[n]),D.useEffect(()=>{const A=k.current,G=A==null?void 0:A.querySelector("thead");if(!G)return;const J=()=>{N(null)};return G==null||G.addEventListener("mousedown",J),()=>{G==null||G.removeEventListener("mousedown",J)}},[]),!T)return y.jsx(Oo,{sx:{textAlign:"center"},children:Kr.NRF});const ne=(A,G)=>{var ue,ye;if(V.current){A.preventDefault();return}O(G),N(null),A.dataTransfer.setData("colIndex",G);const J=d[G],oe=J==null?void 0:J.label,be=document.createElement("div");be.textContent=oe,Object.assign(be.style,{display:"flex",alignItems:"center",justifyContent:"center",padding:"1.5rem 2.5rem",minWidth:(ue=J==null?void 0:J.style)==null?void 0:ue.minWidth,maxWidth:(ye=J==null?void 0:J.style)==null?void 0:ye.maxWidth,fontSize:"1.2rem",fontWeight:"500",color:u.palette.primary.notifyTextColor,background:u.palette.primary.notifyBackground,border:`0.1rem solid ${u.palette.primary.notifyBorderColor}`,borderRadius:"0rem",pointerEvents:"none",position:"absolute",top:"0",left:"0",zIndex:"-1",textAlign:"center",boxSizing:"border-box",boxShadow:"0 1px 4px rgba(0, 0, 0, 0.2)"}),document.body.appendChild(be);const{offsetWidth:Z,offsetHeight:ge}=be;A.dataTransfer.setDragImage(be,Z/2,ge/2),requestAnimationFrame(()=>{document.body.removeChild(be)})},q=(A,G)=>{A.preventDefault(),M(G),X(A)},Q=async(A,G)=>{if(A.preventDefault(),clearInterval($),b===null||b===G)return;const J=[...d],[oe]=J.splice(b,1);J.splice(G,0,oe);const be=d.slice().sort((ge,ue)=>ge.sequenceId-ue.sequenceId).map(ge=>ge.sequenceId),Z=J.map((ge,ue)=>({...ge,sequenceId:be[ue]??ge.sequenceId}));v({updatedColumns:Z}),O(null),M(null)},K=()=>{O(null),M(null)},ce=(A,G,J,oe)=>{var We,Ke,st,$e,pe;if(!A)return null;const be=(A==null?void 0:A.isMandatory)&&(A==null?void 0:A.isSticky),Z=parseFloat((Ke=(We=A==null?void 0:A.style)==null?void 0:We.minWidth)==null?void 0:Ke.toString().replace("rem",""))||7.5;G===0&&(R.current=0);const ge=be?G===0?0:`${R.current}rem`:void 0;be&&(R.current+=Z);const ue=b===G,ye=E==G||((st=d==null?void 0:d[E])==null?void 0:st.isMandatory),Ne=ve=>{A.isMandatory?(ve.preventDefault(),ve.dataTransfer.dropEffect="none"):(ve.preventDefault(),ve.dataTransfer.dropEffect="move"),q==null||q(ve,G)},Ie=ve=>{A.isMandatory||Q==null||Q(ve,G)},Me=oe?`${oe==null?void 0:oe.key}_${A==null?void 0:A.key}_${G}`:G;return y.jsx(Ta,{rowSpan:A!=null&&A.children?1:2,colSpan:(pe=($e=A==null?void 0:A.children)==null?void 0:$e.filter(ve=>!(ve!=null&&ve.isHidden)))==null?void 0:pe.length,style:A==null?void 0:A.style,onMouseEnter:()=>{I!==Me&&N(Me)},draggable:J&&!(A!=null&&A.isMandatory),onDragStart:J&&!(A!=null&&A.isMandatory)?ve=>ne(ve,G):ve=>{ve.preventDefault()},onDragOver:J&&!(A!=null&&A.isMandatory)?Ne:void 0,onDrop:J&&!(A!=null&&A.isMandatory)?Ie:void 0,onDragEnd:J&&!(A!=null&&A.isMandatory)?K:void 0,sx:{...A.isCenterTable&&{border:"0.1rem solid",borderTop:"none"},...ue&&{border:`0.1rem solid ${u.palette.brandColor.lightBlue}!important`},...be&&{position:"sticky",left:ge,zIndex:3},cursor:ye?"not-allowed":J&&!(A!=null&&A.isMandatory)?"grab":"default"},children:y.jsx(rw,{parent:oe,column:A,sort:t,handleMenuClick:h,isManageable:J})},G)},ie=(A,G,J,oe)=>{var ue,ye,Ne;if(!A)return null;const be=(A==null?void 0:A.isMandatory)&&(A==null?void 0:A.isSticky),Z=parseFloat((ye=(ue=A==null?void 0:A.style)==null?void 0:ue.minWidth)==null?void 0:ye.toString().replace("rem",""))||7.5;J===0&&(R.current=0);const ge=be?J===0?0:`${R.current}rem`:void 0;return be&&(R.current+=Z),y.jsxs(Ta,{colSpan:1,style:A==null?void 0:A.style,className:`${A==null?void 0:A.label}`,sx:{...A.isCenterTable&&{border:"0.1rem solid",borderTop:"none"},position:"relative",...be&&{position:"sticky",left:ge,zIndex:2,backgroundColor:Ie=>{var Me;return e!=null&&e.selectedRow&&((Me=e==null?void 0:e.selectedRow)==null?void 0:Me.fhi)===(G==null?void 0:G.fhi)||G!=null&&G.isHigh?Ie.palette.primary.appBackground:Ie.palette.primary.notifyBackground}}},children:[((e==null?void 0:e.selectedRow)&&((Ne=e==null?void 0:e.selectedRow)==null?void 0:Ne.fhi)===(G==null?void 0:G.fhi)||(G==null?void 0:G.isHigh))&&y.jsx(Ce,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}}),y.jsx(Fp,{isRenderCellContent:!!(A!=null&&A.cellRenderer),column:A,row:G,parent:oe})]},J)},se=(A,G,J,oe)=>y.jsx(y.Fragment,{children:A&&J&&!(A!=null&&A.isMandatory)?y.jsx(Ce,{resizeStart:()=>{A!=null&&A.isMandatory&&!(A!=null&&A.isResizable)||(V.current=!0,ee(G))},resizeEnd:()=>{A!=null&&A.isMandatory&&!(A!=null&&A.isResizable)||(V.current=!1,ee(null))},component:A!=null&&A.children||A!=null&&A.isMandatory?$l:$p,rowSpan:A!=null&&A.children?1:2,colSpan:1,id:G,sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${u.palette.primary.notifyBorderColor}`,cursor:"col-resize","&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"0.1rem",height:"2rem",backgroundColor:u.palette.primary.notifyBorderColor,zIndex:1},...!(A!=null&&A.isMandatory)&&{"&:hover::after":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"0.2rem",height:`${P}px`,backgroundColor:u.palette.primary.notifyBorderColor,zIndex:1}}},disabled:!J}):null}),ae=(A,G,J,oe,be,Z)=>{var ge;return Z&&`${Z==null?void 0:Z.key}${G==null?void 0:G.key}${J}`,y.jsx(y.Fragment,{children:G&&oe&&!(G!=null&&G.isMandatory)?y.jsx($l,{className:"column_resizer_body",sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${u.palette.primary.notifyBorderColor}`},children:((e==null?void 0:e.selectedRow)&&((ge=e==null?void 0:e.selectedRow)==null?void 0:ge.fhi)===(A==null?void 0:A.fhi)||(A==null?void 0:A.isHigh))&&y.jsx(Ce,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}})},`resize-${J}`):null})},X=A=>{const G=k.current,{left:J,right:oe}=G.getBoundingClientRect(),be=50,Z=A.clientX>oe-be?1:A.clientX<J+be?-1:0;Z!==0?(F.current&&clearInterval(F.current),F.current=setInterval(()=>{G.scrollLeft+=Z*10},50)):F.current&&(clearInterval(F.current),F.current=null)};return y.jsxs(y.Fragment,{children:[y.jsx(Lg,{sx:{maxHeight:"40rem",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${u.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem"},children:y.jsxs(Fg,{ref:k,stickyHeader:!0,"aria-label":"sticky table",sx:{backgroundColor:A=>A.palette.primary.notifyBackground},children:[y.jsxs(Wg,{children:[y.jsx(js,{sx:{position:"sticky",top:0,backgroundColor:u.palette.primary.notifyBackground,zIndex:3,maxHeight:"3.5rem"},children:d.map((A,G)=>A!=null&&A.isHidden||(A==null?void 0:A.isVisible)===!1?null:y.jsxs(D.Fragment,{children:[ce(A,G,x),se(A,G,x)]},G))}),y.jsx(js,{draggable:!1,sx:{position:"sticky",top:"2rem",backgroundColor:u.palette.primary.notifyBackground,zIndex:2},children:d.flatMap((A,G)=>A!=null&&A.isHidden||!(A!=null&&A.children)||(A==null?void 0:A.isVisible)===!1?[]:A.children.map((J,oe)=>J!=null&&J.isHidden?null:y.jsxs(D.Fragment,{children:[ce(J,oe,x,A),w&&se(J,oe,x)]},`${G}-${oe}`)))})]}),y.jsx(Bg,{children:n.map((A,G)=>{const J=A[W],oe=B==null?void 0:B[J],be=(oe==null?void 0:oe.length)>0;return y.jsxs(D.Fragment,{children:[y.jsx(js,{sx:{backgroundColor:Z=>{var ge;return e&&((ge=e==null?void 0:e.selectedRow)==null?void 0:ge.fhi)===(A==null?void 0:A.fhi)||A!=null&&A.isHigh?Z.palette.primary.appBackground:Z.palette.primary.notifyBackground}},onClick:()=>e==null?void 0:e.onRowClick(A),children:d.map((Z,ge)=>Z!=null&&Z.isHidden||(Z==null?void 0:Z.isVisible)===!1?null:Z!=null&&Z.children?Z.children.map((ue,ye)=>ue!=null&&ue.isHidden?null:y.jsxs(D.Fragment,{children:[ie(ue,A,ye,Z),w&&ae(A,ue,ye,x,G,Z)]},`${ge}-${ye}`)):y.jsxs(D.Fragment,{children:[ie(Z,A,ge),w&&ae(A,Z,ge,x)]},ge))}),_&&oe&&y.jsx(y.Fragment,{children:be?oe.map((Z,ge)=>y.jsx(js,{children:L.map((ue,ye)=>y.jsx(Ta,{style:ue==null?void 0:ue.style,children:y.jsx(Fp,{isRenderCellContent:!!(ue!=null&&ue.cellRenderer),column:ue,row:Z})},ye))},`nested-${ge}`)):y.jsx(js,{children:y.jsx(Ta,{colSpan:L.length,children:y.jsx(Oo,{sx:{textAlign:"center"},children:Kr.NRF})})})})]},G)})})]})}),r&&y.jsx(ew,{pagination:r,gridPath:l,baseUrl:a}),y.jsx(tw,{menuOpen:p==null?void 0:p.isOpen,handleClose:g,onHideClick:m})]})}ow.propTypes={sort:s.object,data:s.array,pagination:s.object,columns:s.object,nested:s.object};function sw({tableProps:e,isDefaultConfig:t,gridPath:n,baseUrl:r,childUniqueKey:o}){var c;const{columns:i}=e,a=D.useContext(ya),l=p7({columns:i,gridPath:n,baseUrl:r,isDefaultConfig:t,childUniqueKey:o,pageSize:(c=e==null?void 0:e.pagination)==null?void 0:c.rowPerPage});return D.useEffect(()=>{l!=null&&l.length&&(a==null||a({type:He.SET_GRID_DATA,payload:{visibleGridColumns:l}}))},[l]),y.jsx(ow,{...e,gridPath:n,baseUrl:r,childUniqueKey:o})}sw.propTypes={tableProps:s.object.isRequired,mergedColumns:s.array.isRequired};const iw=({type:e})=>{const t=It(),r=(t==null?void 0:t.mode)==="dark"?{bgcolor:"grey.800"}:{};return{grid:y.jsxs(Ce,{sx:{borderRadius:2,overflow:"hidden"},children:[y.jsx(Tr,{variant:"text",width:"100%",height:60,sx:r}),Array.from({length:10}).map((i,a)=>y.jsx(Ce,{sx:{display:"flex",alignItems:"center",padding:"0.5rem",gap:"3rem"},children:Array.from({length:5}).map((l,c)=>y.jsx(Ce,{sx:{flex:1},children:y.jsx(Tr,{variant:"text",height:45,sx:r})},c))},a))]}),toolbar:y.jsx(y.Fragment,{children:y.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{display:"flex",gap:"1rem"},children:[y.jsxs(ft,{direction:"row",gap:"1rem",children:[y.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"15.2rem",height:"5rem",sx:r})]}),y.jsxs(ft,{direction:"row",gap:"1rem",children:[y.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r})]})]})})}[e]},T7=e=>{if(!e)return null;const{options:t,...n}=e,r=t?"select":"button",o={button:i=>{var a;return y.jsx(go,{...i,styles:{...i.styles,iconPrimary:((a=i==null?void 0:i.styles)==null?void 0:a.variant)=="filled"}})},select:i=>{var a;return y.jsx(Ce,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"},width:(a=i.styles)==null?void 0:a.width},children:y.jsx(l1,{...i,options:t})})}};return o[r]?o[r](n):null},k7=({presentSetting:e,gridSetting:t,gridPath:n,childUniqueKey:r})=>{if(!n)return e;const o=n.split("/").filter(Boolean);let i=o.reduce((u,d)=>u==null?void 0:u[d],e)||null,a=Sa(t==null?void 0:t.grid,r);const l=Dr(i==null?void 0:i.columns);a=a==null?void 0:a.map(u=>{var p;const d=(u==null?void 0:u.children)||{},f=((p=l==null?void 0:l[u==null?void 0:u.key])==null?void 0:p.children)||{};return{...u,children:{...f,[r]:d==null?void 0:d[r]}}});let c=e;for(let u=0;u<o.length;u++){const d=o[u];u===o.length-1?c[d]={columns:a,pageSize:(t==null?void 0:t.pageSize)??null}:(c[d]=c[d]||{},c=c[d])}return{settingObject:e,defaultUserSettings:a}},O7=async({baseUrl:e,gridSetting:t,childUniqueKey:n,gridPath:r})=>{try{const o=JSON.parse(localStorage.getItem("settings")),{settingObject:i,defaultUserSettings:a}=k7({presentSetting:o,gridSetting:t,gridPath:r,childUniqueKey:n});return localStorage.setItem("settings",JSON.stringify(i)),await _c({baseUrl:e,payload:i}),a}catch(o){console.error(o)}},E7=({customTools:e})=>{var r,o;const t=(r=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===J1.PRIMARY))==null?void 0:r.sort((i,a)=>i.sequenceId-a.sequenceId),n=(o=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===J1.SECONDARY))==null?void 0:o.sort((i,a)=>i.sequenceId-a.sequenceId);return{primaryButtons:t,secondaryButtons:n}},aw=({customTools:e,isExpanded:t,setIsExpanded:n})=>{const{primaryButtons:r,secondaryButtons:o}=E7({customTools:e}),[i,a]=D.useState(r),l=(o==null?void 0:o.length)>0,c=d=>{d?a([...r,...o]):setTimeout(()=>{a(r)},100)},u=()=>{const d=!t;n(d),c(d)};return D.useEffect(()=>{c(t)},[e]),y.jsxs(y.Fragment,{children:[t&&y.jsx("div",{style:{position:"fixed",left:0,width:"100vw",height:"4rem",zIndex:998}}),y.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:"0.8rem",flexWrap:"nowrap",maxWidth:"100%",whiteSpace:"nowrap",zIndex:999},children:[y.jsx(J5,{mode:"popLayout",children:i.map((d,f)=>y.jsx(Xi.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},layout:!0,children:y.jsx(Ce,{sx:{flexShrink:0,minWidth:"fit-content"},children:T7(d)})},`${d.id}_${f}`))}),l&&y.jsx(Ce,{sx:{paddingLeft:t?"0.5rem":0},children:y.jsx(go,{label:t?"":"More Actions",styles:{iconPrimary:!0,icon:t?Ge.CrossWhite:Ge.More,colorType:t?"danger":""},onClick:u})})]})]})};aw.propTypes={customTools:s.array.isRequired};const lw=({defaultTools:e,isManageable:t,customTools:n,baseUrl:r,gridPath:o,pageSize:i,gridData:a,childUniqueKey:l})=>{var w,T,k,b,O,E;const c=D.useContext(ya),{visibleGridColumns:u,triggerApi:d}=D.useContext(Sc),[f,p]=D.useState([]),[h,g]=D.useState(!1);D.useEffect(()=>{if(u.length){const M={id:99999,sequenceId:99999,isLocalizable:!1,key:"horizons",label:"Horizons",isSortable:!1,isHidden:!0,showChildCheckbox:!0,showCheckbox:!1,isMandatory:!0,showInHierarchy:!0,showHide:!0,children:[]};let I=u.map($=>($!=null&&$.children&&$.children.forEach(R=>{M.children.some(F=>F.key===R.key)||M.children.push({...R,showInHierarchy:!0})}),$)).filter($=>($==null?void 0:$.id)!==(M==null?void 0:M.id));const N=M.children.length>0?[...I,M]:I;p(N)}},[u]);const m=async M=>{try{await O7({baseUrl:r,gridPath:o,childUniqueKey:l,gridSetting:{grid:M,pageSize:i}})}catch(I){console.error(I)}finally{c({type:He.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),c({type:He.TRIGGER_API,payload:{triggerApi:!1}})}};D.useEffect(()=>{d&&m(u)},[d]);const v=M=>{const I=M.map(R=>R.id),N=M.flatMap(R=>R.children||[]).map(R=>R.id),$=f.map(R=>{var L;const V=I.includes(R.id);if(Array.isArray(R.children)&&R.children.length>0){const _=R.children.map(W=>{const P=N.includes(W.id);return{...W,isHidden:!P}}),B=_.filter(W=>f.some(P=>{var j;return(j=P.children)==null?void 0:j.some(z=>z.id===W.id)})).every(W=>W.isHidden);return{...R,...!((L=R.children[0])!=null&&L.showInHierarchy)&&{isHidden:B||!V},children:_}}return{...R,isHidden:!V}});c({type:He.SET_GRID_DATA,payload:{visibleGridColumns:$}}),c({type:He.HAS_SETTING_CHANGE,payload:{hasChange:!0}})},x=()=>f.map(I=>{const N=Array.isArray(I.children)?I.children.filter($=>!$.isHidden):void 0;return!I.isHidden||I.isHidden&&I.showInHierarchy?{...I,children:N}:null}).filter(Boolean);return y.jsxs(Ce,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.6rem",width:"100%"},children:[y.jsxs(Ce,{sx:{display:"flex",flexDirection:"row",gap:"0.6rem"},children:[((w=e==null?void 0:e.search)==null?void 0:w.isRequired)&&y.jsx(s1,{...e==null?void 0:e.search,iconUrl:Ge.Search}),((T=e==null?void 0:e.refresh)==null?void 0:T.isRequired)&&y.jsx(go,{...e==null?void 0:e.refresh,styles:{variant:"filled",icon:Ge.Refresh,colorType:"empty",width:"3.2rem",height:"3.2rem"}}),((k=e==null?void 0:e.groupBy)==null?void 0:k.isRequired)&&y.jsx(Ce,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:y.jsx(Tc,{styles:{icon:Ge.Group},...e.groupBy})}),t&&y.jsx(Ce,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:y.jsx(Tc,{placeholder:"Manage Columns",options:f,value:x(),isMulti:!0,isDraggable:!0,showSearch:!0,isManageColumn:!0,onChange:v,disabled:!a.length,styles:{icon:Ge.Manage}})})]}),y.jsxs(Ce,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[n&&y.jsx(aw,{customTools:n,setIsExpanded:g,isExpanded:h}),((b=e==null?void 0:e.save)==null?void 0:b.isRequired)&&y.jsx(Ce,{sx:{px:"0.5rem"},children:y.jsx(go,{label:h?"":"Save",styles:{icon:Ge.Save,colorType:"empty"},...e==null?void 0:e.save})}),((O=e==null?void 0:e.upload)==null?void 0:O.isRequired)&&y.jsx(go,{...e==null?void 0:e.upload,styles:{variant:h?"outlined":"filled",icon:h?Ge.UploadDark:Ge.Upload,iconPrimary:!h,colorType:"secondary",isAnimate:!0}}),((E=e==null?void 0:e.download)==null?void 0:E.isRequired)&&y.jsx(go,{...e==null?void 0:e.download,styles:{variant:"outlined",icon:Ge.Download,isAnimate:!0}})]})]})};lw.propTypes={defaultTools:s.object.isRequired,customTools:s.array,isManageable:s.bool,baseUrl:s.string,gridPath:s.gridPath};function Bp({tableProps:e,toolbarProps:t,isDefaultConfig:n,isLoading:r}){var i,a;const o=(i=e.columns)==null?void 0:i.isManageable;return y.jsx(a1,{children:r?y.jsxs(y.Fragment,{children:[y.jsx(iw,{type:"toolbar"}),y.jsx(iw,{type:"grid"})]}):y.jsxs(Ce,{sx:{position:"sticky"},children:[t&&y.jsx(lw,{...t,isManageable:o,pageSize:(a=e==null?void 0:e.pagination)==null?void 0:a.rowPerPage,gridData:e==null?void 0:e.data}),y.jsx(sw,{tableProps:e,isDefaultConfig:n,gridPath:(t==null?void 0:t.gridPath)||"",baseUrl:(t==null?void 0:t.baseUrl)||"",childUniqueKey:(t==null?void 0:t.childUniqueKey)||""})]})})}Bp.propTypes={tableProps:s.object.isRequired,toolbarProps:s.object,isDefaultConfig:s.bool};const cw=({list:e,handleLinkClick:t})=>{const n=It(),r=({list:o})=>{var i;return(i=o==null?void 0:o.sort((a,l)=>a.order-l.order))==null?void 0:i.map((a,l)=>a!=null&&a.link?y.jsx(Br,{component:"h3",sx:{fontSize:"1rem",cursor:"pointer",color:l===(o==null?void 0:o.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},href:a==null?void 0:a.link,underline:"hover",onClick:()=>t(a),children:a==null?void 0:a.title},l):y.jsx(ot,{component:"h3",sx:{fontSize:"1rem",color:l===(o==null?void 0:o.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},children:a==null?void 0:a.title},l))};return y.jsx(L0,{separator:y.jsx(hn,{url:Ge.ArrowRight}),children:r({list:e})})};cw.propTypes={list:s.array.isRequired,handleLinkClick:s.func};const uw=({breadcrumbProps:e,switchProps:t,filterComponentProps:n})=>{var o,i,a,l,c,u;const r=It();return y.jsxs(y.Fragment,{children:[y.jsxs(ft,{sx:{background:r.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,height:"3rem",p:"0px 1.5rem 0 1.5rem",zIndex:4,position:"relative"},direction:"row",justifyContent:"space-between",alignItems:"center",children:[y.jsx(cw,{...e}),y.jsxs(ft,{direction:"row",gap:"1rem",alignItems:"center",children:[t&&y.jsx(f1,{...t}),(n==null?void 0:n.filterBtnProps)&&y.jsxs(ft,{direction:"row",children:[y.jsx(vi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"2rem!important",opacity:"1!important",borderColor:r.palette.primary.notifyBorderColor}}),y.jsxs(ft,{direction:"row",alignItems:"center",gap:"0.5rem",onClick:(o=n==null?void 0:n.filterBtnProps)==null?void 0:o.onFilterClick,sx:{cursor:"pointer"},children:[y.jsx(hn,{url:Ge.Filter}),y.jsx(ot,{sx:{fontSize:"1.1rem",color:r.palette.primary.notifyActiveText},children:(i=n==null?void 0:n.filterBtnProps)==null?void 0:i.label})]})]})]})]}),y.jsx(Xi.div,{layout:!0,initial:{height:"0rem"},animate:{height:(a=n==null?void 0:n.filterBtnProps)!=null&&a.filterContainerVisible?"5rem":"0rem",opacity:(l=n==null?void 0:n.filterBtnProps)!=null&&l.filterContainerVisible?1:0},transition:{duration:.5,ease:"easeInOut"},style:{background:r.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,padding:"0px 5.5rem 0 1.5rem",position:"relative",alignItems:"center",display:"flex",overflow:"hidden"},children:y.jsxs(ft,{sx:{background:r.palette.primary.appBackground,height:"3.8rem",p:"0 2rem",width:"100%",borderRadius:"0.7rem",overflow:"visible"},direction:"row",alignItems:"center",children:[y.jsx(ot,{sx:{fontSize:"1.2rem",fontWeight:"500",color:r.palette.primary.notifyActiveText},children:"Filters:"}),y.jsx(Ce,{sx:{overflowX:"auto",overflowY:"visible",whiteSpace:"nowrap",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},margin:"0 1rem",padding:"0.5rem 0",flexGrow:1},children:y.jsx(ft,{direction:"row",gap:"1.2rem",sx:{overflow:"visible"},children:(c=n==null?void 0:n.filterItems)==null?void 0:c.map((d,f)=>y.jsx(y.Fragment,{children:y.jsxs(Ce,{sx:{position:"relative",overflow:"visible",border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,background:r.palette.primary.notifyBackground,borderRadius:"0.6rem",padding:"0.3rem 1.1rem",display:"inline-block"},children:[y.jsx(Ce,{component:"img",src:Ge.FilterClose,sx:{position:"absolute",top:"-0.4rem",right:"-0.6rem",cursor:"pointer"},onClick:()=>n==null?void 0:n.onFilterChipClose(d)}),y.jsx(ot,{sx:{fontSize:"1rem",color:r.palette.primary.notifyTextColor},children:d==null?void 0:d.filterLabel})]},f)}))})}),y.jsx(Ce,{component:ot,sx:{fontSize:"1.1rem",fontWeight:"500",textDecoration:"underline",color:r.palette.brandColor.red,cursor:"pointer"},onClick:(u=n==null?void 0:n.filterContainerProps)==null?void 0:u.onClearClick,children:"Clear"})]})})]})};uw.propTypes={breadcrumbProps:s.object.isRequired,switchProps:s.object};function dw({headerProps:e}){return y.jsx(_n,{children:y.jsx(uw,{...e})})}dw.propTypes={headerProps:s.object.isRequired};const Lp=D.createContext(null),fw=D.createContext(null);function P7({children:e}){const[t,n]=D.useReducer(M7,R7);return y.jsx(Lp.Provider,{value:t,children:y.jsx(fw.Provider,{value:n,children:e})})}function M7(e,t){var n;switch(t.type){case He.LOADING:return{...e,loading:t.loading};case He.SUCCESS:return{...e,data:(n=t.data)==null?void 0:n.sort((r,o)=>new Date(o.createdAt)-new Date(r.createdAt))};case He.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case He.ERROR:return{...e,error:t.error};default:throw new Error(`${Kr.UNHANDLED}: ${t}`)}}const R7={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:Vp,BU_ID:Wp,SNOP_ID:pw}=X1,{TENANT_IDS:zp,BU_IDS:Up}=Q1,D7=async e=>{try{const t=`${e}${$c.NOTIFICATION}/v1?${Vp}=${zp}&${Wp}=${Up}`;return await St.get(t,Ca)}catch(t){return t}},hw=async(e,t,n)=>{try{const r=n===Z1.MARK_ALL_READ?"":`&${pw}=${n}&`,o=`${e}${$c.NOTIFICATION}${Rp.VERSION}?${Vp}=${zp}&${Wp}=${Up}${r}`;return await St.put(o,t,Ca)}catch(r){return r}},I7=async({baseUrl:e,id:t,snopId:n})=>{try{const r=`${e}${$c.NOTIFICATION}${Rp.VERSION}?${Vp}=${zp}&${Wp}=${Up}&${pw}=${n}&id=${t}`;return await St.get(r,Ca)}catch(r){return r}},Lc={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500},mw=({baseUrl:e})=>{const t=D.useContext(fw),[n,r]=D.useState(!1),[o,i]=D.useState(!1),[a,l]=D.useState(!1),[c,u]=D.useState({}),[d,f]=D.useState(null),[p,h]=D.useState(1),[g,m]=D.useState(!1),[v,x]=D.useState(0),{loading:w,data:T,isMarkAllAsRead:k}=D.useContext(Lp),[b,O]=D.useState([]);D.useEffect(()=>{O(T)},[T]);const E=D.useCallback(async()=>{var F,L;try{t({type:He.LOADING,loading:!0}),t({type:He.SUCCESS,data:[]});const _=await D7(e);if(_.status===Lc.OK){const B=((L=(F=_.data)==null?void 0:F.responseData)==null?void 0:L.response)||[],W=Cc(B);t({type:He.SUCCESS,data:Cc(W)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:i1(B),boo:i1(B)>0}})}}catch{t({type:He.ERROR,error:Kr.SWR})}finally{t({type:He.LOADING,loading:!1})}},[e,t]);D.useEffect(()=>{E();const F=setInterval(E,3e5);return()=>clearInterval(F)},[E]);const M=async(F,L)=>{var _,B,W;if(F){f(F);try{const P=await I7({baseUrl:e,id:F,snopId:L});if(P.status===Lc.OK){const j=((W=(B=(_=P.data)==null?void 0:_.responseData)==null?void 0:B.response)==null?void 0:W[0])||{};u(j||{}),l(!0)}else throw new Error}catch{t({type:He.ERROR,error:Kr.SWR})}finally{f(null)}}},I=async(F,L)=>{if(F.length){t({type:He.LOADING,loading:!0});try{if((await hw(e,F,L)).status===Lc.OK){const B=T.map(P=>F.includes(P.id)?{...P,isRead:!0}:P),W=B.filter(P=>!P.isRead).length;t({type:He.SUCCESS,data:Cc(B)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:W,boo:W>0}}),setTimeout(()=>{t({type:He.LOADING,loading:!1})},200)}}catch{t({type:He.ERROR,error:Kr.SWR}),t({type:He.LOADING,loading:!1})}}},N=async()=>{t({type:He.LOADING,loading:!0});try{const F=uV(T);if((await hw(e,F,Z1.MARK_ALL_READ)).status===Lc.OK){const _=T.map(B=>({...B,isRead:!0}));t({type:He.SUCCESS,data:Cc(_)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:0,boo:!1}}),setTimeout(()=>{t({type:He.LOADING,loading:!1})},200)}}catch{t({type:He.ERROR,error:Kr.SWR}),t({type:He.LOADING,loading:!1})}},$=(F,L)=>{t({type:He.LOADING,loading:!0}),x(L),setTimeout(()=>{t({type:He.LOADING,loading:!1})},400)},R=F=>{const L=F||T||[];return{0:L,1:L.filter(_=>(_==null?void 0:_.type)==="INFO"),2:L.filter(_=>(_==null?void 0:_.type)==="ERROR")}},V=()=>{t({type:He.LOADING,loading:!0});const F=!g,L=F?(b||[]).filter(_=>!_.isRead):T||[];m(F),O(L),h(1),setTimeout(()=>{t({type:He.LOADING,loading:!1})},400)};return{fetchNotification:E,showDetailsProps:{open:a,handleClose:()=>l(!1),setOpen:l,data:c,clickId:d},alertDialogProps:{open:n,handleClose:()=>r(!1),onRefresh:E,handleRead:I,handleMarkAllAsRead:N,setOpen:r,handleShowDetails:M,clickId:d,isMainDialog:!0},activeTab:v,loading:w,tabData:R(b)[v],data:b,mode:g,handleTabChange:$,toggleAlertMode:V,page:p,setPage:h,isMarkAllAsRead:k}};var gw,yw,bw;function Hp(){return Hp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hp.apply(null,arguments)}var A7=function(t){return C.createElement("svg",Hp({xmlns:"http://www.w3.org/2000/svg",width:16,height:17,fill:"none"},t),gw||(gw=C.createElement("path",{stroke:"#909090",strokeLinecap:"round",strokeMiterlimit:10,d:"M8.013 2.19c-2.206 0-4 1.793-4 4v1.927c0 .406-.173 1.026-.38 1.373l-.766 1.273c-.474.787-.147 1.66.72 1.954 2.873.96 5.973.96 8.846 0a1.335 1.335 0 0 0 .72-1.954l-.766-1.273c-.2-.347-.374-.967-.374-1.373V6.19c0-2.2-1.8-4-4-4Z"})),yw||(yw=C.createElement("path",{stroke:"#909090",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.247 2.383a4.503 4.503 0 0 0-2.467 0 1.324 1.324 0 0 1 2.467 0"})),bw||(bw=C.createElement("path",{stroke:"#909090",strokeMiterlimit:10,d:"M10.013 12.957c0 1.1-.9 2-2 2a2.007 2.007 0 0 1-2-2"})))};const N7=({count:e})=>(It(),y.jsxs(y.Fragment,{children:[y.jsx(Ce,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center","& svg":{transform:"scale(1)"}},children:y.jsx(A7,{style:{scale:2}})}),y.jsx(x7,{badgeContent:e!=0?"":null,color:"error"})]}));function vw({children:e,handleClose:t,open:n,isMainDialog:r}){return y.jsx(Ol,{open:n,onClose:t,...r?{scroll:"paper",PaperProps:{sx:{position:"fixed",top:30,right:30,m:0,width:400,height:450,display:"flex",flexDirection:"column",borderRadius:2,boxShadow:6,backgroundColor:o=>o.palette.primary.notifyBackground}}}:{fullWidth:!0,maxWidth:"md",sx:{"& .MuiPaper-root":{minHeight:250,maxHeight:500,borderRadius:"1.5rem",boxShadow:6,backgroundColor:o=>o.palette.primary.appBackground}}},children:e})}var xw;function qp(){return qp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qp.apply(null,arguments)}var j7=function(t){return C.createElement("svg",qp({xmlns:"http://www.w3.org/2000/svg",width:14,height:9,fill:"none",viewBox:"0 0 13 9"},t),xw||(xw=C.createElement("path",{fill:"#A8A8A8",fillRule:"evenodd",d:"M8.954 1.004a.406.406 0 0 1 0 .575L3.537 6.996a.406.406 0 0 1-.574 0L.796 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0m3.25 0a.406.406 0 0 1 0 .575L6.787 6.996a.406.406 0 1 1-.574-.575l5.416-5.417a.406.406 0 0 1 .575 0",clipRule:"evenodd"})))},ww,Cw;function Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yp.apply(null,arguments)}var $7=function(t){return C.createElement("svg",Yp({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),ww||(ww=C.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M7.79 6c0 .99-.8 1.79-1.79 1.79S4.21 6.99 4.21 6 5.01 4.21 6 4.21s1.79.8 1.79 1.79"})),Cw||(Cw=C.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M6 10.135c1.765 0 3.41-1.04 4.555-2.84.45-.705.45-1.89 0-2.595C9.41 2.9 7.765 1.86 6 1.86S2.59 2.9 1.445 4.7c-.45.705-.45 1.89 0 2.595 1.145 1.8 2.79 2.84 4.555 2.84"})))},Sw;function Gp(){return Gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gp.apply(null,arguments)}var F7=function(t){return C.createElement("svg",Gp({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),Sw||(Sw=C.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M8.277 1.004a.406.406 0 0 1 0 .575L2.86 6.996a.406.406 0 0 1-.574 0L.119 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0",clipRule:"evenodd"})))};const Tw=({type:e,item:t,handleShowDetails:n,handleRead:r,handleCTAClicked:o,clickId:i})=>{var c,u;const a=It(),l=(u=(c=JSON.parse(localStorage.getItem("settings")))==null?void 0:c.platform)==null?void 0:u.theme;return y.jsxs(Ce,{className:"cards",sx:{pt:" 0.8rem"},children:[y.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:y.jsx(rd,{sx:{width:"calc(100% - 2%)","& .MuiBadge-badge":{backgroundColor:"#6041EA",height:"0.5rem",minWidth:"0.5rem"}},variant:"dot",invisible:t==null?void 0:t.isRead,children:y.jsx(Oo,{sx:{color:a.palette.primary.notifyActiveText,whiteSpace:"normal",wordBreak:"break-word"},component:"p",className:["title-card",(t==null?void 0:t.isRead)&&"read"].join(" "),children:t==null?void 0:t.message})})}),y.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:y.jsxs(ft,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[(t==null?void 0:t.isNotificationDetails)&&y.jsx(Bc,{icon:y.jsx($7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:n,label:i===(t==null?void 0:t.id)?y.jsx(kl,{color:"primary",size:13}):"Show Details",component:"button",variant:"filled",clickable:!0,size:"small",sx:{backgroundColor:a.palette.brandColor.orange,color:a.palette.brandColor.white}}),!(t!=null&&t.isRead)&&y.jsx(Bc,{icon:y.jsx(F7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:r,label:"Acknowledge",component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.primaryCTAURL)&&y.jsx(Bc,{disabled:t==null?void 0:t.isPrimaryCTAClicked,onClick:()=>o({redirect:t==null?void 0:t.isPrimaryCTARedirect,isClicked:t==null?void 0:t.isPrimaryCTAClicked,url:t==null?void 0:t.primaryCTAURL}),label:t==null?void 0:t.primaryCTALabel,component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.secondaryCTAURL)&&y.jsx(Bc,{disabled:t==null?void 0:t.isSecondaryCTAClicked,onClick:()=>o({redirect:t==null?void 0:t.isSecondaryCTARedirect,isClicked:t==null?void 0:t.isSecondaryCTAClicked,url:t==null?void 0:t.secondaryCTAURL}),label:t==null?void 0:t.secondaryCTALabel,component:"button",variant:"outlined",clickable:!0,size:"small"})]})}),y.jsxs(ft,{display:"flex",flexDirection:"row",alignItems:"center",gap:.35,children:[y.jsx(Oo,{sx:{fontSize:"0.8rem"},children:t==null?void 0:t.product}),y.jsx(Oo,{color:a.palette.primary.notifyTextColor,children:"•"}),y.jsx(Oo,{sx:{fontSize:"0.8rem"},children:cV(t==null?void 0:t.createdAt)})]})]})};Tw.propTypes={type:s.string,title:s.string,subTitle:s.string,isRead:s.bool,handleShowDetails:s.func,handleRead:s.func};const kw=({data:e,handleRead:t,handleShowDetails:n,clickId:r,mode:o,page:i,setPage:a})=>{const{isMarkAllAsRead:l}=D.useContext(Lp),c=new Date,u=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(c),[d,f]=D.useState([]),[p,h]=D.useState(!1),[g,m]=D.useState(!0),v=D.useRef(null),x=async T=>{h(!0);const k=e.slice((T-1)*10,T*10);await new Promise(b=>setTimeout(b,1e3)),f(b=>{const O=k.filter(E=>!b.some(M=>M.id===E.id));return[...b,...O]}),h(!1),(d==null?void 0:d.length)>=(e==null?void 0:e.length)&&m(!1)};D.useEffect(()=>{var k;let T=[];o?l!=null&&l.count?T=(k=e==null?void 0:e.filter(b=>!b.isRead))==null?void 0:k.slice(0,10):T=[]:T=e.slice(0,10),(T==null?void 0:T.length)<10&&m(!1),f(T)},[e,o,l]),D.useEffect(()=>{g&&i!==1&&x(i)},[i,e]),D.useEffect(()=>{f([...e])},[e]),D.useEffect(()=>{const T=new IntersectionObserver(k=>{k[0].isIntersecting&&!p&&g&&a(b=>b+1)},{threshold:1});return v.current&&T.observe(v.current),()=>{v.current&&T.unobserve(v.current)}},[p,g]);const w=({redirect:T,isClicked:k,url:b})=>{window.open(b,"_blank")};return y.jsxs(Ce,{sx:{width:"100%"},children:[Object.entries(pV(d)).map(([T,k])=>y.jsxs(D.Fragment,{children:[T!==u&&y.jsx(v7,{children:T}),k.map((b,O)=>y.jsx(D.Fragment,{children:y.jsx(Tw,{item:b,handleCTAClicked:w,handleShowDetails:()=>n(b.id,b.snopId),handleRead:()=>t([b.id],b.snopId),clickId:r})},`${O}_${b.id}`))]},T)),p&&i>1&&!!(d!=null&&d.length)&&y.jsx(Ce,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:y.jsx(kl,{size:20,sx:{color:T=>T.palette.primary.notifyIconColor}})}),!(d!=null&&d.length)&&y.jsx(ot,{sx:{fontSize:"1.1rem",color:T=>T.palette.primary.notifyTextColor,textAlign:"center",px:"0.8rem"},children:"You don't have any unread notification here. Use the toggle to switch between read and unread notification."}),y.jsx(Ce,{ref:v,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};kw.propTypes={data:s.array,handleRead:s.func,handleShowDetails:s.func};const _7=({onRefresh:e,handleShowDetails:t,clickId:n,handleRead:r,handleMarkAllAsRead:o})=>{var g,m,v,x;const{loading:i,activeTab:a,data:l,tabData:c,mode:u,page:d,setPage:f,handleTabChange:p,toggleAlertMode:h}=mw({});return y.jsxs(y.Fragment,{children:[y.jsxs(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,pt:2},children:[y.jsx(ot,{variant:"h2",sx:{fontSize:"1.2rem",color:w=>w.palette.primary.notifyTextColor},children:"Notifications"}),y.jsx(Ce,{onClick:e,children:y.jsx(hn,{url:Ge.Refresh,alt:"refresh",sx:{cursor:"pointer"}})})]}),y.jsx(Ce,{sx:{borderBottom:1,m:"1.2rem 1.2rem 0 1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},children:y.jsxs(w7,{value:a,onChange:p,children:[y.jsx(_p,{label:y.jsxs(Ce,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["All (",y.jsx(ot,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((g=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))==null?void 0:g.length)||0}),")"]})}),y.jsx(_p,{label:y.jsxs(Ce,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Info (",y.jsx(ot,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((m=l==null?void 0:l.filter(w=>(w==null?void 0:w.type)==="INFO"&&!(w!=null&&w.isRead)))==null?void 0:m.length)||0}),")"]}),sx:{color:w=>w.palette.brandColor.blue}}),y.jsx(_p,{label:y.jsxs(Ce,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Error (",y.jsx(ot,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((v=l==null?void 0:l.filter(w=>(w==null?void 0:w.type)==="ERROR"&&!(w!=null&&w.isRead)))==null?void 0:v.length)||0}),")"]}),sx:{color:w=>w.palette.brandColor.red}})]})}),y.jsx(Pl,{dividers:!0,sx:{p:0,...i&&!c.length&&{alignItems:"center",justifyContent:"center"},flexGrow:1,overflowY:"auto",mx:"1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},tabIndex:-1,children:i?y.jsx(kl,{size:30,sx:{color:w=>w.palette.primary.notifyIconColor}}):y.jsx(y.Fragment,{children:y.jsx(kw,{data:c,handleShowDetails:t,handleRead:r,clickId:n,page:d,setPage:f,mode:u})})}),y.jsxs(El,{sx:{justifyContent:"space-between",px:"1.2rem"},children:[y.jsxs(ft,{direction:"row",gap:1,children:[y.jsx(Oo,{sx:{fontSize:"1rem"},children:"Only show unread"}),y.jsx(b7,{disabled:i,checked:u,onChange:h})]}),y.jsx(Hn,{variant:"outlined",className:"view-all",onClick:o,startIcon:y.jsx(j7,{}),disabled:!((x=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))!=null&&x.length),style:{backgroundColor:"transparent"},sx:{fontSize:"1rem",fontWeight:"300",p:0,border:"none",textTransform:"none",color:w=>w.palette.primary.notifyTextColor,"&:hover":{color:w=>w.palette.primary.notifyActiveText,background:"transparent",boxShadow:"none",border:"none"},"&.Mui-disabled":{opacity:.5,color:w=>`${w.palette.primary.notifyActiveText}!important`,background:"transparent",boxShadow:"none",border:"none"}},children:"Mark all as read"})]})]})},B7=({data:e,handleClose:t})=>{var v;const[n,r]=D.useState(1),[o,i]=D.useState(10),[a,l]=D.useState(((v=e==null?void 0:e.notificationDetails)==null?void 0:v.length)||0),[c,u]=D.useState("sku_name"),[d,f]=D.useState("asc"),[p,h]=D.useState([]),[g,m]=D.useState("");return D.useEffect(()=>{var x;if(g||c){const w=dV(e==null?void 0:e.notificationDetails,o7,g);if(c){const T=fV(w,c,d);h(hp(T,n,o)),l(T.length);return}h(hp(w,n,o)),l(w.length);return}h(hp(e==null?void 0:e.notificationDetails,n,o)),l((x=e==null?void 0:e.notificationDetails)==null?void 0:x.length)},[g,e==null?void 0:e.notificationDetails,n,o,d,c]),y.jsxs(y.Fragment,{children:[y.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{padding:"1.5rem 2rem",borderBottom:"0.1rem solid",borderColor:x=>x.palette.primary.notifyBorderColor},children:[y.jsx(ot,{component:"h2",sx:{fontSize:"1.4rem",color:x=>x.palette.primary.notifyActiveText},children:(e==null?void 0:e.message)||""}),y.jsx(Ce,{onClick:t,sx:{cursor:"pointer"},children:y.jsx(hn,{url:Ge.CloseCircle})})]}),y.jsx(Pl,{children:y.jsx(Bp,{tableProps:{data:p,columns:{...g7(),isManageable:!1},sort:{sortField:c,sortDir:d,onSort:x=>{var T;const w=(T=x==null?void 0:x.column)==null?void 0:T.key;f(k=>c===w&&k==="asc"?"desc":"asc"),u(w)}},pagination:{selectedPage:n,rowPerPage:o,totalRecords:a,onPageChange:x=>{r(x)},onPageSizeChange:x=>{i(x==null?void 0:x.value),r(1)}}},toolbarProps:{defaultTools:{search:{isRequired:!0,onChange:x=>{const w=x.target.value;w&&r(1),m(w)},placeholder:"Search..."}}}})}),y.jsx(El,{sx:{padding:"1.5rem 2rem"}})]})},L7=({baseUrl:e})=>{const{alertDialogProps:t,showDetailsProps:n,fetchNotification:r,isMarkAllAsRead:o}=mw({baseUrl:e});return y.jsxs(y.Fragment,{children:[y.jsx(Ce,{sx:{display:"flex",justifyContent:"center",cursor:"pointer",marginTop:"0.6rem"},onClick:()=>{var i;r(),(i=t==null?void 0:t.setOpen)==null||i.call(t,!0)},children:y.jsx(N7,{count:o.count})}),y.jsx(vw,{...t,children:y.jsx(_7,{...t})}),y.jsx(vw,{...n,children:y.jsx(B7,{...n})})]})},V7=({baseUrl:e})=>y.jsx(_n,{children:y.jsx(P7,{children:y.jsx(L7,{baseUrl:e})})}),W7=({rightChild:e,leftChild:t,isDrawerMerged:n,isDrawerOpen:r,drawerTitle:o,showExpand:i,onCloseClick:a,onMergeClick:l,onExpandClick:c,isDrawerExpanded:u,styles:d,showMerge:f})=>{const p=It();return y.jsx(Ce,{sx:{position:"relative",overflow:"hidden"},children:y.jsxs(lo,{container:!0,sx:{height:"100%"},children:[y.jsx(lo,{item:!0,sx:{width:n?d!=null&&d.drawerWidth?`calc(${"100%"-(d==null?void 0:d.drawerWidth)})`:"75%":"100%",position:"relative",zIndex:3,height:"calc(100vh - 7rem)",p:"0rem 1.5rem",overflow:"auto"},children:t}),r&&!n&&y.jsxs(y.Fragment,{children:[y.jsx(Ce,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"#07080B80",backdropFilter:"blur(3px)",zIndex:3,transition:"opacity 0.3s ease-in-out"}}),y.jsx(Ce,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"transparent",zIndex:4}})]}),e&&y.jsxs(lo,{item:!0,sx:{width:u?"90%":(d==null?void 0:d.drawerWidth)||"25%",position:n?"relative":"absolute",top:0,right:0,height:"calc(100vh - 7rem)",backgroundColor:p.palette.primary.notifyBackground,transform:r?"translateX(0)":"translateX(100%)",transition:"transform 0.4s ease-in-out , width 0.4s ease-in-out",zIndex:4,borderLeft:`0.1rem solid ${p.palette.primary.notifyBorderColor}`,display:"flex",flexDirection:"column"},children:[y.jsxs(ft,{direction:"row",alignItems:"center",sx:{width:"100%",flexShrink:0,paddingBottom:"0.8rem",px:2,pt:"0.8rem",borderBottom:h=>`0.1rem solid ${h.palette.primary.notifyBorderColor}`},children:[!u&&f&&y.jsxs(y.Fragment,{children:[y.jsx(Ce,{component:"img",src:Ge.Merge,sx:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer"},onClick:l}),y.jsx(vi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"auto!important",borderColor:p.palette.primary.notifyBorderColor}})]}),y.jsxs(ft,{direction:"row",justifyContent:"space-between",alignItems:"center",flexGrow:1,children:[y.jsxs(ft,{direction:"row",gap:"0.5rem",alignItems:"center",onClick:a,sx:{cursor:"pointer"},children:[y.jsx(hn,{url:Ge.CrossLight}),y.jsx(ot,{sx:{fontSize:"1.2rem",color:p.palette.primary.notifyTextColor},children:o})]}),y.jsx(ft,{direction:"row",gap:"0.5rem",alignItems:"center",children:i&&y.jsx(Ce,{onClick:c,sx:{cursor:"pointer"},children:y.jsx(Ce,{component:"img",src:u?Ge.Collapse:Ge.Expand})})})]})]}),y.jsx(Ce,{sx:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},overflow:"auto",px:2},children:e})]})]})})},Ow=({layoutChildren:e,layoutProps:t})=>y.jsx(_n,{children:y.jsx(W7,{...e,...t})});Ow.propTypes={layoutChildren:s.object.isRequired,layoutProps:s.object.isRequired},vt.Button=go,vt.Checkbox=sc,vt.DatePicker=aV,vt.Grid=Bp,vt.Header=dw,vt.InputField=s1,vt.Loader=NV,vt.Notification=V7,vt.Select=l1,vt.SliderLayout=Ow,vt.Switch=f1,vt.TextField=xc,vt.ToastProvider=MV,vt.toast=kV,Object.defineProperty(vt,Symbol.toStringTag,{value:"Module"})});
326
+ `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=To(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&jc.assertOptions(r,{silentJSONParsing:mr.transitional(mr.boolean),forcedJSONParsing:mr.transitional(mr.boolean),clarifyTimeoutError:mr.transitional(mr.boolean)},!1),o!=null&&(te.isFunction(o)?n.paramsSerializer={serialize:o}:jc.assertOptions(o,{encode:mr.function,serialize:mr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),jc.assertOptions(n,{baseUrl:mr.spelling("baseURL"),withXsrfToken:mr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&te.merge(i.common,i[n.method]);i&&te.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),n.headers=gn.concat(a,i);const l=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,p;if(!c){const g=[H1.bind(this),void 0];for(g.unshift.apply(g,l),g.push.apply(g,u),p=g.length,d=Promise.resolve(n);f<p;)d=d.then(g[f++],g[f++]);return d}p=l.length;let h=n;for(f=0;f<p;){const g=l[f++],m=l[f++];try{h=g(h)}catch(v){m.call(this,v);break}}try{d=H1.call(this,h)}catch(g){return Promise.reject(g)}for(f=0,p=u.length;f<p;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=To(this.defaults,t);const n=$1(t.baseURL,t.url,t.allowAbsoluteUrls);return E1(n,t.params,t.paramsSerializer)}};te.forEach(["delete","get","head","options"],function(t){ko.prototype[t]=function(n,r){return this.request(To(r||{},{method:t,url:n,data:(r||{}).data}))}}),te.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,l){return this.request(To(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}ko.prototype[t]=n(),ko.prototype[t+"Form"]=n(!0)});let t7=class Pw{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(l=>{r.subscribe(l),i=l}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,l){r.reason||(r.reason=new Ns(i,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Pw(function(o){t=o}),cancel:t}}};function n7(e){return function(n){return e.apply(null,n)}}function r7(e){return te.isObject(e)&&e.isAxiosError===!0}const Mp={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Mp).forEach(([e,t])=>{Mp[t]=e});function G1(e){const t=new ko(e),n=p1(ko.prototype.request,t);return te.extend(n,ko.prototype,t,{allOwnKeys:!0}),te.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return G1(To(e,o))},n}const St=G1(xa);St.Axios=ko,St.CanceledError=Ns,St.CancelToken=t7,St.isCancel=I1,St.VERSION=q1,St.toFormData=Mc,St.AxiosError=Ue,St.Cancel=St.CanceledError,St.all=function(t){return Promise.all(t)},St.spread=n7,St.isAxiosError=r7,St.mergeConfig=To,St.AxiosHeaders=gn,St.formToJSON=e=>R1(te.isHTMLForm(e)?new FormData(e):e),St.getAdapter=U1.getAdapter,St.HttpStatusCode=Mp,St.default=St;const{Axios:YW,AxiosError:GW,CanceledError:KW,isCancel:XW,CancelToken:ZW,VERSION:JW,all:QW,Cancel:ez,isAxiosError:tz,spread:nz,toFormData:rz,AxiosHeaders:oz,HttpStatusCode:sz,formToJSON:iz,getAdapter:az,mergeConfig:lz}=St,Rp={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"},Ca={headers:{"Content-Type":"application/json"},withCredentials:!0},K1=St.create({baseURL:Rp.BASE_URL,axiosConfig:Ca});K1.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),K1.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const Rr={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},X1={TENANT_ID:"tenant_id",BU_ID:"bu_id",SNOP_ID:"snop_id"},o7=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),s7=[10,25,50,100],Z1={MARK_ALL_READ:"MARK_ALL_READ"},i7=s7.map(e=>({label:e,value:e})),J1={PRIMARY:"PRIMARY",SECONDARY:"SECONDARY"},$c={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"};/*! js-cookie v3.0.5 | MIT */function Fc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var a7={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Dp(e,t){function n(o,i,a){if(!(typeof document>"u")){a=Fc({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var c in a)a[c]&&(l+="; "+c,a[c]!==!0&&(l+="="+a[c].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+l}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],a={},l=0;l<i.length;l++){var c=i[l].split("="),u=c.slice(1).join("=");try{var d=decodeURIComponent(c[0]);if(a[d]=e.read(u,d),o===d)break}catch{}}return o?a[o]:a}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",Fc({},i,{expires:-1}))},withAttributes:function(o){return Dp(this.converter,Fc({},this.attributes,o))},withConverter:function(o){return Dp(Fc({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var l7=Dp(a7,{path:"/"});const Ip=wc(Rr.SNOP),Ap=wc(Rr.SELECTED_BU),Np=wc(Rr.USER);wc(Rr.SETTINGS);const Q1={BU_IDS:Ap==null?void 0:Ap.business_unit_id,TOKEN:JSON.parse(l7.get(Rr.TOKEN)||null),TENANT_IDS:Np==null?void 0:Np.tenant_id,SNOP_IDS:Ip==null?void 0:Ip.snop_id},{TENANT_ID:c7,BU_ID:u7}=X1,{TENANT_IDS:d7,BU_IDS:f7}=Q1,_c=async({baseUrl:e,payload:t})=>{try{const n=`${e}${$c.SETTING}/v1?${c7}=${d7}&${u7}=${f7}`;return await St.post(n,t,Ca)}catch(n){return n}},p7=({columns:e,gridPath:t,baseUrl:n,isDefaultConfig:r,pageSize:o=10,childUniqueKey:i})=>{var x,w,T;let{definitions:a,defaultUserSettings:l,labels:c}=e;const u=Dr(c),d=t.split("/").filter(Boolean),f=JSON.parse(localStorage.getItem(Rr.SETTINGS));let p=d.reduce((k,b)=>k==null?void 0:k[b],f)||null;const h=Dr((p==null?void 0:p.columns)||[]);if(!r&&t){let k=(l&&jp({childUniqueKey:i}))??jp({definitions:a,childUniqueKey:i});k.filter(O=>!h[O.key]);const b=p&&((x=p==null?void 0:p.columns)==null?void 0:x.some(O=>(O==null?void 0:O.children)&&O.children[i]));if(!p||b==!1){if(b==!1){const O=Dr(k);k=(w=p==null?void 0:p.columns)==null?void 0:w.map(E=>{var M;return E!=null&&E.children&&!E.children[i]?{...E,children:{...E.children,[i]:(M=O==null?void 0:O[E==null?void 0:E.key])==null?void 0:M.children[i]}}:E})}(async()=>{try{const E={...f||{platform:{theme:"light"}}},M=(p==null?void 0:p.pageSize)??o;let I=E;for(let N=0;N<d.length;N++){const $=d[N];N===d.length-1?I[$]={columns:k,pageSize:M}:(I[$]={...I[$]||{}},I=I[$])}localStorage.setItem(Rr.SETTINGS,JSON.stringify(E)),await _c({baseUrl:n,payload:E})}catch(O){console.error(O)}})()}}l=((p==null?void 0:p.columns)&&m7(h,l,i))??l??jp({definitions:a});const g=[],m=Dr(l);for(const k of a){const b=m[k.key]||{},O=u[k.key]||{},E=Dr(b.children||[]),M=Dr(O.children||[]);let I={...k,...b,...O};(T=k.children)!=null&&T.length&&(I.children=k.children.map(N=>({...N,...E[N.key],...M[N.key]}))),g.push(I)}return g.sort((k,b)=>k.sequenceId-b.sequenceId)},h7=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),Sa=(e,t)=>e==null?void 0:e.map(n=>({id:n.id,key:n.key,sequenceId:n.sequenceId||n.id,isHidden:n.isHidden||!1,style:n.style||{},...(n==null?void 0:n.children)&&{children:t?{[t]:Sa(n.children)}:Sa(n.children)}})),Dr=e=>Array.isArray(e)&&(e==null?void 0:e.reduce((t,n)=>(t[n.key]=n,t),{})),jp=({definitions:e,childUniqueKey:t})=>Sa(e,t),m7=(e,t,n)=>t.map(o=>{const i=e[o.key],a=o.children?o.children.map(l=>{var d;const c=Dr(Array.isArray(i==null?void 0:i.children)?i==null?void 0:i.children:(d=i==null?void 0:i.children)==null?void 0:d[n]),u=c==null?void 0:c[l.key];return{...l,sequenceId:(u==null?void 0:u.sequenceId)||l.sequenceId,isHidden:(u==null?void 0:u.isHidden)??l.isHidden}}):void 0;return{...o,sequenceId:(i==null?void 0:i.sequenceId)||o.sequenceId,isHidden:(i==null?void 0:i.isHidden)??o.isHidden,...a?{children:a}:{}}}),g7=()=>({definitions:[{id:1,key:"sku_name",isSortable:!0,isMandatory:!0},{id:2,key:"node",isSortable:!0,isMandatory:!0},{id:3,key:"channel_name",isSortable:!0,isMandatory:!0}],defaultUserSettings:[{id:1,key:"sku_name",sequenceId:1,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}},{id:2,key:"node",sequenceId:2,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}},{id:3,key:"channel_name",sequenceId:3,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}}],labels:[{id:1,key:"sku_name",label:"SKU",isLocalizable:!1},{id:2,key:"node",label:"Node",isLocalizable:!1},{id:3,key:"channel_name",label:"Channel",isLocalizable:!1}]});class $p extends D.Component{constructor(t){super(t),this.startDrag=this.startDrag.bind(this),this.endDrag=this.endDrag.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.dragging=!1,this.mouseX=0,this.startPos=0,this.startWidthPrev=0,this.lastDraggedWidth=0,this.draggedCol=null,this.resizeRef=D.createRef()}startDrag(){if(!this.props.disabled&&(this.draggedCol=this.props.id,this.props.resizeStart&&this.draggedCol===this.props.id&&this.props.resizeStart(),this.dragging=!0,this.startPos=this.mouseX,this.startWidthPrev=0,this.resizeRef.current)){let t=this.resizeRef.current.previousSibling;t&&(this.startWidthPrev=t.clientWidth)}}endDrag(){this.props.disabled||(this.dragging=!1,this.props.resizeEnd&&this.draggedCol===this.props.id&&this.props.resizeEnd(this.lastDraggedWidth),this.draggedCol=null)}onMouseMove(t){if(this.props.disabled||(this.mouseX=t.touches?t.touches[0].screenX:t.screenX,!this.dragging))return;const n=this.resizeRef.current,r=this.startPos-this.mouseX;let o=this.startWidthPrev-r;(!this.props.minWidth||o>=this.props.minWidth)&&(!this.props.maxWidth||o<=this.props.maxWidth)&&(n.previousSibling.style.width=o+"px",n.previousSibling.style.minWidth=o+"px",n.previousSibling.style.maxWidth=o+"px",n.previousSibling.style.setProperty("--column_resize_before_width",o+"px"),this.lastDraggedWidth=o)}componentDidMount(){const t=this.resizeRef.current;if(t&&(this.props.defaultWidth?(t.previousSibling.style.minWidth=this.props.defaultWidth+"px",t.previousSibling.style.width=this.props.defaultWidth+"px",t.previousSibling.style.maxWidth=this.props.defaultWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.defaultWidth+"px")):this.props.minWidth&&(t.previousSibling.style.minWidth=this.props.minWidth+"px",t.previousSibling.style.width=this.props.minWidth+"px",t.previousSibling.style.maxWidth=this.props.minWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.minWidth+"px"))),this.props.disabled){this.props.defaultWidth&&t&&(t.previousSibling.style.minWidth=this.props.defaultWidth+"px",t.previousSibling.style.width=this.props.defaultWidth+"px",t.previousSibling.style.maxWidth=this.props.defaultWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.defaultWidth+"px")),this.props.maxWidth&&t&&(t.previousSibling.style.maxWidth=this.props.maxWidth+"px");return}this.addEventListenersToDocument()}componentWillUnmount(){this.props.disabled||this.removeEventListenersFromDocument()}componentDidUpdate(t,n){t.disabled&&!this.props.disabled&&this.addEventListenersToDocument(),!t.disabled&&this.props.disabled&&this.removeEventListenersFromDocument()}addEventListenersToDocument(){document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.endDrag),document.addEventListener("touchmove",this.onMouseMove),document.addEventListener("touchend",this.endDrag)}removeEventListenersFromDocument(){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.endDrag),document.removeEventListener("touchmove",this.onMouseMove),document.removeEventListener("touchend",this.endDrag)}render(){var t={userSelect:"none"};return this.props.disabled||(t.cursor="ew-resize"),this.props.className===""&&(t.width="6px",t.backgroundColor="rgba(0, 0, 0, 0.1)"),D.createElement("th",{ref:this.resizeRef,style:t,disabled:this.props.disabled,rowSpan:this.props.rowSpan?this.props.rowSpan:1,colSpan:this.props.colSpan?this.props.colSpan:1,className:`column_resizer_own_class ${this.props.disabled?"disabled_column_resize":""} ${this.props.className}`,onMouseDown:this.props.disabled?null:this.startDrag,onTouchStart:this.props.disabled?null:this.startDrag})}}$p.defaultProps={disabled:!1,minWidth:0,className:""},$p.propTypes={disabled:"boolean",minWidth:"number",className:"string"};const y7=(e,t,n,r,o,i)=>{const[a,l]=D.useState({isOpen:!1,column:null}),c=(p,h,g)=>{l({isOpen:p.currentTarget,column:h,isChild:!!g})},u=()=>{l({isOpen:!1,column:null,isChild:!1})},d=async()=>{u();const p=e.map(h=>{var g;if(a!=null&&a.isChild&&Array.isArray(h.children)){const m=h.children.map(x=>{var w;return x.key===((w=a.column)==null?void 0:w.key)?{...x,isHidden:!0}:x}),v=m.every(x=>x.isHidden);return{...h,isHidden:v?!0:h.isHidden,children:m}}return h.key===((g=a.column)==null?void 0:g.key)?{...h,isHidden:!0}:h});f({updatedColumns:p})},f=async({updatedColumns:p})=>{t({type:He.SET_GRID_DATA,payload:{visibleGridColumns:p}});const h=r.split("/").filter(Boolean),g=JSON.parse(localStorage.getItem(Rr.SETTINGS));let m=h.reduce((O,E)=>O==null?void 0:O[E],g)||null,v=Sa(p,i);const x=Dr(m==null?void 0:m.columns);v=v==null?void 0:v.map(O=>{var I;const E=(O==null?void 0:O.children)||{},M=((I=x==null?void 0:x[O==null?void 0:O.key])==null?void 0:I.children)||{};return{...O,children:{...M,[i]:E==null?void 0:E[i]}}});const T={...g||{platform:{theme:"light"}}},k=(m==null?void 0:m.pageSize)??o;let b=T;for(let O=0;O<h.length;O++){const E=h[O];O===h.length-1?b[E]={columns:v,pageSize:k}:(b[E]={...b[E]||{}},b=b[E])}localStorage.setItem(Rr.SETTINGS,JSON.stringify(T)),await _c({baseUrl:n,payload:T})};return{selectedColumn:a,handleMenuClick:c,handleClose:u,handleHideClick:d,columnUpdaterFunction:f}},ew=({pagination:e,gridPath:t,baseUrl:n})=>{const{selectedPage:r,rowPerPage:o,totalRecords:i,onPageChange:a,onPageSizeChange:l}=e,c=It(),u=async(d,f)=>{if(!f)return;const p=f.split("/").filter(Boolean),h="settings",m={...JSON.parse(localStorage.getItem(h))||{}};let v=m;for(let x=0;x<p.length;x++){const w=p[x];x===p.length-1?v[w]={...v[w]||{},pageSize:d}:(v[w]={...v[w]||{}},v=v[w])}localStorage.setItem(h,JSON.stringify(m)),await _c({baseUrl:n,payload:m})};return y.jsxs(Ce,{sx:{display:"flex",p:"1rem 1.5rem"},children:[y.jsxs(Ce,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"0.5rem",width:"100%"},children:[y.jsx(ot,{sx:{fontSize:"1.1rem",color:c.palette.primary.notifyTextColor},children:`Showing ${Math.min(r*o,i)} of ${i} rows`}),y.jsx(Ce,{sx:{"& .MuiInputBase-input":{padding:"0rem 0.8rem!important"},width:"6rem"},children:y.jsx(Tc,{options:i7,value:o,onChange:async d=>{l(d),u(d==null?void 0:d.value,t)}})})]}),y.jsx(Tg,{count:Math.ceil(i/o),page:r,onChange:async(d,f)=>{a(f)},siblingCount:0,shape:"rounded",sx:{width:"100%","& .MuiPagination-ul":{width:"100%",display:"flex",justifyContent:"flex-end","& li:first-of-type":{border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,color:c.palette.primary.notifyActiveText,marginRight:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"},"& li:last-child":{border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,color:c.palette.primary.notifyActiveText,marginLeft:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"}},"& .MuiPaginationItem-root":{color:"#595959",fontSize:"1.1rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex","& .MuiSvgIcon-root":{fontSize:"2.2rem"}},"& .Mui-selected":{color:c.palette.primary.notifyActiveText,backgroundColor:`${c.palette.brandColor.paginationBc} !important`}}})]})};ew.propTypes={pagination:s.object.isRequired};function Fp({isRenderCellContent:e,column:t,row:n,parent:r}){const o=n[t.key];return y.jsx(y.Fragment,{children:e?y.jsx(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},children:t==null?void 0:t.cellRenderer(n,{column:t,parent:r})}):y.jsx(Ag,{title:(o==null?void 0:o.length)>20?o:"",arrow:!0,children:y.jsx(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},id:t.key,component:"label",children:hV(o)})})})}Fp.propTypes={isRenderCellContent:s.bool,column:s.object,row:s.object};const tw=({menuOpen:e,handleClose:t,onHideClick:n})=>{const r=It();return y.jsx(ki,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:y.jsx(Ce,{sx:{backgroundColor:r.palette.primary.notifyBackground,border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:y.jsx(Hn,{onClick:n,disableRipple:!0,sx:{textTransform:"none",fontSize:"1.1rem",p:"0.4rem 1rem",minHeight:"unset",fontWeight:500,color:r.palette.primary.notifyTextColor,backgroundColor:"transparent","&:hover":{backgroundColor:"transparent"},"&:active":{backgroundColor:"transparent"},"&:focus":{backgroundColor:"transparent"}},children:"Hide Column"})})})};tw.propTypes={menuOpen:s.object,handleClose:s.func,onHideClick:s.func},Y(Ol)(({theme:e})=>({"& .MuiPaper-root":{borderRadius:8,border:`1px solid ${e.palette.primary.notifyBorderColor}`,boxShadow:e.shadows[4],padding:"1rem 1rem 0rem 1rem",backgroundColor:e.palette.primary.notifyBackground}}));const Oo=Y(ot)(({theme:e})=>({color:e.palette.primary.notifyTextColor,fontSize:"1.1rem"})),b7=Y(Ng)(({theme:e})=>({width:28,height:16,padding:0,display:"flex","&:active":{"& .MuiSwitch-thumb":{width:15},"& .MuiSwitch-switchBase.Mui-checked":{transform:"translateX(9px)"}},"& .MuiSwitch-switchBase":{padding:2,"&.Mui-checked":{transform:"translateX(12px)",color:"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:"#1890ff",...e.applyStyles("dark",{backgroundColor:"#177ddc"})}}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px 0 rgb(0 35 11 / 20%)",width:12,height:12,borderRadius:6,transition:e.transitions.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:16/2,opacity:1,backgroundColor:"rgba(0,0,0,.25)",boxSizing:"border-box",...e.applyStyles("dark",{backgroundColor:"rgba(255,255,255,.35)"})}})),v7=Y(vi)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),x7=Y(rd)(({theme:e})=>({"& .MuiBadge-badge":{right:3.5,top:1.8,border:`0.1rem solid ${e.palette.primary.notifyBackground}`,padding:"0 1.3px",borderRadius:"50%",backgroundColor:"#D44E40",fontSize:"0.725rem",minWidth:"0.7rem",height:"0.7rem"}}));Y(_l)(({theme:e})=>({"& .MuiInputBase-root":{height:"3.52rem"},"& .MuiFormLabel-root":{color:`${e.palette.primary.notifyBorderColor} !important`,fontSize:"1rem",marginTop:"0.4rem"},"& label.Mui-focused":{color:e.palette.primary.notifyTextColor},"& .MuiInput-underline:after":{borderBottomColor:e.palette.primary.notifyBorderColor,borderBottomWidth:"0.1rem"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&:hover fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&.Mui-focused fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"}}}));const w7=Y(Jg)(({theme:e})=>({minHeight:"2rem","& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveText}})),_p=Y(jg)(({theme:e})=>({color:e.palette.primary.notifyActiveText,textTransform:"none",fontWeight:"normal",padding:0,fontSize:"1rem",minHeight:"2rem",paddingBottom:"1rem","&.Mui-selected":{fontWeight:"bold",color:e.palette.primary.notifyActiveText}})),Bc=Y(ed)(({theme:e})=>({"&.MuiChip-outlined":{borderColor:e.palette.primary.notifyBorderColor,color:e.palette.primary.notifyActiveText},height:"2rem",fontSize:"0.9rem",fontWeight:"300",borderColor:e.palette.primary.notifyBorderColor,color:e.palette.primary.notifyActiveText,borderRadius:"0.6rem",padding:"0.2rem","&:hover":{backgroundColor:`${e.palette.brandColor.orange} !important`,color:`${e.palette.brandColor.white} !important`}})),nw=({sortKey:e,sortField:t,sortDir:n,handleSortClick:r})=>{const o=i=>y.jsx(Ar,{onClick:r,sx:{padding:"0.5rem"},draggable:!1,children:y.jsx(hn,{url:i})});return y.jsx(y.Fragment,{children:o(t===e?n==="asc"?Ge.AscSort:Ge.DescSort:Ge.Unsort)})};nw.propTypes={sortKey:s.string.isRequired,sortField:s.string,sortDir:s.string,handleSortClick:s.func};function rw({parent:e,column:t,sort:n,handleMenuClick:r,isManageable:o}){const i=o&&(!(t!=null&&t.isMandatory)||(t==null?void 0:t.isMandatory)&&(t==null?void 0:t.showHide)===!0),a=t==null?void 0:t.label,l=t==null?void 0:t.isSortable,c=n==null?void 0:n.sortField,u=n==null?void 0:n.sortDir,d=n==null?void 0:n.onSort;return y.jsxs(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",textAlign:"center",whiteSpace:"normal"},draggable:!1,children:[a,y.jsxs(Ce,{sx:{display:"flex",alignItems:"center"},draggable:!1,children:[l&&y.jsx(nw,{sortKey:e?`${e==null?void 0:e.key}|${t==null?void 0:t.key}`:t==null?void 0:t.key,sortField:c,sortDir:u,handleSortClick:()=>d({column:t,sortDir:u,sortField:c,parent:e})}),i&&y.jsx(Ar,{draggable:!1,onClick:f=>r(f,t,e),sx:{padding:"0.5rem 0.2rem"},children:y.jsx(hn,{url:Ge.Menu})})]})]})}rw.propTypes={column:s.object.isRequired,sort:s.object.isRequired,handleMenuClick:s.func,isManageable:s.bool};const C7=Y($l)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:"2rem",display:"table-cell",[`&.${xd.head}`]:{color:e.palette.primary.notifyTextColor,backgroundColor:e.palette.primary.notifyBackground,borderColor:e.palette.primary.notifyBorderColor,padding:"0rem",textAlign:"center"},[`&.${xd.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0rem",textAlign:"center"}}));function Ta({children:e,...t}){return y.jsx(C7,{...t,children:e})}Ta.propTypes={children:s.node};const S7=Y(Hg)(()=>({"&:last-child td":{borderBottom:0}}));function js({children:e,...t}){return y.jsx(S7,{...t,children:e})}js.propTypes={children:s.node};function ow({rows:e,sort:t,data:n,pagination:r,columns:o,nested:i,baseUrl:a,gridPath:l,childUniqueKey:c}){var U;const u=It(),{visibleGridColumns:d}=D.useContext(Sc),f=D.useContext(ya),{selectedColumn:p,handleMenuClick:h,handleClose:g,handleHideClick:m,columnUpdaterFunction:v}=y7(d,f,a,l,r==null?void 0:r.rowPerPage,c),x=o==null?void 0:o.isManageable,w=o==null?void 0:o.isResizable,T=(n==null?void 0:n.length)>0,k=D.useRef(null),[b,O]=D.useState(null),[E,M]=D.useState(null),[I,N]=D.useState(null);let $=null;const R=D.useRef(0),V=D.useRef(!1),F=D.useRef(null),L=h7(((U=i==null?void 0:i.column)==null?void 0:U.definitions)||[]),_=i==null?void 0:i.isNested,B=(i==null?void 0:i.data)||[],W=i==null?void 0:i.hashKey,[P,j]=D.useState(0),[z,ee]=D.useState(null);if(D.useEffect(()=>{if(k.current){const A=()=>{j(k.current.offsetHeight)};return A(),window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)}},[n]),D.useEffect(()=>{const A=k.current,G=A==null?void 0:A.querySelector("thead");if(!G)return;const J=()=>{N(null)};return G==null||G.addEventListener("mousedown",J),()=>{G==null||G.removeEventListener("mousedown",J)}},[]),!T)return y.jsx(Oo,{sx:{textAlign:"center"},children:Kr.NRF});const ne=(A,G)=>{var ue,ye;if(V.current){A.preventDefault();return}O(G),N(null),A.dataTransfer.setData("colIndex",G);const J=d[G],oe=J==null?void 0:J.label,be=document.createElement("div");be.textContent=oe,Object.assign(be.style,{display:"flex",alignItems:"center",justifyContent:"center",padding:"1.5rem 2.5rem",minWidth:(ue=J==null?void 0:J.style)==null?void 0:ue.minWidth,maxWidth:(ye=J==null?void 0:J.style)==null?void 0:ye.maxWidth,fontSize:"1.2rem",fontWeight:"500",color:u.palette.primary.notifyTextColor,background:u.palette.primary.notifyBackground,border:`0.1rem solid ${u.palette.primary.notifyBorderColor}`,borderRadius:"0rem",pointerEvents:"none",position:"absolute",top:"0",left:"0",zIndex:"-1",textAlign:"center",boxSizing:"border-box",boxShadow:"0 1px 4px rgba(0, 0, 0, 0.2)"}),document.body.appendChild(be);const{offsetWidth:Z,offsetHeight:ge}=be;A.dataTransfer.setDragImage(be,Z/2,ge/2),requestAnimationFrame(()=>{document.body.removeChild(be)})},q=(A,G)=>{A.preventDefault(),M(G),X(A)},Q=async(A,G)=>{if(A.preventDefault(),clearInterval($),b===null||b===G)return;const J=[...d],[oe]=J.splice(b,1);J.splice(G,0,oe);const be=d.slice().sort((ge,ue)=>ge.sequenceId-ue.sequenceId).map(ge=>ge.sequenceId),Z=J.map((ge,ue)=>({...ge,sequenceId:be[ue]??ge.sequenceId}));v({updatedColumns:Z}),O(null),M(null)},K=()=>{O(null),M(null)},ce=(A,G,J,oe)=>{var We,Ke,st,$e,pe;if(!A)return null;const be=(A==null?void 0:A.isMandatory)&&(A==null?void 0:A.isSticky),Z=parseFloat((Ke=(We=A==null?void 0:A.style)==null?void 0:We.minWidth)==null?void 0:Ke.toString().replace("rem",""))||7.5;G===0&&(R.current=0);const ge=be?G===0?0:`${R.current}rem`:void 0;be&&(R.current+=Z);const ue=b===G,ye=E==G||((st=d==null?void 0:d[E])==null?void 0:st.isMandatory),Ne=ve=>{A.isMandatory?(ve.preventDefault(),ve.dataTransfer.dropEffect="none"):(ve.preventDefault(),ve.dataTransfer.dropEffect="move"),q==null||q(ve,G)},Ie=ve=>{A.isMandatory||Q==null||Q(ve,G)},Me=oe?`${oe==null?void 0:oe.key}_${A==null?void 0:A.key}_${G}`:G;return y.jsx(Ta,{rowSpan:A!=null&&A.children?1:2,colSpan:(pe=($e=A==null?void 0:A.children)==null?void 0:$e.filter(ve=>!(ve!=null&&ve.isHidden)))==null?void 0:pe.length,style:A==null?void 0:A.style,onMouseEnter:()=>{I!==Me&&N(Me)},draggable:J&&!(A!=null&&A.isMandatory),onDragStart:J&&!(A!=null&&A.isMandatory)?ve=>ne(ve,G):ve=>{ve.preventDefault()},onDragOver:J&&!(A!=null&&A.isMandatory)?Ne:void 0,onDrop:J&&!(A!=null&&A.isMandatory)?Ie:void 0,onDragEnd:J&&!(A!=null&&A.isMandatory)?K:void 0,sx:{...A.isCenterTable&&{border:"0.1rem solid",borderTop:"none"},...ue&&{border:`0.1rem solid ${u.palette.brandColor.lightBlue}!important`},...be&&{position:"sticky",left:ge,zIndex:3},cursor:ye?"not-allowed":J&&!(A!=null&&A.isMandatory)?"grab":"default"},children:y.jsx(rw,{parent:oe,column:A,sort:t,handleMenuClick:h,isManageable:J})},G)},ie=(A,G,J,oe)=>{var ue,ye,Ne;if(!A)return null;const be=(A==null?void 0:A.isMandatory)&&(A==null?void 0:A.isSticky),Z=parseFloat((ye=(ue=A==null?void 0:A.style)==null?void 0:ue.minWidth)==null?void 0:ye.toString().replace("rem",""))||7.5;J===0&&(R.current=0);const ge=be?J===0?0:`${R.current}rem`:void 0;return be&&(R.current+=Z),y.jsxs(Ta,{colSpan:1,style:A==null?void 0:A.style,className:`${A==null?void 0:A.label}`,sx:{...A.isCenterTable&&{border:"0.1rem solid",borderTop:"none"},position:"relative",...be&&{position:"sticky",left:ge,zIndex:2,backgroundColor:Ie=>{var Me;return e!=null&&e.selectedRow&&((Me=e==null?void 0:e.selectedRow)==null?void 0:Me.fhi)===(G==null?void 0:G.fhi)||G!=null&&G.isHigh?Ie.palette.primary.appBackground:Ie.palette.primary.notifyBackground}}},children:[((e==null?void 0:e.selectedRow)&&((Ne=e==null?void 0:e.selectedRow)==null?void 0:Ne.fhi)===(G==null?void 0:G.fhi)||(G==null?void 0:G.isHigh))&&y.jsx(Ce,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}}),y.jsx(Fp,{isRenderCellContent:!!(A!=null&&A.cellRenderer),column:A,row:G,parent:oe})]},J)},se=(A,G,J,oe)=>y.jsx(y.Fragment,{children:A&&J&&!(A!=null&&A.isMandatory)?y.jsx(Ce,{resizeStart:()=>{A!=null&&A.isMandatory&&!(A!=null&&A.isResizable)||(V.current=!0,ee(G))},resizeEnd:()=>{A!=null&&A.isMandatory&&!(A!=null&&A.isResizable)||(V.current=!1,ee(null))},component:A!=null&&A.children||A!=null&&A.isMandatory?$l:$p,rowSpan:A!=null&&A.children?1:2,colSpan:1,id:G,sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${u.palette.primary.notifyBorderColor}`,cursor:"col-resize","&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"0.1rem",height:"2rem",backgroundColor:u.palette.primary.notifyBorderColor,zIndex:1},...!(A!=null&&A.isMandatory)&&{"&:hover::after":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"0.2rem",height:`${P}px`,backgroundColor:u.palette.primary.notifyBorderColor,zIndex:1}}},disabled:!J}):null}),ae=(A,G,J,oe,be,Z)=>{var ge;return Z&&`${Z==null?void 0:Z.key}${G==null?void 0:G.key}${J}`,y.jsx(y.Fragment,{children:G&&oe&&!(G!=null&&G.isMandatory)?y.jsx($l,{className:"column_resizer_body",sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${u.palette.primary.notifyBorderColor}`},children:((e==null?void 0:e.selectedRow)&&((ge=e==null?void 0:e.selectedRow)==null?void 0:ge.fhi)===(A==null?void 0:A.fhi)||(A==null?void 0:A.isHigh))&&y.jsx(Ce,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}})},`resize-${J}`):null})},X=A=>{const G=k.current,{left:J,right:oe}=G.getBoundingClientRect(),be=50,Z=A.clientX>oe-be?1:A.clientX<J+be?-1:0;Z!==0?(F.current&&clearInterval(F.current),F.current=setInterval(()=>{G.scrollLeft+=Z*10},50)):F.current&&(clearInterval(F.current),F.current=null)};return y.jsxs(y.Fragment,{children:[y.jsx(Lg,{sx:{maxHeight:"40rem",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${u.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem"},children:y.jsxs(Fg,{ref:k,stickyHeader:!0,"aria-label":"sticky table",sx:{backgroundColor:A=>A.palette.primary.notifyBackground},children:[y.jsxs(Wg,{children:[y.jsx(js,{sx:{position:"sticky",top:0,backgroundColor:u.palette.primary.notifyBackground,zIndex:3,maxHeight:"3.5rem"},children:d.map((A,G)=>A!=null&&A.isHidden||(A==null?void 0:A.isVisible)===!1?null:y.jsxs(D.Fragment,{children:[ce(A,G,x),se(A,G,x)]},G))}),y.jsx(js,{draggable:!1,sx:{position:"sticky",top:"2rem",backgroundColor:u.palette.primary.notifyBackground,zIndex:2},children:d.flatMap((A,G)=>A!=null&&A.isHidden||!(A!=null&&A.children)||(A==null?void 0:A.isVisible)===!1?[]:A.children.map((J,oe)=>J!=null&&J.isHidden?null:y.jsxs(D.Fragment,{children:[ce(J,oe,x,A),w&&se(J,oe,x)]},`${G}-${oe}`)))})]}),y.jsx(Bg,{children:n.map((A,G)=>{const J=A[W],oe=B==null?void 0:B[J],be=(oe==null?void 0:oe.length)>0;return y.jsxs(D.Fragment,{children:[y.jsx(js,{sx:{backgroundColor:Z=>{var ge;return e&&((ge=e==null?void 0:e.selectedRow)==null?void 0:ge.fhi)===(A==null?void 0:A.fhi)||A!=null&&A.isHigh?Z.palette.primary.appBackground:Z.palette.primary.notifyBackground}},onClick:()=>e==null?void 0:e.onRowClick(A),children:d.map((Z,ge)=>Z!=null&&Z.isHidden||(Z==null?void 0:Z.isVisible)===!1?null:Z!=null&&Z.children?Z.children.map((ue,ye)=>ue!=null&&ue.isHidden?null:y.jsxs(D.Fragment,{children:[ie(ue,A,ye,Z),w&&ae(A,ue,ye,x,G,Z)]},`${ge}-${ye}`)):y.jsxs(D.Fragment,{children:[ie(Z,A,ge),w&&ae(A,Z,ge,x)]},ge))}),_&&oe&&y.jsx(y.Fragment,{children:be?oe.map((Z,ge)=>y.jsx(js,{children:L.map((ue,ye)=>y.jsx(Ta,{style:ue==null?void 0:ue.style,children:y.jsx(Fp,{isRenderCellContent:!!(ue!=null&&ue.cellRenderer),column:ue,row:Z})},ye))},`nested-${ge}`)):y.jsx(js,{children:y.jsx(Ta,{colSpan:L.length,children:y.jsx(Oo,{sx:{textAlign:"center"},children:Kr.NRF})})})})]},G)})})]})}),r&&y.jsx(ew,{pagination:r,gridPath:l,baseUrl:a}),y.jsx(tw,{menuOpen:p==null?void 0:p.isOpen,handleClose:g,onHideClick:m})]})}ow.propTypes={sort:s.object,data:s.array,pagination:s.object,columns:s.object,nested:s.object};function sw({tableProps:e,isDefaultConfig:t,gridPath:n,baseUrl:r,childUniqueKey:o}){var c;const{columns:i}=e,a=D.useContext(ya),l=p7({columns:i,gridPath:n,baseUrl:r,isDefaultConfig:t,childUniqueKey:o,pageSize:(c=e==null?void 0:e.pagination)==null?void 0:c.rowPerPage});return D.useEffect(()=>{console.log({mergedColumns:l}),l!=null&&l.length&&(a==null||a({type:He.SET_GRID_DATA,payload:{visibleGridColumns:l}}))},[l]),y.jsx(ow,{...e,gridPath:n,baseUrl:r,childUniqueKey:o})}sw.propTypes={tableProps:s.object.isRequired,mergedColumns:s.array.isRequired};const iw=({type:e})=>{const t=It(),r=(t==null?void 0:t.mode)==="dark"?{bgcolor:"grey.800"}:{};return{grid:y.jsxs(Ce,{sx:{borderRadius:2,overflow:"hidden"},children:[y.jsx(Tr,{variant:"text",width:"100%",height:60,sx:r}),Array.from({length:10}).map((i,a)=>y.jsx(Ce,{sx:{display:"flex",alignItems:"center",padding:"0.5rem",gap:"3rem"},children:Array.from({length:5}).map((l,c)=>y.jsx(Ce,{sx:{flex:1},children:y.jsx(Tr,{variant:"text",height:45,sx:r})},c))},a))]}),toolbar:y.jsx(y.Fragment,{children:y.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{display:"flex",gap:"1rem"},children:[y.jsxs(ft,{direction:"row",gap:"1rem",children:[y.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"15.2rem",height:"5rem",sx:r})]}),y.jsxs(ft,{direction:"row",gap:"1rem",children:[y.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r})]})]})})}[e]},T7=e=>{if(!e)return null;const{options:t,...n}=e,r=t?"select":"button",o={button:i=>{var a;return y.jsx(go,{...i,styles:{...i.styles,iconPrimary:((a=i==null?void 0:i.styles)==null?void 0:a.variant)=="filled"}})},select:i=>{var a;return y.jsx(Ce,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"},width:(a=i.styles)==null?void 0:a.width},children:y.jsx(l1,{...i,options:t})})}};return o[r]?o[r](n):null},k7=({presentSetting:e,gridSetting:t,gridPath:n,childUniqueKey:r})=>{if(!n)return e;const o=n.split("/").filter(Boolean);let i=o.reduce((u,d)=>u==null?void 0:u[d],e)||null,a=Sa(t==null?void 0:t.grid,r);const l=Dr(i==null?void 0:i.columns);a=a==null?void 0:a.map(u=>{var p;const d=(u==null?void 0:u.children)||{},f=((p=l==null?void 0:l[u==null?void 0:u.key])==null?void 0:p.children)||{};return{...u,children:{...f,[r]:d==null?void 0:d[r]}}});let c=e;for(let u=0;u<o.length;u++){const d=o[u];u===o.length-1?c[d]={columns:a,pageSize:(t==null?void 0:t.pageSize)??null}:(c[d]=c[d]||{},c=c[d])}return{settingObject:e,defaultUserSettings:a}},O7=async({baseUrl:e,gridSetting:t,childUniqueKey:n,gridPath:r})=>{try{const o=JSON.parse(localStorage.getItem("settings")),{settingObject:i,defaultUserSettings:a}=k7({presentSetting:o,gridSetting:t,gridPath:r,childUniqueKey:n});return localStorage.setItem("settings",JSON.stringify(i)),await _c({baseUrl:e,payload:i}),a}catch(o){console.error(o)}},E7=({customTools:e})=>{var r,o;const t=(r=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===J1.PRIMARY))==null?void 0:r.sort((i,a)=>i.sequenceId-a.sequenceId),n=(o=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===J1.SECONDARY))==null?void 0:o.sort((i,a)=>i.sequenceId-a.sequenceId);return{primaryButtons:t,secondaryButtons:n}},aw=({customTools:e,isExpanded:t,setIsExpanded:n})=>{const{primaryButtons:r,secondaryButtons:o}=E7({customTools:e}),[i,a]=D.useState(r),l=(o==null?void 0:o.length)>0,c=d=>{d?a([...r,...o]):setTimeout(()=>{a(r)},100)},u=()=>{const d=!t;n(d),c(d)};return D.useEffect(()=>{c(t)},[e]),y.jsxs(y.Fragment,{children:[t&&y.jsx("div",{style:{position:"fixed",left:0,width:"100vw",height:"4rem",zIndex:998}}),y.jsxs(Ce,{sx:{display:"flex",alignItems:"center",gap:"0.8rem",flexWrap:"nowrap",maxWidth:"100%",whiteSpace:"nowrap",zIndex:999},children:[y.jsx(J5,{mode:"popLayout",children:i.map((d,f)=>y.jsx(Xi.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},layout:!0,children:y.jsx(Ce,{sx:{flexShrink:0,minWidth:"fit-content"},children:T7(d)})},`${d.id}_${f}`))}),l&&y.jsx(Ce,{sx:{paddingLeft:t?"0.5rem":0},children:y.jsx(go,{label:t?"":"More Actions",styles:{iconPrimary:!0,icon:t?Ge.CrossWhite:Ge.More,colorType:t?"danger":""},onClick:u})})]})]})};aw.propTypes={customTools:s.array.isRequired};const lw=({defaultTools:e,isManageable:t,customTools:n,baseUrl:r,gridPath:o,pageSize:i,gridData:a,childUniqueKey:l})=>{var w,T,k,b,O,E;const c=D.useContext(ya),{visibleGridColumns:u,triggerApi:d}=D.useContext(Sc),[f,p]=D.useState([]),[h,g]=D.useState(!1);D.useEffect(()=>{if(u.length){const M={id:99999,sequenceId:99999,isLocalizable:!1,key:"horizons",label:"Horizons",isSortable:!1,isHidden:!0,showChildCheckbox:!0,showCheckbox:!1,isMandatory:!0,showInHierarchy:!0,showHide:!0,children:[]};let I=u.map($=>($!=null&&$.children&&$.children.forEach(R=>{M.children.some(F=>F.key===R.key)||M.children.push({...R,showInHierarchy:!0})}),$)).filter($=>($==null?void 0:$.id)!==(M==null?void 0:M.id));const N=M.children.length>0?[...I,M]:I;p(N)}},[u]);const m=async M=>{try{await O7({baseUrl:r,gridPath:o,childUniqueKey:l,gridSetting:{grid:M,pageSize:i}})}catch(I){console.error(I)}finally{c({type:He.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),c({type:He.TRIGGER_API,payload:{triggerApi:!1}})}};D.useEffect(()=>{d&&m(u)},[d]);const v=M=>{const I=M.map(R=>R.id),N=M.flatMap(R=>R.children||[]).map(R=>R.id),$=f.map(R=>{var L;const V=I.includes(R.id);if(Array.isArray(R.children)&&R.children.length>0){const _=R.children.map(W=>{const P=N.includes(W.id);return{...W,isHidden:!P}}),B=_.filter(W=>f.some(P=>{var j;return(j=P.children)==null?void 0:j.some(z=>z.id===W.id)})).every(W=>W.isHidden);return{...R,...!((L=R.children[0])!=null&&L.showInHierarchy)&&{isHidden:B||!V},children:_}}return{...R,isHidden:!V}});c({type:He.SET_GRID_DATA,payload:{visibleGridColumns:$}}),c({type:He.HAS_SETTING_CHANGE,payload:{hasChange:!0}})},x=()=>f.map(I=>{const N=Array.isArray(I.children)?I.children.filter($=>!$.isHidden):void 0;return!I.isHidden||I.isHidden&&I.showInHierarchy?{...I,children:N}:null}).filter(Boolean);return y.jsxs(Ce,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.6rem",width:"100%"},children:[y.jsxs(Ce,{sx:{display:"flex",flexDirection:"row",gap:"0.6rem"},children:[((w=e==null?void 0:e.search)==null?void 0:w.isRequired)&&y.jsx(s1,{...e==null?void 0:e.search,iconUrl:Ge.Search}),((T=e==null?void 0:e.refresh)==null?void 0:T.isRequired)&&y.jsx(go,{...e==null?void 0:e.refresh,styles:{variant:"filled",icon:Ge.Refresh,colorType:"empty",width:"3.2rem",height:"3.2rem"}}),((k=e==null?void 0:e.groupBy)==null?void 0:k.isRequired)&&y.jsx(Ce,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:y.jsx(Tc,{styles:{icon:Ge.Group},...e.groupBy})}),t&&y.jsx(Ce,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:y.jsx(Tc,{placeholder:"Manage Columns",options:f,value:x(),isMulti:!0,isDraggable:!0,showSearch:!0,isManageColumn:!0,onChange:v,disabled:!a.length,styles:{icon:Ge.Manage}})})]}),y.jsxs(Ce,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[n&&y.jsx(aw,{customTools:n,setIsExpanded:g,isExpanded:h}),((b=e==null?void 0:e.save)==null?void 0:b.isRequired)&&y.jsx(Ce,{sx:{px:"0.5rem"},children:y.jsx(go,{label:h?"":"Save",styles:{icon:Ge.Save,colorType:"empty"},...e==null?void 0:e.save})}),((O=e==null?void 0:e.upload)==null?void 0:O.isRequired)&&y.jsx(go,{...e==null?void 0:e.upload,styles:{variant:h?"outlined":"filled",icon:h?Ge.UploadDark:Ge.Upload,iconPrimary:!h,colorType:"secondary",isAnimate:!0}}),((E=e==null?void 0:e.download)==null?void 0:E.isRequired)&&y.jsx(go,{...e==null?void 0:e.download,styles:{variant:"outlined",icon:Ge.Download,isAnimate:!0}})]})]})};lw.propTypes={defaultTools:s.object.isRequired,customTools:s.array,isManageable:s.bool,baseUrl:s.string,gridPath:s.gridPath};function Bp({tableProps:e,toolbarProps:t,isDefaultConfig:n,isLoading:r}){var i,a;const o=(i=e.columns)==null?void 0:i.isManageable;return y.jsx(a1,{children:r?y.jsxs(y.Fragment,{children:[y.jsx(iw,{type:"toolbar"}),y.jsx(iw,{type:"grid"})]}):y.jsxs(Ce,{sx:{position:"sticky"},children:[t&&y.jsx(lw,{...t,isManageable:o,pageSize:(a=e==null?void 0:e.pagination)==null?void 0:a.rowPerPage,gridData:e==null?void 0:e.data}),y.jsx(sw,{tableProps:e,isDefaultConfig:n,gridPath:(t==null?void 0:t.gridPath)||"",baseUrl:(t==null?void 0:t.baseUrl)||"",childUniqueKey:(t==null?void 0:t.childUniqueKey)||""})]})})}Bp.propTypes={tableProps:s.object.isRequired,toolbarProps:s.object,isDefaultConfig:s.bool};const cw=({list:e,handleLinkClick:t})=>{const n=It(),r=({list:o})=>{var i;return(i=o==null?void 0:o.sort((a,l)=>a.order-l.order))==null?void 0:i.map((a,l)=>a!=null&&a.link?y.jsx(Br,{component:"h3",sx:{fontSize:"1rem",cursor:"pointer",color:l===(o==null?void 0:o.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},href:a==null?void 0:a.link,underline:"hover",onClick:()=>t(a),children:a==null?void 0:a.title},l):y.jsx(ot,{component:"h3",sx:{fontSize:"1rem",color:l===(o==null?void 0:o.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},children:a==null?void 0:a.title},l))};return y.jsx(L0,{separator:y.jsx(hn,{url:Ge.ArrowRight}),children:r({list:e})})};cw.propTypes={list:s.array.isRequired,handleLinkClick:s.func};const uw=({breadcrumbProps:e,switchProps:t,filterComponentProps:n})=>{var o,i,a,l,c,u;const r=It();return y.jsxs(y.Fragment,{children:[y.jsxs(ft,{sx:{background:r.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,height:"3rem",p:"0px 1.5rem 0 1.5rem",zIndex:4,position:"relative"},direction:"row",justifyContent:"space-between",alignItems:"center",children:[y.jsx(cw,{...e}),y.jsxs(ft,{direction:"row",gap:"1rem",alignItems:"center",children:[t&&y.jsx(f1,{...t}),(n==null?void 0:n.filterBtnProps)&&y.jsxs(ft,{direction:"row",children:[y.jsx(vi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"2rem!important",opacity:"1!important",borderColor:r.palette.primary.notifyBorderColor}}),y.jsxs(ft,{direction:"row",alignItems:"center",gap:"0.5rem",onClick:(o=n==null?void 0:n.filterBtnProps)==null?void 0:o.onFilterClick,sx:{cursor:"pointer"},children:[y.jsx(hn,{url:Ge.Filter}),y.jsx(ot,{sx:{fontSize:"1.1rem",color:r.palette.primary.notifyActiveText},children:(i=n==null?void 0:n.filterBtnProps)==null?void 0:i.label})]})]})]})]}),y.jsx(Xi.div,{layout:!0,initial:{height:"0rem"},animate:{height:(a=n==null?void 0:n.filterBtnProps)!=null&&a.filterContainerVisible?"5rem":"0rem",opacity:(l=n==null?void 0:n.filterBtnProps)!=null&&l.filterContainerVisible?1:0},transition:{duration:.5,ease:"easeInOut"},style:{background:r.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,padding:"0px 5.5rem 0 1.5rem",position:"relative",alignItems:"center",display:"flex",overflow:"hidden"},children:y.jsxs(ft,{sx:{background:r.palette.primary.appBackground,height:"3.8rem",p:"0 2rem",width:"100%",borderRadius:"0.7rem",overflow:"visible"},direction:"row",alignItems:"center",children:[y.jsx(ot,{sx:{fontSize:"1.2rem",fontWeight:"500",color:r.palette.primary.notifyActiveText},children:"Filters:"}),y.jsx(Ce,{sx:{overflowX:"auto",overflowY:"visible",whiteSpace:"nowrap",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},margin:"0 1rem",padding:"0.5rem 0",flexGrow:1},children:y.jsx(ft,{direction:"row",gap:"1.2rem",sx:{overflow:"visible"},children:(c=n==null?void 0:n.filterItems)==null?void 0:c.map((d,f)=>y.jsx(y.Fragment,{children:y.jsxs(Ce,{sx:{position:"relative",overflow:"visible",border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,background:r.palette.primary.notifyBackground,borderRadius:"0.6rem",padding:"0.3rem 1.1rem",display:"inline-block"},children:[y.jsx(Ce,{component:"img",src:Ge.FilterClose,sx:{position:"absolute",top:"-0.4rem",right:"-0.6rem",cursor:"pointer"},onClick:()=>n==null?void 0:n.onFilterChipClose(d)}),y.jsx(ot,{sx:{fontSize:"1rem",color:r.palette.primary.notifyTextColor},children:d==null?void 0:d.filterLabel})]},f)}))})}),y.jsx(Ce,{component:ot,sx:{fontSize:"1.1rem",fontWeight:"500",textDecoration:"underline",color:r.palette.brandColor.red,cursor:"pointer"},onClick:(u=n==null?void 0:n.filterContainerProps)==null?void 0:u.onClearClick,children:"Clear"})]})})]})};uw.propTypes={breadcrumbProps:s.object.isRequired,switchProps:s.object};function dw({headerProps:e}){return y.jsx(_n,{children:y.jsx(uw,{...e})})}dw.propTypes={headerProps:s.object.isRequired};const Lp=D.createContext(null),fw=D.createContext(null);function P7({children:e}){const[t,n]=D.useReducer(M7,R7);return y.jsx(Lp.Provider,{value:t,children:y.jsx(fw.Provider,{value:n,children:e})})}function M7(e,t){var n;switch(t.type){case He.LOADING:return{...e,loading:t.loading};case He.SUCCESS:return{...e,data:(n=t.data)==null?void 0:n.sort((r,o)=>new Date(o.createdAt)-new Date(r.createdAt))};case He.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case He.ERROR:return{...e,error:t.error};default:throw new Error(`${Kr.UNHANDLED}: ${t}`)}}const R7={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:Vp,BU_ID:Wp,SNOP_ID:pw}=X1,{TENANT_IDS:zp,BU_IDS:Up}=Q1,D7=async e=>{try{const t=`${e}${$c.NOTIFICATION}/v1?${Vp}=${zp}&${Wp}=${Up}`;return await St.get(t,Ca)}catch(t){return t}},hw=async(e,t,n)=>{try{const r=n===Z1.MARK_ALL_READ?"":`&${pw}=${n}&`,o=`${e}${$c.NOTIFICATION}${Rp.VERSION}?${Vp}=${zp}&${Wp}=${Up}${r}`;return await St.put(o,t,Ca)}catch(r){return r}},I7=async({baseUrl:e,id:t,snopId:n})=>{try{const r=`${e}${$c.NOTIFICATION}${Rp.VERSION}?${Vp}=${zp}&${Wp}=${Up}&${pw}=${n}&id=${t}`;return await St.get(r,Ca)}catch(r){return r}},Lc={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500},mw=({baseUrl:e})=>{const t=D.useContext(fw),[n,r]=D.useState(!1),[o,i]=D.useState(!1),[a,l]=D.useState(!1),[c,u]=D.useState({}),[d,f]=D.useState(null),[p,h]=D.useState(1),[g,m]=D.useState(!1),[v,x]=D.useState(0),{loading:w,data:T,isMarkAllAsRead:k}=D.useContext(Lp),[b,O]=D.useState([]);D.useEffect(()=>{O(T)},[T]);const E=D.useCallback(async()=>{var F,L;try{t({type:He.LOADING,loading:!0}),t({type:He.SUCCESS,data:[]});const _=await D7(e);if(_.status===Lc.OK){const B=((L=(F=_.data)==null?void 0:F.responseData)==null?void 0:L.response)||[],W=Cc(B);t({type:He.SUCCESS,data:Cc(W)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:i1(B),boo:i1(B)>0}})}}catch{t({type:He.ERROR,error:Kr.SWR})}finally{t({type:He.LOADING,loading:!1})}},[e,t]);D.useEffect(()=>{E();const F=setInterval(E,3e5);return()=>clearInterval(F)},[E]);const M=async(F,L)=>{var _,B,W;if(F){f(F);try{const P=await I7({baseUrl:e,id:F,snopId:L});if(P.status===Lc.OK){const j=((W=(B=(_=P.data)==null?void 0:_.responseData)==null?void 0:B.response)==null?void 0:W[0])||{};u(j||{}),l(!0)}else throw new Error}catch{t({type:He.ERROR,error:Kr.SWR})}finally{f(null)}}},I=async(F,L)=>{if(F.length){t({type:He.LOADING,loading:!0});try{if((await hw(e,F,L)).status===Lc.OK){const B=T.map(P=>F.includes(P.id)?{...P,isRead:!0}:P),W=B.filter(P=>!P.isRead).length;t({type:He.SUCCESS,data:Cc(B)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:W,boo:W>0}}),setTimeout(()=>{t({type:He.LOADING,loading:!1})},200)}}catch{t({type:He.ERROR,error:Kr.SWR}),t({type:He.LOADING,loading:!1})}}},N=async()=>{t({type:He.LOADING,loading:!0});try{const F=uV(T);if((await hw(e,F,Z1.MARK_ALL_READ)).status===Lc.OK){const _=T.map(B=>({...B,isRead:!0}));t({type:He.SUCCESS,data:Cc(_)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:0,boo:!1}}),setTimeout(()=>{t({type:He.LOADING,loading:!1})},200)}}catch{t({type:He.ERROR,error:Kr.SWR}),t({type:He.LOADING,loading:!1})}},$=(F,L)=>{t({type:He.LOADING,loading:!0}),x(L),setTimeout(()=>{t({type:He.LOADING,loading:!1})},400)},R=F=>{const L=F||T||[];return{0:L,1:L.filter(_=>(_==null?void 0:_.type)==="INFO"),2:L.filter(_=>(_==null?void 0:_.type)==="ERROR")}},V=()=>{t({type:He.LOADING,loading:!0});const F=!g,L=F?(b||[]).filter(_=>!_.isRead):T||[];m(F),O(L),h(1),setTimeout(()=>{t({type:He.LOADING,loading:!1})},400)};return{fetchNotification:E,showDetailsProps:{open:a,handleClose:()=>l(!1),setOpen:l,data:c,clickId:d},alertDialogProps:{open:n,handleClose:()=>r(!1),onRefresh:E,handleRead:I,handleMarkAllAsRead:N,setOpen:r,handleShowDetails:M,clickId:d,isMainDialog:!0},activeTab:v,loading:w,tabData:R(b)[v],data:b,mode:g,handleTabChange:$,toggleAlertMode:V,page:p,setPage:h,isMarkAllAsRead:k}};var gw,yw,bw;function Hp(){return Hp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hp.apply(null,arguments)}var A7=function(t){return C.createElement("svg",Hp({xmlns:"http://www.w3.org/2000/svg",width:16,height:17,fill:"none"},t),gw||(gw=C.createElement("path",{stroke:"#909090",strokeLinecap:"round",strokeMiterlimit:10,d:"M8.013 2.19c-2.206 0-4 1.793-4 4v1.927c0 .406-.173 1.026-.38 1.373l-.766 1.273c-.474.787-.147 1.66.72 1.954 2.873.96 5.973.96 8.846 0a1.335 1.335 0 0 0 .72-1.954l-.766-1.273c-.2-.347-.374-.967-.374-1.373V6.19c0-2.2-1.8-4-4-4Z"})),yw||(yw=C.createElement("path",{stroke:"#909090",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.247 2.383a4.503 4.503 0 0 0-2.467 0 1.324 1.324 0 0 1 2.467 0"})),bw||(bw=C.createElement("path",{stroke:"#909090",strokeMiterlimit:10,d:"M10.013 12.957c0 1.1-.9 2-2 2a2.007 2.007 0 0 1-2-2"})))};const N7=({count:e})=>(It(),y.jsxs(y.Fragment,{children:[y.jsx(Ce,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center","& svg":{transform:"scale(1)"}},children:y.jsx(A7,{style:{scale:2}})}),y.jsx(x7,{badgeContent:e!=0?"":null,color:"error"})]}));function vw({children:e,handleClose:t,open:n,isMainDialog:r}){return y.jsx(Ol,{open:n,onClose:t,...r?{scroll:"paper",PaperProps:{sx:{position:"fixed",top:30,right:30,m:0,width:400,height:450,display:"flex",flexDirection:"column",borderRadius:2,boxShadow:6,backgroundColor:o=>o.palette.primary.notifyBackground}}}:{fullWidth:!0,maxWidth:"md",sx:{"& .MuiPaper-root":{minHeight:250,maxHeight:500,borderRadius:"1.5rem",boxShadow:6,backgroundColor:o=>o.palette.primary.appBackground}}},children:e})}var xw;function qp(){return qp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qp.apply(null,arguments)}var j7=function(t){return C.createElement("svg",qp({xmlns:"http://www.w3.org/2000/svg",width:14,height:9,fill:"none",viewBox:"0 0 13 9"},t),xw||(xw=C.createElement("path",{fill:"#A8A8A8",fillRule:"evenodd",d:"M8.954 1.004a.406.406 0 0 1 0 .575L3.537 6.996a.406.406 0 0 1-.574 0L.796 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0m3.25 0a.406.406 0 0 1 0 .575L6.787 6.996a.406.406 0 1 1-.574-.575l5.416-5.417a.406.406 0 0 1 .575 0",clipRule:"evenodd"})))},ww,Cw;function Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yp.apply(null,arguments)}var $7=function(t){return C.createElement("svg",Yp({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),ww||(ww=C.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M7.79 6c0 .99-.8 1.79-1.79 1.79S4.21 6.99 4.21 6 5.01 4.21 6 4.21s1.79.8 1.79 1.79"})),Cw||(Cw=C.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M6 10.135c1.765 0 3.41-1.04 4.555-2.84.45-.705.45-1.89 0-2.595C9.41 2.9 7.765 1.86 6 1.86S2.59 2.9 1.445 4.7c-.45.705-.45 1.89 0 2.595 1.145 1.8 2.79 2.84 4.555 2.84"})))},Sw;function Gp(){return Gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gp.apply(null,arguments)}var F7=function(t){return C.createElement("svg",Gp({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),Sw||(Sw=C.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M8.277 1.004a.406.406 0 0 1 0 .575L2.86 6.996a.406.406 0 0 1-.574 0L.119 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0",clipRule:"evenodd"})))};const Tw=({type:e,item:t,handleShowDetails:n,handleRead:r,handleCTAClicked:o,clickId:i})=>{var c,u;const a=It(),l=(u=(c=JSON.parse(localStorage.getItem("settings")))==null?void 0:c.platform)==null?void 0:u.theme;return y.jsxs(Ce,{className:"cards",sx:{pt:" 0.8rem"},children:[y.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:y.jsx(rd,{sx:{width:"calc(100% - 2%)","& .MuiBadge-badge":{backgroundColor:"#6041EA",height:"0.5rem",minWidth:"0.5rem"}},variant:"dot",invisible:t==null?void 0:t.isRead,children:y.jsx(Oo,{sx:{color:a.palette.primary.notifyActiveText,whiteSpace:"normal",wordBreak:"break-word"},component:"p",className:["title-card",(t==null?void 0:t.isRead)&&"read"].join(" "),children:t==null?void 0:t.message})})}),y.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:y.jsxs(ft,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[(t==null?void 0:t.isNotificationDetails)&&y.jsx(Bc,{icon:y.jsx($7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:n,label:i===(t==null?void 0:t.id)?y.jsx(kl,{color:"primary",size:13}):"Show Details",component:"button",variant:"filled",clickable:!0,size:"small",sx:{backgroundColor:a.palette.brandColor.orange,color:a.palette.brandColor.white}}),!(t!=null&&t.isRead)&&y.jsx(Bc,{icon:y.jsx(F7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:r,label:"Acknowledge",component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.primaryCTAURL)&&y.jsx(Bc,{disabled:t==null?void 0:t.isPrimaryCTAClicked,onClick:()=>o({redirect:t==null?void 0:t.isPrimaryCTARedirect,isClicked:t==null?void 0:t.isPrimaryCTAClicked,url:t==null?void 0:t.primaryCTAURL}),label:t==null?void 0:t.primaryCTALabel,component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.secondaryCTAURL)&&y.jsx(Bc,{disabled:t==null?void 0:t.isSecondaryCTAClicked,onClick:()=>o({redirect:t==null?void 0:t.isSecondaryCTARedirect,isClicked:t==null?void 0:t.isSecondaryCTAClicked,url:t==null?void 0:t.secondaryCTAURL}),label:t==null?void 0:t.secondaryCTALabel,component:"button",variant:"outlined",clickable:!0,size:"small"})]})}),y.jsxs(ft,{display:"flex",flexDirection:"row",alignItems:"center",gap:.35,children:[y.jsx(Oo,{sx:{fontSize:"0.8rem"},children:t==null?void 0:t.product}),y.jsx(Oo,{color:a.palette.primary.notifyTextColor,children:"•"}),y.jsx(Oo,{sx:{fontSize:"0.8rem"},children:cV(t==null?void 0:t.createdAt)})]})]})};Tw.propTypes={type:s.string,title:s.string,subTitle:s.string,isRead:s.bool,handleShowDetails:s.func,handleRead:s.func};const kw=({data:e,handleRead:t,handleShowDetails:n,clickId:r,mode:o,page:i,setPage:a})=>{const{isMarkAllAsRead:l}=D.useContext(Lp),c=new Date,u=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(c),[d,f]=D.useState([]),[p,h]=D.useState(!1),[g,m]=D.useState(!0),v=D.useRef(null),x=async T=>{h(!0);const k=e.slice((T-1)*10,T*10);await new Promise(b=>setTimeout(b,1e3)),f(b=>{const O=k.filter(E=>!b.some(M=>M.id===E.id));return[...b,...O]}),h(!1),(d==null?void 0:d.length)>=(e==null?void 0:e.length)&&m(!1)};D.useEffect(()=>{var k;let T=[];o?l!=null&&l.count?T=(k=e==null?void 0:e.filter(b=>!b.isRead))==null?void 0:k.slice(0,10):T=[]:T=e.slice(0,10),(T==null?void 0:T.length)<10&&m(!1),f(T)},[e,o,l]),D.useEffect(()=>{g&&i!==1&&x(i)},[i,e]),D.useEffect(()=>{f([...e])},[e]),D.useEffect(()=>{const T=new IntersectionObserver(k=>{k[0].isIntersecting&&!p&&g&&a(b=>b+1)},{threshold:1});return v.current&&T.observe(v.current),()=>{v.current&&T.unobserve(v.current)}},[p,g]);const w=({redirect:T,isClicked:k,url:b})=>{window.open(b,"_blank")};return y.jsxs(Ce,{sx:{width:"100%"},children:[Object.entries(pV(d)).map(([T,k])=>y.jsxs(D.Fragment,{children:[T!==u&&y.jsx(v7,{children:T}),k.map((b,O)=>y.jsx(D.Fragment,{children:y.jsx(Tw,{item:b,handleCTAClicked:w,handleShowDetails:()=>n(b.id,b.snopId),handleRead:()=>t([b.id],b.snopId),clickId:r})},`${O}_${b.id}`))]},T)),p&&i>1&&!!(d!=null&&d.length)&&y.jsx(Ce,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:y.jsx(kl,{size:20,sx:{color:T=>T.palette.primary.notifyIconColor}})}),!(d!=null&&d.length)&&y.jsx(ot,{sx:{fontSize:"1.1rem",color:T=>T.palette.primary.notifyTextColor,textAlign:"center",px:"0.8rem"},children:"You don't have any unread notification here. Use the toggle to switch between read and unread notification."}),y.jsx(Ce,{ref:v,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};kw.propTypes={data:s.array,handleRead:s.func,handleShowDetails:s.func};const _7=({onRefresh:e,handleShowDetails:t,clickId:n,handleRead:r,handleMarkAllAsRead:o})=>{var g,m,v,x;const{loading:i,activeTab:a,data:l,tabData:c,mode:u,page:d,setPage:f,handleTabChange:p,toggleAlertMode:h}=mw({});return y.jsxs(y.Fragment,{children:[y.jsxs(Ce,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,pt:2},children:[y.jsx(ot,{variant:"h2",sx:{fontSize:"1.2rem",color:w=>w.palette.primary.notifyTextColor},children:"Notifications"}),y.jsx(Ce,{onClick:e,children:y.jsx(hn,{url:Ge.Refresh,alt:"refresh",sx:{cursor:"pointer"}})})]}),y.jsx(Ce,{sx:{borderBottom:1,m:"1.2rem 1.2rem 0 1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},children:y.jsxs(w7,{value:a,onChange:p,children:[y.jsx(_p,{label:y.jsxs(Ce,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["All (",y.jsx(ot,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((g=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))==null?void 0:g.length)||0}),")"]})}),y.jsx(_p,{label:y.jsxs(Ce,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Info (",y.jsx(ot,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((m=l==null?void 0:l.filter(w=>(w==null?void 0:w.type)==="INFO"&&!(w!=null&&w.isRead)))==null?void 0:m.length)||0}),")"]}),sx:{color:w=>w.palette.brandColor.blue}}),y.jsx(_p,{label:y.jsxs(Ce,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Error (",y.jsx(ot,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((v=l==null?void 0:l.filter(w=>(w==null?void 0:w.type)==="ERROR"&&!(w!=null&&w.isRead)))==null?void 0:v.length)||0}),")"]}),sx:{color:w=>w.palette.brandColor.red}})]})}),y.jsx(Pl,{dividers:!0,sx:{p:0,...i&&!c.length&&{alignItems:"center",justifyContent:"center"},flexGrow:1,overflowY:"auto",mx:"1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},tabIndex:-1,children:i?y.jsx(kl,{size:30,sx:{color:w=>w.palette.primary.notifyIconColor}}):y.jsx(y.Fragment,{children:y.jsx(kw,{data:c,handleShowDetails:t,handleRead:r,clickId:n,page:d,setPage:f,mode:u})})}),y.jsxs(El,{sx:{justifyContent:"space-between",px:"1.2rem"},children:[y.jsxs(ft,{direction:"row",gap:1,children:[y.jsx(Oo,{sx:{fontSize:"1rem"},children:"Only show unread"}),y.jsx(b7,{disabled:i,checked:u,onChange:h})]}),y.jsx(Hn,{variant:"outlined",className:"view-all",onClick:o,startIcon:y.jsx(j7,{}),disabled:!((x=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))!=null&&x.length),style:{backgroundColor:"transparent"},sx:{fontSize:"1rem",fontWeight:"300",p:0,border:"none",textTransform:"none",color:w=>w.palette.primary.notifyTextColor,"&:hover":{color:w=>w.palette.primary.notifyActiveText,background:"transparent",boxShadow:"none",border:"none"},"&.Mui-disabled":{opacity:.5,color:w=>`${w.palette.primary.notifyActiveText}!important`,background:"transparent",boxShadow:"none",border:"none"}},children:"Mark all as read"})]})]})},B7=({data:e,handleClose:t})=>{var v;const[n,r]=D.useState(1),[o,i]=D.useState(10),[a,l]=D.useState(((v=e==null?void 0:e.notificationDetails)==null?void 0:v.length)||0),[c,u]=D.useState("sku_name"),[d,f]=D.useState("asc"),[p,h]=D.useState([]),[g,m]=D.useState("");return D.useEffect(()=>{var x;if(g||c){const w=dV(e==null?void 0:e.notificationDetails,o7,g);if(c){const T=fV(w,c,d);h(hp(T,n,o)),l(T.length);return}h(hp(w,n,o)),l(w.length);return}h(hp(e==null?void 0:e.notificationDetails,n,o)),l((x=e==null?void 0:e.notificationDetails)==null?void 0:x.length)},[g,e==null?void 0:e.notificationDetails,n,o,d,c]),y.jsxs(y.Fragment,{children:[y.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{padding:"1.5rem 2rem",borderBottom:"0.1rem solid",borderColor:x=>x.palette.primary.notifyBorderColor},children:[y.jsx(ot,{component:"h2",sx:{fontSize:"1.4rem",color:x=>x.palette.primary.notifyActiveText},children:(e==null?void 0:e.message)||""}),y.jsx(Ce,{onClick:t,sx:{cursor:"pointer"},children:y.jsx(hn,{url:Ge.CloseCircle})})]}),y.jsx(Pl,{children:y.jsx(Bp,{tableProps:{data:p,columns:{...g7(),isManageable:!1},sort:{sortField:c,sortDir:d,onSort:x=>{var T;const w=(T=x==null?void 0:x.column)==null?void 0:T.key;f(k=>c===w&&k==="asc"?"desc":"asc"),u(w)}},pagination:{selectedPage:n,rowPerPage:o,totalRecords:a,onPageChange:x=>{r(x)},onPageSizeChange:x=>{i(x==null?void 0:x.value),r(1)}}},toolbarProps:{defaultTools:{search:{isRequired:!0,onChange:x=>{const w=x.target.value;w&&r(1),m(w)},placeholder:"Search..."}}}})}),y.jsx(El,{sx:{padding:"1.5rem 2rem"}})]})},L7=({baseUrl:e})=>{const{alertDialogProps:t,showDetailsProps:n,fetchNotification:r,isMarkAllAsRead:o}=mw({baseUrl:e});return y.jsxs(y.Fragment,{children:[y.jsx(Ce,{sx:{display:"flex",justifyContent:"center",cursor:"pointer",marginTop:"0.6rem"},onClick:()=>{var i;r(),(i=t==null?void 0:t.setOpen)==null||i.call(t,!0)},children:y.jsx(N7,{count:o.count})}),y.jsx(vw,{...t,children:y.jsx(_7,{...t})}),y.jsx(vw,{...n,children:y.jsx(B7,{...n})})]})},V7=({baseUrl:e})=>y.jsx(_n,{children:y.jsx(P7,{children:y.jsx(L7,{baseUrl:e})})}),W7=({rightChild:e,leftChild:t,isDrawerMerged:n,isDrawerOpen:r,drawerTitle:o,showExpand:i,onCloseClick:a,onMergeClick:l,onExpandClick:c,isDrawerExpanded:u,styles:d,showMerge:f})=>{const p=It();return y.jsx(Ce,{sx:{position:"relative",overflow:"hidden"},children:y.jsxs(lo,{container:!0,sx:{height:"100%"},children:[y.jsx(lo,{item:!0,sx:{width:n?d!=null&&d.drawerWidth?`calc(${"100%"-(d==null?void 0:d.drawerWidth)})`:"75%":"100%",position:"relative",zIndex:3,height:"calc(100vh - 7rem)",p:"0rem 1.5rem",overflow:"auto"},children:t}),r&&!n&&y.jsxs(y.Fragment,{children:[y.jsx(Ce,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"#07080B80",backdropFilter:"blur(3px)",zIndex:3,transition:"opacity 0.3s ease-in-out"}}),y.jsx(Ce,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"transparent",zIndex:4}})]}),e&&y.jsxs(lo,{item:!0,sx:{width:u?"90%":(d==null?void 0:d.drawerWidth)||"25%",position:n?"relative":"absolute",top:0,right:0,height:"calc(100vh - 7rem)",backgroundColor:p.palette.primary.notifyBackground,transform:r?"translateX(0)":"translateX(100%)",transition:"transform 0.4s ease-in-out , width 0.4s ease-in-out",zIndex:4,borderLeft:`0.1rem solid ${p.palette.primary.notifyBorderColor}`,display:"flex",flexDirection:"column"},children:[y.jsxs(ft,{direction:"row",alignItems:"center",sx:{width:"100%",flexShrink:0,paddingBottom:"0.8rem",px:2,pt:"0.8rem",borderBottom:h=>`0.1rem solid ${h.palette.primary.notifyBorderColor}`},children:[!u&&f&&y.jsxs(y.Fragment,{children:[y.jsx(Ce,{component:"img",src:Ge.Merge,sx:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer"},onClick:l}),y.jsx(vi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"auto!important",borderColor:p.palette.primary.notifyBorderColor}})]}),y.jsxs(ft,{direction:"row",justifyContent:"space-between",alignItems:"center",flexGrow:1,children:[y.jsxs(ft,{direction:"row",gap:"0.5rem",alignItems:"center",onClick:a,sx:{cursor:"pointer"},children:[y.jsx(hn,{url:Ge.CrossLight}),y.jsx(ot,{sx:{fontSize:"1.2rem",color:p.palette.primary.notifyTextColor},children:o})]}),y.jsx(ft,{direction:"row",gap:"0.5rem",alignItems:"center",children:i&&y.jsx(Ce,{onClick:c,sx:{cursor:"pointer"},children:y.jsx(Ce,{component:"img",src:u?Ge.Collapse:Ge.Expand})})})]})]}),y.jsx(Ce,{sx:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},overflow:"auto",px:2},children:e})]})]})})},Ow=({layoutChildren:e,layoutProps:t})=>y.jsx(_n,{children:y.jsx(W7,{...e,...t})});Ow.propTypes={layoutChildren:s.object.isRequired,layoutProps:s.object.isRequired},vt.Button=go,vt.Checkbox=sc,vt.DatePicker=aV,vt.Grid=Bp,vt.Header=dw,vt.InputField=s1,vt.Loader=NV,vt.Notification=V7,vt.Select=l1,vt.SliderLayout=Ow,vt.Switch=f1,vt.TextField=xc,vt.ToastProvider=MV,vt.toast=kV,Object.defineProperty(vt,Symbol.toStringTag,{value:"Module"})});
327
327
  //# sourceMappingURL=index.umd.js.map