@3sc/common-component 0.0.239 → 0.0.240
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.es.js +2 -0
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
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(m)}},[t]),g.jsx(H3,{isPresent:t,childRef:r,sizeRef:i,children:C.cloneElement(e,{ref:r})})}const Y3=({children:e,initial:t,isPresent:n,onExitComplete:o,custom:r,presenceAffectsLayout:i,mode:a,anchorX:l})=>{const c=xd(G3),u=R.useId(),d=R.useCallback(p=>{c.set(p,!0);for(const m of c.values())if(!m)return;o&&o()},[c,o]),f=R.useMemo(()=>({id:u,initial:t,isPresent:n,custom:r,onExitComplete:d,register:p=>(c.set(p,!1),()=>c.delete(p))}),i?[Math.random(),d]:[n,d]);return R.useMemo(()=>{c.forEach((p,m)=>c.set(m,!1))},[n]),C.useEffect(()=>{!n&&!c.size&&o&&o()},[n]),a==="popLayout"&&(e=g.jsx(q3,{isPresent:n,anchorX:l,children:e})),g.jsx(Fl.Provider,{value:f,children:e})};function G3(){return new Map}function Z0(e=!0){const t=R.useContext(Fl);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:o,register:r}=t,i=R.useId();R.useEffect(()=>{if(e)return r(i)},[e]);const a=R.useCallback(()=>e&&o&&o(i),[i,o,e]);return!n&&o?[!1,a]:[!0]}const Bl=e=>e.key||"";function J0(e){const t=[];return R.Children.forEach(e,n=>{R.isValidElement(n)&&t.push(n)}),t}const K3=({children:e,custom:t,initial:n=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:i="sync",propagate:a=!1,anchorX:l="left"})=>{const[c,u]=Z0(a),d=R.useMemo(()=>J0(e),[e]),f=a&&!c?[]:d.map(Bl),p=R.useRef(!0),m=R.useRef(d),y=xd(()=>new Map),[h,b]=R.useState(d),[x,T]=R.useState(d);X0(()=>{p.current=!1,m.current=d;for(let v=0;v<x.length;v++){const E=Bl(x[v]);f.includes(E)?y.delete(E):y.get(E)!==!0&&y.set(E,!1)}},[x,f.length,f.join("-")]);const w=[];if(d!==h){let v=[...d];for(let E=0;E<x.length;E++){const k=x[E],M=Bl(k);f.includes(M)||(v.splice(E,0,k),w.push(k))}return i==="wait"&&w.length&&(v=w),T(J0(v)),b(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:O}=R.useContext(vd);return g.jsx(g.Fragment,{children:x.map(v=>{const E=Bl(v),k=a&&!c?!1:d===x||f.includes(E),M=()=>{if(y.has(E))y.set(E,!0);else return;let I=!0;y.forEach(j=>{j||(I=!1)}),I&&(O==null||O(),T(m.current),a&&(u==null||u()),o&&o())};return g.jsx(Y3,{isPresent:k,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:r,mode:i,onExitComplete:k?void 0:M,anchorX:l,children:v},E)})})};function Sd(e,t){e.indexOf(t)===-1&&e.push(t)}function Td(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let us=()=>{},Lo=()=>{};process.env.NODE_ENV!=="production"&&(us=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Lo=(e,t)=>{if(!e)throw new Error(t)});const Od={useManualTiming:!1};function Ed(e){let t;return()=>(t===void 0&&(t=e()),t)}const Fn=e=>e,Pi=(e,t,n)=>{const o=t-e;return o===0?1:(n-e)/o};class kd{constructor(){this.subscriptions=[]}add(t){return Sd(this.subscriptions,t),()=>Td(this.subscriptions,t)}notify(t,n,o){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,o);else for(let i=0;i<r;i++){const a=this.subscriptions[i];a&&a(t,n,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Hn=e=>e*1e3,so=e=>e/1e3;function Q0(e,t){return t?e*(1e3/t):0}const ey=new Set;function Ll(e,t,n){e||ey.has(t)||(console.warn(t),ey.add(t))}const X3=Ed(()=>window.ScrollTimeline!==void 0);class Z3{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 o=0;o<this.animations.length;o++)this.animations[o][t]=n}attachTimeline(t,n){const o=this.animations.map(r=>{if(X3()&&r.attachTimeline)return r.attachTimeline(t);if(typeof n=="function")return n(r)});return()=>{o.forEach((r,i)=>{r&&r(),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 J3 extends Z3{then(t,n){return this.finished.finally(t).then(()=>{})}}const ty={value:null},Pd=e=>Array.isArray(e)&&typeof e[0]=="number",Q3={};function eI(e,t){const n=Ed(e);return()=>Q3[t]??n()}const Mi=eI(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ny=(e,t,n=10)=>{let o="";const r=Math.max(Math.round(t/n),2);for(let i=0;i<r;i++)o+=e(i/(r-1))+", ";return`linear(${o.substring(0,o.length-2)})`},Ri=([e,t,n,o])=>`cubic-bezier(${e}, ${t}, ${n}, ${o})`,Md={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ri([0,.65,.55,1]),circOut:Ri([.55,0,1,.45]),backIn:Ri([.31,.01,.66,-.59]),backOut:Ri([.33,1.53,.69,.99])};function oy(e,t){if(e)return typeof e=="function"&&Mi()?ny(e,t):Pd(e)?Ri(e):Array.isArray(e)?e.map(n=>oy(n,t)||Md.easeOut):Md[e]}function tI(e,t,n,{delay:o=0,duration:r=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=oy(l,r);return Array.isArray(f)&&(d.easing=f),e.animate(d,{delay:o,duration:r,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal",pseudoElement:u})}function Rd(e){return typeof e=="function"&&"applyToOptions"in e}function Dd(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Vl=2e4;function Id(e){let t=0;const n=50;let o=e.next(t);for(;!o.done&&t<Vl;)t+=n,o=e.next(t);return t>=Vl?1/0:t}function nI(e,t=100,n){const o=n({...e,keyframes:[0,t]}),r=Math.min(Id(o),Vl);return{type:"keyframes",ease:i=>o.next(r*i).value/t,duration:so(r)}}function ry(e){return!!(typeof e=="function"&&Mi()||!e||typeof e=="string"&&(e in Md||Mi())||Pd(e)||Array.isArray(e)&&e.every(ry))}function sy(e,t){e.timeline=t,e.onfinish=null}const Wl=["read","resolveKeyframes","update","preRender","render","postRender"];function oI(e,t){let n=new Set,o=new Set,r=!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,m=!1)=>{const h=m&&r?n:o;return p&&a.add(f),h.has(f)||h.add(f),f},cancel:f=>{o.delete(f),a.delete(f)},process:f=>{if(l=f,r){i=!0;return}r=!0,[n,o]=[o,n],n.forEach(u),t&&ty.value&&ty.value.frameloop[t].push(c),c=0,n.clear(),r=!1,i&&(i=!1,d.process(f))}};return d}const rI=40;function iy(e,t){let n=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Wl.reduce((x,T)=>(x[T]=oI(i,t?T:void 0),x),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:p}=a,m=()=>{const x=performance.now();n=!1,r.delta=o?1e3/60:Math.max(Math.min(x-r.timestamp,rI),1),r.timestamp=x,r.isProcessing=!0,l.process(r),c.process(r),u.process(r),d.process(r),f.process(r),p.process(r),r.isProcessing=!1,n&&t&&(o=!1,e(m))},y=()=>{n=!0,o=!0,r.isProcessing||e(m)};return{schedule:Wl.reduce((x,T)=>{const w=a[T];return x[T]=(O,v=!1,E=!1)=>(n||y(),w.schedule(O,v,E)),x},{}),cancel:x=>{for(let T=0;T<Wl.length;T++)a[Wl[T]].cancel(x)},state:r,steps:a}}const{schedule:Ad}=iy(queueMicrotask,!1),{schedule:wt,cancel:Vo,state:qt,steps:jd}=iy(typeof requestAnimationFrame<"u"?requestAnimationFrame:Fn,!0);let zl;function sI(){zl=void 0}const io={now:()=>(zl===void 0&&io.set(qt.isProcessing||Od.useManualTiming?qt.timestamp:performance.now()),zl),set:e=>{zl=e,queueMicrotask(sI)}},qn={x:!1,y:!1};function ay(){return qn.x||qn.y}function iI(e){return e==="x"||e==="y"?qn[e]?null:(qn[e]=!0,()=>{qn[e]=!1}):qn.x||qn.y?null:(qn.x=qn.y=!0,()=>{qn.x=qn.y=!1})}function aI(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;const r=(n==null?void 0:n[e])??o.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}function ly(e,t){const n=aI(e),o=new AbortController,r={passive:!0,...t,signal:o.signal};return[n,r,()=>o.abort()]}function cy(e){return!(e.pointerType==="touch"||ay())}function lI(e,t,n={}){const[o,r,i]=ly(e,n),a=l=>{if(!cy(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{cy(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,r)};return o.forEach(l=>{l.addEventListener("pointerenter",a,r)}),i}const uy=(e,t)=>t?e===t?!0:uy(e,t.parentElement):!1,Nd=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,cI=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function uI(e){return cI.has(e.tagName)||e.tabIndex!==-1}const Di=new WeakSet;function dy(e){return t=>{t.key==="Enter"&&e(t)}}function $d(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const dI=(e,t)=>{const n=e.currentTarget;if(!n)return;const o=dy(()=>{if(Di.has(n))return;$d(n,"down");const r=dy(()=>{$d(n,"up")}),i=()=>$d(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",o,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",o),t)};function fy(e){return Nd(e)&&!ay()}function fI(e,t,n={}){const[o,r,i]=ly(e,n),a=l=>{const c=l.currentTarget;if(!fy(l)||Di.has(c))return;Di.add(c);const u=t(c,l),d=(m,y)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",p),!(!fy(m)||!Di.has(c))&&(Di.delete(c),typeof u=="function"&&u(m,{success:y}))},f=m=>{d(m,c===window||c===document||n.useGlobalTarget||uy(c,m.target))},p=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",p,r)};return o.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,r),l instanceof HTMLElement&&(l.addEventListener("focus",u=>dI(u,r)),!uI(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}const py=30,pI=e=>!isNaN(parseFloat(e));class hI{constructor(t,n={}){this.version="12.7.3",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,r=!0)=>{const i=io.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&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=io.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=pI(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ll(!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 kd);const o=this.events[t].add(n);return t==="change"?()=>{o(),wt.read(()=>{this.events.change.getSize()||this.stop()})}:o}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,o){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-o}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=io.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>py)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,py);return Q0(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 Ii(e,t){return new hI(e,t)}const hy=R.createContext({strict:!1}),my={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"]},ds={};for(const e in my)ds[e]={isEnabled:t=>my[e].some(n=>!!t[n])};function mI(e){for(const t in e)ds[t]={...ds[t],...e[t]}}const gI=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 Ul(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||gI.has(e)}let gy=e=>!Ul(e);function yI(e){e&&(gy=t=>t.startsWith("on")?!Ul(t):e(t))}try{yI(require("@emotion/is-prop-valid").default)}catch{}function bI(e,t,n){const o={};for(const r in e)r==="values"&&typeof e.values=="object"||(gy(r)||n===!0&&Ul(r)||!t&&!Ul(r)||e.draggable&&r.startsWith("onDrag"))&&(o[r]=e[r]);return o}function vI(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...o)=>(process.env.NODE_ENV!=="production"&&Ll(!1,"motion() is deprecated. Use motion.create() instead."),e(...o));return new Proxy(n,{get:(o,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const Hl=R.createContext({});function ql(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ai(e){return typeof e=="string"||Array.isArray(e)}const _d=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Fd=["initial",..._d];function Yl(e){return ql(e.animate)||Fd.some(t=>Ai(e[t]))}function yy(e){return!!(Yl(e)||e.variants)}function xI(e,t){if(Yl(e)){const{initial:n,animate:o}=e;return{initial:n===!1||Ai(n)?n:void 0,animate:Ai(o)?o:void 0}}return e.inherit!==!1?t:{}}function wI(e){const{initial:t,animate:n}=xI(e,R.useContext(Hl));return R.useMemo(()=>({initial:t,animate:n}),[by(t),by(n)])}function by(e){return Array.isArray(e)?e.join(" "):e}const CI=Symbol.for("motionComponentSymbol");function fs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function SI(e,t,n){return R.useCallback(o=>{o&&e.onMount&&e.onMount(o),t&&(o?t.mount(o):t.unmount()),n&&(typeof n=="function"?n(o):fs(n)&&(n.current=o))},[t])}const Bd=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),vy="data-"+Bd("framerAppearId"),xy=R.createContext({});function TI(e,t,n,o,r){var h,b;const{visualElement:i}=R.useContext(Hl),a=R.useContext(hy),l=R.useContext(Fl),c=R.useContext(Cd).reducedMotion,u=R.useRef(null);o=o||a.renderer,!u.current&&o&&(u.current=o(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=R.useContext(xy);d&&!d.projection&&r&&(d.type==="html"||d.type==="svg")&&OI(u.current,n,r,f);const p=R.useRef(!1);R.useInsertionEffect(()=>{d&&p.current&&d.update(n,l)});const m=n[vy],y=R.useRef(!!m&&!((h=window.MotionHandoffIsComplete)!=null&&h.call(window,m))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,m)));return X0(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),Ad.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),R.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)==null||x.call(window,m)}),y.current=!1))}),d}function OI(e,t,n,o){const{layoutId:r,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:wy(e.parent)),e.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||l&&fs(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:o,crossfade:d,layoutScroll:c,layoutRoot:u})}function wy(e){if(e)return e.options.allowProjection!==!1?e.projection:wy(e.parent)}function EI({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:o,Component:r}){e&&mI(e);function i(l,c){let u;const d={...R.useContext(Cd),...l,layoutId:kI(l)},{isStatic:f}=d,p=wI(l),m=o(l,f);if(!f&&wd){PI(d,e);const y=MI(d);u=y.MeasureLayout,p.visualElement=TI(r,m,d,t,y.ProjectionNode)}return g.jsxs(Hl.Provider,{value:p,children:[u&&p.visualElement?g.jsx(u,{visualElement:p.visualElement,...d}):null,n(r,l,SI(m,p.visualElement,c),m,f,p.visualElement)]})}i.displayName=`motion.${typeof r=="string"?r:`create(${r.displayName??r.name??""})`}`;const a=R.forwardRef(i);return a[CI]=r,a}function kI({layoutId:e}){const t=R.useContext(vd).id;return t&&e!==void 0?t+"-"+e:e}function PI(e,t){const n=R.useContext(hy).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const o="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?us(!1,o):Lo(!1,o)}}function MI(e){const{drag:t,layout:n}=ds;if(!t&&!n)return{};const o={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const Cy=e=>t=>typeof t=="string"&&t.startsWith(e),Ld=Cy("--"),RI=Cy("var(--"),Vd=e=>RI(e)?DI.test(e.split("/*")[0].trim()):!1,DI=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ji={};function II(e){for(const t in e)ji[t]=e[t],Ld(t)&&(ji[t].isCSSVariable=!0)}const ps=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],lr=new Set(ps);function Sy(e,{layout:t,layoutId:n}){return lr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ji[e]||e==="opacity")}const Xt=e=>!!(e&&e.getVelocity),Ty=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Oo=(e,t,n)=>n>t?t:n<e?e:n,hs={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ni={...hs,transform:e=>Oo(0,1,e)},Gl={...hs,default:1},$i=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Wo=$i("deg"),ao=$i("%"),Ne=$i("px"),AI=$i("vh"),jI=$i("vw"),Oy={...ao,parse:e=>ao.parse(e)/100,transform:e=>ao.transform(e*100)},NI={borderWidth:Ne,borderTopWidth:Ne,borderRightWidth:Ne,borderBottomWidth:Ne,borderLeftWidth:Ne,borderRadius:Ne,radius:Ne,borderTopLeftRadius:Ne,borderTopRightRadius:Ne,borderBottomRightRadius:Ne,borderBottomLeftRadius:Ne,width:Ne,maxWidth:Ne,height:Ne,maxHeight:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,backgroundPositionX:Ne,backgroundPositionY:Ne},$I={rotate:Wo,rotateX:Wo,rotateY:Wo,rotateZ:Wo,scale:Gl,scaleX:Gl,scaleY:Gl,scaleZ:Gl,skew:Wo,skewX:Wo,skewY:Wo,distance:Ne,translateX:Ne,translateY:Ne,translateZ:Ne,x:Ne,y:Ne,z:Ne,perspective:Ne,transformPerspective:Ne,opacity:Ni,originX:Oy,originY:Oy,originZ:Ne},Ey={...hs,transform:Math.round},Wd={...NI,...$I,zIndex:Ey,size:Ne,fillOpacity:Ni,strokeOpacity:Ni,numOctaves:Ey},_I={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},FI=ps.length;function BI(e,t,n){let o="",r=!0;for(let i=0;i<FI;i++){const a=ps[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=Ty(l,Wd[a]);if(!c){r=!1;const d=_I[a]||a;o+=`${d}(${u}) `}n&&(t[a]=u)}}return o=o.trim(),n?o=n(t,r?"":o):r&&(o="none"),o}function zd(e,t,n){const{style:o,vars:r,transformOrigin:i}=e;let a=!1,l=!1;for(const c in t){const u=t[c];if(lr.has(c)){a=!0;continue}else if(Ld(c)){r[c]=u;continue}else{const d=Ty(u,Wd[c]);c.startsWith("origin")?(l=!0,i[c]=d):o[c]=d}}if(t.transform||(a||n?o.transform=BI(t,e.transform,n):o.transform&&(o.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=i;o.transformOrigin=`${c} ${u} ${d}`}}const Ud=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ky(e,t,n){for(const o in t)!Xt(t[o])&&!Sy(o,n)&&(e[o]=t[o])}function LI({transformTemplate:e},t){return R.useMemo(()=>{const n=Ud();return zd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function VI(e,t){const n=e.style||{},o={};return ky(o,n,e),Object.assign(o,LI(e,t)),o}function WI(e,t){const n={},o=VI(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.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=o,n}const zI=["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 Hd(e){return typeof e!="string"||e.includes("-")?!1:!!(zI.indexOf(e)>-1||/[A-Z]/u.test(e))}const UI={offset:"stroke-dashoffset",array:"stroke-dasharray"},HI={offset:"strokeDashoffset",array:"strokeDasharray"};function qI(e,t,n=1,o=0,r=!0){e.pathLength=1;const i=r?UI:HI;e[i.offset]=Ne.transform(-o);const a=Ne.transform(t),l=Ne.transform(n);e[i.array]=`${a} ${l}`}function Py(e,t,n){return typeof e=="string"?e:Ne.transform(t+n*e)}function YI(e,t,n){const o=Py(t,e.x,e.width),r=Py(n,e.y,e.height);return`${o} ${r}`}function qd(e,{attrX:t,attrY:n,attrScale:o,originX:r,originY:i,pathLength:a,pathSpacing:l=1,pathOffset:c=0,...u},d,f){if(zd(e,u,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:m,dimensions:y}=e;p.transform&&(y&&(m.transform=p.transform),delete p.transform),y&&(r!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=YI(y,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),o!==void 0&&(p.scale=o),a!==void 0&&qI(p,a,l,c,!1)}const My=()=>({...Ud(),attrs:{}}),Yd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function GI(e,t,n,o){const r=R.useMemo(()=>{const i=My();return qd(i,t,Yd(o),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};ky(i,e.style,e),r.style={...i,...r.style}}return r}function KI(e=!1){return(n,o,r,{latestValues:i},a)=>{const c=(Hd(n)?GI:WI)(o,i,a,n),u=bI(o,typeof n=="string",e),d=n!==R.Fragment?{...u,...c,ref:r}:{},{children:f}=o,p=R.useMemo(()=>Xt(f)?f.get():f,[f]);return R.createElement(n,{...d,children:p})}}function Ry(e){const t=[{},{}];return e==null||e.values.forEach((n,o)=>{t[0][o]=n.get(),t[1][o]=n.getVelocity()}),t}function Gd(e,t,n,o){if(typeof t=="function"){const[r,i]=Ry(o);t=t(n!==void 0?n:e.custom,r,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,i]=Ry(o);t=t(n!==void 0?n:e.custom,r,i)}return t}const Kd=e=>Array.isArray(e),XI=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),ZI=e=>Kd(e)?e[e.length-1]||0:e;function Kl(e){const t=Xt(e)?e.get():e;return XI(t)?t.toValue():t}function JI({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},o,r,i){const a={latestValues:QI(o,r,i,e),renderState:t()};return n&&(a.onMount=l=>n({props:o,current:l,...a}),a.onUpdate=l=>n(l)),a}const Dy=e=>(t,n)=>{const o=R.useContext(Hl),r=R.useContext(Fl),i=()=>JI(e,t,o,r);return n?i():xd(i)};function QI(e,t,n,o){const r={},i=o(e,{});for(const p in i)r[p]=Kl(i[p]);let{initial:a,animate:l}=e;const c=Yl(e),u=yy(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"&&!ql(f)){const p=Array.isArray(f)?f:[f];for(let m=0;m<p.length;m++){const y=Gd(e,p[m]);if(y){const{transitionEnd:h,transition:b,...x}=y;for(const T in x){let w=x[T];if(Array.isArray(w)){const O=d?w.length-1:0;w=w[O]}w!==null&&(r[T]=w)}for(const T in h)r[T]=h[T]}}}return r}function Xd(e,t,n){var i;const{style:o}=e,r={};for(const a in o)(Xt(o[a])||t.style&&Xt(t.style[a])||Sy(a,e)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(r[a]=o[a]);return r}const eA={useVisualState:Dy({scrapeMotionValuesFromProps:Xd,createRenderState:Ud})};function Iy(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 Ay(e,{style:t,vars:n},o,r){Object.assign(e.style,t,r&&r.getProjectionStyles(o));for(const i in n)e.style.setProperty(i,n[i])}const jy=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 Ny(e,t,n,o){Ay(e,t,void 0,o);for(const r in t.attrs)e.setAttribute(jy.has(r)?r:Bd(r),t.attrs[r])}function $y(e,t,n){const o=Xd(e,t,n);for(const r in e)if(Xt(e[r])||Xt(t[r])){const i=ps.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;o[i]=e[r]}return o}const _y=["x","y","width","height","cx","cy","r"],tA={useVisualState:Dy({scrapeMotionValuesFromProps:$y,createRenderState:My,onUpdate:({props:e,prevProps:t,current:n,renderState:o,latestValues:r})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in r)if(lr.has(l)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let l=0;l<_y.length;l++){const c=_y[l];e[c]!==t[c]&&(a=!0)}a&&wt.read(()=>{Iy(n,o),wt.render(()=>{qd(o,r,Yd(n.tagName),e.transformTemplate),Ny(n,o)})})}})};function nA(e,t){return function(o,{forwardMotionProps:r}={forwardMotionProps:!1}){const a={...Hd(o)?tA:eA,preloadedFeatures:e,useRender:KI(r),createVisualElement:t,Component:o};return EI(a)}}function _i(e,t,n){const o=e.getProps();return Gd(o,t,n!==void 0?n:o.custom,e)}const Fy=new Set(["width","height","top","left","right","bottom",...ps]);function oA(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ii(n))}function rA(e,t){const n=_i(e,t);let{transitionEnd:o={},transition:r={},...i}=n||{};i={...i,...o};for(const a in i){const l=ZI(i[a]);oA(e,a,l)}}function sA(e){return!!(Xt(e)&&e.add)}function Zd(e,t){const n=e.getValue("willChange");if(sA(n))return n.add(t);if(!n&&Od.WillChange){const o=new Od.WillChange("auto");e.addValue("willChange",o),o.add(t)}}function By(e){return e.props[vy]}const Ly=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,iA=1e-7,aA=12;function lA(e,t,n,o,r){let i,a,l=0;do a=t+(n-t)/2,i=Ly(a,o,r)-e,i>0?n=a:t=a;while(Math.abs(i)>iA&&++l<aA);return a}function Fi(e,t,n,o){if(e===t&&n===o)return Fn;const r=i=>lA(i,0,1,e,n);return i=>i===0||i===1?i:Ly(r(i),t,o)}const Vy=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Wy=e=>t=>1-e(1-t),zy=Fi(.33,1.53,.69,.99),Jd=Wy(zy),Uy=Vy(Jd),Hy=e=>(e*=2)<1?.5*Jd(e):.5*(2-Math.pow(2,-10*(e-1))),Qd=e=>1-Math.sin(Math.acos(e)),qy=Wy(Qd),Yy=Vy(Qd),Gy=e=>/^0[^.\s]+$/u.test(e);function cA(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Gy(e):!0}const Bi=e=>Math.round(e*1e5)/1e5,ef=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function uA(e){return e==null}const dA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tf=(e,t)=>n=>!!(typeof n=="string"&&dA.test(n)&&n.startsWith(e)||t&&!uA(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ky=(e,t,n)=>o=>{if(typeof o!="string")return o;const[r,i,a,l]=o.match(ef);return{[e]:parseFloat(r),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},fA=e=>Oo(0,255,e),nf={...hs,transform:e=>Math.round(fA(e))},cr={test:tf("rgb","red"),parse:Ky("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:o=1})=>"rgba("+nf.transform(e)+", "+nf.transform(t)+", "+nf.transform(n)+", "+Bi(Ni.transform(o))+")"};function pA(e){let t="",n="",o="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),o=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),o=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,o+=o,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}}const of={test:tf("#"),parse:pA,transform:cr.transform},ms={test:tf("hsl","hue"),parse:Ky("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:o=1})=>"hsla("+Math.round(e)+", "+ao.transform(Bi(t))+", "+ao.transform(Bi(n))+", "+Bi(Ni.transform(o))+")"},Zt={test:e=>cr.test(e)||of.test(e)||ms.test(e),parse:e=>cr.test(e)?cr.parse(e):ms.test(e)?ms.parse(e):of.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?cr.transform(e):ms.transform(e)},hA=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function mA(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ef))==null?void 0:t.length)||0)+(((n=e.match(hA))==null?void 0:n.length)||0)>0}const Xy="number",Zy="color",gA="var",yA="var(",Jy="${}",bA=/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 Li(e){const t=e.toString(),n=[],o={color:[],number:[],var:[]},r=[];let i=0;const l=t.replace(bA,c=>(Zt.test(c)?(o.color.push(i),r.push(Zy),n.push(Zt.parse(c))):c.startsWith(yA)?(o.var.push(i),r.push(gA),n.push(c)):(o.number.push(i),r.push(Xy),n.push(parseFloat(c))),++i,Jy)).split(Jy);return{values:n,split:l,indexes:o,types:r}}function Qy(e){return Li(e).values}function eb(e){const{split:t,types:n}=Li(e),o=t.length;return r=>{let i="";for(let a=0;a<o;a++)if(i+=t[a],r[a]!==void 0){const l=n[a];l===Xy?i+=Bi(r[a]):l===Zy?i+=Zt.transform(r[a]):i+=r[a]}return i}}const vA=e=>typeof e=="number"?0:e;function xA(e){const t=Qy(e);return eb(e)(t.map(vA))}const zo={test:mA,parse:Qy,createTransformer:eb,getAnimatableNone:xA},wA=new Set(["brightness","contrast","saturate","opacity"]);function CA(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[o]=n.match(ef)||[];if(!o)return e;const r=n.replace(o,"");let i=wA.has(t)?1:0;return o!==n&&(i*=100),t+"("+i+r+")"}const SA=/\b([a-z-]*)\(.*?\)/gu,rf={...zo,getAnimatableNone:e=>{const t=e.match(SA);return t?t.map(CA).join(" "):e}},TA={...Wd,color:Zt,backgroundColor:Zt,outlineColor:Zt,fill:Zt,stroke:Zt,borderColor:Zt,borderTopColor:Zt,borderRightColor:Zt,borderBottomColor:Zt,borderLeftColor:Zt,filter:rf,WebkitFilter:rf},tb=e=>TA[e];function nb(e,t){let n=tb(e);return n!==rf&&(n=zo),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const OA=new Set(["auto","none","0"]);function EA(e,t,n){let o=0,r;for(;o<e.length&&!r;){const i=e[o];typeof i=="string"&&!OA.has(i)&&Li(i).values.length&&(r=e[o]),o++}if(r&&n)for(const i of t)e[i]=nb(n,r)}const ur=e=>e*180/Math.PI,sf=e=>{const t=ur(Math.atan2(e[1],e[0]));return af(t)},kA={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:sf,rotateZ:sf,skewX:e=>ur(Math.atan(e[1])),skewY:e=>ur(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},af=e=>(e=e%360,e<0&&(e+=360),e),ob=sf,rb=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),sb=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),PA={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:rb,scaleY:sb,scale:e=>(rb(e)+sb(e))/2,rotateX:e=>af(ur(Math.atan2(e[6],e[5]))),rotateY:e=>af(ur(Math.atan2(-e[2],e[0]))),rotateZ:ob,rotate:ob,skewX:e=>ur(Math.atan(e[4])),skewY:e=>ur(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ib(e){return e.includes("scale")?1:0}function lf(e,t){if(!e||e==="none")return ib(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let o,r;if(n)o=PA,r=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=kA,r=l}if(!r)return ib(t);const i=o[t],a=r[1].split(",").map(RA);return typeof i=="function"?i(a):a[i]}const MA=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return lf(n,t)};function RA(e){return parseFloat(e.trim())}const ab=e=>e===hs||e===Ne,DA=new Set(["x","y","z"]),IA=ps.filter(e=>!DA.has(e));function AA(e){const t=[];return IA.forEach(n=>{const o=e.getValue(n);o!==void 0&&(t.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),t}const gs={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})=>lf(t,"x"),y:(e,{transform:t})=>lf(t,"y")};gs.translateX=gs.x,gs.translateY=gs.y;const dr=new Set;let cf=!1,uf=!1;function lb(){if(uf){const e=Array.from(dr).filter(o=>o.needsMeasurement),t=new Set(e.map(o=>o.element)),n=new Map;t.forEach(o=>{const r=AA(o);r.length&&(n.set(o,r),o.render())}),e.forEach(o=>o.measureInitialState()),t.forEach(o=>{o.render();const r=n.get(o);r&&r.forEach(([i,a])=>{var l;(l=o.getValue(i))==null||l.set(a)})}),e.forEach(o=>o.measureEndState()),e.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}uf=!1,cf=!1,dr.forEach(e=>e.complete()),dr.clear()}function cb(){dr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(uf=!0)})}function jA(){cb(),lb()}class df{constructor(t,n,o,r,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=o,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(dr.add(this),cf||(cf=!0,wt.read(cb),wt.resolveKeyframes(lb))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:o,motionValue:r}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const a=r==null?void 0:r.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(o&&n){const c=o.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),r&&a===void 0&&r.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),dr.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,dr.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ub=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),NA=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $A(e){const t=NA.exec(e);if(!t)return[,];const[,n,o,r]=t;return[`--${n??o}`,r]}const _A=4;function db(e,t,n=1){Lo(n<=_A,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[o,r]=$A(e);if(!o)return;const i=window.getComputedStyle(t).getPropertyValue(o);if(i){const a=i.trim();return ub(a)?parseFloat(a):a}return Vd(r)?db(r,t,n+1):r}const fb=e=>t=>t.test(e),pb=[hs,Ne,ao,Wo,jI,AI,{test:e=>e==="auto",parse:e=>e}],hb=e=>pb.find(fb(e));class mb extends df{constructor(t,n,o,r,i){super(t,n,o,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:o}=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(),Vd(u))){const d=db(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Fy.has(o)||t.length!==2)return;const[r,i]=t,a=hb(r),l=hb(i);if(a!==l)if(ab(a)&&ab(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,o=[];for(let r=0;r<t.length;r++)cA(t[r])&&o.push(r);o.length&&EA(t,o,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:o}=this;if(!t||!t.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=gs[o](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(o,r).jump(r,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:o}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=o.length-1,a=o[i];o[i]=gs[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 gb=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(zo.test(e)||e==="0")&&!e.startsWith("url("));function FA(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 BA(e,t,n,o){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],a=gb(r,t),l=gb(i,t);return us(a===l,`You are trying to animate ${t} from "${r}" to "${i}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${i} via the \`style\` property.`),!a||!l?!1:FA(e)||(n==="spring"||Rd(n))&&o}const LA=e=>e!==null;function Xl(e,{repeat:t,repeatType:n="loop"},o){const r=e.filter(LA),i=t&&n!=="loop"&&t%2===1?0:r.length-1;return!i||o===void 0?r[i]:o}const VA=40;class yb{constructor({autoplay:t=!0,delay:n=0,type:o="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=io.now(),this.options={autoplay:t,delay:n,type:o,repeat:r,repeatDelay:i,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>VA?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&jA(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=io.now(),this.hasAttemptedResolve=!0;const{name:o,type:r,velocity:i,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!BA(t,o,r,i))if(a)this.options.duration=0;else{c&&c(Xl(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 kt=(e,t,n)=>e+(t-e)*n;function ff(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 WA({hue:e,saturation:t,lightness:n,alpha:o}){e/=360,t/=100,n/=100;let r=0,i=0,a=0;if(!t)r=i=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=ff(c,l,e+1/3),i=ff(c,l,e),a=ff(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:o}}function Zl(e,t){return n=>n>0?t:e}const pf=(e,t,n)=>{const o=e*e,r=n*(t*t-o)+o;return r<0?0:Math.sqrt(r)},zA=[of,cr,ms],UA=e=>zA.find(t=>t.test(e));function bb(e){const t=UA(e);if(us(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===ms&&(n=WA(n)),n}const vb=(e,t)=>{const n=bb(e),o=bb(t);if(!n||!o)return Zl(e,t);const r={...n};return i=>(r.red=pf(n.red,o.red,i),r.green=pf(n.green,o.green,i),r.blue=pf(n.blue,o.blue,i),r.alpha=kt(n.alpha,o.alpha,i),cr.transform(r))},HA=(e,t)=>n=>t(e(n)),Vi=(...e)=>e.reduce(HA),hf=new Set(["none","hidden"]);function qA(e,t){return hf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function YA(e,t){return n=>kt(e,t,n)}function mf(e){return typeof e=="number"?YA:typeof e=="string"?Vd(e)?Zl:Zt.test(e)?vb:XA:Array.isArray(e)?xb:typeof e=="object"?Zt.test(e)?vb:GA:Zl}function xb(e,t){const n=[...e],o=n.length,r=e.map((i,a)=>mf(i)(i,t[a]));return i=>{for(let a=0;a<o;a++)n[a]=r[a](i);return n}}function GA(e,t){const n={...e,...t},o={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(o[r]=mf(e[r])(e[r],t[r]));return r=>{for(const i in o)n[i]=o[i](r);return n}}function KA(e,t){const n=[],o={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const i=t.types[r],a=e.indexes[i][o[i]],l=e.values[a]??0;n[r]=l,o[i]++}return n}const XA=(e,t)=>{const n=zo.createTransformer(t),o=Li(e),r=Li(t);return o.indexes.var.length===r.indexes.var.length&&o.indexes.color.length===r.indexes.color.length&&o.indexes.number.length>=r.indexes.number.length?hf.has(e)&&!r.values.length||hf.has(t)&&!o.values.length?qA(e,t):Vi(xb(KA(o,r),r.values),n):(us(!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.`),Zl(e,t))};function wb(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?kt(e,t,n):mf(e)(e,t)}const ZA=5;function Cb(e,t,n){const o=Math.max(t-ZA,0);return Q0(n-e(o),t-o)}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},Sb=.001;function JA({duration:e=Pt.duration,bounce:t=Pt.bounce,velocity:n=Pt.velocity,mass:o=Pt.mass}){let r,i;us(e<=Hn(Pt.maxDuration),"Spring duration must be 10 seconds or less");let a=1-t;a=Oo(Pt.minDamping,Pt.maxDamping,a),e=Oo(Pt.minDuration,Pt.maxDuration,so(e)),a<1?(r=u=>{const d=u*a,f=d*e,p=d-n,m=gf(u,a),y=Math.exp(-f);return Sb-p/m*y},i=u=>{const f=u*a*e,p=f*n+n,m=Math.pow(a,2)*Math.pow(u,2)*e,y=Math.exp(-f),h=gf(Math.pow(u,2),a);return(-r(u)+Sb>0?-1:1)*((p-m)*y)/h}):(r=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=ej(r,i,l);if(e=Hn(e),isNaN(c))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:e};{const u=Math.pow(c,2)*o;return{stiffness:u,damping:a*2*Math.sqrt(o*u),duration:e}}}const QA=12;function ej(e,t,n){let o=n;for(let r=1;r<QA;r++)o=o-e(o)/t(o);return o}function gf(e,t){return e*Math.sqrt(1-t*t)}const tj=["duration","bounce"],nj=["stiffness","damping","mass"];function Tb(e,t){return t.some(n=>e[n]!==void 0)}function oj(e){let t={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...e};if(!Tb(e,nj)&&Tb(e,tj))if(e.visualDuration){const n=e.visualDuration,o=2*Math.PI/(n*1.2),r=o*o,i=2*Oo(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Pt.mass,stiffness:r,damping:i}}else{const n=JA(e);t={...t,...n,mass:Pt.mass},t.isResolvedFromDuration=!0}return t}function Jl(e=Pt.visualDuration,t=Pt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:o,restDelta:r}=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:m}=oj({...n,velocity:-so(n.velocity||0)}),y=p||0,h=u/(2*Math.sqrt(c*d)),b=a-i,x=so(Math.sqrt(c/d)),T=Math.abs(b)<5;o||(o=T?Pt.restSpeed.granular:Pt.restSpeed.default),r||(r=T?Pt.restDelta.granular:Pt.restDelta.default);let w;if(h<1){const v=gf(x,h);w=E=>{const k=Math.exp(-h*x*E);return a-k*((y+h*x*b)/v*Math.sin(v*E)+b*Math.cos(v*E))}}else if(h===1)w=v=>a-Math.exp(-x*v)*(b+(y+x*b)*v);else{const v=x*Math.sqrt(h*h-1);w=E=>{const k=Math.exp(-h*x*E),M=Math.min(v*E,300);return a-k*((y+h*x*b)*Math.sinh(M)+v*b*Math.cosh(M))/v}}const O={calculatedDuration:m&&f||null,next:v=>{const E=w(v);if(m)l.done=v>=f;else{let k=0;h<1&&(k=v===0?Hn(y):Cb(w,v,E));const M=Math.abs(k)<=o,I=Math.abs(a-E)<=r;l.done=M&&I}return l.value=l.done?a:E,l},toString:()=>{const v=Math.min(Id(O),Vl),E=ny(k=>O.next(v*k).value,v,30);return v+"ms "+E},toTransition:()=>{}};return O}Jl.applyToOptions=e=>{const t=nI(e,100,Jl);return e.ease=Mi()?t.ease:"easeOut",e.duration=Hn(t.duration),e.type="keyframes",e};function Ob({keyframes:e,velocity:t=0,power:n=.8,timeConstant:o=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],p={done:!1,value:f},m=M=>l!==void 0&&M<l||c!==void 0&&M>c,y=M=>l===void 0?c:c===void 0||Math.abs(l-M)<Math.abs(c-M)?l:c;let h=n*t;const b=f+h,x=a===void 0?b:a(b);x!==b&&(h=x-f);const T=M=>-h*Math.exp(-M/o),w=M=>x+T(M),O=M=>{const I=T(M),j=w(M);p.done=Math.abs(I)<=u,p.value=p.done?x:j};let v,E;const k=M=>{m(p.value)&&(v=M,E=Jl({keyframes:[p.value,y(p.value)],velocity:Cb(w,M,p.value),damping:r,stiffness:i,restDelta:u,restSpeed:d}))};return k(0),{calculatedDuration:null,next:M=>{let I=!1;return!E&&v===void 0&&(I=!0,O(M),k(M)),v!==void 0&&M>=v?E.next(M-v):(!I&&O(M),p)}}}const rj=Fi(.42,0,1,1),sj=Fi(0,0,.58,1),Eb=Fi(.42,0,.58,1),ij=e=>Array.isArray(e)&&typeof e[0]!="number",kb={linear:Fn,easeIn:rj,easeInOut:Eb,easeOut:sj,circIn:Qd,circInOut:Yy,circOut:qy,backIn:Jd,backInOut:Uy,backOut:zy,anticipate:Hy},Pb=e=>{if(Pd(e)){Lo(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,o,r]=e;return Fi(t,n,o,r)}else if(typeof e=="string")return Lo(kb[e]!==void 0,`Invalid easing type '${e}'`),kb[e];return e};function aj(e,t,n){const o=[],r=n||wb,i=e.length-1;for(let a=0;a<i;a++){let l=r(e[a],e[a+1]);if(t){const c=Array.isArray(t)?t[a]||Fn:t;l=Vi(c,l)}o.push(l)}return o}function lj(e,t,{clamp:n=!0,ease:o,mixer:r}={}){const i=e.length;if(Lo(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=aj(t,o,r),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=Pi(e[f],e[f+1],d);return l[f](p)};return n?d=>u(Oo(e[0],e[i-1],d)):u}function cj(e,t){const n=e[e.length-1];for(let o=1;o<=t;o++){const r=Pi(0,t,o);e.push(kt(n,1,r))}}function uj(e){const t=[0];return cj(t,e.length-1),t}function dj(e,t){return e.map(n=>n*t)}function fj(e,t){return e.map(()=>t||Eb).splice(0,e.length-1)}function Wi({duration:e=300,keyframes:t,times:n,ease:o="easeInOut"}){const r=ij(o)?o.map(Pb):Pb(o),i={done:!1,value:t[0]},a=dj(n&&n.length===t.length?n:uj(t),e),l=lj(a,t,{ease:Array.isArray(r)?r:fj(t,r)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const pj=e=>{const t=({timestamp:n})=>e(n);return{start:()=>wt.update(t,!0),stop:()=>Vo(t),now:()=>qt.isProcessing?qt.timestamp:io.now()}},hj={decay:Ob,inertia:Ob,tween:Wi,keyframes:Wi,spring:Jl},mj=e=>e/100;class yf extends yb{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:o,element:r,keyframes:i}=this.options,a=(r==null?void 0:r.KeyframeResolver)||df,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(i,l,n,o,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:o=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=this.options,l=Rd(n)?n:hj[n]||Wi;let c,u;process.env.NODE_ENV!=="production"&&l!==Wi&&Lo(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==Wi&&typeof t[0]!="number"&&(c=Vi(mj,wb(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=Id(d));const{calculatedDuration:f}=d,p=f+r,m=p*(o+1)-r;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:p,totalDuration:m}}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:o}=this;if(!o){const{keyframes:M}=this.options;return{done:!0,value:M[M.length-1]}}const{finalKeyframe:r,generator:i,mirroredGenerator:a,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=o;if(this.startTime===null)return i.next(0);const{delay:p,repeat:m,repeatType:y,repeatDelay:h,onUpdate:b}=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),T=this.speed>=0?x<0:x>d;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let w=this.currentTime,O=i;if(m){const M=Math.min(this.currentTime,d)/f;let I=Math.floor(M),j=M%1;!j&&M>=1&&(j=1),j===1&&I--,I=Math.min(I,m+1),!!(I%2)&&(y==="reverse"?(j=1-j,h&&(j-=h/f)):y==="mirror"&&(O=a)),w=Oo(0,1,j)*f}const v=T?{done:!1,value:c[0]}:O.next(w);l&&(v.value=l(v.value));let{done:E}=v;!T&&u!==null&&(E=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return k&&r!==void 0&&(v.value=Xl(c,this.options,r)),b&&b(v.value),k&&this.finish(),v}get duration(){const{resolved:t}=this;return t?so(t.calculatedDuration):0}get time(){return so(this.currentTime)}set time(t){t=Hn(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=so(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=pj,onPlay:n,startTime:o}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=o??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 gj=new Set(["opacity","clipPath","filter","transform"]),yj=Ed(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ql=10,bj=2e4;function vj(e){return Rd(e.type)||e.type==="spring"||!ry(e.ease)}function xj(e,t){const n=new yf({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:e[0]};const r=[];let i=0;for(;!o.done&&i<bj;)o=n.sample(i),r.push(o.value),i+=Ql;return{times:void 0,keyframes:r,duration:i-Ql,ease:"linear"}}const Mb={anticipate:Hy,backInOut:Uy,circInOut:Yy};function wj(e){return e in Mb}class Rb extends yb{constructor(t){super(t);const{name:n,motionValue:o,element:r,keyframes:i}=this.options;this.resolver=new mb(i,(a,l)=>this.onKeyframesResolved(a,l),n,o,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:o=300,times:r,ease:i,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Mi()&&wj(i)&&(i=Mb[i]),vj(this.options)){const{onComplete:f,onUpdate:p,motionValue:m,element:y,...h}=this.options,b=xj(t,h);t=b.keyframes,t.length===1&&(t[1]=t[0]),o=b.duration,r=b.times,i=b.ease,a="keyframes"}const d=tI(l.owner.current,c,t,{...this.options,duration:o,times:r,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(sy(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Xl(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:o,times:r,type:a,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return so(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return so(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:o}=n;o.currentTime=Hn(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:o}=n;o.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 Fn;const{animation:o}=n;sy(o,t)}return Fn}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:o,duration:r,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,...m}=this.options,y=new yf({...m,keyframes:o,duration:r,type:i,ease:a,times:l,isGenerator:!0}),h=Hn(this.time);u.setWithVelocity(y.sample(h-Ql).value,y.sample(h).value,Ql)}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:o,repeatDelay:r,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 yj()&&o&&gj.has(o)&&(o!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&a!==0&&l!=="inertia"}}const Cj={type:"spring",stiffness:500,damping:25,restSpeed:10},Sj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Tj={type:"keyframes",duration:.8},Oj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ej=(e,{keyframes:t})=>t.length>2?Tj:lr.has(e)?e.startsWith("scale")?Sj(t[1]):Cj:Oj;function kj({when:e,delay:t,delayChildren:n,staggerChildren:o,staggerDirection:r,repeat:i,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const bf=(e,t,n,o={},r,i)=>a=>{const l=Dd(o,e)||{},c=l.delay||o.delay||0;let{elapsed:u=0}=o;u=u-Hn(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:r};kj(l)||(d={...d,...Ej(e,d)}),d.duration&&(d.duration=Hn(d.duration)),d.repeatDelay&&(d.repeatDelay=Hn(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=Xl(d.keyframes,l);if(p!==void 0)return wt.update(()=>{d.onUpdate(p),d.onComplete()}),new J3([])}return!i&&Rb.supports(d)?new Rb(d):new yf(d)};function Pj({protectedKeys:e,needsAnimating:t},n){const o=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,o}function Db(e,t,{delay:n=0,transitionOverride:o,type:r}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:a,...l}=t;o&&(i=o);const c=[],u=r&&e.animationState&&e.animationState.getState()[r];for(const d in l){const f=e.getValue(d,e.latestValues[d]??null),p=l[d];if(p===void 0||u&&Pj(u,d))continue;const m={delay:n,...Dd(i||{},d)};let y=!1;if(window.MotionHandoffAnimation){const b=By(e);if(b){const x=window.MotionHandoffAnimation(b,d,wt);x!==null&&(m.startTime=x,y=!0)}}Zd(e,d),f.start(bf(d,f,p,e.shouldReduceMotion&&Fy.has(d)?{type:!1}:m,e,y));const h=f.animation;h&&c.push(h)}return a&&Promise.all(c).then(()=>{wt.update(()=>{a&&rA(e,a)})}),c}function vf(e,t,n={}){var c;const o=_i(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(r=n.transitionOverride);const i=o?()=>Promise.all(Db(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:p}=r;return Mj(e,t,d+u,f,p,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[u,d]=l==="beforeChildren"?[i,a]:[a,i];return u().then(()=>d())}else return Promise.all([i(),a(n.delay)])}function Mj(e,t,n=0,o=0,r=1,i){const a=[],l=(e.variantChildren.size-1)*o,c=r===1?(u=0)=>u*o:(u=0)=>l-u*o;return Array.from(e.variantChildren).sort(Rj).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(vf(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function Rj(e,t){return e.sortNodePosition(t)}function Dj(e,t,n={}){e.notify("AnimationStart",t);let o;if(Array.isArray(t)){const r=t.map(i=>vf(e,i,n));o=Promise.all(r)}else if(typeof t=="string")o=vf(e,t,n);else{const r=typeof t=="function"?_i(e,t,n.custom):t;o=Promise.all(Db(e,r,n))}return o.then(()=>{e.notify("AnimationComplete",t)})}function Ib(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let o=0;o<n;o++)if(t[o]!==e[o])return!1;return!0}const Ij=Fd.length;function Ab(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ab(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Ij;n++){const o=Fd[n],r=e.props[o];(Ai(r)||r===!1)&&(t[o]=r)}return t}const Aj=[..._d].reverse(),jj=_d.length;function Nj(e){return t=>Promise.all(t.map(({animation:n,options:o})=>Dj(e,n,o)))}function $j(e){let t=Nj(e),n=jb(),o=!0;const r=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:m,transitionEnd:y,...h}=f;u={...u,...h,...y}}return u};function i(c){t=c(e)}function a(c){const{props:u}=e,d=Ab(e.parent)||{},f=[],p=new Set;let m={},y=1/0;for(let b=0;b<jj;b++){const x=Aj[b],T=n[x],w=u[x]!==void 0?u[x]:d[x],O=Ai(w),v=x===c?T.isActive:null;v===!1&&(y=b);let E=w===d[x]&&w!==u[x]&&O;if(E&&o&&e.manuallyAnimateOnMount&&(E=!1),T.protectedKeys={...m},!T.isActive&&v===null||!w&&!T.prevProp||ql(w)||typeof w=="boolean")continue;const k=_j(T.prevProp,w);let M=k||x===c&&T.isActive&&!E&&O||b>y&&O,I=!1;const j=Array.isArray(w)?w:[w];let F=j.reduce(r(x),{});v===!1&&(F={});const{prevResolvedValues:A={}}=T,V={...A,...F},$=L=>{M=!0,p.has(L)&&(I=!0,p.delete(L)),T.needsAnimating[L]=!0;const W=e.getValue(L);W&&(W.liveStyle=!1)};for(const L in V){const W=F[L],D=A[L];if(m.hasOwnProperty(L))continue;let N=!1;Kd(W)&&Kd(D)?N=!Ib(W,D):N=W!==D,N?W!=null?$(L):p.add(L):W!==void 0&&p.has(L)?$(L):T.protectedKeys[L]=!0}T.prevProp=w,T.prevResolvedValues=F,T.isActive&&(m={...m,...F}),o&&e.blockInitialAnimation&&(M=!1),M&&(!(E&&k)||I)&&f.push(...j.map(L=>({animation:L,options:{type:x}})))}if(p.size){const b={};if(typeof u.initial!="boolean"){const x=_i(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(b.transition=x.transition)}p.forEach(x=>{const T=e.getBaseTarget(x),w=e.getValue(x);w&&(w.liveStyle=!0),b[x]=T??null}),f.push({animation:b})}let h=!!f.length;return o&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(h=!1),o=!1,h?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 m;return(m=p.animationState)==null?void 0:m.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=jb(),o=!0}}}function _j(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ib(t,e):!1}function fr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function jb(){return{animate:fr(!0),whileInView:fr(),whileHover:fr(),whileTap:fr(),whileDrag:fr(),whileFocus:fr(),exit:fr()}}class Uo{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Fj extends Uo{constructor(t){super(t),t.animationState||(t.animationState=$j(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ql(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 Bj=0;class Lj extends Uo{constructor(){super(...arguments),this.id=Bj++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.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 Vj={animation:{Feature:Fj},exit:{Feature:Lj}};function zi(e,t,n,o={passive:!0}){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n)}function Ui(e){return{point:{x:e.pageX,y:e.pageY}}}const Wj=e=>t=>Nd(t)&&e(t,Ui(t));function Hi(e,t,n,o){return zi(e,t,Wj(n),o)}function Nb({top:e,left:t,right:n,bottom:o}){return{x:{min:t,max:n},y:{min:e,max:o}}}function zj({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Uj(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),o=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}const $b=1e-4,Hj=1-$b,qj=1+$b,_b=.01,Yj=0-_b,Gj=0+_b;function rn(e){return e.max-e.min}function Kj(e,t,n){return Math.abs(e-t)<=n}function Fb(e,t,n,o=.5){e.origin=o,e.originPoint=kt(t.min,t.max,e.origin),e.scale=rn(n)/rn(t),e.translate=kt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Hj&&e.scale<=qj||isNaN(e.scale))&&(e.scale=1),(e.translate>=Yj&&e.translate<=Gj||isNaN(e.translate))&&(e.translate=0)}function qi(e,t,n,o){Fb(e.x,t.x,n.x,o?o.originX:void 0),Fb(e.y,t.y,n.y,o?o.originY:void 0)}function Bb(e,t,n){e.min=n.min+t.min,e.max=e.min+rn(t)}function Xj(e,t,n){Bb(e.x,t.x,n.x),Bb(e.y,t.y,n.y)}function Lb(e,t,n){e.min=t.min-n.min,e.max=e.min+rn(t)}function Yi(e,t,n){Lb(e.x,t.x,n.x),Lb(e.y,t.y,n.y)}const Vb=()=>({translate:0,scale:1,origin:0,originPoint:0}),ys=()=>({x:Vb(),y:Vb()}),Wb=()=>({min:0,max:0}),_t=()=>({x:Wb(),y:Wb()});function Bn(e){return[e("x"),e("y")]}function xf(e){return e===void 0||e===1}function wf({scale:e,scaleX:t,scaleY:n}){return!xf(e)||!xf(t)||!xf(n)}function pr(e){return wf(e)||zb(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function zb(e){return Ub(e.x)||Ub(e.y)}function Ub(e){return e&&e!=="0%"}function ec(e,t,n){const o=e-n,r=t*o;return n+r}function Hb(e,t,n,o,r){return r!==void 0&&(e=ec(e,r,o)),ec(e,n,o)+t}function Cf(e,t=0,n=1,o,r){e.min=Hb(e.min,t,n,o,r),e.max=Hb(e.max,t,n,o,r)}function qb(e,{x:t,y:n}){Cf(e.x,t.translate,t.scale,t.originPoint),Cf(e.y,n.translate,n.scale,n.originPoint)}const Yb=.999999999999,Gb=1.0000000000001;function Zj(e,t,n,o=!1){const r=n.length;if(!r)return;t.x=t.y=1;let i,a;for(let l=0;l<r;l++){i=n[l],a=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(o&&i.options.layoutScroll&&i.scroll&&i!==i.root&&vs(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,qb(e,a)),o&&pr(i.latestValues)&&vs(e,i.latestValues))}t.x<Gb&&t.x>Yb&&(t.x=1),t.y<Gb&&t.y>Yb&&(t.y=1)}function bs(e,t){e.min=e.min+t,e.max=e.max+t}function Kb(e,t,n,o,r=.5){const i=kt(e.min,e.max,r);Cf(e,t,n,i,o)}function vs(e,t){Kb(e.x,t.x,t.scaleX,t.scale,t.originX),Kb(e.y,t.y,t.scaleY,t.scale,t.originY)}function Xb(e,t){return Nb(Uj(e.getBoundingClientRect(),t))}function Jj(e,t,n){const o=Xb(e,n),{scroll:r}=t;return r&&(bs(o.x,r.offset.x),bs(o.y,r.offset.y)),o}const Zb=({current:e})=>e?e.ownerDocument.defaultView:null,Jb=(e,t)=>Math.abs(e-t);function Qj(e,t){const n=Jb(e.x,t.x),o=Jb(e.y,t.y);return Math.sqrt(n**2+o**2)}class Qb{constructor(t,n,{transformPagePoint:o,contextWindow:r,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=Tf(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=Qj(f.offset,{x:0,y:0})>=3;if(!p&&!m)return;const{point:y}=f,{timestamp:h}=qt;this.history.push({...y,timestamp:h});const{onStart:b,onMove:x}=this.handlers;p||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Sf(p,this.transformPagePoint),wt.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:h}=this.handlers;if(this.dragSnapToOrigin&&h&&h(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Tf(f.type==="pointercancel"?this.lastMoveEventInfo:Sf(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,b),y&&y(f,b)},!Nd(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=o,this.contextWindow=r||window;const a=Ui(t),l=Sf(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=qt;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Tf(l,this.history)),this.removeListeners=Vi(Hi(this.contextWindow,"pointermove",this.handlePointerMove),Hi(this.contextWindow,"pointerup",this.handlePointerUp),Hi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Vo(this.updatePoint)}}function Sf(e,t){return t?{point:t(e.point)}:e}function ev(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Tf({point:e},t){return{point:e,delta:ev(e,tv(t)),offset:ev(e,eN(t)),velocity:tN(t,.1)}}function eN(e){return e[0]}function tv(e){return e[e.length-1]}function tN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,o=null;const r=tv(e);for(;n>=0&&(o=e[n],!(r.timestamp-o.timestamp>Hn(t)));)n--;if(!o)return{x:0,y:0};const i=so(r.timestamp-o.timestamp);if(i===0)return{x:0,y:0};const a={x:(r.x-o.x)/i,y:(r.y-o.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function nN(e,{min:t,max:n},o){return t!==void 0&&e<t?e=o?kt(t,e,o.min):Math.max(e,t):n!==void 0&&e>n&&(e=o?kt(n,e,o.max):Math.min(e,n)),e}function nv(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 oN(e,{top:t,left:n,bottom:o,right:r}){return{x:nv(e.x,n,r),y:nv(e.y,t,o)}}function ov(e,t){let n=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,o]=[o,n]),{min:n,max:o}}function rN(e,t){return{x:ov(e.x,t.x),y:ov(e.y,t.y)}}function sN(e,t){let n=.5;const o=rn(e),r=rn(t);return r>o?n=Pi(t.min,t.max-o,e.min):o>r&&(n=Pi(e.min,e.max-r,t.min)),Oo(0,1,n)}function iN(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 Of=.35;function aN(e=Of){return e===!1?e=0:e===!0&&(e=Of),{x:rv(e,"left","right"),y:rv(e,"top","bottom")}}function rv(e,t,n){return{min:sv(e,t),max:sv(e,n)}}function sv(e,t){return typeof e=="number"?e:e[t]||0}const lN=new WeakMap;class cN{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=_t(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ui(d).point)},i=(d,f)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=iI(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),Bn(b=>{let x=this.getAxisMotionValue(b).get()||0;if(ao.test(x)){const{projection:T}=this.visualElement;if(T&&T.layout){const w=T.layout.layoutBox[b];w&&(x=rn(w)*(parseFloat(x)/100))}}this.originPoint[b]=x}),y&&wt.postRender(()=>y(d,f)),Zd(this.visualElement,"transform");const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:h}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:b}=f;if(m&&this.currentDirection===null){this.currentDirection=uN(b),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),h&&h(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Bn(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 Qb(t,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Zb(this.visualElement)})}stop(t,n){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:r}=n;this.startAnimation(r);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:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,o){const{drag:r}=this.getProps();if(!o||!tc(t,r,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+o[t];this.constraints&&this.constraints[t]&&(a=nN(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,r=this.constraints;t&&fs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&o?this.constraints=oN(o.layoutBox,t):this.constraints=!1,this.elastic=aN(n),r!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&Bn(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=iN(o.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!fs(t))return!1;const o=t.current;Lo(o!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=Jj(o,r.root,this.visualElement.getTransformPagePoint());let a=rN(r.layout.layoutBox,i);if(n){const l=n(zj(a));this.hasMutatedConstraints=!!l,l&&(a=Nb(l))}return a}startAnimation(t){const{drag:n,dragMomentum:o,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Bn(d=>{if(!tc(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const p=r?200:1e6,m=r?40:1e7,y={type:"inertia",velocity:o?t[d]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const o=this.getAxisMotionValue(t);return Zd(this.visualElement,t),o.start(bf(t,o,0,n,this.visualElement,!1))}stopAnimation(){Bn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Bn(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()}`,o=this.visualElement.getProps(),r=o[n];return r||this.visualElement.getValue(t,(o.initial?o.initial[t]:void 0)||0)}snapToCursor(t){Bn(n=>{const{drag:o}=this.getProps();if(!tc(n,o,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(n);if(r&&r.layout){const{min:a,max:l}=r.layout.layoutBox[n];i.set(t[n]-kt(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!fs(n)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Bn(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();r[a]=sN({min:c,max:c},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),Bn(a=>{if(!tc(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(kt(c,u,r[a]))})}addListeners(){if(!this.visualElement.current)return;lN.set(this.visualElement,this);const t=this.visualElement.current,n=Hi(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),o=()=>{const{dragConstraints:c}=this.getProps();fs(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),wt.read(o);const a=zi(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Bn(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:o=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Of,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:o,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function tc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function uN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class dN extends Uo{constructor(t){super(t),this.removeGroupControls=Fn,this.removeListeners=Fn,this.controls=new cN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Fn}unmount(){this.removeGroupControls(),this.removeListeners()}}const iv=e=>(t,n)=>{e&&wt.postRender(()=>e(t,n))};class fN extends Uo{constructor(){super(...arguments),this.removePointerDownListener=Fn}onPointerDown(t){this.session=new Qb(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Zb(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:iv(t),onStart:iv(n),onMove:o,onEnd:(i,a)=>{delete this.session,r&&wt.postRender(()=>r(i,a))}}}mount(){this.removePointerDownListener=Hi(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 nc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function av(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Gi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ne.test(e))e=parseFloat(e);else return e;const n=av(e,t.target.x),o=av(e,t.target.y);return`${n}% ${o}%`}},pN={correct:(e,{treeScale:t,projectionDelta:n})=>{const o=e,r=zo.parse(e);if(r.length>5)return o;const i=zo.createTransformer(e),a=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+a]/=l,r[1+a]/=c;const u=kt(l,c,.5);return typeof r[2+a]=="number"&&(r[2+a]/=u),typeof r[3+a]=="number"&&(r[3+a]/=u),i(r)}};class hN extends R.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:o,layoutId:r}=this.props,{projection:i}=t;II(mN),i&&(n.group&&n.group.add(i),o&&o.register&&r&&o.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),nc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:o,drag:r,isPresent:i}=this.props,a=o.projection;return a&&(a.isPresent=i,r||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(),Ad.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:o}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function lv(e){const[t,n]=Z0(),o=R.useContext(vd);return g.jsx(hN,{...e,layoutGroup:o,switchLayoutGroup:R.useContext(xy),isPresent:t,safeToRemove:n})}const mN={borderRadius:{...Gi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Gi,borderTopRightRadius:Gi,borderBottomLeftRadius:Gi,borderBottomRightRadius:Gi,boxShadow:pN};function gN(e,t,n){const o=Xt(e)?e:Ii(e);return o.start(bf("",o,t,n)),o.animation}function yN(e){return e instanceof SVGElement&&e.tagName!=="svg"}const bN=(e,t)=>e.depth-t.depth;class vN{constructor(){this.children=[],this.isDirty=!1}add(t){Sd(this.children,t),this.isDirty=!0}remove(t){Td(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(bN),this.isDirty=!1,this.children.forEach(t)}}function xN(e,t){const n=io.now(),o=({timestamp:r})=>{const i=r-n;i>=t&&(Vo(o),e(i-t))};return wt.read(o,!0),()=>Vo(o)}const cv=["TopLeft","TopRight","BottomLeft","BottomRight"],wN=cv.length,uv=e=>typeof e=="string"?parseFloat(e):e,dv=e=>typeof e=="number"||Ne.test(e);function CN(e,t,n,o,r,i){r?(e.opacity=kt(0,n.opacity??1,SN(o)),e.opacityExit=kt(t.opacity??1,0,TN(o))):i&&(e.opacity=kt(t.opacity??1,n.opacity??1,o));for(let a=0;a<wN;a++){const l=`border${cv[a]}Radius`;let c=fv(t,l),u=fv(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||dv(c)===dv(u)?(e[l]=Math.max(kt(uv(c),uv(u),o),0),(ao.test(u)||ao.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=kt(t.rotate||0,n.rotate||0,o))}function fv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const SN=pv(0,.5,qy),TN=pv(.5,.95,Fn);function pv(e,t,n){return o=>o<e?0:o>t?1:n(Pi(e,t,o))}function hv(e,t){e.min=t.min,e.max=t.max}function Ln(e,t){hv(e.x,t.x),hv(e.y,t.y)}function mv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function gv(e,t,n,o,r){return e-=t,e=ec(e,1/n,o),r!==void 0&&(e=ec(e,1/r,o)),e}function ON(e,t=0,n=1,o=.5,r,i=e,a=e){if(ao.test(t)&&(t=parseFloat(t),t=kt(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=kt(i.min,i.max,o);e===i&&(l-=t),e.min=gv(e.min,t,n,l,r),e.max=gv(e.max,t,n,l,r)}function yv(e,t,[n,o,r],i,a){ON(e,t[n],t[o],t[r],t.scale,i,a)}const EN=["x","scaleX","originX"],kN=["y","scaleY","originY"];function bv(e,t,n,o){yv(e.x,t,EN,n?n.x:void 0,o?o.x:void 0),yv(e.y,t,kN,n?n.y:void 0,o?o.y:void 0)}function vv(e){return e.translate===0&&e.scale===1}function xv(e){return vv(e.x)&&vv(e.y)}function wv(e,t){return e.min===t.min&&e.max===t.max}function PN(e,t){return wv(e.x,t.x)&&wv(e.y,t.y)}function Cv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Sv(e,t){return Cv(e.x,t.x)&&Cv(e.y,t.y)}function Tv(e){return rn(e.x)/rn(e.y)}function Ov(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class MN{constructor(){this.members=[]}add(t){Sd(this.members,t),t.scheduleRender()}remove(t){if(Td(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(r=>t===r);if(n===0)return!1;let o;for(let r=n;r>=0;r--){const i=this.members[r];if(i.isPresent!==!1){o=i;break}}return o?(this.promote(o),!0):!1}promote(t,n){const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,n&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:o}=t;n.onExitComplete&&n.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function RN(e,t,n){let o="";const r=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((r||i||a)&&(o=`translate3d(${r}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(o+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:p,skewX:m,skewY:y}=n;u&&(o=`perspective(${u}px) ${o}`),d&&(o+=`rotate(${d}deg) `),f&&(o+=`rotateX(${f}deg) `),p&&(o+=`rotateY(${p}deg) `),m&&(o+=`skewX(${m}deg) `),y&&(o+=`skewY(${y}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(o+=`scale(${l}, ${c})`),o||"none"}const Ef=["","X","Y","Z"],DN={visibility:"hidden"},Ev=1e3;let IN=0;function kf(e,t,n,o){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),o&&(o[e]=0))}function kv(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=By(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",wt,!(r||i))}const{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&kv(o)}function Pv({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(a={},l=t==null?void 0:t()){this.id=IN++,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(NN),this.nodes.forEach(LN),this.nodes.forEach(VN),this.nodes.forEach($N)},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 vN)}addEventListener(a,l){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new kd),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=yN(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=xN(p,250),nc.hasAnimatedSinceResize&&(nc.hasAnimatedSinceResize=!1,this.nodes.forEach(Rv))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const h=this.options.transition||d.getDefaultTransition()||qN,{onLayoutAnimationStart:b,onLayoutAnimationComplete:x}=d.getProps(),T=!this.targetLayout||!Sv(this.targetLayout,y),w=!p&&m;if(this.options.layoutRoot||this.resumeFrom||w||p&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const O={...Dd(h,"layout"),onPlay:b,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else p||Rv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}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,Vo(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(WN),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&&kv(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(Mv);return}this.isUpdating||this.nodes.forEach(FN),this.isUpdating=!1,this.nodes.forEach(BN),this.nodes.forEach(AN),this.nodes.forEach(jN),this.clearAllSnapshots();const l=io.now();qt.delta=Oo(0,1e3/60,l-qt.timestamp),qt.timestamp=l,qt.isProcessing=!0,jd.update.process(qt),jd.preRender.process(qt),jd.render.process(qt),qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ad.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(_N),this.sharedNodes.forEach(zN)}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&&!rn(this.snapshot.measuredBox.x)&&!rn(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=_t(),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=o(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(!r)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!xv(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;a&&(l||pr(this.latestValues)||d)&&(r(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)),YN(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return _t();const l=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(GN))){const{scroll:d}=this.root;d&&(bs(l.x,d.offset.x),bs(l.y,d.offset.y))}return l}removeElementScroll(a){var c;const l=_t();if(Ln(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&&Ln(l,a),bs(l.x,f.offset.x),bs(l.y,f.offset.y))}return l}applyTransform(a,l=!1){const c=_t();Ln(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&&vs(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),pr(d.latestValues)&&vs(c,d.latestValues)}return pr(this.latestValues)&&vs(c,this.latestValues),c}removeTransform(a){const l=_t();Ln(l,a);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!pr(u.latestValues))continue;wf(u.latestValues)&&u.updateSnapshot();const d=_t(),f=u.measurePageBox();Ln(d,f),bv(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return pr(this.latestValues)&&bv(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 m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_t(),this.relativeTargetOrigin=_t(),Yi(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Ln(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=_t(),this.targetWithTransforms=_t()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Xj(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ln(this.target,this.layout.layoutBox),qb(this.target,this.targetDelta)):Ln(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_t(),this.relativeTargetOrigin=_t(),Yi(this.relativeTargetOrigin,this.target,m.target),Ln(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||wf(this.parent.latestValues)||zb(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 y;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.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;Ln(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;Zj(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=_t());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(mv(this.prevProjectionDelta.x,this.projectionDelta.x),mv(this.prevProjectionDelta.y,this.projectionDelta.y)),qi(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!Ov(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ov(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}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=ys(),this.projectionDelta=ys(),this.projectionDeltaWithTransform=ys()}setAnimationOrigin(a,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=ys();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const p=_t(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,h=m!==y,b=this.getStack(),x=!b||b.members.length<=1,T=!!(h&&!x&&this.options.crossfade===!0&&!this.path.some(HN));this.animationProgress=0;let w;this.mixTargetDelta=O=>{const v=O/1e3;Dv(f.x,a.x,v),Dv(f.y,a.y,v),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yi(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),UN(this.relativeTarget,this.relativeTargetOrigin,p,v),w&&PN(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=_t()),Ln(w,this.relativeTarget)),h&&(this.animationValues=d,CN(d,u,this.latestValues,v,T,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=v},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&&(Vo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wt.update(()=>{nc.hasAnimatedSinceResize=!0,this.currentAnimation=gN(0,Ev,{...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(Ev),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&&$v(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||_t();const f=rn(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const p=rn(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+p}Ln(l,c),vs(l,d),qi(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new MN),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&&kf("z",a,u,this.animationValues);for(let d=0;d<Ef.length;d++)kf(`rotate${Ef[d]}`,a,u,this.animationValues),kf(`skew${Ef[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 DN;const l={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=Kl(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 m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=Kl(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!pr(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const d=u.animationValues||u.latestValues;this.applyTransformsToTarget(),l.transform=RN(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 m in ji){if(d[m]===void 0)continue;const{correct:y,applyTo:h,isCSSVariable:b}=ji[m],x=l.transform==="none"?d[m]:y(d[m],u);if(h){const T=h.length;for(let w=0;w<T;w++)l[h[w]]=x}else b?this.options.visualElement.renderState.vars[m]=x:l[m]=x}return this.options.layoutId&&(l.pointerEvents=u===this?Kl(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(Mv),this.root.sharedNodes.clear()}}}function AN(e){e.updateLayout()}function jN(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:o,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i==="size"?Bn(f=>{const p=a?t.measuredBox[f]:t.layoutBox[f],m=rn(p);p.min=o[f].min,p.max=p.min+m}):$v(i,t.layoutBox,o)&&Bn(f=>{const p=a?t.measuredBox[f]:t.layoutBox[f],m=rn(o[f]);p.max=p.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=ys();qi(l,o,t.layoutBox);const c=ys();a?qi(c,e.applyTransform(r,!0),t.measuredBox):qi(c,o,t.layoutBox);const u=!xv(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:m}=f;if(p&&m){const y=_t();Yi(y,t.layoutBox,p.layoutBox);const h=_t();Yi(h,o,m.layoutBox),Sv(y,h)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=h,e.relativeTargetOrigin=y,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:o}=e.options;o&&o()}e.options.transition=void 0}function NN(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 $N(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function _N(e){e.clearSnapshot()}function Mv(e){e.clearMeasurements()}function FN(e){e.isLayoutDirty=!1}function BN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Rv(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function LN(e){e.resolveTargetDelta()}function VN(e){e.calcProjection()}function WN(e){e.resetSkewAndRotation()}function zN(e){e.removeLeadSnapshot()}function Dv(e,t,n){e.translate=kt(t.translate,0,n),e.scale=kt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Iv(e,t,n,o){e.min=kt(t.min,n.min,o),e.max=kt(t.max,n.max,o)}function UN(e,t,n,o){Iv(e.x,t.x,n.x,o),Iv(e.y,t.y,n.y,o)}function HN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const qN={duration:.45,ease:[.4,0,.1,1]},Av=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),jv=Av("applewebkit/")&&!Av("chrome/")?Math.round:Fn;function Nv(e){e.min=jv(e.min),e.max=jv(e.max)}function YN(e){Nv(e.x),Nv(e.y)}function $v(e,t,n){return e==="position"||e==="preserve-aspect"&&!Kj(Tv(t),Tv(n),.2)}function GN(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const KN=Pv({attachResizeListener:(e,t)=>zi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Pf={current:void 0},_v=Pv({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Pf.current){const e=new KN({});e.mount(window),e.setOptions({layoutScroll:!0}),Pf.current=e}return Pf.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),XN={pan:{Feature:fN},drag:{Feature:dN,ProjectionNode:_v,MeasureLayout:lv}};function Fv(e,t,n){const{props:o}=e;e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=o[r];i&&wt.postRender(()=>i(t,Ui(t)))}class ZN extends Uo{mount(){const{current:t}=this.node;t&&(this.unmount=lI(t,(n,o)=>(Fv(this.node,o,"Start"),r=>Fv(this.node,r,"End"))))}unmount(){}}class JN extends Uo{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=Vi(zi(this.node.current,"focus",()=>this.onFocus()),zi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Bv(e,t,n){const{props:o}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&o.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=o[r];i&&wt.postRender(()=>i(t,Ui(t)))}class QN extends Uo{mount(){const{current:t}=this.node;t&&(this.unmount=fI(t,(n,o)=>(Bv(this.node,o,"Start"),(r,{success:i})=>Bv(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Mf=new WeakMap,Rf=new WeakMap,e6=e=>{const t=Mf.get(e.target);t&&t(e)},t6=e=>{e.forEach(e6)};function n6({root:e,...t}){const n=e||document;Rf.has(n)||Rf.set(n,{});const o=Rf.get(n),r=JSON.stringify(t);return o[r]||(o[r]=new IntersectionObserver(t6,{root:e,...t})),o[r]}function o6(e,t,n){const o=n6(t);return Mf.set(e,n),o.observe(e),()=>{Mf.delete(e),o.unobserve(e)}}const r6={some:0,all:1};class s6 extends Uo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:o,amount:r="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:o,threshold:typeof r=="number"?r:r6[r]},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 o6(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(i6(t,n))&&this.startObserver()}unmount(){}}function i6({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const a6={inView:{Feature:s6},tap:{Feature:QN},focus:{Feature:JN},hover:{Feature:ZN}},l6={layout:{ProjectionNode:_v,MeasureLayout:lv}},Df={current:null},Lv={current:!1};function c6(){if(Lv.current=!0,!!wd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Df.current=e.matches;e.addListener(t),t()}else Df.current=!1}const u6=[...pb,Zt,zo],d6=e=>u6.find(fb(e)),f6=new WeakMap;function p6(e,t,n){for(const o in t){const r=t[o],i=n[o];if(Xt(r))e.addValue(o,r),process.env.NODE_ENV==="development"&&Ll(r.version==="12.7.3",`Attempting to mix Motion versions ${r.version} with 12.7.3 may not work as expected.`);else if(Xt(i))e.addValue(o,Ii(r,{owner:e}));else if(i!==r)if(e.hasValue(o)){const a=e.getValue(o);a.liveStyle===!0?a.jump(r):a.hasAnimated||a.set(r)}else{const a=e.getStaticValue(o);e.addValue(o,Ii(a!==void 0?a:r,{owner:e}))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const Vv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class h6{scrapeMotionValuesFromProps(t,n,o){return{}}constructor({parent:t,props:n,presenceContext:o,reducedMotionConfig:r,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=df,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 m=io.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,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=o,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=Yl(n),this.isVariantNode=yy(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in p){const y=p[m];c[m]!==void 0&&Xt(y)&&y.set(c[m],!1)}}mount(t){this.current=t,f6.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,o)=>this.bindToMotionValue(o,n)),Lv.current||c6(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Df.current,process.env.NODE_ENV!=="production"&&Ll(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(),Vo(this.notifyUpdate),Vo(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 o=lr.has(t);o&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&wt.preRender(this.notifyUpdate),o&&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,()=>{r(),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 ds){const n=ds[t];if(!n)continue;const{isEnabled:o,Feature:r}=n;if(!this.features[t]&&r&&o(this.props)&&(this.features[t]=new r(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):_t()}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 o=0;o<Vv.length;o++){const r=Vv[o];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const i="on"+r,a=t[i];a&&(this.propEventSubscriptions[r]=this.on(r,a))}this.prevMotionValues=p6(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 o=this.values.get(t);n!==o&&(o&&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 o=this.values.get(t);return o===void 0&&n!==void 0&&(o=Ii(n===null?void 0:n,{owner:this}),this.addValue(t,o)),o}readValue(t,n){let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(ub(o)||Gy(o))?o=parseFloat(o):!d6(o)&&zo.test(n)&&(o=nb(t,n)),this.setBaseTarget(t,Xt(o)?o.get():o)),Xt(o)?o.get():o}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let o;if(typeof n=="string"||typeof n=="object"){const a=Gd(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(o=a[t])}if(n&&o!==void 0)return o;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!Xt(r)?r:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kd),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Wv extends h6{constructor(){super(...arguments),this.KeyframeResolver=mb}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:o}){delete n[t],delete o[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 m6(e){return window.getComputedStyle(e)}class g6 extends Wv{constructor(){super(...arguments),this.type="html",this.renderInstance=Ay}readValueFromInstance(t,n){if(lr.has(n))return MA(t,n);{const o=m6(t),r=(Ld(n)?o.getPropertyValue(n):o[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Xb(t,n)}build(t,n,o){zd(t,n,o.transformTemplate)}scrapeMotionValuesFromProps(t,n,o){return Xd(t,n,o)}}class y6 extends Wv{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_t,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Iy(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(lr.has(n)){const o=tb(n);return o&&o.default||0}return n=jy.has(n)?n:Bd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,o){return $y(t,n,o)}onBindTransform(){this.current&&!this.renderState.dimensions&&wt.postRender(this.updateDimensions)}build(t,n,o){qd(t,n,this.isSVGTag,o.transformTemplate)}renderInstance(t,n,o,r){Ny(t,n,o,r)}mount(t){this.isSVGTag=Yd(t.tagName),super.mount(t)}}const b6=(e,t)=>Hd(e)?new y6(t):new g6(t,{allowProjection:e!==R.Fragment}),v6=nA({...Vj,...a6,...XN,...l6},b6),Ki=vI(v6),x6=({showOptions:e,setShowOptions:t,buttonRef:n,options:o,onClick:r})=>{const i=R.useRef(null);return R.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]),g.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})=>g.jsx(jo,{...a,timeout:100,children:g.jsx(ge,{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:g.jsx(ge,{children:o==null?void 0:o.map((l,c)=>g.jsx(_o,{sx:{opacity:1,pointerEvents:"auto",padding:"0rem",borderTop:c!==0?u=>`0.1rem solid ${u.palette.primary.notifyBorderColor}`:"none"},onClick:u=>{u.stopPropagation(),r(l)},children:g.jsx(dt,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{p:"0.5rem"},children:g.jsx(dt,{direction:"row",alignItems:"center",gap:"1rem",children:g.jsx(et,{component:"h3",sx:{color:u=>u.palette.primary.notifyActiveText,fontWeight:"300",fontSize:"1.1rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l.label})})})},c))})})})})},zv=({styles:e,label:t,disabled:n,onClick:o,...r})=>{var y,h;const i=Nt();let a=(t==null?void 0:t.length)*((t==null?void 0:t.length)>=10?6.5:7.5)+38||0;a=r!=null&&r.options?a+15:a;const[l,c]=R.useState(!1),u=R.useRef(null),[d,f]=R.useState(!1),[p,m]=R.useState(e==null?void 0:e.isAnimate);return g.jsxs(Ki.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:(y=e==null?void 0:e.hover)==null?void 0:y.backgroundColor,color:(h=e==null?void 0:e.hover)==null?void 0:h.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",cursor:"pointer",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:()=>{!(r!=null&&r.options)&&o(),r!=null&&r.options&&(f(b=>!b),m(d))},...r,children:[(e==null?void 0:e.icon)&&(!(e!=null&&e.iconPosition)||(e==null?void 0:e.iconPosition)==="start")&&g.jsx(ge,{component:"img",src:e==null?void 0:e.icon}),t&&g.jsxs(Ki.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:[g.jsx(et,{sx:{fontSize:"1.1rem"},children:t}),(r==null?void 0:r.options)&&(d?g.jsx(ge,{component:"img",src:nt.ArrowUpLight}):g.jsx(ge,{component:"img",src:nt.ArrowDownLight}))]}),(e==null?void 0:e.iconPosition)==="end"&&g.jsx(ge,{component:"img",src:e==null?void 0:e.icon}),g.jsx(x6,{showOptions:d,buttonRef:u==null?void 0:u.current,setShowOptions:f,options:r==null?void 0:r.options,onClick:o})]})};zv.propTypes={styles:s.object.isRequired,label:s.string};function hr({...e}){return g.jsx(_n,{children:g.jsx(zv,{...e})})}function oc({...e}){return g.jsx(_n,{children:g.jsx(Lg,{icon:g.jsx(ge,{component:"img",src:nt.Uncheck}),checkedIcon:g.jsx(ge,{component:"img",src:nt.Check}),...e})})}const Uv=new Set;function w6(e,t="warning"){if(process.env.NODE_ENV==="production")return;const n=Array.isArray(e)?e.join(`
|
|
302
|
+
`),()=>{document.head.removeChild(m)}},[t]),g.jsx(H3,{isPresent:t,childRef:r,sizeRef:i,children:C.cloneElement(e,{ref:r})})}const Y3=({children:e,initial:t,isPresent:n,onExitComplete:o,custom:r,presenceAffectsLayout:i,mode:a,anchorX:l})=>{const c=xd(G3),u=R.useId(),d=R.useCallback(p=>{c.set(p,!0);for(const m of c.values())if(!m)return;o&&o()},[c,o]),f=R.useMemo(()=>({id:u,initial:t,isPresent:n,custom:r,onExitComplete:d,register:p=>(c.set(p,!1),()=>c.delete(p))}),i?[Math.random(),d]:[n,d]);return R.useMemo(()=>{c.forEach((p,m)=>c.set(m,!1))},[n]),C.useEffect(()=>{!n&&!c.size&&o&&o()},[n]),a==="popLayout"&&(e=g.jsx(q3,{isPresent:n,anchorX:l,children:e})),g.jsx(Fl.Provider,{value:f,children:e})};function G3(){return new Map}function Z0(e=!0){const t=R.useContext(Fl);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:o,register:r}=t,i=R.useId();R.useEffect(()=>{if(e)return r(i)},[e]);const a=R.useCallback(()=>e&&o&&o(i),[i,o,e]);return!n&&o?[!1,a]:[!0]}const Bl=e=>e.key||"";function J0(e){const t=[];return R.Children.forEach(e,n=>{R.isValidElement(n)&&t.push(n)}),t}const K3=({children:e,custom:t,initial:n=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:i="sync",propagate:a=!1,anchorX:l="left"})=>{const[c,u]=Z0(a),d=R.useMemo(()=>J0(e),[e]),f=a&&!c?[]:d.map(Bl),p=R.useRef(!0),m=R.useRef(d),y=xd(()=>new Map),[h,b]=R.useState(d),[x,T]=R.useState(d);X0(()=>{p.current=!1,m.current=d;for(let v=0;v<x.length;v++){const E=Bl(x[v]);f.includes(E)?y.delete(E):y.get(E)!==!0&&y.set(E,!1)}},[x,f.length,f.join("-")]);const w=[];if(d!==h){let v=[...d];for(let E=0;E<x.length;E++){const k=x[E],M=Bl(k);f.includes(M)||(v.splice(E,0,k),w.push(k))}return i==="wait"&&w.length&&(v=w),T(J0(v)),b(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:O}=R.useContext(vd);return g.jsx(g.Fragment,{children:x.map(v=>{const E=Bl(v),k=a&&!c?!1:d===x||f.includes(E),M=()=>{if(y.has(E))y.set(E,!0);else return;let I=!0;y.forEach(j=>{j||(I=!1)}),I&&(O==null||O(),T(m.current),a&&(u==null||u()),o&&o())};return g.jsx(Y3,{isPresent:k,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:r,mode:i,onExitComplete:k?void 0:M,anchorX:l,children:v},E)})})};function Sd(e,t){e.indexOf(t)===-1&&e.push(t)}function Td(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let us=()=>{},Lo=()=>{};process.env.NODE_ENV!=="production"&&(us=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Lo=(e,t)=>{if(!e)throw new Error(t)});const Od={useManualTiming:!1};function Ed(e){let t;return()=>(t===void 0&&(t=e()),t)}const Fn=e=>e,Pi=(e,t,n)=>{const o=t-e;return o===0?1:(n-e)/o};class kd{constructor(){this.subscriptions=[]}add(t){return Sd(this.subscriptions,t),()=>Td(this.subscriptions,t)}notify(t,n,o){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,o);else for(let i=0;i<r;i++){const a=this.subscriptions[i];a&&a(t,n,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Hn=e=>e*1e3,so=e=>e/1e3;function Q0(e,t){return t?e*(1e3/t):0}const ey=new Set;function Ll(e,t,n){e||ey.has(t)||(console.warn(t),ey.add(t))}const X3=Ed(()=>window.ScrollTimeline!==void 0);class Z3{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 o=0;o<this.animations.length;o++)this.animations[o][t]=n}attachTimeline(t,n){const o=this.animations.map(r=>{if(X3()&&r.attachTimeline)return r.attachTimeline(t);if(typeof n=="function")return n(r)});return()=>{o.forEach((r,i)=>{r&&r(),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 J3 extends Z3{then(t,n){return this.finished.finally(t).then(()=>{})}}const ty={value:null},Pd=e=>Array.isArray(e)&&typeof e[0]=="number",Q3={};function eI(e,t){const n=Ed(e);return()=>Q3[t]??n()}const Mi=eI(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ny=(e,t,n=10)=>{let o="";const r=Math.max(Math.round(t/n),2);for(let i=0;i<r;i++)o+=e(i/(r-1))+", ";return`linear(${o.substring(0,o.length-2)})`},Ri=([e,t,n,o])=>`cubic-bezier(${e}, ${t}, ${n}, ${o})`,Md={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ri([0,.65,.55,1]),circOut:Ri([.55,0,1,.45]),backIn:Ri([.31,.01,.66,-.59]),backOut:Ri([.33,1.53,.69,.99])};function oy(e,t){if(e)return typeof e=="function"&&Mi()?ny(e,t):Pd(e)?Ri(e):Array.isArray(e)?e.map(n=>oy(n,t)||Md.easeOut):Md[e]}function tI(e,t,n,{delay:o=0,duration:r=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=oy(l,r);return Array.isArray(f)&&(d.easing=f),e.animate(d,{delay:o,duration:r,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal",pseudoElement:u})}function Rd(e){return typeof e=="function"&&"applyToOptions"in e}function Dd(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Vl=2e4;function Id(e){let t=0;const n=50;let o=e.next(t);for(;!o.done&&t<Vl;)t+=n,o=e.next(t);return t>=Vl?1/0:t}function nI(e,t=100,n){const o=n({...e,keyframes:[0,t]}),r=Math.min(Id(o),Vl);return{type:"keyframes",ease:i=>o.next(r*i).value/t,duration:so(r)}}function ry(e){return!!(typeof e=="function"&&Mi()||!e||typeof e=="string"&&(e in Md||Mi())||Pd(e)||Array.isArray(e)&&e.every(ry))}function sy(e,t){e.timeline=t,e.onfinish=null}const Wl=["read","resolveKeyframes","update","preRender","render","postRender"];function oI(e,t){let n=new Set,o=new Set,r=!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,m=!1)=>{const h=m&&r?n:o;return p&&a.add(f),h.has(f)||h.add(f),f},cancel:f=>{o.delete(f),a.delete(f)},process:f=>{if(l=f,r){i=!0;return}r=!0,[n,o]=[o,n],n.forEach(u),t&&ty.value&&ty.value.frameloop[t].push(c),c=0,n.clear(),r=!1,i&&(i=!1,d.process(f))}};return d}const rI=40;function iy(e,t){let n=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Wl.reduce((x,T)=>(x[T]=oI(i,t?T:void 0),x),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:p}=a,m=()=>{const x=performance.now();n=!1,r.delta=o?1e3/60:Math.max(Math.min(x-r.timestamp,rI),1),r.timestamp=x,r.isProcessing=!0,l.process(r),c.process(r),u.process(r),d.process(r),f.process(r),p.process(r),r.isProcessing=!1,n&&t&&(o=!1,e(m))},y=()=>{n=!0,o=!0,r.isProcessing||e(m)};return{schedule:Wl.reduce((x,T)=>{const w=a[T];return x[T]=(O,v=!1,E=!1)=>(n||y(),w.schedule(O,v,E)),x},{}),cancel:x=>{for(let T=0;T<Wl.length;T++)a[Wl[T]].cancel(x)},state:r,steps:a}}const{schedule:Ad}=iy(queueMicrotask,!1),{schedule:wt,cancel:Vo,state:qt,steps:jd}=iy(typeof requestAnimationFrame<"u"?requestAnimationFrame:Fn,!0);let zl;function sI(){zl=void 0}const io={now:()=>(zl===void 0&&io.set(qt.isProcessing||Od.useManualTiming?qt.timestamp:performance.now()),zl),set:e=>{zl=e,queueMicrotask(sI)}},qn={x:!1,y:!1};function ay(){return qn.x||qn.y}function iI(e){return e==="x"||e==="y"?qn[e]?null:(qn[e]=!0,()=>{qn[e]=!1}):qn.x||qn.y?null:(qn.x=qn.y=!0,()=>{qn.x=qn.y=!1})}function aI(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;const r=(n==null?void 0:n[e])??o.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}function ly(e,t){const n=aI(e),o=new AbortController,r={passive:!0,...t,signal:o.signal};return[n,r,()=>o.abort()]}function cy(e){return!(e.pointerType==="touch"||ay())}function lI(e,t,n={}){const[o,r,i]=ly(e,n),a=l=>{if(!cy(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{cy(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,r)};return o.forEach(l=>{l.addEventListener("pointerenter",a,r)}),i}const uy=(e,t)=>t?e===t?!0:uy(e,t.parentElement):!1,Nd=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,cI=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function uI(e){return cI.has(e.tagName)||e.tabIndex!==-1}const Di=new WeakSet;function dy(e){return t=>{t.key==="Enter"&&e(t)}}function $d(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const dI=(e,t)=>{const n=e.currentTarget;if(!n)return;const o=dy(()=>{if(Di.has(n))return;$d(n,"down");const r=dy(()=>{$d(n,"up")}),i=()=>$d(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",o,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",o),t)};function fy(e){return Nd(e)&&!ay()}function fI(e,t,n={}){const[o,r,i]=ly(e,n),a=l=>{const c=l.currentTarget;if(!fy(l)||Di.has(c))return;Di.add(c);const u=t(c,l),d=(m,y)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",p),!(!fy(m)||!Di.has(c))&&(Di.delete(c),typeof u=="function"&&u(m,{success:y}))},f=m=>{d(m,c===window||c===document||n.useGlobalTarget||uy(c,m.target))},p=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",p,r)};return o.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,r),l instanceof HTMLElement&&(l.addEventListener("focus",u=>dI(u,r)),!uI(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}const py=30,pI=e=>!isNaN(parseFloat(e));class hI{constructor(t,n={}){this.version="12.7.3",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,r=!0)=>{const i=io.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&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=io.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=pI(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ll(!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 kd);const o=this.events[t].add(n);return t==="change"?()=>{o(),wt.read(()=>{this.events.change.getSize()||this.stop()})}:o}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,o){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-o}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=io.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>py)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,py);return Q0(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 Ii(e,t){return new hI(e,t)}const hy=R.createContext({strict:!1}),my={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"]},ds={};for(const e in my)ds[e]={isEnabled:t=>my[e].some(n=>!!t[n])};function mI(e){for(const t in e)ds[t]={...ds[t],...e[t]}}const gI=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 Ul(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||gI.has(e)}let gy=e=>!Ul(e);function yI(e){e&&(gy=t=>t.startsWith("on")?!Ul(t):e(t))}try{yI(require("@emotion/is-prop-valid").default)}catch{}function bI(e,t,n){const o={};for(const r in e)r==="values"&&typeof e.values=="object"||(gy(r)||n===!0&&Ul(r)||!t&&!Ul(r)||e.draggable&&r.startsWith("onDrag"))&&(o[r]=e[r]);return o}function vI(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...o)=>(process.env.NODE_ENV!=="production"&&Ll(!1,"motion() is deprecated. Use motion.create() instead."),e(...o));return new Proxy(n,{get:(o,r)=>r==="create"?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const Hl=R.createContext({});function ql(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ai(e){return typeof e=="string"||Array.isArray(e)}const _d=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Fd=["initial",..._d];function Yl(e){return ql(e.animate)||Fd.some(t=>Ai(e[t]))}function yy(e){return!!(Yl(e)||e.variants)}function xI(e,t){if(Yl(e)){const{initial:n,animate:o}=e;return{initial:n===!1||Ai(n)?n:void 0,animate:Ai(o)?o:void 0}}return e.inherit!==!1?t:{}}function wI(e){const{initial:t,animate:n}=xI(e,R.useContext(Hl));return R.useMemo(()=>({initial:t,animate:n}),[by(t),by(n)])}function by(e){return Array.isArray(e)?e.join(" "):e}const CI=Symbol.for("motionComponentSymbol");function fs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function SI(e,t,n){return R.useCallback(o=>{o&&e.onMount&&e.onMount(o),t&&(o?t.mount(o):t.unmount()),n&&(typeof n=="function"?n(o):fs(n)&&(n.current=o))},[t])}const Bd=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),vy="data-"+Bd("framerAppearId"),xy=R.createContext({});function TI(e,t,n,o,r){var h,b;const{visualElement:i}=R.useContext(Hl),a=R.useContext(hy),l=R.useContext(Fl),c=R.useContext(Cd).reducedMotion,u=R.useRef(null);o=o||a.renderer,!u.current&&o&&(u.current=o(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=R.useContext(xy);d&&!d.projection&&r&&(d.type==="html"||d.type==="svg")&&OI(u.current,n,r,f);const p=R.useRef(!1);R.useInsertionEffect(()=>{d&&p.current&&d.update(n,l)});const m=n[vy],y=R.useRef(!!m&&!((h=window.MotionHandoffIsComplete)!=null&&h.call(window,m))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,m)));return X0(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),Ad.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),R.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)==null||x.call(window,m)}),y.current=!1))}),d}function OI(e,t,n,o){const{layoutId:r,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:wy(e.parent)),e.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||l&&fs(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:o,crossfade:d,layoutScroll:c,layoutRoot:u})}function wy(e){if(e)return e.options.allowProjection!==!1?e.projection:wy(e.parent)}function EI({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:o,Component:r}){e&&mI(e);function i(l,c){let u;const d={...R.useContext(Cd),...l,layoutId:kI(l)},{isStatic:f}=d,p=wI(l),m=o(l,f);if(!f&&wd){PI(d,e);const y=MI(d);u=y.MeasureLayout,p.visualElement=TI(r,m,d,t,y.ProjectionNode)}return g.jsxs(Hl.Provider,{value:p,children:[u&&p.visualElement?g.jsx(u,{visualElement:p.visualElement,...d}):null,n(r,l,SI(m,p.visualElement,c),m,f,p.visualElement)]})}i.displayName=`motion.${typeof r=="string"?r:`create(${r.displayName??r.name??""})`}`;const a=R.forwardRef(i);return a[CI]=r,a}function kI({layoutId:e}){const t=R.useContext(vd).id;return t&&e!==void 0?t+"-"+e:e}function PI(e,t){const n=R.useContext(hy).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const o="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?us(!1,o):Lo(!1,o)}}function MI(e){const{drag:t,layout:n}=ds;if(!t&&!n)return{};const o={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const Cy=e=>t=>typeof t=="string"&&t.startsWith(e),Ld=Cy("--"),RI=Cy("var(--"),Vd=e=>RI(e)?DI.test(e.split("/*")[0].trim()):!1,DI=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ji={};function II(e){for(const t in e)ji[t]=e[t],Ld(t)&&(ji[t].isCSSVariable=!0)}const ps=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],lr=new Set(ps);function Sy(e,{layout:t,layoutId:n}){return lr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ji[e]||e==="opacity")}const Xt=e=>!!(e&&e.getVelocity),Ty=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Oo=(e,t,n)=>n>t?t:n<e?e:n,hs={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ni={...hs,transform:e=>Oo(0,1,e)},Gl={...hs,default:1},$i=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Wo=$i("deg"),ao=$i("%"),Ne=$i("px"),AI=$i("vh"),jI=$i("vw"),Oy={...ao,parse:e=>ao.parse(e)/100,transform:e=>ao.transform(e*100)},NI={borderWidth:Ne,borderTopWidth:Ne,borderRightWidth:Ne,borderBottomWidth:Ne,borderLeftWidth:Ne,borderRadius:Ne,radius:Ne,borderTopLeftRadius:Ne,borderTopRightRadius:Ne,borderBottomRightRadius:Ne,borderBottomLeftRadius:Ne,width:Ne,maxWidth:Ne,height:Ne,maxHeight:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,backgroundPositionX:Ne,backgroundPositionY:Ne},$I={rotate:Wo,rotateX:Wo,rotateY:Wo,rotateZ:Wo,scale:Gl,scaleX:Gl,scaleY:Gl,scaleZ:Gl,skew:Wo,skewX:Wo,skewY:Wo,distance:Ne,translateX:Ne,translateY:Ne,translateZ:Ne,x:Ne,y:Ne,z:Ne,perspective:Ne,transformPerspective:Ne,opacity:Ni,originX:Oy,originY:Oy,originZ:Ne},Ey={...hs,transform:Math.round},Wd={...NI,...$I,zIndex:Ey,size:Ne,fillOpacity:Ni,strokeOpacity:Ni,numOctaves:Ey},_I={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},FI=ps.length;function BI(e,t,n){let o="",r=!0;for(let i=0;i<FI;i++){const a=ps[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=Ty(l,Wd[a]);if(!c){r=!1;const d=_I[a]||a;o+=`${d}(${u}) `}n&&(t[a]=u)}}return o=o.trim(),n?o=n(t,r?"":o):r&&(o="none"),o}function zd(e,t,n){const{style:o,vars:r,transformOrigin:i}=e;let a=!1,l=!1;for(const c in t){const u=t[c];if(lr.has(c)){a=!0;continue}else if(Ld(c)){r[c]=u;continue}else{const d=Ty(u,Wd[c]);c.startsWith("origin")?(l=!0,i[c]=d):o[c]=d}}if(t.transform||(a||n?o.transform=BI(t,e.transform,n):o.transform&&(o.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=i;o.transformOrigin=`${c} ${u} ${d}`}}const Ud=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ky(e,t,n){for(const o in t)!Xt(t[o])&&!Sy(o,n)&&(e[o]=t[o])}function LI({transformTemplate:e},t){return R.useMemo(()=>{const n=Ud();return zd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function VI(e,t){const n=e.style||{},o={};return ky(o,n,e),Object.assign(o,LI(e,t)),o}function WI(e,t){const n={},o=VI(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.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=o,n}const zI=["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 Hd(e){return typeof e!="string"||e.includes("-")?!1:!!(zI.indexOf(e)>-1||/[A-Z]/u.test(e))}const UI={offset:"stroke-dashoffset",array:"stroke-dasharray"},HI={offset:"strokeDashoffset",array:"strokeDasharray"};function qI(e,t,n=1,o=0,r=!0){e.pathLength=1;const i=r?UI:HI;e[i.offset]=Ne.transform(-o);const a=Ne.transform(t),l=Ne.transform(n);e[i.array]=`${a} ${l}`}function Py(e,t,n){return typeof e=="string"?e:Ne.transform(t+n*e)}function YI(e,t,n){const o=Py(t,e.x,e.width),r=Py(n,e.y,e.height);return`${o} ${r}`}function qd(e,{attrX:t,attrY:n,attrScale:o,originX:r,originY:i,pathLength:a,pathSpacing:l=1,pathOffset:c=0,...u},d,f){if(zd(e,u,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:m,dimensions:y}=e;p.transform&&(y&&(m.transform=p.transform),delete p.transform),y&&(r!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=YI(y,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),o!==void 0&&(p.scale=o),a!==void 0&&qI(p,a,l,c,!1)}const My=()=>({...Ud(),attrs:{}}),Yd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function GI(e,t,n,o){const r=R.useMemo(()=>{const i=My();return qd(i,t,Yd(o),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};ky(i,e.style,e),r.style={...i,...r.style}}return r}function KI(e=!1){return(n,o,r,{latestValues:i},a)=>{const c=(Hd(n)?GI:WI)(o,i,a,n),u=bI(o,typeof n=="string",e),d=n!==R.Fragment?{...u,...c,ref:r}:{},{children:f}=o,p=R.useMemo(()=>Xt(f)?f.get():f,[f]);return R.createElement(n,{...d,children:p})}}function Ry(e){const t=[{},{}];return e==null||e.values.forEach((n,o)=>{t[0][o]=n.get(),t[1][o]=n.getVelocity()}),t}function Gd(e,t,n,o){if(typeof t=="function"){const[r,i]=Ry(o);t=t(n!==void 0?n:e.custom,r,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,i]=Ry(o);t=t(n!==void 0?n:e.custom,r,i)}return t}const Kd=e=>Array.isArray(e),XI=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),ZI=e=>Kd(e)?e[e.length-1]||0:e;function Kl(e){const t=Xt(e)?e.get():e;return XI(t)?t.toValue():t}function JI({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},o,r,i){const a={latestValues:QI(o,r,i,e),renderState:t()};return n&&(a.onMount=l=>n({props:o,current:l,...a}),a.onUpdate=l=>n(l)),a}const Dy=e=>(t,n)=>{const o=R.useContext(Hl),r=R.useContext(Fl),i=()=>JI(e,t,o,r);return n?i():xd(i)};function QI(e,t,n,o){const r={},i=o(e,{});for(const p in i)r[p]=Kl(i[p]);let{initial:a,animate:l}=e;const c=Yl(e),u=yy(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"&&!ql(f)){const p=Array.isArray(f)?f:[f];for(let m=0;m<p.length;m++){const y=Gd(e,p[m]);if(y){const{transitionEnd:h,transition:b,...x}=y;for(const T in x){let w=x[T];if(Array.isArray(w)){const O=d?w.length-1:0;w=w[O]}w!==null&&(r[T]=w)}for(const T in h)r[T]=h[T]}}}return r}function Xd(e,t,n){var i;const{style:o}=e,r={};for(const a in o)(Xt(o[a])||t.style&&Xt(t.style[a])||Sy(a,e)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(r[a]=o[a]);return r}const eA={useVisualState:Dy({scrapeMotionValuesFromProps:Xd,createRenderState:Ud})};function Iy(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 Ay(e,{style:t,vars:n},o,r){Object.assign(e.style,t,r&&r.getProjectionStyles(o));for(const i in n)e.style.setProperty(i,n[i])}const jy=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 Ny(e,t,n,o){Ay(e,t,void 0,o);for(const r in t.attrs)e.setAttribute(jy.has(r)?r:Bd(r),t.attrs[r])}function $y(e,t,n){const o=Xd(e,t,n);for(const r in e)if(Xt(e[r])||Xt(t[r])){const i=ps.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;o[i]=e[r]}return o}const _y=["x","y","width","height","cx","cy","r"],tA={useVisualState:Dy({scrapeMotionValuesFromProps:$y,createRenderState:My,onUpdate:({props:e,prevProps:t,current:n,renderState:o,latestValues:r})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in r)if(lr.has(l)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let l=0;l<_y.length;l++){const c=_y[l];e[c]!==t[c]&&(a=!0)}a&&wt.read(()=>{Iy(n,o),wt.render(()=>{qd(o,r,Yd(n.tagName),e.transformTemplate),Ny(n,o)})})}})};function nA(e,t){return function(o,{forwardMotionProps:r}={forwardMotionProps:!1}){const a={...Hd(o)?tA:eA,preloadedFeatures:e,useRender:KI(r),createVisualElement:t,Component:o};return EI(a)}}function _i(e,t,n){const o=e.getProps();return Gd(o,t,n!==void 0?n:o.custom,e)}const Fy=new Set(["width","height","top","left","right","bottom",...ps]);function oA(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ii(n))}function rA(e,t){const n=_i(e,t);let{transitionEnd:o={},transition:r={},...i}=n||{};i={...i,...o};for(const a in i){const l=ZI(i[a]);oA(e,a,l)}}function sA(e){return!!(Xt(e)&&e.add)}function Zd(e,t){const n=e.getValue("willChange");if(sA(n))return n.add(t);if(!n&&Od.WillChange){const o=new Od.WillChange("auto");e.addValue("willChange",o),o.add(t)}}function By(e){return e.props[vy]}const Ly=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,iA=1e-7,aA=12;function lA(e,t,n,o,r){let i,a,l=0;do a=t+(n-t)/2,i=Ly(a,o,r)-e,i>0?n=a:t=a;while(Math.abs(i)>iA&&++l<aA);return a}function Fi(e,t,n,o){if(e===t&&n===o)return Fn;const r=i=>lA(i,0,1,e,n);return i=>i===0||i===1?i:Ly(r(i),t,o)}const Vy=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Wy=e=>t=>1-e(1-t),zy=Fi(.33,1.53,.69,.99),Jd=Wy(zy),Uy=Vy(Jd),Hy=e=>(e*=2)<1?.5*Jd(e):.5*(2-Math.pow(2,-10*(e-1))),Qd=e=>1-Math.sin(Math.acos(e)),qy=Wy(Qd),Yy=Vy(Qd),Gy=e=>/^0[^.\s]+$/u.test(e);function cA(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Gy(e):!0}const Bi=e=>Math.round(e*1e5)/1e5,ef=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function uA(e){return e==null}const dA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tf=(e,t)=>n=>!!(typeof n=="string"&&dA.test(n)&&n.startsWith(e)||t&&!uA(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ky=(e,t,n)=>o=>{if(typeof o!="string")return o;const[r,i,a,l]=o.match(ef);return{[e]:parseFloat(r),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},fA=e=>Oo(0,255,e),nf={...hs,transform:e=>Math.round(fA(e))},cr={test:tf("rgb","red"),parse:Ky("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:o=1})=>"rgba("+nf.transform(e)+", "+nf.transform(t)+", "+nf.transform(n)+", "+Bi(Ni.transform(o))+")"};function pA(e){let t="",n="",o="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),o=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),o=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,o+=o,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}}const of={test:tf("#"),parse:pA,transform:cr.transform},ms={test:tf("hsl","hue"),parse:Ky("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:o=1})=>"hsla("+Math.round(e)+", "+ao.transform(Bi(t))+", "+ao.transform(Bi(n))+", "+Bi(Ni.transform(o))+")"},Zt={test:e=>cr.test(e)||of.test(e)||ms.test(e),parse:e=>cr.test(e)?cr.parse(e):ms.test(e)?ms.parse(e):of.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?cr.transform(e):ms.transform(e)},hA=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function mA(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ef))==null?void 0:t.length)||0)+(((n=e.match(hA))==null?void 0:n.length)||0)>0}const Xy="number",Zy="color",gA="var",yA="var(",Jy="${}",bA=/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 Li(e){const t=e.toString(),n=[],o={color:[],number:[],var:[]},r=[];let i=0;const l=t.replace(bA,c=>(Zt.test(c)?(o.color.push(i),r.push(Zy),n.push(Zt.parse(c))):c.startsWith(yA)?(o.var.push(i),r.push(gA),n.push(c)):(o.number.push(i),r.push(Xy),n.push(parseFloat(c))),++i,Jy)).split(Jy);return{values:n,split:l,indexes:o,types:r}}function Qy(e){return Li(e).values}function eb(e){const{split:t,types:n}=Li(e),o=t.length;return r=>{let i="";for(let a=0;a<o;a++)if(i+=t[a],r[a]!==void 0){const l=n[a];l===Xy?i+=Bi(r[a]):l===Zy?i+=Zt.transform(r[a]):i+=r[a]}return i}}const vA=e=>typeof e=="number"?0:e;function xA(e){const t=Qy(e);return eb(e)(t.map(vA))}const zo={test:mA,parse:Qy,createTransformer:eb,getAnimatableNone:xA},wA=new Set(["brightness","contrast","saturate","opacity"]);function CA(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[o]=n.match(ef)||[];if(!o)return e;const r=n.replace(o,"");let i=wA.has(t)?1:0;return o!==n&&(i*=100),t+"("+i+r+")"}const SA=/\b([a-z-]*)\(.*?\)/gu,rf={...zo,getAnimatableNone:e=>{const t=e.match(SA);return t?t.map(CA).join(" "):e}},TA={...Wd,color:Zt,backgroundColor:Zt,outlineColor:Zt,fill:Zt,stroke:Zt,borderColor:Zt,borderTopColor:Zt,borderRightColor:Zt,borderBottomColor:Zt,borderLeftColor:Zt,filter:rf,WebkitFilter:rf},tb=e=>TA[e];function nb(e,t){let n=tb(e);return n!==rf&&(n=zo),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const OA=new Set(["auto","none","0"]);function EA(e,t,n){let o=0,r;for(;o<e.length&&!r;){const i=e[o];typeof i=="string"&&!OA.has(i)&&Li(i).values.length&&(r=e[o]),o++}if(r&&n)for(const i of t)e[i]=nb(n,r)}const ur=e=>e*180/Math.PI,sf=e=>{const t=ur(Math.atan2(e[1],e[0]));return af(t)},kA={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:sf,rotateZ:sf,skewX:e=>ur(Math.atan(e[1])),skewY:e=>ur(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},af=e=>(e=e%360,e<0&&(e+=360),e),ob=sf,rb=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),sb=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),PA={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:rb,scaleY:sb,scale:e=>(rb(e)+sb(e))/2,rotateX:e=>af(ur(Math.atan2(e[6],e[5]))),rotateY:e=>af(ur(Math.atan2(-e[2],e[0]))),rotateZ:ob,rotate:ob,skewX:e=>ur(Math.atan(e[4])),skewY:e=>ur(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ib(e){return e.includes("scale")?1:0}function lf(e,t){if(!e||e==="none")return ib(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let o,r;if(n)o=PA,r=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=kA,r=l}if(!r)return ib(t);const i=o[t],a=r[1].split(",").map(RA);return typeof i=="function"?i(a):a[i]}const MA=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return lf(n,t)};function RA(e){return parseFloat(e.trim())}const ab=e=>e===hs||e===Ne,DA=new Set(["x","y","z"]),IA=ps.filter(e=>!DA.has(e));function AA(e){const t=[];return IA.forEach(n=>{const o=e.getValue(n);o!==void 0&&(t.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))}),t}const gs={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})=>lf(t,"x"),y:(e,{transform:t})=>lf(t,"y")};gs.translateX=gs.x,gs.translateY=gs.y;const dr=new Set;let cf=!1,uf=!1;function lb(){if(uf){const e=Array.from(dr).filter(o=>o.needsMeasurement),t=new Set(e.map(o=>o.element)),n=new Map;t.forEach(o=>{const r=AA(o);r.length&&(n.set(o,r),o.render())}),e.forEach(o=>o.measureInitialState()),t.forEach(o=>{o.render();const r=n.get(o);r&&r.forEach(([i,a])=>{var l;(l=o.getValue(i))==null||l.set(a)})}),e.forEach(o=>o.measureEndState()),e.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}uf=!1,cf=!1,dr.forEach(e=>e.complete()),dr.clear()}function cb(){dr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(uf=!0)})}function jA(){cb(),lb()}class df{constructor(t,n,o,r,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=o,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(dr.add(this),cf||(cf=!0,wt.read(cb),wt.resolveKeyframes(lb))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:o,motionValue:r}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const a=r==null?void 0:r.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(o&&n){const c=o.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),r&&a===void 0&&r.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),dr.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,dr.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ub=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),NA=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $A(e){const t=NA.exec(e);if(!t)return[,];const[,n,o,r]=t;return[`--${n??o}`,r]}const _A=4;function db(e,t,n=1){Lo(n<=_A,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[o,r]=$A(e);if(!o)return;const i=window.getComputedStyle(t).getPropertyValue(o);if(i){const a=i.trim();return ub(a)?parseFloat(a):a}return Vd(r)?db(r,t,n+1):r}const fb=e=>t=>t.test(e),pb=[hs,Ne,ao,Wo,jI,AI,{test:e=>e==="auto",parse:e=>e}],hb=e=>pb.find(fb(e));class mb extends df{constructor(t,n,o,r,i){super(t,n,o,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:o}=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(),Vd(u))){const d=db(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Fy.has(o)||t.length!==2)return;const[r,i]=t,a=hb(r),l=hb(i);if(a!==l)if(ab(a)&&ab(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,o=[];for(let r=0;r<t.length;r++)cA(t[r])&&o.push(r);o.length&&EA(t,o,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:o}=this;if(!t||!t.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=gs[o](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(o,r).jump(r,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:o}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=o.length-1,a=o[i];o[i]=gs[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 gb=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(zo.test(e)||e==="0")&&!e.startsWith("url("));function FA(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 BA(e,t,n,o){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],a=gb(r,t),l=gb(i,t);return us(a===l,`You are trying to animate ${t} from "${r}" to "${i}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${i} via the \`style\` property.`),!a||!l?!1:FA(e)||(n==="spring"||Rd(n))&&o}const LA=e=>e!==null;function Xl(e,{repeat:t,repeatType:n="loop"},o){const r=e.filter(LA),i=t&&n!=="loop"&&t%2===1?0:r.length-1;return!i||o===void 0?r[i]:o}const VA=40;class yb{constructor({autoplay:t=!0,delay:n=0,type:o="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=io.now(),this.options={autoplay:t,delay:n,type:o,repeat:r,repeatDelay:i,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>VA?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&jA(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=io.now(),this.hasAttemptedResolve=!0;const{name:o,type:r,velocity:i,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!BA(t,o,r,i))if(a)this.options.duration=0;else{c&&c(Xl(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 kt=(e,t,n)=>e+(t-e)*n;function ff(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 WA({hue:e,saturation:t,lightness:n,alpha:o}){e/=360,t/=100,n/=100;let r=0,i=0,a=0;if(!t)r=i=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=ff(c,l,e+1/3),i=ff(c,l,e),a=ff(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:o}}function Zl(e,t){return n=>n>0?t:e}const pf=(e,t,n)=>{const o=e*e,r=n*(t*t-o)+o;return r<0?0:Math.sqrt(r)},zA=[of,cr,ms],UA=e=>zA.find(t=>t.test(e));function bb(e){const t=UA(e);if(us(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===ms&&(n=WA(n)),n}const vb=(e,t)=>{const n=bb(e),o=bb(t);if(!n||!o)return Zl(e,t);const r={...n};return i=>(r.red=pf(n.red,o.red,i),r.green=pf(n.green,o.green,i),r.blue=pf(n.blue,o.blue,i),r.alpha=kt(n.alpha,o.alpha,i),cr.transform(r))},HA=(e,t)=>n=>t(e(n)),Vi=(...e)=>e.reduce(HA),hf=new Set(["none","hidden"]);function qA(e,t){return hf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function YA(e,t){return n=>kt(e,t,n)}function mf(e){return typeof e=="number"?YA:typeof e=="string"?Vd(e)?Zl:Zt.test(e)?vb:XA:Array.isArray(e)?xb:typeof e=="object"?Zt.test(e)?vb:GA:Zl}function xb(e,t){const n=[...e],o=n.length,r=e.map((i,a)=>mf(i)(i,t[a]));return i=>{for(let a=0;a<o;a++)n[a]=r[a](i);return n}}function GA(e,t){const n={...e,...t},o={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(o[r]=mf(e[r])(e[r],t[r]));return r=>{for(const i in o)n[i]=o[i](r);return n}}function KA(e,t){const n=[],o={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const i=t.types[r],a=e.indexes[i][o[i]],l=e.values[a]??0;n[r]=l,o[i]++}return n}const XA=(e,t)=>{const n=zo.createTransformer(t),o=Li(e),r=Li(t);return o.indexes.var.length===r.indexes.var.length&&o.indexes.color.length===r.indexes.color.length&&o.indexes.number.length>=r.indexes.number.length?hf.has(e)&&!r.values.length||hf.has(t)&&!o.values.length?qA(e,t):Vi(xb(KA(o,r),r.values),n):(us(!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.`),Zl(e,t))};function wb(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?kt(e,t,n):mf(e)(e,t)}const ZA=5;function Cb(e,t,n){const o=Math.max(t-ZA,0);return Q0(n-e(o),t-o)}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},Sb=.001;function JA({duration:e=Pt.duration,bounce:t=Pt.bounce,velocity:n=Pt.velocity,mass:o=Pt.mass}){let r,i;us(e<=Hn(Pt.maxDuration),"Spring duration must be 10 seconds or less");let a=1-t;a=Oo(Pt.minDamping,Pt.maxDamping,a),e=Oo(Pt.minDuration,Pt.maxDuration,so(e)),a<1?(r=u=>{const d=u*a,f=d*e,p=d-n,m=gf(u,a),y=Math.exp(-f);return Sb-p/m*y},i=u=>{const f=u*a*e,p=f*n+n,m=Math.pow(a,2)*Math.pow(u,2)*e,y=Math.exp(-f),h=gf(Math.pow(u,2),a);return(-r(u)+Sb>0?-1:1)*((p-m)*y)/h}):(r=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=ej(r,i,l);if(e=Hn(e),isNaN(c))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:e};{const u=Math.pow(c,2)*o;return{stiffness:u,damping:a*2*Math.sqrt(o*u),duration:e}}}const QA=12;function ej(e,t,n){let o=n;for(let r=1;r<QA;r++)o=o-e(o)/t(o);return o}function gf(e,t){return e*Math.sqrt(1-t*t)}const tj=["duration","bounce"],nj=["stiffness","damping","mass"];function Tb(e,t){return t.some(n=>e[n]!==void 0)}function oj(e){let t={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...e};if(!Tb(e,nj)&&Tb(e,tj))if(e.visualDuration){const n=e.visualDuration,o=2*Math.PI/(n*1.2),r=o*o,i=2*Oo(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Pt.mass,stiffness:r,damping:i}}else{const n=JA(e);t={...t,...n,mass:Pt.mass},t.isResolvedFromDuration=!0}return t}function Jl(e=Pt.visualDuration,t=Pt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:o,restDelta:r}=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:m}=oj({...n,velocity:-so(n.velocity||0)}),y=p||0,h=u/(2*Math.sqrt(c*d)),b=a-i,x=so(Math.sqrt(c/d)),T=Math.abs(b)<5;o||(o=T?Pt.restSpeed.granular:Pt.restSpeed.default),r||(r=T?Pt.restDelta.granular:Pt.restDelta.default);let w;if(h<1){const v=gf(x,h);w=E=>{const k=Math.exp(-h*x*E);return a-k*((y+h*x*b)/v*Math.sin(v*E)+b*Math.cos(v*E))}}else if(h===1)w=v=>a-Math.exp(-x*v)*(b+(y+x*b)*v);else{const v=x*Math.sqrt(h*h-1);w=E=>{const k=Math.exp(-h*x*E),M=Math.min(v*E,300);return a-k*((y+h*x*b)*Math.sinh(M)+v*b*Math.cosh(M))/v}}const O={calculatedDuration:m&&f||null,next:v=>{const E=w(v);if(m)l.done=v>=f;else{let k=0;h<1&&(k=v===0?Hn(y):Cb(w,v,E));const M=Math.abs(k)<=o,I=Math.abs(a-E)<=r;l.done=M&&I}return l.value=l.done?a:E,l},toString:()=>{const v=Math.min(Id(O),Vl),E=ny(k=>O.next(v*k).value,v,30);return v+"ms "+E},toTransition:()=>{}};return O}Jl.applyToOptions=e=>{const t=nI(e,100,Jl);return e.ease=Mi()?t.ease:"easeOut",e.duration=Hn(t.duration),e.type="keyframes",e};function Ob({keyframes:e,velocity:t=0,power:n=.8,timeConstant:o=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],p={done:!1,value:f},m=M=>l!==void 0&&M<l||c!==void 0&&M>c,y=M=>l===void 0?c:c===void 0||Math.abs(l-M)<Math.abs(c-M)?l:c;let h=n*t;const b=f+h,x=a===void 0?b:a(b);x!==b&&(h=x-f);const T=M=>-h*Math.exp(-M/o),w=M=>x+T(M),O=M=>{const I=T(M),j=w(M);p.done=Math.abs(I)<=u,p.value=p.done?x:j};let v,E;const k=M=>{m(p.value)&&(v=M,E=Jl({keyframes:[p.value,y(p.value)],velocity:Cb(w,M,p.value),damping:r,stiffness:i,restDelta:u,restSpeed:d}))};return k(0),{calculatedDuration:null,next:M=>{let I=!1;return!E&&v===void 0&&(I=!0,O(M),k(M)),v!==void 0&&M>=v?E.next(M-v):(!I&&O(M),p)}}}const rj=Fi(.42,0,1,1),sj=Fi(0,0,.58,1),Eb=Fi(.42,0,.58,1),ij=e=>Array.isArray(e)&&typeof e[0]!="number",kb={linear:Fn,easeIn:rj,easeInOut:Eb,easeOut:sj,circIn:Qd,circInOut:Yy,circOut:qy,backIn:Jd,backInOut:Uy,backOut:zy,anticipate:Hy},Pb=e=>{if(Pd(e)){Lo(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,o,r]=e;return Fi(t,n,o,r)}else if(typeof e=="string")return Lo(kb[e]!==void 0,`Invalid easing type '${e}'`),kb[e];return e};function aj(e,t,n){const o=[],r=n||wb,i=e.length-1;for(let a=0;a<i;a++){let l=r(e[a],e[a+1]);if(t){const c=Array.isArray(t)?t[a]||Fn:t;l=Vi(c,l)}o.push(l)}return o}function lj(e,t,{clamp:n=!0,ease:o,mixer:r}={}){const i=e.length;if(Lo(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=aj(t,o,r),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=Pi(e[f],e[f+1],d);return l[f](p)};return n?d=>u(Oo(e[0],e[i-1],d)):u}function cj(e,t){const n=e[e.length-1];for(let o=1;o<=t;o++){const r=Pi(0,t,o);e.push(kt(n,1,r))}}function uj(e){const t=[0];return cj(t,e.length-1),t}function dj(e,t){return e.map(n=>n*t)}function fj(e,t){return e.map(()=>t||Eb).splice(0,e.length-1)}function Wi({duration:e=300,keyframes:t,times:n,ease:o="easeInOut"}){const r=ij(o)?o.map(Pb):Pb(o),i={done:!1,value:t[0]},a=dj(n&&n.length===t.length?n:uj(t),e),l=lj(a,t,{ease:Array.isArray(r)?r:fj(t,r)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const pj=e=>{const t=({timestamp:n})=>e(n);return{start:()=>wt.update(t,!0),stop:()=>Vo(t),now:()=>qt.isProcessing?qt.timestamp:io.now()}},hj={decay:Ob,inertia:Ob,tween:Wi,keyframes:Wi,spring:Jl},mj=e=>e/100;class yf extends yb{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:o,element:r,keyframes:i}=this.options,a=(r==null?void 0:r.KeyframeResolver)||df,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(i,l,n,o,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:o=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=this.options,l=Rd(n)?n:hj[n]||Wi;let c,u;process.env.NODE_ENV!=="production"&&l!==Wi&&Lo(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==Wi&&typeof t[0]!="number"&&(c=Vi(mj,wb(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=Id(d));const{calculatedDuration:f}=d,p=f+r,m=p*(o+1)-r;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:p,totalDuration:m}}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:o}=this;if(!o){const{keyframes:M}=this.options;return{done:!0,value:M[M.length-1]}}const{finalKeyframe:r,generator:i,mirroredGenerator:a,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=o;if(this.startTime===null)return i.next(0);const{delay:p,repeat:m,repeatType:y,repeatDelay:h,onUpdate:b}=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),T=this.speed>=0?x<0:x>d;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let w=this.currentTime,O=i;if(m){const M=Math.min(this.currentTime,d)/f;let I=Math.floor(M),j=M%1;!j&&M>=1&&(j=1),j===1&&I--,I=Math.min(I,m+1),!!(I%2)&&(y==="reverse"?(j=1-j,h&&(j-=h/f)):y==="mirror"&&(O=a)),w=Oo(0,1,j)*f}const v=T?{done:!1,value:c[0]}:O.next(w);l&&(v.value=l(v.value));let{done:E}=v;!T&&u!==null&&(E=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return k&&r!==void 0&&(v.value=Xl(c,this.options,r)),b&&b(v.value),k&&this.finish(),v}get duration(){const{resolved:t}=this;return t?so(t.calculatedDuration):0}get time(){return so(this.currentTime)}set time(t){t=Hn(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=so(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=pj,onPlay:n,startTime:o}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=o??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 gj=new Set(["opacity","clipPath","filter","transform"]),yj=Ed(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ql=10,bj=2e4;function vj(e){return Rd(e.type)||e.type==="spring"||!ry(e.ease)}function xj(e,t){const n=new yf({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:e[0]};const r=[];let i=0;for(;!o.done&&i<bj;)o=n.sample(i),r.push(o.value),i+=Ql;return{times:void 0,keyframes:r,duration:i-Ql,ease:"linear"}}const Mb={anticipate:Hy,backInOut:Uy,circInOut:Yy};function wj(e){return e in Mb}class Rb extends yb{constructor(t){super(t);const{name:n,motionValue:o,element:r,keyframes:i}=this.options;this.resolver=new mb(i,(a,l)=>this.onKeyframesResolved(a,l),n,o,r),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:o=300,times:r,ease:i,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Mi()&&wj(i)&&(i=Mb[i]),vj(this.options)){const{onComplete:f,onUpdate:p,motionValue:m,element:y,...h}=this.options,b=xj(t,h);t=b.keyframes,t.length===1&&(t[1]=t[0]),o=b.duration,r=b.times,i=b.ease,a="keyframes"}const d=tI(l.owner.current,c,t,{...this.options,duration:o,times:r,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(sy(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Xl(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:o,times:r,type:a,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return so(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return so(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:o}=n;o.currentTime=Hn(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:o}=n;o.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 Fn;const{animation:o}=n;sy(o,t)}return Fn}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:o,duration:r,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,...m}=this.options,y=new yf({...m,keyframes:o,duration:r,type:i,ease:a,times:l,isGenerator:!0}),h=Hn(this.time);u.setWithVelocity(y.sample(h-Ql).value,y.sample(h).value,Ql)}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:o,repeatDelay:r,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 yj()&&o&&gj.has(o)&&(o!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&a!==0&&l!=="inertia"}}const Cj={type:"spring",stiffness:500,damping:25,restSpeed:10},Sj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Tj={type:"keyframes",duration:.8},Oj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ej=(e,{keyframes:t})=>t.length>2?Tj:lr.has(e)?e.startsWith("scale")?Sj(t[1]):Cj:Oj;function kj({when:e,delay:t,delayChildren:n,staggerChildren:o,staggerDirection:r,repeat:i,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const bf=(e,t,n,o={},r,i)=>a=>{const l=Dd(o,e)||{},c=l.delay||o.delay||0;let{elapsed:u=0}=o;u=u-Hn(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:r};kj(l)||(d={...d,...Ej(e,d)}),d.duration&&(d.duration=Hn(d.duration)),d.repeatDelay&&(d.repeatDelay=Hn(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=Xl(d.keyframes,l);if(p!==void 0)return wt.update(()=>{d.onUpdate(p),d.onComplete()}),new J3([])}return!i&&Rb.supports(d)?new Rb(d):new yf(d)};function Pj({protectedKeys:e,needsAnimating:t},n){const o=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,o}function Db(e,t,{delay:n=0,transitionOverride:o,type:r}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:a,...l}=t;o&&(i=o);const c=[],u=r&&e.animationState&&e.animationState.getState()[r];for(const d in l){const f=e.getValue(d,e.latestValues[d]??null),p=l[d];if(p===void 0||u&&Pj(u,d))continue;const m={delay:n,...Dd(i||{},d)};let y=!1;if(window.MotionHandoffAnimation){const b=By(e);if(b){const x=window.MotionHandoffAnimation(b,d,wt);x!==null&&(m.startTime=x,y=!0)}}Zd(e,d),f.start(bf(d,f,p,e.shouldReduceMotion&&Fy.has(d)?{type:!1}:m,e,y));const h=f.animation;h&&c.push(h)}return a&&Promise.all(c).then(()=>{wt.update(()=>{a&&rA(e,a)})}),c}function vf(e,t,n={}){var c;const o=_i(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(r=n.transitionOverride);const i=o?()=>Promise.all(Db(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:p}=r;return Mj(e,t,d+u,f,p,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[u,d]=l==="beforeChildren"?[i,a]:[a,i];return u().then(()=>d())}else return Promise.all([i(),a(n.delay)])}function Mj(e,t,n=0,o=0,r=1,i){const a=[],l=(e.variantChildren.size-1)*o,c=r===1?(u=0)=>u*o:(u=0)=>l-u*o;return Array.from(e.variantChildren).sort(Rj).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(vf(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function Rj(e,t){return e.sortNodePosition(t)}function Dj(e,t,n={}){e.notify("AnimationStart",t);let o;if(Array.isArray(t)){const r=t.map(i=>vf(e,i,n));o=Promise.all(r)}else if(typeof t=="string")o=vf(e,t,n);else{const r=typeof t=="function"?_i(e,t,n.custom):t;o=Promise.all(Db(e,r,n))}return o.then(()=>{e.notify("AnimationComplete",t)})}function Ib(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let o=0;o<n;o++)if(t[o]!==e[o])return!1;return!0}const Ij=Fd.length;function Ab(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ab(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Ij;n++){const o=Fd[n],r=e.props[o];(Ai(r)||r===!1)&&(t[o]=r)}return t}const Aj=[..._d].reverse(),jj=_d.length;function Nj(e){return t=>Promise.all(t.map(({animation:n,options:o})=>Dj(e,n,o)))}function $j(e){let t=Nj(e),n=jb(),o=!0;const r=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:m,transitionEnd:y,...h}=f;u={...u,...h,...y}}return u};function i(c){t=c(e)}function a(c){const{props:u}=e,d=Ab(e.parent)||{},f=[],p=new Set;let m={},y=1/0;for(let b=0;b<jj;b++){const x=Aj[b],T=n[x],w=u[x]!==void 0?u[x]:d[x],O=Ai(w),v=x===c?T.isActive:null;v===!1&&(y=b);let E=w===d[x]&&w!==u[x]&&O;if(E&&o&&e.manuallyAnimateOnMount&&(E=!1),T.protectedKeys={...m},!T.isActive&&v===null||!w&&!T.prevProp||ql(w)||typeof w=="boolean")continue;const k=_j(T.prevProp,w);let M=k||x===c&&T.isActive&&!E&&O||b>y&&O,I=!1;const j=Array.isArray(w)?w:[w];let F=j.reduce(r(x),{});v===!1&&(F={});const{prevResolvedValues:A={}}=T,V={...A,...F},$=L=>{M=!0,p.has(L)&&(I=!0,p.delete(L)),T.needsAnimating[L]=!0;const W=e.getValue(L);W&&(W.liveStyle=!1)};for(const L in V){const W=F[L],D=A[L];if(m.hasOwnProperty(L))continue;let N=!1;Kd(W)&&Kd(D)?N=!Ib(W,D):N=W!==D,N?W!=null?$(L):p.add(L):W!==void 0&&p.has(L)?$(L):T.protectedKeys[L]=!0}T.prevProp=w,T.prevResolvedValues=F,T.isActive&&(m={...m,...F}),o&&e.blockInitialAnimation&&(M=!1),M&&(!(E&&k)||I)&&f.push(...j.map(L=>({animation:L,options:{type:x}})))}if(p.size){const b={};if(typeof u.initial!="boolean"){const x=_i(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(b.transition=x.transition)}p.forEach(x=>{const T=e.getBaseTarget(x),w=e.getValue(x);w&&(w.liveStyle=!0),b[x]=T??null}),f.push({animation:b})}let h=!!f.length;return o&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(h=!1),o=!1,h?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 m;return(m=p.animationState)==null?void 0:m.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=jb(),o=!0}}}function _j(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ib(t,e):!1}function fr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function jb(){return{animate:fr(!0),whileInView:fr(),whileHover:fr(),whileTap:fr(),whileDrag:fr(),whileFocus:fr(),exit:fr()}}class Uo{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Fj extends Uo{constructor(t){super(t),t.animationState||(t.animationState=$j(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ql(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 Bj=0;class Lj extends Uo{constructor(){super(...arguments),this.id=Bj++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.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 Vj={animation:{Feature:Fj},exit:{Feature:Lj}};function zi(e,t,n,o={passive:!0}){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n)}function Ui(e){return{point:{x:e.pageX,y:e.pageY}}}const Wj=e=>t=>Nd(t)&&e(t,Ui(t));function Hi(e,t,n,o){return zi(e,t,Wj(n),o)}function Nb({top:e,left:t,right:n,bottom:o}){return{x:{min:t,max:n},y:{min:e,max:o}}}function zj({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Uj(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),o=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}const $b=1e-4,Hj=1-$b,qj=1+$b,_b=.01,Yj=0-_b,Gj=0+_b;function rn(e){return e.max-e.min}function Kj(e,t,n){return Math.abs(e-t)<=n}function Fb(e,t,n,o=.5){e.origin=o,e.originPoint=kt(t.min,t.max,e.origin),e.scale=rn(n)/rn(t),e.translate=kt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Hj&&e.scale<=qj||isNaN(e.scale))&&(e.scale=1),(e.translate>=Yj&&e.translate<=Gj||isNaN(e.translate))&&(e.translate=0)}function qi(e,t,n,o){Fb(e.x,t.x,n.x,o?o.originX:void 0),Fb(e.y,t.y,n.y,o?o.originY:void 0)}function Bb(e,t,n){e.min=n.min+t.min,e.max=e.min+rn(t)}function Xj(e,t,n){Bb(e.x,t.x,n.x),Bb(e.y,t.y,n.y)}function Lb(e,t,n){e.min=t.min-n.min,e.max=e.min+rn(t)}function Yi(e,t,n){Lb(e.x,t.x,n.x),Lb(e.y,t.y,n.y)}const Vb=()=>({translate:0,scale:1,origin:0,originPoint:0}),ys=()=>({x:Vb(),y:Vb()}),Wb=()=>({min:0,max:0}),_t=()=>({x:Wb(),y:Wb()});function Bn(e){return[e("x"),e("y")]}function xf(e){return e===void 0||e===1}function wf({scale:e,scaleX:t,scaleY:n}){return!xf(e)||!xf(t)||!xf(n)}function pr(e){return wf(e)||zb(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function zb(e){return Ub(e.x)||Ub(e.y)}function Ub(e){return e&&e!=="0%"}function ec(e,t,n){const o=e-n,r=t*o;return n+r}function Hb(e,t,n,o,r){return r!==void 0&&(e=ec(e,r,o)),ec(e,n,o)+t}function Cf(e,t=0,n=1,o,r){e.min=Hb(e.min,t,n,o,r),e.max=Hb(e.max,t,n,o,r)}function qb(e,{x:t,y:n}){Cf(e.x,t.translate,t.scale,t.originPoint),Cf(e.y,n.translate,n.scale,n.originPoint)}const Yb=.999999999999,Gb=1.0000000000001;function Zj(e,t,n,o=!1){const r=n.length;if(!r)return;t.x=t.y=1;let i,a;for(let l=0;l<r;l++){i=n[l],a=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(o&&i.options.layoutScroll&&i.scroll&&i!==i.root&&vs(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,qb(e,a)),o&&pr(i.latestValues)&&vs(e,i.latestValues))}t.x<Gb&&t.x>Yb&&(t.x=1),t.y<Gb&&t.y>Yb&&(t.y=1)}function bs(e,t){e.min=e.min+t,e.max=e.max+t}function Kb(e,t,n,o,r=.5){const i=kt(e.min,e.max,r);Cf(e,t,n,i,o)}function vs(e,t){Kb(e.x,t.x,t.scaleX,t.scale,t.originX),Kb(e.y,t.y,t.scaleY,t.scale,t.originY)}function Xb(e,t){return Nb(Uj(e.getBoundingClientRect(),t))}function Jj(e,t,n){const o=Xb(e,n),{scroll:r}=t;return r&&(bs(o.x,r.offset.x),bs(o.y,r.offset.y)),o}const Zb=({current:e})=>e?e.ownerDocument.defaultView:null,Jb=(e,t)=>Math.abs(e-t);function Qj(e,t){const n=Jb(e.x,t.x),o=Jb(e.y,t.y);return Math.sqrt(n**2+o**2)}class Qb{constructor(t,n,{transformPagePoint:o,contextWindow:r,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=Tf(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=Qj(f.offset,{x:0,y:0})>=3;if(!p&&!m)return;const{point:y}=f,{timestamp:h}=qt;this.history.push({...y,timestamp:h});const{onStart:b,onMove:x}=this.handlers;p||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Sf(p,this.transformPagePoint),wt.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:h}=this.handlers;if(this.dragSnapToOrigin&&h&&h(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Tf(f.type==="pointercancel"?this.lastMoveEventInfo:Sf(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,b),y&&y(f,b)},!Nd(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=o,this.contextWindow=r||window;const a=Ui(t),l=Sf(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=qt;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Tf(l,this.history)),this.removeListeners=Vi(Hi(this.contextWindow,"pointermove",this.handlePointerMove),Hi(this.contextWindow,"pointerup",this.handlePointerUp),Hi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Vo(this.updatePoint)}}function Sf(e,t){return t?{point:t(e.point)}:e}function ev(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Tf({point:e},t){return{point:e,delta:ev(e,tv(t)),offset:ev(e,eN(t)),velocity:tN(t,.1)}}function eN(e){return e[0]}function tv(e){return e[e.length-1]}function tN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,o=null;const r=tv(e);for(;n>=0&&(o=e[n],!(r.timestamp-o.timestamp>Hn(t)));)n--;if(!o)return{x:0,y:0};const i=so(r.timestamp-o.timestamp);if(i===0)return{x:0,y:0};const a={x:(r.x-o.x)/i,y:(r.y-o.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function nN(e,{min:t,max:n},o){return t!==void 0&&e<t?e=o?kt(t,e,o.min):Math.max(e,t):n!==void 0&&e>n&&(e=o?kt(n,e,o.max):Math.min(e,n)),e}function nv(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 oN(e,{top:t,left:n,bottom:o,right:r}){return{x:nv(e.x,n,r),y:nv(e.y,t,o)}}function ov(e,t){let n=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,o]=[o,n]),{min:n,max:o}}function rN(e,t){return{x:ov(e.x,t.x),y:ov(e.y,t.y)}}function sN(e,t){let n=.5;const o=rn(e),r=rn(t);return r>o?n=Pi(t.min,t.max-o,e.min):o>r&&(n=Pi(e.min,e.max-r,t.min)),Oo(0,1,n)}function iN(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 Of=.35;function aN(e=Of){return e===!1?e=0:e===!0&&(e=Of),{x:rv(e,"left","right"),y:rv(e,"top","bottom")}}function rv(e,t,n){return{min:sv(e,t),max:sv(e,n)}}function sv(e,t){return typeof e=="number"?e:e[t]||0}const lN=new WeakMap;class cN{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=_t(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ui(d).point)},i=(d,f)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=iI(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),Bn(b=>{let x=this.getAxisMotionValue(b).get()||0;if(ao.test(x)){const{projection:T}=this.visualElement;if(T&&T.layout){const w=T.layout.layoutBox[b];w&&(x=rn(w)*(parseFloat(x)/100))}}this.originPoint[b]=x}),y&&wt.postRender(()=>y(d,f)),Zd(this.visualElement,"transform");const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:h}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:b}=f;if(m&&this.currentDirection===null){this.currentDirection=uN(b),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),h&&h(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Bn(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 Qb(t,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Zb(this.visualElement)})}stop(t,n){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:r}=n;this.startAnimation(r);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:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,o){const{drag:r}=this.getProps();if(!o||!tc(t,r,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+o[t];this.constraints&&this.constraints[t]&&(a=nN(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,r=this.constraints;t&&fs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&o?this.constraints=oN(o.layoutBox,t):this.constraints=!1,this.elastic=aN(n),r!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&Bn(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=iN(o.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!fs(t))return!1;const o=t.current;Lo(o!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=Jj(o,r.root,this.visualElement.getTransformPagePoint());let a=rN(r.layout.layoutBox,i);if(n){const l=n(zj(a));this.hasMutatedConstraints=!!l,l&&(a=Nb(l))}return a}startAnimation(t){const{drag:n,dragMomentum:o,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Bn(d=>{if(!tc(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const p=r?200:1e6,m=r?40:1e7,y={type:"inertia",velocity:o?t[d]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const o=this.getAxisMotionValue(t);return Zd(this.visualElement,t),o.start(bf(t,o,0,n,this.visualElement,!1))}stopAnimation(){Bn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Bn(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()}`,o=this.visualElement.getProps(),r=o[n];return r||this.visualElement.getValue(t,(o.initial?o.initial[t]:void 0)||0)}snapToCursor(t){Bn(n=>{const{drag:o}=this.getProps();if(!tc(n,o,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(n);if(r&&r.layout){const{min:a,max:l}=r.layout.layoutBox[n];i.set(t[n]-kt(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!fs(n)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Bn(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();r[a]=sN({min:c,max:c},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),Bn(a=>{if(!tc(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(kt(c,u,r[a]))})}addListeners(){if(!this.visualElement.current)return;lN.set(this.visualElement,this);const t=this.visualElement.current,n=Hi(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),o=()=>{const{dragConstraints:c}=this.getProps();fs(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),wt.read(o);const a=zi(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Bn(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:o=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Of,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:o,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function tc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function uN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class dN extends Uo{constructor(t){super(t),this.removeGroupControls=Fn,this.removeListeners=Fn,this.controls=new cN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Fn}unmount(){this.removeGroupControls(),this.removeListeners()}}const iv=e=>(t,n)=>{e&&wt.postRender(()=>e(t,n))};class fN extends Uo{constructor(){super(...arguments),this.removePointerDownListener=Fn}onPointerDown(t){this.session=new Qb(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Zb(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:iv(t),onStart:iv(n),onMove:o,onEnd:(i,a)=>{delete this.session,r&&wt.postRender(()=>r(i,a))}}}mount(){this.removePointerDownListener=Hi(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 nc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function av(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Gi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ne.test(e))e=parseFloat(e);else return e;const n=av(e,t.target.x),o=av(e,t.target.y);return`${n}% ${o}%`}},pN={correct:(e,{treeScale:t,projectionDelta:n})=>{const o=e,r=zo.parse(e);if(r.length>5)return o;const i=zo.createTransformer(e),a=typeof r[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;r[0+a]/=l,r[1+a]/=c;const u=kt(l,c,.5);return typeof r[2+a]=="number"&&(r[2+a]/=u),typeof r[3+a]=="number"&&(r[3+a]/=u),i(r)}};class hN extends R.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:o,layoutId:r}=this.props,{projection:i}=t;II(mN),i&&(n.group&&n.group.add(i),o&&o.register&&r&&o.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),nc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:o,drag:r,isPresent:i}=this.props,a=o.projection;return a&&(a.isPresent=i,r||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(),Ad.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:o}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function lv(e){const[t,n]=Z0(),o=R.useContext(vd);return g.jsx(hN,{...e,layoutGroup:o,switchLayoutGroup:R.useContext(xy),isPresent:t,safeToRemove:n})}const mN={borderRadius:{...Gi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Gi,borderTopRightRadius:Gi,borderBottomLeftRadius:Gi,borderBottomRightRadius:Gi,boxShadow:pN};function gN(e,t,n){const o=Xt(e)?e:Ii(e);return o.start(bf("",o,t,n)),o.animation}function yN(e){return e instanceof SVGElement&&e.tagName!=="svg"}const bN=(e,t)=>e.depth-t.depth;class vN{constructor(){this.children=[],this.isDirty=!1}add(t){Sd(this.children,t),this.isDirty=!0}remove(t){Td(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(bN),this.isDirty=!1,this.children.forEach(t)}}function xN(e,t){const n=io.now(),o=({timestamp:r})=>{const i=r-n;i>=t&&(Vo(o),e(i-t))};return wt.read(o,!0),()=>Vo(o)}const cv=["TopLeft","TopRight","BottomLeft","BottomRight"],wN=cv.length,uv=e=>typeof e=="string"?parseFloat(e):e,dv=e=>typeof e=="number"||Ne.test(e);function CN(e,t,n,o,r,i){r?(e.opacity=kt(0,n.opacity??1,SN(o)),e.opacityExit=kt(t.opacity??1,0,TN(o))):i&&(e.opacity=kt(t.opacity??1,n.opacity??1,o));for(let a=0;a<wN;a++){const l=`border${cv[a]}Radius`;let c=fv(t,l),u=fv(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||dv(c)===dv(u)?(e[l]=Math.max(kt(uv(c),uv(u),o),0),(ao.test(u)||ao.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=kt(t.rotate||0,n.rotate||0,o))}function fv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const SN=pv(0,.5,qy),TN=pv(.5,.95,Fn);function pv(e,t,n){return o=>o<e?0:o>t?1:n(Pi(e,t,o))}function hv(e,t){e.min=t.min,e.max=t.max}function Ln(e,t){hv(e.x,t.x),hv(e.y,t.y)}function mv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function gv(e,t,n,o,r){return e-=t,e=ec(e,1/n,o),r!==void 0&&(e=ec(e,1/r,o)),e}function ON(e,t=0,n=1,o=.5,r,i=e,a=e){if(ao.test(t)&&(t=parseFloat(t),t=kt(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=kt(i.min,i.max,o);e===i&&(l-=t),e.min=gv(e.min,t,n,l,r),e.max=gv(e.max,t,n,l,r)}function yv(e,t,[n,o,r],i,a){ON(e,t[n],t[o],t[r],t.scale,i,a)}const EN=["x","scaleX","originX"],kN=["y","scaleY","originY"];function bv(e,t,n,o){yv(e.x,t,EN,n?n.x:void 0,o?o.x:void 0),yv(e.y,t,kN,n?n.y:void 0,o?o.y:void 0)}function vv(e){return e.translate===0&&e.scale===1}function xv(e){return vv(e.x)&&vv(e.y)}function wv(e,t){return e.min===t.min&&e.max===t.max}function PN(e,t){return wv(e.x,t.x)&&wv(e.y,t.y)}function Cv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Sv(e,t){return Cv(e.x,t.x)&&Cv(e.y,t.y)}function Tv(e){return rn(e.x)/rn(e.y)}function Ov(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class MN{constructor(){this.members=[]}add(t){Sd(this.members,t),t.scheduleRender()}remove(t){if(Td(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(r=>t===r);if(n===0)return!1;let o;for(let r=n;r>=0;r--){const i=this.members[r];if(i.isPresent!==!1){o=i;break}}return o?(this.promote(o),!0):!1}promote(t,n){const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,n&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;r===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:o}=t;n.onExitComplete&&n.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function RN(e,t,n){let o="";const r=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((r||i||a)&&(o=`translate3d(${r}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(o+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:p,skewX:m,skewY:y}=n;u&&(o=`perspective(${u}px) ${o}`),d&&(o+=`rotate(${d}deg) `),f&&(o+=`rotateX(${f}deg) `),p&&(o+=`rotateY(${p}deg) `),m&&(o+=`skewX(${m}deg) `),y&&(o+=`skewY(${y}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(o+=`scale(${l}, ${c})`),o||"none"}const Ef=["","X","Y","Z"],DN={visibility:"hidden"},Ev=1e3;let IN=0;function kf(e,t,n,o){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),o&&(o[e]=0))}function kv(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=By(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",wt,!(r||i))}const{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&kv(o)}function Pv({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(a={},l=t==null?void 0:t()){this.id=IN++,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(NN),this.nodes.forEach(LN),this.nodes.forEach(VN),this.nodes.forEach($N)},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 vN)}addEventListener(a,l){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new kd),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=yN(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=xN(p,250),nc.hasAnimatedSinceResize&&(nc.hasAnimatedSinceResize=!1,this.nodes.forEach(Rv))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const h=this.options.transition||d.getDefaultTransition()||qN,{onLayoutAnimationStart:b,onLayoutAnimationComplete:x}=d.getProps(),T=!this.targetLayout||!Sv(this.targetLayout,y),w=!p&&m;if(this.options.layoutRoot||this.resumeFrom||w||p&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const O={...Dd(h,"layout"),onPlay:b,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else p||Rv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}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,Vo(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(WN),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&&kv(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(Mv);return}this.isUpdating||this.nodes.forEach(FN),this.isUpdating=!1,this.nodes.forEach(BN),this.nodes.forEach(AN),this.nodes.forEach(jN),this.clearAllSnapshots();const l=io.now();qt.delta=Oo(0,1e3/60,l-qt.timestamp),qt.timestamp=l,qt.isProcessing=!0,jd.update.process(qt),jd.preRender.process(qt),jd.render.process(qt),qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ad.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(_N),this.sharedNodes.forEach(zN)}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&&!rn(this.snapshot.measuredBox.x)&&!rn(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=_t(),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=o(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(!r)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!xv(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;a&&(l||pr(this.latestValues)||d)&&(r(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)),YN(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return _t();const l=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(GN))){const{scroll:d}=this.root;d&&(bs(l.x,d.offset.x),bs(l.y,d.offset.y))}return l}removeElementScroll(a){var c;const l=_t();if(Ln(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&&Ln(l,a),bs(l.x,f.offset.x),bs(l.y,f.offset.y))}return l}applyTransform(a,l=!1){const c=_t();Ln(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&&vs(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),pr(d.latestValues)&&vs(c,d.latestValues)}return pr(this.latestValues)&&vs(c,this.latestValues),c}removeTransform(a){const l=_t();Ln(l,a);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!pr(u.latestValues))continue;wf(u.latestValues)&&u.updateSnapshot();const d=_t(),f=u.measurePageBox();Ln(d,f),bv(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return pr(this.latestValues)&&bv(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 m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_t(),this.relativeTargetOrigin=_t(),Yi(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Ln(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=_t(),this.targetWithTransforms=_t()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Xj(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ln(this.target,this.layout.layoutBox),qb(this.target,this.targetDelta)):Ln(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_t(),this.relativeTargetOrigin=_t(),Yi(this.relativeTargetOrigin,this.target,m.target),Ln(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||wf(this.parent.latestValues)||zb(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 y;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.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;Ln(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;Zj(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=_t());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(mv(this.prevProjectionDelta.x,this.projectionDelta.x),mv(this.prevProjectionDelta.y,this.projectionDelta.y)),qi(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!Ov(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ov(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}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=ys(),this.projectionDelta=ys(),this.projectionDeltaWithTransform=ys()}setAnimationOrigin(a,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=ys();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const p=_t(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,h=m!==y,b=this.getStack(),x=!b||b.members.length<=1,T=!!(h&&!x&&this.options.crossfade===!0&&!this.path.some(HN));this.animationProgress=0;let w;this.mixTargetDelta=O=>{const v=O/1e3;Dv(f.x,a.x,v),Dv(f.y,a.y,v),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yi(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),UN(this.relativeTarget,this.relativeTargetOrigin,p,v),w&&PN(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=_t()),Ln(w,this.relativeTarget)),h&&(this.animationValues=d,CN(d,u,this.latestValues,v,T,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=v},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&&(Vo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wt.update(()=>{nc.hasAnimatedSinceResize=!0,this.currentAnimation=gN(0,Ev,{...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(Ev),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&&$v(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||_t();const f=rn(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const p=rn(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+p}Ln(l,c),vs(l,d),qi(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new MN),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&&kf("z",a,u,this.animationValues);for(let d=0;d<Ef.length;d++)kf(`rotate${Ef[d]}`,a,u,this.animationValues),kf(`skew${Ef[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 DN;const l={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=Kl(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 m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=Kl(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!pr(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const d=u.animationValues||u.latestValues;this.applyTransformsToTarget(),l.transform=RN(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 m in ji){if(d[m]===void 0)continue;const{correct:y,applyTo:h,isCSSVariable:b}=ji[m],x=l.transform==="none"?d[m]:y(d[m],u);if(h){const T=h.length;for(let w=0;w<T;w++)l[h[w]]=x}else b?this.options.visualElement.renderState.vars[m]=x:l[m]=x}return this.options.layoutId&&(l.pointerEvents=u===this?Kl(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(Mv),this.root.sharedNodes.clear()}}}function AN(e){e.updateLayout()}function jN(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:o,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i==="size"?Bn(f=>{const p=a?t.measuredBox[f]:t.layoutBox[f],m=rn(p);p.min=o[f].min,p.max=p.min+m}):$v(i,t.layoutBox,o)&&Bn(f=>{const p=a?t.measuredBox[f]:t.layoutBox[f],m=rn(o[f]);p.max=p.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=ys();qi(l,o,t.layoutBox);const c=ys();a?qi(c,e.applyTransform(r,!0),t.measuredBox):qi(c,o,t.layoutBox);const u=!xv(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:m}=f;if(p&&m){const y=_t();Yi(y,t.layoutBox,p.layoutBox);const h=_t();Yi(h,o,m.layoutBox),Sv(y,h)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=h,e.relativeTargetOrigin=y,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:o}=e.options;o&&o()}e.options.transition=void 0}function NN(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 $N(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function _N(e){e.clearSnapshot()}function Mv(e){e.clearMeasurements()}function FN(e){e.isLayoutDirty=!1}function BN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Rv(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function LN(e){e.resolveTargetDelta()}function VN(e){e.calcProjection()}function WN(e){e.resetSkewAndRotation()}function zN(e){e.removeLeadSnapshot()}function Dv(e,t,n){e.translate=kt(t.translate,0,n),e.scale=kt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Iv(e,t,n,o){e.min=kt(t.min,n.min,o),e.max=kt(t.max,n.max,o)}function UN(e,t,n,o){Iv(e.x,t.x,n.x,o),Iv(e.y,t.y,n.y,o)}function HN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const qN={duration:.45,ease:[.4,0,.1,1]},Av=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),jv=Av("applewebkit/")&&!Av("chrome/")?Math.round:Fn;function Nv(e){e.min=jv(e.min),e.max=jv(e.max)}function YN(e){Nv(e.x),Nv(e.y)}function $v(e,t,n){return e==="position"||e==="preserve-aspect"&&!Kj(Tv(t),Tv(n),.2)}function GN(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const KN=Pv({attachResizeListener:(e,t)=>zi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Pf={current:void 0},_v=Pv({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Pf.current){const e=new KN({});e.mount(window),e.setOptions({layoutScroll:!0}),Pf.current=e}return Pf.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),XN={pan:{Feature:fN},drag:{Feature:dN,ProjectionNode:_v,MeasureLayout:lv}};function Fv(e,t,n){const{props:o}=e;e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=o[r];i&&wt.postRender(()=>i(t,Ui(t)))}class ZN extends Uo{mount(){const{current:t}=this.node;t&&(this.unmount=lI(t,(n,o)=>(Fv(this.node,o,"Start"),r=>Fv(this.node,r,"End"))))}unmount(){}}class JN extends Uo{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=Vi(zi(this.node.current,"focus",()=>this.onFocus()),zi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Bv(e,t,n){const{props:o}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&o.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=o[r];i&&wt.postRender(()=>i(t,Ui(t)))}class QN extends Uo{mount(){const{current:t}=this.node;t&&(this.unmount=fI(t,(n,o)=>(Bv(this.node,o,"Start"),(r,{success:i})=>Bv(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Mf=new WeakMap,Rf=new WeakMap,e6=e=>{const t=Mf.get(e.target);t&&t(e)},t6=e=>{e.forEach(e6)};function n6({root:e,...t}){const n=e||document;Rf.has(n)||Rf.set(n,{});const o=Rf.get(n),r=JSON.stringify(t);return o[r]||(o[r]=new IntersectionObserver(t6,{root:e,...t})),o[r]}function o6(e,t,n){const o=n6(t);return Mf.set(e,n),o.observe(e),()=>{Mf.delete(e),o.unobserve(e)}}const r6={some:0,all:1};class s6 extends Uo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:o,amount:r="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:o,threshold:typeof r=="number"?r:r6[r]},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 o6(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(i6(t,n))&&this.startObserver()}unmount(){}}function i6({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const a6={inView:{Feature:s6},tap:{Feature:QN},focus:{Feature:JN},hover:{Feature:ZN}},l6={layout:{ProjectionNode:_v,MeasureLayout:lv}},Df={current:null},Lv={current:!1};function c6(){if(Lv.current=!0,!!wd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Df.current=e.matches;e.addListener(t),t()}else Df.current=!1}const u6=[...pb,Zt,zo],d6=e=>u6.find(fb(e)),f6=new WeakMap;function p6(e,t,n){for(const o in t){const r=t[o],i=n[o];if(Xt(r))e.addValue(o,r),process.env.NODE_ENV==="development"&&Ll(r.version==="12.7.3",`Attempting to mix Motion versions ${r.version} with 12.7.3 may not work as expected.`);else if(Xt(i))e.addValue(o,Ii(r,{owner:e}));else if(i!==r)if(e.hasValue(o)){const a=e.getValue(o);a.liveStyle===!0?a.jump(r):a.hasAnimated||a.set(r)}else{const a=e.getStaticValue(o);e.addValue(o,Ii(a!==void 0?a:r,{owner:e}))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const Vv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class h6{scrapeMotionValuesFromProps(t,n,o){return{}}constructor({parent:t,props:n,presenceContext:o,reducedMotionConfig:r,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=df,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 m=io.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,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=o,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=Yl(n),this.isVariantNode=yy(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in p){const y=p[m];c[m]!==void 0&&Xt(y)&&y.set(c[m],!1)}}mount(t){this.current=t,f6.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,o)=>this.bindToMotionValue(o,n)),Lv.current||c6(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Df.current,process.env.NODE_ENV!=="production"&&Ll(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(),Vo(this.notifyUpdate),Vo(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 o=lr.has(t);o&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&wt.preRender(this.notifyUpdate),o&&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,()=>{r(),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 ds){const n=ds[t];if(!n)continue;const{isEnabled:o,Feature:r}=n;if(!this.features[t]&&r&&o(this.props)&&(this.features[t]=new r(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):_t()}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 o=0;o<Vv.length;o++){const r=Vv[o];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const i="on"+r,a=t[i];a&&(this.propEventSubscriptions[r]=this.on(r,a))}this.prevMotionValues=p6(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 o=this.values.get(t);n!==o&&(o&&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 o=this.values.get(t);return o===void 0&&n!==void 0&&(o=Ii(n===null?void 0:n,{owner:this}),this.addValue(t,o)),o}readValue(t,n){let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(ub(o)||Gy(o))?o=parseFloat(o):!d6(o)&&zo.test(n)&&(o=nb(t,n)),this.setBaseTarget(t,Xt(o)?o.get():o)),Xt(o)?o.get():o}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let o;if(typeof n=="string"||typeof n=="object"){const a=Gd(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(o=a[t])}if(n&&o!==void 0)return o;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!Xt(r)?r:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kd),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Wv extends h6{constructor(){super(...arguments),this.KeyframeResolver=mb}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:o}){delete n[t],delete o[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 m6(e){return window.getComputedStyle(e)}class g6 extends Wv{constructor(){super(...arguments),this.type="html",this.renderInstance=Ay}readValueFromInstance(t,n){if(lr.has(n))return MA(t,n);{const o=m6(t),r=(Ld(n)?o.getPropertyValue(n):o[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Xb(t,n)}build(t,n,o){zd(t,n,o.transformTemplate)}scrapeMotionValuesFromProps(t,n,o){return Xd(t,n,o)}}class y6 extends Wv{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_t,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Iy(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(lr.has(n)){const o=tb(n);return o&&o.default||0}return n=jy.has(n)?n:Bd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,o){return $y(t,n,o)}onBindTransform(){this.current&&!this.renderState.dimensions&&wt.postRender(this.updateDimensions)}build(t,n,o){qd(t,n,this.isSVGTag,o.transformTemplate)}renderInstance(t,n,o,r){Ny(t,n,o,r)}mount(t){this.isSVGTag=Yd(t.tagName),super.mount(t)}}const b6=(e,t)=>Hd(e)?new y6(t):new g6(t,{allowProjection:e!==R.Fragment}),v6=nA({...Vj,...a6,...XN,...l6},b6),Ki=vI(v6),x6=({showOptions:e,setShowOptions:t,buttonRef:n,options:o,onClick:r})=>{const i=R.useRef(null);return R.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]),g.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})=>g.jsx(jo,{...a,timeout:100,children:g.jsx(ge,{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:g.jsx(ge,{children:o==null?void 0:o.map((l,c)=>g.jsx(_o,{sx:{opacity:1,pointerEvents:"auto",padding:"0rem",borderTop:c!==0?u=>`0.1rem solid ${u.palette.primary.notifyBorderColor}`:"none"},onClick:u=>{u.stopPropagation(),r(l)},children:g.jsx(dt,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{p:"0.5rem"},children:g.jsx(dt,{direction:"row",alignItems:"center",gap:"1rem",children:g.jsx(et,{component:"h3",sx:{color:u=>u.palette.primary.notifyActiveText,fontWeight:"300",fontSize:"1.1rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l.label})})})},c))})})})})},zv=({styles:e,label:t,disabled:n,onClick:o,...r})=>{var y,h;const i=Nt();let a=(t==null?void 0:t.length)*((t==null?void 0:t.length)>=10?6.5:7.5)+38||0;a=r!=null&&r.options?a+15:a;const[l,c]=R.useState(!1),u=R.useRef(null),[d,f]=R.useState(!1),[p,m]=R.useState(e==null?void 0:e.isAnimate);return g.jsxs(Ki.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:(y=e==null?void 0:e.hover)==null?void 0:y.backgroundColor,color:(h=e==null?void 0:e.hover)==null?void 0:h.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",cursor:"pointer",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:()=>{!(r!=null&&r.options)&&o(),r!=null&&r.options&&(f(b=>!b),m(d))},...r,children:[(e==null?void 0:e.icon)&&(!(e!=null&&e.iconPosition)||(e==null?void 0:e.iconPosition)==="start")&&g.jsx(ge,{component:"img",src:e==null?void 0:e.icon}),t&&g.jsxs(Ki.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:[g.jsx(et,{sx:{fontSize:"1.1rem"},children:t}),(r==null?void 0:r.options)&&(d?g.jsx(ge,{component:"img",src:nt.ArrowUpLight}):g.jsx(ge,{component:"img",src:nt.ArrowDownLight}))]}),(e==null?void 0:e.iconPosition)==="end"&&g.jsx(ge,{component:"img",src:e==null?void 0:e.icon}),g.jsx(x6,{showOptions:d,buttonRef:u==null?void 0:u.current,setShowOptions:f,options:r==null?void 0:r.options,onClick:o})]})};zv.propTypes={styles:s.object.isRequired,label:s.string};function hr({...e}){return g.jsx(_n,{children:g.jsx(zv,{...e})})}function oc({...e}){return g.jsx(_n,{children:g.jsx(Lg,{id:e==null?void 0:e.id,icon:g.jsx(ge,{component:"img",src:nt.Uncheck}),checkedIcon:g.jsx(ge,{component:"img",src:nt.Check}),...e})})}const Uv=new Set;function w6(e,t="warning"){if(process.env.NODE_ENV==="production")return;const n=Array.isArray(e)?e.join(`
|
|
303
303
|
`):e;Uv.has(n)||(Uv.add(n),t==="error"?console.error(n):console.warn(n))}function C6(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(o=>n.searchParams.append("args[]",o)),`Minified MUI error #${e}; visit ${n} for the full message.`}const Eo=s.oneOfType([s.func,s.object]);function S6(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":C6(7));return e.charAt(0).toUpperCase()+e.slice(1)}function If(e){return e&&e.ownerDocument||document}const lo=typeof window<"u"?C.useLayoutEffect:C.useEffect;let Hv=0;function T6(e){const[t,n]=C.useState(e),o=e||t;return C.useEffect(()=>{t==null&&(Hv+=1,n(`mui-${Hv}`))},[t]),o}const qv={...C}.useId;function rc(e){if(qv!==void 0){const t=qv();return e??t}return T6(e)}function xs({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=C.useRef(e!==void 0),[i,a]=C.useState(t),l=r?e:i;if(process.env.NODE_ENV!=="production"){C.useEffect(()=>{r!==(e!==void 0)&&console.error([`MUI: A component is changing the ${r?"":"un"}controlled ${o} state of ${n} to be ${r?"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
|
`))},[o,n,e]);const{current:u}=C.useRef(t);C.useEffect(()=>{!r&&!Object.is(u,t)&&console.error([`MUI: A component is changing the default ${o} 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=>{r||a(u)},[]);return[l,c]}function Ce(e){const t=C.useRef(e);return lo(()=>{t.current=e}),C.useRef((...n)=>(0,t.current)(...n)).current}function hn(...e){const t=C.useRef(void 0),n=C.useCallback(o=>{const r=e.map(i=>{if(i==null)return null;if(typeof i=="function"){const a=i,l=a(o);return typeof l=="function"?l:()=>{a(null)}}return i.current=o,()=>{i.current=null}});return()=>{r.forEach(i=>i==null?void 0:i())}},e);return C.useMemo(()=>e.every(o=>o==null)?null:o=>{t.current&&(t.current(),t.current=void 0),o!=null&&(t.current=n(o))},e)}const Yv={};function O6(e,t){const n=C.useRef(Yv);return n.current===Yv&&(n.current=e(t)),n}const E6=[];function k6(e){C.useEffect(e,E6)}class Af{constructor(){Fc(this,"currentId",null);Fc(this,"clear",()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});Fc(this,"disposeEffect",()=>this.clear)}static create(){return new Af}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function ws(){const e=O6(Af.create).current;return k6(e.disposeEffect),e}const P6={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function It(e,t,n=void 0){const o={};for(const r in e){const i=e[r];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]))}o[r]=a}return o}const Gv=e=>e,M6=(()=>{let e=Gv;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Gv}}})(),R6={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 o=R6[t];return o?`${n}-${o}`:`${M6.generate(e)}-${t}`}function Vt(e,t,n="Mui"){const o={};return t.forEach(r=>{o[r]=Lt(e,r,n)}),o}function D6(e){return typeof e=="string"}function I6(e,t,n){return e===void 0||D6(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function A6(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(o=>o.match(/^on[A-Z]/)&&typeof e[o]=="function"&&!t.includes(o)).forEach(o=>{n[o]=e[o]}),n}function Kv(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 j6(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:o,externalForwardedProps:r,className:i}=e;if(!t){const m=le(n==null?void 0:n.className,i,r==null?void 0:r.className,o==null?void 0:o.className),y={...n==null?void 0:n.style,...r==null?void 0:r.style,...o==null?void 0:o.style},h={...n,...r,...o};return m.length>0&&(h.className=m),Object.keys(y).length>0&&(h.style=y),{props:h,internalRef:void 0}}const a=A6({...r,...o}),l=Kv(o),c=Kv(r),u=t(a),d=le(u==null?void 0:u.className,n==null?void 0:n.className,i,r==null?void 0:r.className,o==null?void 0:o.className),f={...u==null?void 0:u.style,...n==null?void 0:n.style,...r==null?void 0:r.style,...o==null?void 0:o.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 Xi(e,t,n){return typeof e=="function"?e(t,n):e}function ut(e){var f;const{elementType:t,externalSlotProps:n,ownerState:o,skipResolvingSlotProps:r=!1,...i}=e,a=r?{}:Xi(n,o),{props:l,internalRef:c}=j6({...i,externalSlotProps:a}),u=hn(c,a==null?void 0:a.ref,(f=e.additionalProps)==null?void 0:f.ref);return I6(t,{...l,ref:u},o)}const Zi=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),N6=({openTo:e,defaultOpenTo:t,views:n,defaultViews:o})=>{const r=n??o;let i;if(e!=null)i=e;else if(r.includes(t))i=t;else if(r.length>0)i=r[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:r,openTo:i}},sc=(e,t,n)=>{let o=t;return o=e.setHours(o,e.getHours(n)),o=e.setMinutes(o,e.getMinutes(n)),o=e.setSeconds(o,e.getSeconds(n)),o=e.setMilliseconds(o,e.getMilliseconds(n)),o},Ji=({date:e,disableFuture:t,disablePast:n,maxDate:o,minDate:r,isDateDisabled:i,utils:a,timezone:l})=>{const c=sc(a,a.date(void 0,l),e);n&&a.isBefore(r,c)&&(r=c),t&&a.isAfter(o,c)&&(o=c);let u=e,d=e;for(a.isBefore(e,r)&&(u=r,d=null),a.isAfter(e,o)&&(d&&(d=o),u=null);u||d;){if(u&&a.isAfter(u,o)&&(u=null),d&&a.isBefore(d,r)&&(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},$6=(e,t)=>e.isValid(t)?t:null,Xv=(e,t,n)=>t==null||!e.isValid(t)?n:t,_6=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),jf=(e,t)=>{const o=[e.startOfYear(t)];for(;o.length<12;){const r=o[o.length-1];o.push(e.addMonths(r,1))}return o},Zv=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),F6=["year","month","day"],Jv=e=>F6.includes(e),Nf=(e,{format:t,views:n},o)=>{if(t!=null)return t;const r=e.formats;return Zi(n,["year"])?r.year:Zi(n,["month"])?r.month:Zi(n,["day"])?r.dayOfMonth:Zi(n,["month","year"])?`${r.month} ${r.year}`:Zi(n,["day","month"])?`${r.month} ${r.dayOfMonth}`:o?/en/.test(e.getCurrentLocaleCode())?r.normalDateWithWeekday:r.normalDate:r.keyboardDate},B6=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(o=>e.addDays(n,o))},L6=["hours","minutes","seconds"],V6=e=>L6.includes(e),Qv=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),W6=(e,t)=>(n,o)=>e?t.isAfter(n,o):Qv(n,t)>Qv(o,t),co={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},z6=e=>Math.max(...e.map(t=>co[t.type]??1)),Qi=(e,t,n)=>{if(t===co.year)return e.startOfYear(n);if(t===co.month)return e.startOfMonth(n);if(t===co.day)return e.startOfDay(n);let o=n;return t<co.minutes&&(o=e.setMinutes(o,0)),t<co.seconds&&(o=e.setSeconds(o,0)),t<co.milliseconds&&(o=e.setMilliseconds(o,0)),o},U6=({props:e,utils:t,granularity:n,timezone:o,getTodayDate:r})=>{let i=r?r():Qi(t,n,Zv(t,o));e.minDate!=null&&t.isAfterDay(e.minDate,i)&&(i=Qi(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,i)&&(i=Qi(t,n,e.maxDate));const a=W6(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&a(e.minTime,i)&&(i=Qi(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:sc(t,i,e.minTime))),e.maxTime!=null&&a(i,e.maxTime)&&(i=Qi(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:sc(t,i,e.maxTime))),i},$f=(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 o=new this(t);return n.forEach(r=>o.set(r)),o}static accessor(t){const o=(this[P1]=this[P1]={accessors:{}}).accessors,r=this.prototype;function i(a){const l=Ca(a);o[l]||(D8(r,a),o[l]=!0)}return ee.isArray(t)?t.forEach(i):i(t),this}};mn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ee.reduceDescriptors(mn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}}),ee.freezeMethods(mn);function wp(e,t){const n=this||wa,o=t||n,r=mn.from(o.headers);let i=o.data;return ee.forEach(e,function(l){i=l.call(n,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function M1(e){return!!(e&&e.__CANCEL__)}function Is(e,t,n){ze.call(this,e??"canceled",ze.ERR_CANCELED,t,n),this.name="CanceledError"}ee.inherits(Is,ze,{__CANCEL__:!0});function R1(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new ze("Request failed with status code "+n.status,[ze.ERR_BAD_REQUEST,ze.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function I8(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function A8(e,t){e=e||10;const n=new Array(e),o=new Array(e);let r=0,i=0,a;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=o[i];a||(a=u),n[r]=c,o[r]=u;let f=i,p=0;for(;f!==r;)p+=n[f++],f=f%e;if(r=(r+1)%e,r===i&&(i=(i+1)%e),u-a<t)return;const m=d&&u-d;return m?Math.round(p*1e3/m):void 0}}function j8(e,t){let n=0,o=1e3/t,r,i;const a=(u,d=Date.now())=>{n=d,r=null,i&&(clearTimeout(i),i=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-n;f>=o?a(u,d):(r=u,i||(i=setTimeout(()=>{i=null,a(r)},o-f)))},()=>r&&a(r)]}const Pc=(e,t,n=3)=>{let o=0;const r=A8(50,250);return j8(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,c=a-o,u=r(c),d=a<=l;o=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)},D1=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},I1=e=>(...t)=>ee.asap(()=>e(...t)),N8=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,$8=en.hasStandardBrowserEnv?{write(e,t,n,o,r,i){const a=[e+"="+encodeURIComponent(t)];ee.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),ee.isString(o)&&a.push("path="+o),ee.isString(r)&&a.push("domain="+r),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 _8(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function F8(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function A1(e,t,n){let o=!_8(t);return e&&(o||n==!1)?F8(e,t):t}const j1=e=>e instanceof mn?{...e}:e;function Cr(e,t){t=t||{};const n={};function o(u,d,f,p){return ee.isPlainObject(u)&&ee.isPlainObject(d)?ee.merge.call({caseless:p},u,d):ee.isPlainObject(d)?ee.merge({},d):ee.isArray(d)?d.slice():d}function r(u,d,f,p){if(ee.isUndefined(d)){if(!ee.isUndefined(u))return o(void 0,u,f,p)}else return o(u,d,f,p)}function i(u,d){if(!ee.isUndefined(d))return o(void 0,d)}function a(u,d){if(ee.isUndefined(d)){if(!ee.isUndefined(u))return o(void 0,u)}else return o(void 0,d)}function l(u,d,f){if(f in t)return o(u,d);if(f in e)return o(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)=>r(j1(u),j1(d),f,!0)};return ee.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=c[d]||r,p=f(e[d],t[d],d);ee.isUndefined(p)&&f!==l||(n[d]=p)}),n}const N1=e=>{const t=Cr({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:i,headers:a,auth:l}=t;t.headers=a=mn.from(a),t.url=T1(A1(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(ee.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&&(o&&ee.isFunction(o)&&(o=o(t)),o||o!==!1&&N8(t.url))){const u=r&&i&&$8.read(i);u&&a.set(r,u)}return t},B8=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,o){const r=N1(e);let i=r.data;const a=mn.from(r.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=r,d,f,p,m,y;function h(){m&&m(),y&&y(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let b=new XMLHttpRequest;b.open(r.method.toUpperCase(),r.url,!0),b.timeout=r.timeout;function x(){if(!b)return;const w=mn.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),v={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:w,config:e,request:b};R1(function(k){n(k),h()},function(k){o(k),h()},v),b=null}"onloadend"in b?b.onloadend=x:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(x)},b.onabort=function(){b&&(o(new ze("Request aborted",ze.ECONNABORTED,e,b)),b=null)},b.onerror=function(){o(new ze("Network Error",ze.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let O=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const v=r.transitional||E1;r.timeoutErrorMessage&&(O=r.timeoutErrorMessage),o(new ze(O,v.clarifyTimeoutError?ze.ETIMEDOUT:ze.ECONNABORTED,e,b)),b=null},i===void 0&&a.setContentType(null),"setRequestHeader"in b&&ee.forEach(a.toJSON(),function(O,v){b.setRequestHeader(v,O)}),ee.isUndefined(r.withCredentials)||(b.withCredentials=!!r.withCredentials),l&&l!=="json"&&(b.responseType=r.responseType),u&&([p,y]=Pc(u,!0),b.addEventListener("progress",p)),c&&b.upload&&([f,m]=Pc(c),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",m)),(r.cancelToken||r.signal)&&(d=w=>{b&&(o(!w||w.type?new Is(null,e,b):w),b.abort(),b=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const T=I8(r.url);if(T&&en.protocols.indexOf(T)===-1){o(new ze("Unsupported protocol "+T+":",ze.ERR_BAD_REQUEST,e));return}b.send(i||null)})},L8=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let o=new AbortController,r;const i=function(u){if(!r){r=!0,l();const d=u instanceof Error?u:this.reason;o.abort(d instanceof ze?d:new Is(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,i(new ze(`timeout ${t} of ms exceeded`,ze.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}=o;return c.unsubscribe=()=>ee.asap(l),c}},V8=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let o=0,r;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},W8=async function*(e,t){for await(const n of z8(e))yield*V8(n,t)},z8=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:o}=await t.read();if(n)break;yield o}}finally{await t.cancel()}},$1=(e,t,n,o)=>{const r=W8(e,t);let i=0,a,l=c=>{a||(a=!0,o&&o(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await r.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),r.return()}},{highWaterMark:2})},Mc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",_1=Mc&&typeof ReadableStream=="function",U8=Mc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),F1=(e,...t)=>{try{return!!e(...t)}catch{return!1}},H8=_1&&F1(()=>{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}),B1=64*1024,Cp=_1&&F1(()=>ee.isReadableStream(new Response("").body)),Rc={stream:Cp&&(e=>e.body)};Mc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Rc[t]&&(Rc[t]=ee.isFunction(e[t])?n=>n[t]():(n,o)=>{throw new ze(`Response type '${t}' is not supported`,ze.ERR_NOT_SUPPORT,o)})})})(new Response);const q8=async e=>{if(e==null)return 0;if(ee.isBlob(e))return e.size;if(ee.isSpecCompliantForm(e))return(await new Request(en.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(ee.isArrayBufferView(e)||ee.isArrayBuffer(e))return e.byteLength;if(ee.isURLSearchParams(e)&&(e=e+""),ee.isString(e))return(await U8(e)).byteLength},Y8=async(e,t)=>{const n=ee.toFiniteNumber(e.getContentLength());return n??q8(t)},Sp={http:h8,xhr:B8,fetch:Mc&&(async e=>{let{url:t,method:n,data:o,signal:r,cancelToken:i,timeout:a,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:p}=N1(e);u=u?(u+"").toLowerCase():"text";let m=L8([r,i&&i.toAbortSignal()],a),y;const h=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let b;try{if(c&&H8&&n!=="get"&&n!=="head"&&(b=await Y8(d,o))!==0){let v=new Request(t,{method:"POST",body:o,duplex:"half"}),E;if(ee.isFormData(o)&&(E=v.headers.get("content-type"))&&d.setContentType(E),v.body){const[k,M]=D1(b,Pc(I1(c)));o=$1(v.body,B1,k,M)}}ee.isString(f)||(f=f?"include":"omit");const x="credentials"in Request.prototype;y=new Request(t,{...p,signal:m,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:o,duplex:"half",credentials:x?f:void 0});let T=await fetch(y);const w=Cp&&(u==="stream"||u==="response");if(Cp&&(l||w&&h)){const v={};["status","statusText","headers"].forEach(I=>{v[I]=T[I]});const E=ee.toFiniteNumber(T.headers.get("content-length")),[k,M]=l&&D1(E,Pc(I1(l),!0))||[];T=new Response($1(T.body,B1,k,()=>{M&&M(),h&&h()}),v)}u=u||"text";let O=await Rc[ee.findKey(Rc,u)||"text"](T,e);return!w&&h&&h(),await new Promise((v,E)=>{R1(v,E,{data:O,headers:mn.from(T.headers),status:T.status,statusText:T.statusText,config:e,request:y})})}catch(x){throw h&&h(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new ze("Network Error",ze.ERR_NETWORK,e,y),{cause:x.cause||x}):ze.from(x,x&&x.code,e,y)}})};ee.forEach(Sp,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const L1=e=>`- ${e}`,G8=e=>ee.isFunction(e)||e===null||e===!1,V1={getAdapter:e=>{e=ee.isArray(e)?e:[e];const{length:t}=e;let n,o;const r={};for(let i=0;i<t;i++){n=e[i];let a;if(o=n,!G8(n)&&(o=Sp[(a=String(n)).toLowerCase()],o===void 0))throw new ze(`Unknown adapter '${a}'`);if(o)break;r[a||"#"+i]=o}if(!o){const i=Object.entries(r).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(L1).join(`
|
|
325
325
|
`):" "+L1(i[0]):"as no adapter specified";throw new ze("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o},adapters:Sp};function Tp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Is(null,e)}function W1(e){return Tp(e),e.headers=mn.from(e.headers),e.data=wp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),V1.getAdapter(e.adapter||wa.adapter)(e).then(function(o){return Tp(e),o.data=wp.call(e,e.transformResponse,o),o.headers=mn.from(o.headers),o},function(o){return M1(o)||(Tp(e),o&&o.response&&(o.response.data=wp.call(e,e.transformResponse,o.response),o.response.headers=mn.from(o.response.headers))),Promise.reject(o)})}const z1="1.8.4",Dc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Dc[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const U1={};Dc.transitional=function(t,n,o){function r(i,a){return"[Axios v"+z1+"] Transitional option '"+i+"'"+a+(o?". "+o:"")}return(i,a,l)=>{if(t===!1)throw new ze(r(a," has been removed"+(n?" in "+n:"")),ze.ERR_DEPRECATED);return n&&!U1[a]&&(U1[a]=!0,console.warn(r(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,l):!0}},Dc.spelling=function(t){return(n,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function K8(e,t,n){if(typeof e!="object")throw new ze("options must be an object",ze.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let r=o.length;for(;r-- >0;){const i=o[r],a=t[i];if(a){const l=e[i],c=l===void 0||a(l,i,e);if(c!==!0)throw new ze("option "+i+" must be "+c,ze.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ze("Unknown option "+i,ze.ERR_BAD_OPTION)}}const Ic={assertOptions:K8,validators:Dc},mo=Ic.validators;let Sr=class{constructor(t){this.defaults=t,this.interceptors={request:new O1,response:new O1}}async request(t,n){try{return await this._request(t,n)}catch(o){if(o instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{o.stack?i&&!String(o.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(o.stack+=`
|
|
326
|
-
`+i):o.stack=i}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Cr(this.defaults,n);const{transitional:o,paramsSerializer:r,headers:i}=n;o!==void 0&&Ic.assertOptions(o,{silentJSONParsing:mo.transitional(mo.boolean),forcedJSONParsing:mo.transitional(mo.boolean),clarifyTimeoutError:mo.transitional(mo.boolean)},!1),r!=null&&(ee.isFunction(r)?n.paramsSerializer={serialize:r}:Ic.assertOptions(r,{encode:mo.function,serialize:mo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Ic.assertOptions(n,{baseUrl:mo.spelling("baseURL"),withXsrfToken:mo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&ee.merge(i.common,i[n.method]);i&&ee.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=mn.concat(a,i);const l=[];let c=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(c=c&&h.synchronous,l.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let d,f=0,p;if(!c){const y=[W1.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,u),p=y.length,d=Promise.resolve(n);f<p;)d=d.then(y[f++],y[f++]);return d}p=l.length;let m=n;for(f=0;f<p;){const y=l[f++],h=l[f++];try{m=y(m)}catch(b){h.call(this,b);break}}try{d=W1.call(this,m)}catch(y){return Promise.reject(y)}for(f=0,p=u.length;f<p;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=Cr(this.defaults,t);const n=A1(t.baseURL,t.url,t.allowAbsoluteUrls);return T1(n,t.params,t.paramsSerializer)}};ee.forEach(["delete","get","head","options"],function(t){Sr.prototype[t]=function(n,o){return this.request(Cr(o||{},{method:t,url:n,data:(o||{}).data}))}}),ee.forEach(["post","put","patch"],function(t){function n(o){return function(i,a,l){return this.request(Cr(l||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Sr.prototype[t]=n(),Sr.prototype[t+"Form"]=n(!0)});let X8=class Ow{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 o=this;this.promise.then(r=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](r);o._listeners=null}),this.promise.then=r=>{let i;const a=new Promise(l=>{o.subscribe(l),i=l}).then(r);return a.cancel=function(){o.unsubscribe(i)},a},t(function(i,a,l){o.reason||(o.reason=new Is(i,a,l),n(o.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=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ow(function(r){t=r}),cancel:t}}};function Z8(e){return function(n){return e.apply(null,n)}}function J8(e){return ee.isObject(e)&&e.isAxiosError===!0}const Op={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(Op).forEach(([e,t])=>{Op[t]=e});function H1(e){const t=new Sr(e),n=u1(Sr.prototype.request,t);return ee.extend(n,Sr.prototype,t,{allOwnKeys:!0}),ee.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return H1(Cr(e,r))},n}const St=H1(wa);St.Axios=Sr,St.CanceledError=Is,St.CancelToken=X8,St.isCancel=M1,St.VERSION=z1,St.toFormData=Ec,St.AxiosError=ze,St.Cancel=St.CanceledError,St.all=function(t){return Promise.all(t)},St.spread=Z8,St.isAxiosError=J8,St.mergeConfig=Cr,St.AxiosHeaders=mn,St.formToJSON=e=>k1(ee.isHTMLForm(e)?new FormData(e):e),St.getAdapter=V1.getAdapter,St.HttpStatusCode=Op,St.default=St;const{Axios:jW,AxiosError:NW,CanceledError:$W,isCancel:_W,CancelToken:FW,VERSION:BW,all:LW,Cancel:VW,isAxiosError:WW,spread:zW,toFormData:UW,AxiosHeaders:HW,HttpStatusCode:qW,formToJSON:YW,getAdapter:GW,mergeConfig:KW}=St,Ep={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"};/*! js-cookie v3.0.5 | MIT */function Ac(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var Q8={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 kp(e,t){function n(r,i,a){if(!(typeof document>"u")){a=Ac({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),r=encodeURIComponent(r).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=r+"="+e.write(i,r)+l}}function o(r){if(!(typeof document>"u"||arguments.length&&!r)){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),r===d)break}catch{}}return r?a[r]:a}}return Object.create({set:n,get:o,remove:function(r,i){n(r,"",Ac({},i,{expires:-1}))},withAttributes:function(r){return kp(this.converter,Ac({},this.attributes,r))},withConverter:function(r){return kp(Ac({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var e7=kp(Q8,{path:"/"});const Go={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},Pp={BEARER:"Bearer",TENANT_ID:"tenant_id",BU_ID:"bu_id",SNOP_ID:"snop_id"},t7=[10,25,50,100],q1={MARK_ALL_READ:"MARK_ALL_READ"},n7=t7.map(e=>({label:e,value:e})),Y1={PRIMARY:"PRIMARY",SECONDARY:"SECONDARY"},Mp=vc(Go.SNOP),Rp=vc(Go.SELECTED_BU),Dp=vc(Go.USER),o7=vc(Go.SETTINGS),Tr={BU_IDS:Rp==null?void 0:Rp.business_unit_id,TOKEN:JSON.parse(e7.get(Go.TOKEN)||null),TENANT_IDS:Dp==null?void 0:Dp.tenant_id,SNOP_IDS:Mp==null?void 0:Mp.snop_id,GRID_SETTINGS:o7},Sa={headers:{"Content-Type":"application/json",Authorization:`${Pp.BEARER} ${Tr.TOKEN}`}},G1=St.create({baseURL:Ep.BASE_URL,axiosConfig:Sa});G1.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),G1.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const jc={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"},{TENANT_ID:r7,BU_ID:s7}=Pp,{TENANT_IDS:i7,BU_IDS:a7}=Tr,Nc=async({baseUrl:e,payload:t})=>{try{const n=`${e}${jc.SETTING}/v1?${r7}=${i7}&${s7}=${a7}`;return await St.post(n,t,Sa)}catch(n){return n}},l7=({columns:e,gridPath:t,baseUrl:n,isDefaultConfig:o,pageSize:r})=>{var y;let{definitions:i,defaultUserSettings:a,labels:l}=e;const c=t.split("/").filter(Boolean);let u=c.reduce((h,b)=>h==null?void 0:h[b],Tr.GRID_SETTINGS)||null;o||!u&&!a&&(async()=>{try{a=K1({definitions:i});let h=Tr.GRID_SETTINGS||{platform:{theme:"light"}};const b=(u==null?void 0:u.pageSize)??r;let x=h;for(let T=0;T<c.length;T++){const w=c[T];T===c.length-1?x[w]={columns:a,pageSize:b}:(x[w]=x[w]||{},x=x[w])}localStorage.setItem(Go.SETTINGS,JSON.stringify(h)),await Nc({baseUrl:n,payload:h})}catch(h){console.error(h)}})(),a=(u==null?void 0:u.columns)??a??K1({definitions:i});const d=a.reduce((h,b)=>(h[b.id]=b,h),{}),f=l.reduce((h,b)=>(h[b.id]=b,h),{}),p=[];for(const h of i){const b=d[h.id]||{},x=f[h.id]||{};let T={...h,...b,...x};if((y=h.children)!=null&&y.length){const w=b.children||[],O=x.children||[];T.children=h.children.map((v,E)=>({...v,...w[E],...O[E]}))}p.push(T)}return p.sort((h,b)=>h.sequenceId-b.sequenceId)},c7=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),K1=({definitions:e})=>e.map((t,n)=>({id:t.id,key:t.key,sequenceId:t.id,isHidden:!1,style:t.style||{}})),u7=()=>({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 Ip extends R.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=R.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,o=this.startPos-this.mouseX;let r=this.startWidthPrev-o;(!this.props.minWidth||r>=this.props.minWidth)&&(!this.props.maxWidth||r<=this.props.maxWidth)&&(n.previousSibling.style.width=r+"px",n.previousSibling.style.minWidth=r+"px",n.previousSibling.style.maxWidth=r+"px",n.previousSibling.style.setProperty("--column_resize_before_width",r+"px"),this.lastDraggedWidth=r)}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)"),R.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})}}Ip.defaultProps={disabled:!1,minWidth:0,className:""},Ip.propTypes={disabled:"boolean",minWidth:"number",className:"string"};const d7=(e,t,n,o)=>{const[r,i]=R.useState({isOpen:!1,column:null}),a=(u,d)=>{i({isOpen:u.currentTarget,column:d})},l=()=>{i({isOpen:!1,column:null})};return{selectedColumn:r,handleMenuClick:a,handleClose:l,handleHideClick:async()=>{l();const u=e.map(f=>{var p;return f.id===((p=r==null?void 0:r.column)==null?void 0:p.id)?{...f,isHidden:!0}:f});t({type:He.SET_GRID_DATA,payload:{visibleGridColumns:u}});let d=Tr.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};d.grid=d.grid||{},d.grid[o]=u,localStorage.setItem(Go.SETTINGS,JSON.stringify(d)),await Nc({baseUrl:n,payload:d})}}},X1=({pagination:e})=>{const{selectedPage:t,rowPerPage:n,totalRecords:o,onPageChange:r,onPageSizeChange:i}=e,a=Nt();return g.jsxs(ge,{sx:{display:"flex",p:"1rem 2rem"},children:[g.jsxs(ge,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"0.5rem",width:"100%"},children:[g.jsx(et,{sx:{fontSize:"1.1rem",color:a.palette.primary.notifyTextColor},children:`Showing ${(t-1)*n+1} to ${Math.min(t*n,o)} of ${o} rows`}),g.jsx(ge,{sx:{"& .MuiInputBase-input":{padding:"0rem 0.8rem!important"},width:"6rem"},children:g.jsx(wc,{options:n7,value:n,onChange:i})}),g.jsx(et,{sx:{fontSize:"1.1rem",color:a.palette.primary.notifyTextColor},children:"records per page"})]}),g.jsx(x0,{count:Math.ceil(o/n),page:t,onChange:(l,c)=>{r(c)},shape:"rounded",sx:{width:"100%","& .MuiPagination-ul":{width:"100%",display:"flex",justifyContent:"flex-end","& li:first-of-type":{border:`0.1rem solid ${a.palette.primary.notifyBorderColor}`,color:a.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 ${a.palette.primary.notifyBorderColor}`,color:a.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:a.palette.primary.notifyActiveText,backgroundColor:`${a.palette.brandColor.paginationBc} !important`}}})]})};X1.propTypes={pagination:s.object.isRequired};function Ap({isRenderCellContent:e,column:t,row:n,parent:o}){const r=n[t.key];return g.jsx(g.Fragment,{children:e?g.jsx(ge,{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:o})}):g.jsx(M0,{title:(r==null?void 0:r.length)>20?r:"",arrow:!0,children:g.jsx(ge,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},component:"label",children:cV(r)})})})}Ap.propTypes={isRenderCellContent:s.bool,column:s.object,row:s.object};const Z1=({menuOpen:e,handleClose:t,onHideClick:n})=>{const o=Nt();return g.jsx(Ti,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:g.jsx(ge,{sx:{p:"0.4rem 1rem",backgroundColor:o.palette.primary.notifyBackground,border:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:g.jsx(Un,{onClick:n,sx:{textTransform:"none",fontSize:"1.1rem",p:0,minHeight:"unset",fontWeight:"500",color:o.palette.primary.notifyTextColor},children:"Hide Column"})})})};Z1.propTypes={menuOpen:s.object,handleClose:s.func,onHideClick:s.func},H(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 Or=H(et)(({theme:e})=>({color:e.palette.primary.notifyTextColor,fontSize:"1.1rem"})),f7=H(R0)(({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)"})}})),p7=H(bi)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),h7=H(ed)(({theme:e})=>({"& .MuiBadge-badge":{right:3.5,top:2.34,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"}}));H($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 m7=H(K0)(({theme:e})=>({minHeight:"2rem","& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveText}})),jp=H(D0)(({theme:e})=>({color:e.palette.primary.notifyActiveText,textTransform:"none",fontWeight:"normal",padding:0,fontSize:"1rem",minHeight:"2rem","&.Mui-selected":{fontWeight:"bold",color:e.palette.primary.notifyActiveText}})),$c=H(Zu)(({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`}})),J1=({sortKey:e,sortField:t,sortDir:n,handleSortClick:o})=>{const r=i=>g.jsx(Do,{onClick:o,sx:{padding:"0.5rem"},children:g.jsx(ge,{component:"img",src:i})});return g.jsx(g.Fragment,{children:r(t===e?n==="asc"?nt.AscSort:nt.DescSort:nt.Unsort)})};J1.propTypes={sortKey:s.string.isRequired,sortField:s.string,sortDir:s.string,handleSortClick:s.func};function Q1({parent:e,column:t,sort:n,handleMenuClick:o,isManageable:r}){const i=t==null?void 0:t.isMandatory,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 g.jsxs(ge,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",textAlign:"center",whiteSpace:"normal"},children:[a,g.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[l&&g.jsx(J1,{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})}),r&&!i&&g.jsx(Do,{onClick:f=>o(f,t),sx:{padding:"0.5rem"},children:g.jsx(ge,{component:"img",src:nt.Menu})})]})]})}Q1.propTypes={column:s.object.isRequired,sort:s.object.isRequired,handleMenuClick:s.func,isManageable:s.bool};const g7=H($0)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"table-cell",[`&.${yd.head}`]:{color:e.palette.primary.notifyTextColor,backgroundColor:e.palette.primary.notifyBackground,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 1rem",textAlign:"center"},[`&.${yd.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 1rem",textAlign:"center"}}));function As({children:e,...t}){return g.jsx(g7,{...t,children:e})}As.propTypes={children:s.node};const y7=H(W0)(()=>({"&:last-child td":{borderBottom:0}}));function js({children:e,...t}){return g.jsx(y7,{...t,children:e})}js.propTypes={children:s.node};function ew({rows:e,sort:t,data:n,pagination:o,columns:r,nested:i,baseUrl:a,gridPath:l}){var W;const c=Nt(),{visibleGridColumns:u}=R.useContext(ya),d=R.useContext(ba),{selectedColumn:f,handleMenuClick:p,handleClose:m,handleHideClick:y}=d7(u,d,a,l),h=r==null?void 0:r.isManageable,b=(n==null?void 0:n.length)>0,x=R.useRef(null),[T,w]=R.useState(null);let O=null;const v=R.useRef(0),E=c7(((W=i==null?void 0:i.column)==null?void 0:W.definitions)||[]),k=i==null?void 0:i.isNested,M=(i==null?void 0:i.data)||[],I=i==null?void 0:i.hashKey;if(!b)return g.jsx(Or,{sx:{textAlign:"center"},children:Yo.NRF});const j=(D,N)=>{w(N),D.dataTransfer.setData("colIndex",N)},F=D=>{D.preventDefault(),V(D)},A=async(D,N)=>{if(D.preventDefault(),clearInterval(O),T===null||T===N)return;const B=[...u],[Y]=B.splice(T,1);B.splice(N,0,Y);const Z=u.slice().sort((oe,X)=>oe.sequenceId-X.sequenceId).map(oe=>oe.sequenceId),q=B.map((oe,X)=>({...oe,sequenceId:Z[X]??oe.sequenceId})),Q={...Tr.GRID_SETTINGS||{platform:{theme:"light"}}},G=l.split("/").filter(Boolean);let ne=Q;for(let oe=0;oe<G.length;oe++){const X=G[oe];if(oe===G.length-1){const re=(o==null?void 0:o.rowPerPage)??null;ne[X]={columns:q,pageSize:re}}else ne[X]=ne[X]||{},ne=ne[X]}localStorage.setItem(Go.SETTINGS,JSON.stringify(Q)),d({type:He.SET_GRID_DATA,payload:{visibleGridColumns:q}}),await Nc({baseUrl:a,payload:Q}),w(null)},V=D=>{const N=x.current,{left:B,right:Y}=N.getBoundingClientRect(),Z=50,q=D.clientX>Y-Z?1:D.clientX<B+Z?-1:0;q!==0?(clearInterval(O),O=setInterval(()=>{N.scrollLeft+=q*10},50)):clearInterval(O)},$=(D,N,B,Y)=>{var G,ne,oe;const Z=(D==null?void 0:D.isMandatory)&&(D==null?void 0:D.isSticky),q=parseFloat((ne=(G=D==null?void 0:D.style)==null?void 0:G.minWidth)==null?void 0:ne.toString().replace("rem",""))||7.5;N===0&&(v.current=0);const Q=Z?N===0?0:`${v.current}rem`:void 0;return Z&&(v.current+=q),g.jsx(As,{rowSpan:D!=null&&D.children?1:2,colSpan:(oe=D==null?void 0:D.children)==null?void 0:oe.length,style:D==null?void 0:D.style,draggable:B&&!Y&&!(D!=null&&D.isMandatory),onDragStart:B?X=>j(X,N):void 0,onDragOver:B?F:void 0,onDrop:B?X=>A(X,N):void 0,sx:{...Z&&{borderRadius:"0rem!important",position:"sticky",left:Q,zIndex:3},...D!=null&&D.children||Y?{borderRadius:"0rem!important",borderRight:X=>`0.1rem solid ${X.palette.primary.notifyBorderColor}`}:{borderLeft:X=>(D==null?void 0:D.key)==="volume_value"&&`0.1rem solid ${X.palette.primary.notifyBorderColor}`,borderRight:X=>(D==null?void 0:D.key)==="volume_value"&&`0.1rem solid ${X.palette.primary.notifyBorderColor}`}},children:g.jsx(Q1,{parent:Y,column:D,sort:t,handleMenuClick:p,isManageable:B})},N)},_=(D,N,B,Y)=>!(D!=null&&D.isMandatory)&&B?g.jsx(ge,{component:Ip,id:N,sx:{width:"4rem",maxWidth:"4rem",minWidth:"4rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,"&::after":{content:'""',position:"absolute",left:"50%",top:"50%",transform:"translate(0%, -50%)",width:"0.2rem",height:"50%",background:c.palette.primary.notifyBorderColor}},disabled:!B}):null,P=(D,N,B,Y)=>{var G,ne,oe;const Z=(D==null?void 0:D.isMandatory)&&(D==null?void 0:D.isSticky),q=parseFloat((ne=(G=D==null?void 0:D.style)==null?void 0:G.minWidth)==null?void 0:ne.toString().replace("rem",""))||7.5;B===0&&(v.current=0);const Q=Z?B===0?0:`${v.current}rem`:void 0;return Z&&(v.current+=q),g.jsxs(As,{style:D==null?void 0:D.style,className:`${D==null?void 0:D.label}`,sx:{position:"relative",...Z&&{position:"sticky",left:Q,zIndex:2,backgroundColor:X=>{var re;return e&&((re=e==null?void 0:e.selectedRow)==null?void 0:re.fhi)===(N==null?void 0:N.fhi)||N!=null&&N.isHigh?X.palette.primary.appBackground:X.palette.primary.notifyBackground}},...Y?{p:"0rem!important",borderRight:X=>`0.1rem solid ${X.palette.primary.notifyBorderColor}`}:{px:"0rem!important",borderLeft:X=>(D==null?void 0:D.key)==="volume_value"&&`0.1rem solid ${X.palette.primary.notifyBorderColor}`,borderRight:X=>(D==null?void 0:D.key)==="volume_value"&&`0.1rem solid ${X.palette.primary.notifyBorderColor}`}},children:[(e&&((oe=e==null?void 0:e.selectedRow)==null?void 0:oe.fhi)===(N==null?void 0:N.fhi)||(N==null?void 0:N.isHigh))&&g.jsx(ge,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.05rem",background:"linear-gradient(#F9B16E, #F68080)"}}),g.jsx(Ap,{isRenderCellContent:!!(D!=null&&D.cellRenderer),column:D,row:N,parent:Y})]},B)},L=(D,N,B,Y)=>!(D!=null&&D.isMandatory)&&B?g.jsx(As,{className:"column_resizer_body"},`resize-${N}`):null;return g.jsxs(g.Fragment,{children:[g.jsx(_0,{sx:{maxHeight:"100%",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem"},children:g.jsxs(A0,{ref:x,stickyHeader:!0,"aria-label":"sticky table",sx:{backgroundColor:D=>D.palette.primary.notifyBackground},children:[g.jsxs(B0,{children:[g.jsx(js,{children:u.map((D,N)=>D!=null&&D.isHidden?null:g.jsxs(R.Fragment,{children:[$(D,N,h),(r==null?void 0:r.isResizable)&&_(D,N,h)]},N))}),g.jsx(js,{children:u.flatMap((D,N)=>D!=null&&D.isHidden||!(D!=null&&D.children)?[]:D.children.map((B,Y)=>g.jsxs(R.Fragment,{children:[$(B,Y,h,D),(r==null?void 0:r.isResizable)&&_(B,Y,h)]},`${N}-${Y}`)))})]}),g.jsx(N0,{children:n.map((D,N)=>{const B=D[I],Y=M==null?void 0:M[B],Z=(Y==null?void 0:Y.length)>0;return g.jsxs(R.Fragment,{children:[g.jsx(js,{sx:{backgroundColor:q=>{var Q;return e&&((Q=e==null?void 0:e.selectedRow)==null?void 0:Q.fhi)===(D==null?void 0:D.fhi)||D!=null&&D.isHigh?q.palette.primary.appBackground:q.palette.primary.notifyBackground}},onClick:()=>e==null?void 0:e.onRowClick(D),children:u.map((q,Q)=>q!=null&&q.isHidden?null:q!=null&&q.children?q.children.map((G,ne)=>g.jsxs(R.Fragment,{children:[P(G,D,ne,q),(r==null?void 0:r.isResizable)&&L(G,ne,h)]},`${Q}-${ne}`)):g.jsxs(R.Fragment,{children:[P(q,D,Q),(r==null?void 0:r.isResizable)&&L(q,Q,h)]},Q))}),k&&Y&&g.jsx(g.Fragment,{children:Z?Y.map((q,Q)=>g.jsx(js,{children:E.map((G,ne)=>g.jsx(As,{style:G==null?void 0:G.style,children:g.jsx(Ap,{isRenderCellContent:!!(G!=null&&G.cellRenderer),column:G,row:q})},ne))},`nested-${Q}`)):g.jsx(js,{children:g.jsx(As,{colSpan:E.length,children:g.jsx(Or,{sx:{textAlign:"center"},children:Yo.NRF})})})})]},N)})})]})}),o&&g.jsx(X1,{pagination:o}),g.jsx(Z1,{menuOpen:f==null?void 0:f.isOpen,handleClose:m,onHideClick:y})]})}ew.propTypes={sort:s.object,data:s.array,pagination:s.object,columns:s.object,nested:s.object};function tw({tableProps:e,isDefaultConfig:t,gridPath:n,baseUrl:o}){var u;const{columns:r}=e,{visibleGridColumns:i=[]}=R.useContext(ya)??{},a=R.useContext(ba),l=R.useMemo(()=>{var d;return l7({columns:r,gridPath:n,baseUrl:o,isDefaultConfig:t,pageSize:(d=e==null?void 0:e.pagination)==null?void 0:d.rowPerPage})},[r,n,o,t,(u=e==null?void 0:e.pagination)==null?void 0:u.rowPerPage]),c=R.useMemo(()=>{const d=new Map(i.map(f=>[f.key,f]));return l.map(f=>{const p=d.get(f.key);return{...f,...p&&{isHidden:p.isHidden,sequenceId:p.sequenceId}}})},[l,i]);return R.useEffect(()=>{a({type:He.SET_GRID_DATA,payload:{visibleGridColumns:i.length?c:l}})},[l]),g.jsx(ew,{...e,gridPath:n,baseUrl:o})}tw.propTypes={tableProps:s.object.isRequired,mergedColumns:s.array.isRequired};const nw=({type:e})=>{const t=Nt(),o=(t==null?void 0:t.mode)==="dark"?{bgcolor:"grey.800"}:{};return{grid:g.jsxs(ge,{sx:{borderRadius:2,overflow:"hidden"},children:[g.jsx(To,{variant:"text",width:"100%",height:60,sx:o}),Array.from({length:10}).map((i,a)=>g.jsx(ge,{sx:{display:"flex",alignItems:"center",padding:"0.5rem",gap:"3rem"},children:Array.from({length:5}).map((l,c)=>g.jsx(ge,{sx:{flex:1},children:g.jsx(To,{variant:"text",height:45,sx:o})},c))},a))]}),toolbar:g.jsx(g.Fragment,{children:g.jsxs(dt,{direction:"row",justifyContent:"space-between",sx:{display:"flex",gap:"1rem"},children:[g.jsxs(dt,{direction:"row",gap:"1rem",children:[g.jsx(To,{variant:"text",width:"10.2rem",height:"5rem",sx:o}),g.jsx(To,{variant:"text",width:"3.5rem",height:"5rem",sx:o}),g.jsx(To,{variant:"text",width:"15.2rem",height:"5rem",sx:o})]}),g.jsxs(dt,{direction:"row",gap:"1rem",children:[g.jsx(To,{variant:"text",width:"10.2rem",height:"5rem",sx:o}),g.jsx(To,{variant:"text",width:"3.5rem",height:"5rem",sx:o}),g.jsx(To,{variant:"text",width:"3.5rem",height:"5rem",sx:o})]})]})})}[e]},b7=e=>{if(!e)return null;const{options:t,...n}=e,o=t?"select":"button",r={button:i=>g.jsx(hr,{...i}),select:i=>{var a;return g.jsx(ge,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"},width:(a=i.styles)==null?void 0:a.width},children:g.jsx(s1,{...i,options:t})})}};return r[o]?r[o](n):null},v7=({presentSetting:e,gridSetting:t,gridPath:n})=>{var a;if(!n)return e;const o=n.split("/").filter(Boolean),r=(a=t==null?void 0:t.grid)==null?void 0:a.map(({id:l,isHidden:c,isSortable:u,key:d,sequenceId:f})=>({id:l,isHidden:c,isSortable:u,key:d,sequenceId:f}));let i=e;for(let l=0;l<o.length;l++){const c=o[l];l===o.length-1?i[c]={columns:r,pageSize:(t==null?void 0:t.pageSize)??null}:(i[c]=i[c]||{},i=i[c])}return{settingObject:e,defaultUserSettings:r}},x7=async({baseUrl:e,gridSetting:t,gridPath:n})=>{try{const o=JSON.parse(localStorage.getItem("settings")),{settingObject:r,defaultUserSettings:i}=v7({presentSetting:o,gridSetting:t,gridPath:n});return localStorage.setItem("settings",JSON.stringify(r)),await Nc({baseUrl:e,payload:r}),i}catch(o){console.error(o)}},w7=({customTools:e})=>{var o,r;const t=(o=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===Y1.PRIMARY))==null?void 0:o.sort((i,a)=>i.sequenceId-a.sequenceId),n=(r=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===Y1.SECONDARY))==null?void 0:r.sort((i,a)=>i.sequenceId-a.sequenceId);return{primaryButtons:t,secondaryButtons:n}},ow=({customTools:e,isExpanded:t,setIsExpanded:n})=>{const{primaryButtons:o,secondaryButtons:r}=w7({customTools:e}),[i,a]=R.useState(o),l=(r==null?void 0:r.length)>0,c=d=>{d?a([...o,...r]):setTimeout(()=>{a(o)},100)},u=()=>{const d=!t;n(d),c(d)};return R.useEffect(()=>{c(t)},[e]),g.jsxs(g.Fragment,{children:[t&&g.jsx("div",{style:{position:"fixed",left:0,width:"100vw",height:"4rem",zIndex:998}}),g.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:"0.8rem",flexWrap:"nowrap",maxWidth:"100%",whiteSpace:"nowrap",zIndex:999},children:[g.jsx(K3,{mode:"popLayout",children:i.map((d,f)=>g.jsx(Ki.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},layout:!0,children:g.jsx(ge,{sx:{flexShrink:0,minWidth:"fit-content"},children:b7(d)})},`${d.id}_${f}`))}),l&&g.jsx(ge,{sx:{paddingLeft:t?"0.5rem":0},children:g.jsx(hr,{label:t?"":"More Actions",styles:{icon:t?nt.CrossWhite:nt.More,colorType:t?"danger":""},onClick:u})})]})]})};ow.propTypes={customTools:s.array.isRequired};const rw=({defaultTools:e,isManageable:t,customTools:n,baseUrl:o,gridPath:r,managableColumns:i=[],pageSize:a})=>{var b,x,T,w,O,v;const l=R.useContext(ba),{visibleGridColumns:c,triggerApi:u}=R.useContext(ya),[d,f]=R.useState([]),[p,m]=R.useState(!1);R.useEffect(()=>{if(i.length){const E=i.length?c.filter(k=>i.includes(k.id)):c;f(E)}},[i,c]);const y=async E=>{try{await x7({baseUrl:o,gridPath:r,gridSetting:{grid:E,pageSize:a}})}catch(k){console.error(k)}finally{l({type:He.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),l({type:He.TRIGGER_API,payload:{triggerApi:!1}})}};R.useEffect(()=>{u&&y(c)},[u]);const h=E=>{const k=c.map(M=>d.some(j=>j.id===M.id)?{...M,isHidden:!E.some(j=>j.id===M.id)}:M);l({type:He.SET_GRID_DATA,payload:{visibleGridColumns:k}}),l({type:He.HAS_SETTING_CHANGE,payload:{hasChange:!0}})};return g.jsxs(ge,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.6rem",width:"100%"},children:[g.jsxs(ge,{sx:{display:"flex",flexDirection:"row",gap:"0.6rem"},children:[((b=e==null?void 0:e.search)==null?void 0:b.isRequired)&&g.jsx(n1,{...e==null?void 0:e.search}),((x=e==null?void 0:e.groupBy)==null?void 0:x.isRequired)&&g.jsx(ge,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:g.jsx(wc,{styles:{icon:nt.Group},...e.groupBy})}),((T=e==null?void 0:e.refresh)==null?void 0:T.isRequired)&&g.jsx(hr,{...e==null?void 0:e.refresh,styles:{variant:"filled",icon:nt.Refresh,colorType:"empty",width:"3.2rem",height:"3.2rem"}}),t&&g.jsx(ge,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:g.jsx(wc,{placeholder:"Manage Columns",options:d,value:d.filter(E=>!E.isHidden),isMulti:!0,isDraggable:!0,showSearch:!0,onChange:h,styles:{icon:nt.Manage}})})]}),g.jsxs(ge,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[n&&g.jsx(ow,{customTools:n,setIsExpanded:m,isExpanded:p}),((w=e==null?void 0:e.save)==null?void 0:w.isRequired)&&g.jsx(ge,{sx:{px:"0.5rem"},children:g.jsx(hr,{label:p?"":"Save",styles:{icon:nt.Save,colorType:"empty"},...e==null?void 0:e.save})}),((O=e==null?void 0:e.upload)==null?void 0:O.isRequired)&&g.jsx(hr,{...e==null?void 0:e.upload,styles:{variant:p?"outlined":"filled",icon:p?nt.UploadDark:nt.Upload,colorType:"secondary",isAnimate:!0}}),((v=e==null?void 0:e.download)==null?void 0:v.isRequired)&&g.jsx(hr,{...e==null?void 0:e.download,styles:{variant:"outlined",icon:nt.Download,isAnimate:!0}})]})]})};rw.propTypes={defaultTools:s.object.isRequired,customTools:s.array,isManageable:s.bool,baseUrl:s.string,gridPath:s.gridPath};function Np({tableProps:e,toolbarProps:t,isDefaultConfig:n,isLoading:o}){var i,a;const r=(i=e.columns)==null?void 0:i.isManageable;return g.jsx(r1,{children:o?g.jsxs(g.Fragment,{children:[g.jsx(nw,{type:"toolbar"}),g.jsx(nw,{type:"grid"})]}):g.jsxs(g.Fragment,{children:[t&&g.jsx(rw,{...t,isManageable:r,pageSize:(a=e==null?void 0:e.pagination)==null?void 0:a.rowPerPage}),g.jsx(tw,{tableProps:e,isDefaultConfig:n,gridPath:(t==null?void 0:t.gridPath)||"",baseUrl:(t==null?void 0:t.baseUrl)||""})]})})}Np.propTypes={tableProps:s.object.isRequired,toolbarProps:s.object,isDefaultConfig:s.bool};const sw=({list:e,handleLinkClick:t})=>{const n=Nt(),o=({list:r})=>{var i;return(i=r==null?void 0:r.sort((a,l)=>a.order-l.order))==null?void 0:i.map((a,l)=>a!=null&&a.link?g.jsx(_o,{component:"h3",sx:{fontSize:"1rem",cursor:"pointer",color:l===(r==null?void 0:r.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):g.jsx(et,{component:"h3",sx:{fontSize:"1rem",color:l===(r==null?void 0:r.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},children:a==null?void 0:a.title},l))};return g.jsx($g,{separator:g.jsx(ge,{component:"img",src:nt.ArrowRight}),children:o({list:e})})};sw.propTypes={list:s.array.isRequired,handleLinkClick:s.func};const iw=({breadcrumbProps:e,switchProps:t,filterComponentProps:n})=>{var r,i,a,l,c,u;const o=Nt();return g.jsxs(g.Fragment,{children:[g.jsxs(dt,{sx:{background:o.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,height:"3rem",p:"0px 5.5rem 0 1.5rem",zIndex:4,position:"relative"},direction:"row",justifyContent:"space-between",alignItems:"center",children:[g.jsx(sw,{...e}),g.jsxs(dt,{direction:"row",gap:"1rem",alignItems:"center",children:[t&&g.jsx(c1,{...t}),(n==null?void 0:n.filterBtnProps)&&g.jsxs(dt,{direction:"row",children:[g.jsx(bi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"2rem!important",opacity:"1!important",borderColor:o.palette.primary.notifyBorderColor}}),g.jsxs(dt,{direction:"row",alignItems:"center",gap:"0.5rem",onClick:(r=n==null?void 0:n.filterBtnProps)==null?void 0:r.onFilterClick,sx:{cursor:"pointer"},children:[g.jsx(ge,{component:"img",src:o.icons.filter}),g.jsx(et,{sx:{fontSize:"1.1rem",color:o.palette.primary.notifyActiveText},children:(i=n==null?void 0:n.filterBtnProps)==null?void 0:i.label})]})]})]})]}),g.jsx(Ki.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:o.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,padding:"0px 5.5rem 0 1.5rem",position:"relative",alignItems:"center",display:"flex",overflow:"hidden"},children:g.jsxs(dt,{sx:{background:o.palette.primary.appBackground,height:"3.8rem",p:"0 2rem",width:"100%",borderRadius:"0.7rem",overflow:"visible"},direction:"row",alignItems:"center",children:[g.jsx(et,{sx:{fontSize:"1.2rem",fontWeight:"500",color:o.palette.primary.notifyActiveText},children:"Filters:"}),g.jsx(ge,{sx:{overflowX:"auto",overflowY:"visible",whiteSpace:"nowrap",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},margin:"0 1rem",padding:"0.5rem 0",flexGrow:1},children:g.jsx(dt,{direction:"row",gap:"1.2rem",sx:{overflow:"visible"},children:(c=n==null?void 0:n.filterItems)==null?void 0:c.map((d,f)=>g.jsx(g.Fragment,{children:g.jsxs(ge,{sx:{position:"relative",overflow:"visible",border:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,background:o.palette.primary.notifyBackground,borderRadius:"0.6rem",padding:"0.3rem 1.1rem",display:"inline-block"},children:[g.jsx(ge,{component:"img",src:nt.FilterClose,sx:{position:"absolute",top:"-0.4rem",right:"-0.6rem",cursor:"pointer"},onClick:()=>n==null?void 0:n.onFilterChipClose(d)}),g.jsx(et,{sx:{fontSize:"1rem",color:o.palette.primary.notifyTextColor},children:d==null?void 0:d.filterLabel})]},f)}))})}),g.jsx(ge,{component:et,sx:{fontSize:"1.1rem",fontWeight:"500",textDecoration:"underline",color:o.palette.brandColor.red,cursor:"pointer"},onClick:(u=n==null?void 0:n.filterContainerProps)==null?void 0:u.onClearClick,children:"Clear"})]})})]})};iw.propTypes={breadcrumbProps:s.object.isRequired,switchProps:s.object};function aw({headerProps:e}){return g.jsx(_n,{children:g.jsx(iw,{...e})})}aw.propTypes={headerProps:s.object.isRequired};const $p=R.createContext(null),lw=R.createContext(null);function C7({children:e}){const[t,n]=R.useReducer(S7,T7);return g.jsx($p.Provider,{value:t,children:g.jsx(lw.Provider,{value:n,children:e})})}function S7(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((o,r)=>new Date(r.createdAt)-new Date(o.createdAt))};case He.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case He.ERROR:return{...e,error:t.error};default:throw new Error(`${Yo.UNHANDLED}: ${t}`)}}const T7={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:_p,BU_ID:Fp,SNOP_ID:cw}=Pp,{TENANT_IDS:Bp,BU_IDS:Lp}=Tr,O7=async e=>{try{const t=`${e}${jc.NOTIFICATION}/v1?${_p}=${Bp}&${Fp}=${Lp}`;return await St.get(t,Sa)}catch(t){return t}},uw=async(e,t,n)=>{try{const o=n===q1.MARK_ALL_READ?"":`&${cw}=${n}&`,r=`${e}${jc.NOTIFICATION}${Ep.VERSION}?${_p}=${Bp}&${Fp}=${Lp}${o}`;return await St.put(r,t,Sa)}catch(o){return o}},E7=async({baseUrl:e,id:t,snopId:n})=>{try{const o=`${e}${jc.NOTIFICATION}${Ep.VERSION}?${_p}=${Bp}&${Fp}=${Lp}&${cw}=${n}&id=${t}`;return await St.get(o,Sa)}catch(o){return o}},_c={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500},dw=({baseUrl:e})=>{const t=R.useContext(lw),[n,o]=R.useState(!1),[r,i]=R.useState(!1),[a,l]=R.useState(!1),[c,u]=R.useState({}),[d,f]=R.useState(null),[p,m]=R.useState(1),[y,h]=R.useState(!1),[b,x]=R.useState(0),{loading:T,data:w,isMarkAllAsRead:O}=R.useContext($p),[v,E]=R.useState([]);R.useEffect(()=>{E(w)},[w]);const k=R.useCallback(async()=>{var $,_;try{t({type:He.LOADING,loading:!0}),t({type:He.SUCCESS,data:[]});const P=await O7(e);if(P.status===_c.OK){const L=((_=($=P.data)==null?void 0:$.responseData)==null?void 0:_.response)||[],W=xc(L);t({type:He.SUCCESS,data:xc(W)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:o1(L),boo:o1(L)>0}})}}catch{t({type:He.ERROR,error:Yo.SWR})}finally{t({type:He.LOADING,loading:!1})}},[e,t]);R.useEffect(()=>{k();const $=setInterval(k,3e5);return()=>clearInterval($)},[k]);const M=async($,_)=>{var P,L,W;if($){f($);try{const D=await E7({baseUrl:e,id:$,snopId:_});if(D.status===_c.OK){const N=((W=(L=(P=D.data)==null?void 0:P.responseData)==null?void 0:L.response)==null?void 0:W[0])||{};u(N||{}),l(!0)}else throw new Error}catch{t({type:He.ERROR,error:Yo.SWR})}finally{f(null)}}},I=async($,_)=>{if($.length){t({type:He.LOADING,loading:!0});try{if((await uw(e,$,_)).status===_c.OK){const L=w.map(D=>$.includes(D.id)?{...D,isRead:!0}:D),W=L.filter(D=>!D.isRead).length;t({type:He.SUCCESS,data:xc(L)}),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:Yo.SWR}),t({type:He.LOADING,loading:!1})}}},j=async()=>{t({type:He.LOADING,loading:!0});try{const $=aV(w);if((await uw(e,$,q1.MARK_ALL_READ)).status===_c.OK){const P=w.map(L=>({...L,isRead:!0}));t({type:He.SUCCESS,data:xc(P)}),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:Yo.SWR}),t({type:He.LOADING,loading:!1})}},F=($,_)=>{t({type:He.LOADING,loading:!0}),x(_),setTimeout(()=>{t({type:He.LOADING,loading:!1})},400)},A=$=>{const _=$||w||[];return{0:_,1:_.filter(P=>(P==null?void 0:P.type)==="INFO"),2:_.filter(P=>(P==null?void 0:P.type)==="ERROR")}},V=()=>{t({type:He.LOADING,loading:!0});const $=!y,_=$?(v||[]).filter(P=>!P.isRead):w||[];h($),E(_),m(1),setTimeout(()=>{t({type:He.LOADING,loading:!1})},400)};return{fetchNotification:k,showDetailsProps:{open:a,handleClose:()=>l(!1),setOpen:l,data:c,clickId:d},alertDialogProps:{open:n,handleClose:()=>o(!1),onRefresh:k,handleRead:I,handleMarkAllAsRead:j,setOpen:o,handleShowDetails:M,clickId:d,isMainDialog:!0},activeTab:b,loading:T,tabData:A(v)[b],data:v,mode:y,handleTabChange:F,toggleAlertMode:V,page:p,setPage:m}};var fw,pw,hw,mw;function Vp(){return Vp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Vp.apply(null,arguments)}var k7=function(t){return C.createElement("svg",Vp({xmlns:"http://www.w3.org/2000/svg",width:16,height:18,fill:"none"},t),fw||(fw=C.createElement("path",{stroke:"#666D80",strokeLinecap:"round",strokeMiterlimit:10,d:"M8.013 3.44c-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.373V7.44c0-2.2-1.8-4-4-4Z"})),pw||(pw=C.createElement("path",{stroke:"#666D80",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.247 3.633a4.503 4.503 0 0 0-2.467 0 1.324 1.324 0 0 1 2.467 0"})),hw||(hw=C.createElement("path",{stroke:"#666D80",strokeMiterlimit:10,d:"M10.014 14.207c0 1.1-.9 2-2 2a2.007 2.007 0 0 1-2-2"})),mw||(mw=C.createElement("circle",{cx:12.266,cy:3,r:2.5,fill:"#E85353",stroke:"#F8FAFB"})))};const P7=({count:e})=>(Nt(),g.jsxs(g.Fragment,{children:[g.jsx(ge,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center","& svg":{transform:"scale(1)"}},children:g.jsx(k7,{style:{scale:2}})}),g.jsx(h7,{badgeContent:e==0?"":null,color:"error"})]}));function gw({children:e,handleClose:t,open:n,isMainDialog:o}){return g.jsx(Ol,{open:n,onClose:t,...o?{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:r=>r.palette.primary.notifyBackground}}}:{fullWidth:!0,maxWidth:"md",sx:{"& .MuiPaper-root":{minHeight:250,maxHeight:500,borderRadius:"1.5rem",boxShadow:6,backgroundColor:r=>r.palette.primary.appBackground}}},children:e})}var yw;function Wp(){return Wp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Wp.apply(null,arguments)}var M7=function(t){return C.createElement("svg",Wp({xmlns:"http://www.w3.org/2000/svg",width:14,height:9,fill:"none",viewBox:"0 0 13 9"},t),yw||(yw=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"})))},bw,vw;function zp(){return zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},zp.apply(null,arguments)}var R7=function(t){return C.createElement("svg",zp({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),bw||(bw=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"})),vw||(vw=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"})))},xw;function Up(){return Up=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Up.apply(null,arguments)}var D7=function(t){return C.createElement("svg",Up({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),xw||(xw=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 ww=({type:e,item:t,handleShowDetails:n,handleRead:o,handleCTAClicked:r,clickId:i})=>{var c,u;const a=Nt(),l=(u=(c=JSON.parse(localStorage.getItem("settings")))==null?void 0:c.platform)==null?void 0:u.theme;return g.jsxs(ge,{className:"cards",sx:{pt:" 0.8rem"},children:[g.jsx(dt,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:g.jsx(ed,{sx:{width:"calc(100% - 2%)","& .MuiBadge-badge":{backgroundColor:"#6041EA",height:"0.5rem",minWidth:"0.5rem"}},variant:"dot",className:"badge",invisible:t==null?void 0:t.isRead,children:g.jsx(Or,{sx:{color:a.palette.primary.notifyActiveText},component:"p",className:["title-card",(t==null?void 0:t.isRead)&&"read"].join(" "),children:t==null?void 0:t.message})})}),g.jsx(dt,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:g.jsxs(dt,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[(t==null?void 0:t.isNotificationDetails)&&g.jsx($c,{icon:g.jsx(R7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:n,label:i===(t==null?void 0:t.id)?g.jsx(Tl,{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)&&g.jsx($c,{icon:g.jsx(D7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:o,label:"Acknowledge",component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.primaryCTAURL)&&g.jsx($c,{disabled:t==null?void 0:t.isPrimaryCTAClicked,onClick:()=>r({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)&&g.jsx($c,{disabled:t==null?void 0:t.isSecondaryCTAClicked,onClick:()=>r({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"})]})}),g.jsxs(dt,{display:"flex",flexDirection:"row",alignItems:"center",gap:.35,children:[g.jsx(Or,{sx:{fontSize:"0.8rem"},children:t==null?void 0:t.product}),g.jsx(Or,{color:a.palette.primary.notifyTextColor,children:"•"}),g.jsx(Or,{sx:{fontSize:"0.8rem"},children:iV(t==null?void 0:t.createdAt)})]})]})};ww.propTypes={type:s.string,title:s.string,subTitle:s.string,isRead:s.bool,handleShowDetails:s.func,handleRead:s.func};const Cw=({data:e,handleRead:t,handleShowDetails:n,clickId:o,mode:r,page:i,setPage:a})=>{const{isMarkAllAsRead:l}=R.useContext($p),c=new Date,u=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(c),[d,f]=R.useState([]),[p,m]=R.useState(!1),[y,h]=R.useState(!0),b=R.useRef(null),x=async w=>{m(!0);const O=e.slice((w-1)*10,w*10);await new Promise(v=>setTimeout(v,1e3)),f(v=>{const E=O.filter(k=>!v.some(M=>M.id===k.id));return[...v,...E]}),m(!1),(d==null?void 0:d.length)>=(e==null?void 0:e.length)&&h(!1)};R.useEffect(()=>{var O;let w=[];r?l!=null&&l.count?w=(O=e==null?void 0:e.filter(v=>!v.isRead))==null?void 0:O.slice(0,10):w=[]:w=e.slice(0,10),(w==null?void 0:w.length)<10&&h(!1),f(w)},[e,r,l]),R.useEffect(()=>{y&&i!==1&&x(i)},[i,e]),R.useEffect(()=>{f([...e])},[e]),R.useEffect(()=>{const w=new IntersectionObserver(O=>{O[0].isIntersecting&&!p&&y&&a(v=>v+1)},{threshold:1});return b.current&&w.observe(b.current),()=>{b.current&&w.unobserve(b.current)}},[p,y]);const T=({redirect:w,isClicked:O,url:v})=>{window.open(v,"_blank")};return g.jsxs(ge,{sx:{width:"100%"},children:[Object.entries(lV(d)).map(([w,O])=>g.jsxs(R.Fragment,{children:[w!==u&&g.jsx(p7,{children:w}),O.map((v,E)=>g.jsx(R.Fragment,{children:g.jsx(ww,{item:v,handleCTAClicked:T,handleShowDetails:()=>n(v.id,v.snopId),handleRead:()=>t([v.id],v.snopId),clickId:o})},`${E}_${v.id}`))]},w)),p&&i>1&&!!(d!=null&&d.length)&&g.jsx(ge,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:g.jsx(Tl,{size:20,sx:{color:w=>w.palette.primary.notifyIconColor}})}),!(d!=null&&d.length)&&g.jsx(et,{sx:{fontSize:"1.1rem",color:w=>w.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."}),g.jsx(ge,{ref:b,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};Cw.propTypes={data:s.array,handleRead:s.func,handleShowDetails:s.func};const I7=({onRefresh:e,handleShowDetails:t,clickId:n,handleRead:o,handleMarkAllAsRead:r})=>{var y,h,b,x;const{loading:i,activeTab:a,data:l,tabData:c,mode:u,page:d,setPage:f,handleTabChange:p,toggleAlertMode:m}=dw({});return g.jsxs(g.Fragment,{children:[g.jsxs(ge,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,pt:2},children:[g.jsx(et,{variant:"h2",sx:{fontSize:"1.2rem",color:T=>T.palette.primary.notifyTextColor},children:"Notifications"}),g.jsx(ge,{component:"img",src:nt.Refresh,alt:"refresh",onClick:e,sx:{cursor:"pointer"}})]}),g.jsx(ge,{sx:{borderBottom:1,m:"1.2rem 1.2rem 0 1.2rem",borderColor:T=>T.palette.primary.notifyBorderColor},children:g.jsxs(m7,{value:a,onChange:p,children:[g.jsx(jp,{label:g.jsxs(ge,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["All (",g.jsx(et,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((y=l==null?void 0:l.filter(T=>!(T!=null&&T.isRead)))==null?void 0:y.length)||0}),")"]})}),g.jsx(jp,{label:g.jsxs(ge,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Info (",g.jsx(et,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((h=l==null?void 0:l.filter(T=>(T==null?void 0:T.type)==="INFO"&&!(T!=null&&T.isRead)))==null?void 0:h.length)||0}),")"]}),sx:{color:T=>T.palette.brandColor.blue}}),g.jsx(jp,{label:g.jsxs(ge,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Error (",g.jsx(et,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((b=l==null?void 0:l.filter(T=>(T==null?void 0:T.type)==="ERROR"&&!(T!=null&&T.isRead)))==null?void 0:b.length)||0}),")"]}),sx:{color:T=>T.palette.brandColor.red}})]})}),g.jsx(kl,{dividers:!0,sx:{p:0,...i&&!c.length&&{alignItems:"center",justifyContent:"center"},flexGrow:1,overflowY:"auto",mx:"1.2rem",borderColor:T=>T.palette.primary.notifyBorderColor},tabIndex:-1,children:i?g.jsx(Tl,{size:30,sx:{color:T=>T.palette.primary.notifyIconColor}}):g.jsx(g.Fragment,{children:g.jsx(Cw,{data:c,handleShowDetails:t,handleRead:o,clickId:n,page:d,setPage:f,mode:u})})}),g.jsxs(El,{sx:{justifyContent:"space-between",px:"1.2rem"},children:[g.jsxs(dt,{direction:"row",gap:1,children:[g.jsx(Or,{sx:{fontSize:"1rem"},children:"Only show unread"}),g.jsx(f7,{disabled:i,checked:u,onChange:m})]}),g.jsx(Un,{variant:"outlined",className:"view-all",onClick:r,startIcon:g.jsx(M7,{}),disabled:!((x=l==null?void 0:l.filter(T=>!(T!=null&&T.isRead)))!=null&&x.length),style:{backgroundColor:"transparent"},sx:{fontSize:"1rem",fontWeight:"300",p:0,border:"none",textTransform:"none",color:T=>T.palette.primary.notifyTextColor,"&:hover":{color:T=>T.palette.primary.notifyActiveText,background:"transparent",boxShadow:"none",border:"none"},"&.Mui-disabled":{opacity:.5,color:T=>`${T.palette.primary.notifyActiveText}!important`,background:"transparent",boxShadow:"none",border:"none"}},children:"Mark all as read"})]})]})},A7=({data:e,handleClose:t})=>{var T;const[n,o]=R.useState(1),[r,i]=R.useState(10),[a,l]=R.useState(((T=e==null?void 0:e.notificationDetails)==null?void 0:T.length)||0),[c,u]=R.useState("sku_name"),[d,f]=R.useState("asc"),[p,m]=R.useState(""),y=["sku_name","node","channel_name"],h=R.useMemo(()=>!(e!=null&&e.notificationDetails)||!y.length?[]:p.trim()?e.notificationDetails.filter(w=>y.some(O=>{var v;return(v=w[O])==null?void 0:v.toString().toLowerCase().includes(p.toLowerCase())})):e.notificationDetails,[e,p,y]),b=R.useMemo(()=>c?[...h].sort((w,O)=>{const v=w[c],E=O[c];return v==null?1:E==null?-1:typeof v=="number"&&typeof E=="number"?d==="asc"?v-E:E-v:!isNaN(Date.parse(v))&&!isNaN(Date.parse(E))?d==="asc"?new Date(v).getTime()-new Date(E).getTime():new Date(E).getTime()-new Date(v).getTime():d==="asc"?v.toString().localeCompare(E.toString()):E.toString().localeCompare(v.toString())}):h,[h,c,d]),x=R.useMemo(()=>{const w=(n-1)*r,O=w+r;return b.slice(w,O)},[b,n,r]);return console.log({paginatedData:x}),g.jsxs(g.Fragment,{children:[g.jsxs(dt,{direction:"row",justifyContent:"space-between",sx:{padding:"1.5rem 2rem",borderBottom:"0.1rem solid",borderColor:w=>w.palette.primary.notifyBorderColor},children:[g.jsx(et,{component:"h2",sx:{fontSize:"1.4rem",color:w=>w.palette.primary.notifyActiveText},children:(e==null?void 0:e.message)||""}),g.jsx(ge,{component:"img",src:nt.CloseCircle,onClick:t,sx:{cursor:"pointer"}})]}),g.jsx(kl,{children:g.jsx(Np,{tableProps:{data:x,columns:{...u7(),isManageable:!1},sort:{sortField:c,sortDir:d,onSort:w=>{var v;const O=(v=w==null?void 0:w.column)==null?void 0:v.key;f(E=>c===O&&E==="asc"?"desc":"asc"),u(O)}},pagination:{selectedPage:n,rowPerPage:r,totalRecords:a,onPageChange:w=>{o(w)},onPageSizeChange:w=>{i(w==null?void 0:w.value),o(1)}}},toolbarProps:{defaultTools:{search:{isRequired:!0,onChange:w=>{m(w.target.value)},placeholder:"Search..."}}}})}),g.jsx(El,{sx:{padding:"1.5rem 2rem"}})]})},j7=({baseUrl:e})=>{const{alertDialogProps:t,showDetailsProps:n,fetchNotification:o}=dw({baseUrl:e});return g.jsxs(g.Fragment,{children:[g.jsx(ge,{sx:{display:"flex",justifyContent:"center",cursor:"pointer",marginTop:"0.6rem"},onClick:()=>{var r;o(),(r=t==null?void 0:t.setOpen)==null||r.call(t,!0)},children:g.jsx(P7,{count:0})}),g.jsx(gw,{...t,children:g.jsx(I7,{...t})}),g.jsx(gw,{...n,children:g.jsx(A7,{...n})})]})},N7=({baseUrl:e})=>g.jsx(_n,{children:g.jsx(C7,{children:g.jsx(j7,{baseUrl:e})})}),$7=({rightChild:e,leftChild:t,isDrawerMerged:n,isDrawerOpen:o,drawerTitle:r,showExpand:i,onCloseClick:a,onMergeClick:l,onExpandClick:c,isDrawerExpanded:u,styles:d,showMerge:f})=>{const p=Nt();return g.jsx(ge,{sx:{position:"relative",overflow:"hidden"},children:g.jsxs(ar,{container:!0,sx:{height:"100%"},children:[g.jsx(ar,{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}),o&&!n&&g.jsxs(g.Fragment,{children:[g.jsx(ge,{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"}}),g.jsx(ge,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"transparent",zIndex:4}})]}),e&&g.jsxs(ar,{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:o?"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:[g.jsxs(dt,{direction:"row",alignItems:"center",sx:{width:"100%",flexShrink:0,paddingBottom:"0.8rem",px:2,pt:"0.8rem",borderBottom:m=>`0.1rem solid ${m.palette.primary.notifyBorderColor}`},children:[!u&&f&&g.jsxs(g.Fragment,{children:[g.jsx(ge,{sx:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer"},onClick:l,children:g.jsx(ge,{component:"img",src:nt.Merge})}),g.jsx(bi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"auto!important",borderColor:p.palette.primary.notifyBorderColor}})]}),g.jsxs(dt,{direction:"row",justifyContent:"space-between",alignItems:"center",flexGrow:1,children:[g.jsxs(dt,{direction:"row",gap:"0.5rem",alignItems:"center",onClick:a,sx:{cursor:"pointer"},children:[g.jsx(ge,{component:"img",src:p.icons.close}),g.jsx(et,{sx:{fontSize:"1.2rem",color:p.palette.primary.notifyTextColor},children:r})]}),g.jsx(dt,{direction:"row",gap:"0.5rem",alignItems:"center",children:i&&g.jsx(ge,{onClick:c,sx:{cursor:"pointer"},children:g.jsx(ge,{component:"img",src:u?nt.Collapse:nt.Expand})})})]})]}),g.jsx(ge,{sx:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},overflow:"auto",px:2},children:e})]})]})})},Sw=({layoutChildren:e,layoutProps:t})=>g.jsx(_n,{children:g.jsx($7,{...e,...t})});Sw.propTypes={layoutChildren:s.object.isRequired,layoutProps:s.object.isRequired},vt.Button=hr,vt.Checkbox=oc,vt.DatePicker=rV,vt.Grid=Np,vt.Header=aw,vt.InputField=n1,vt.Loader=MV,vt.Notification=N7,vt.Select=s1,vt.SliderLayout=Sw,vt.Switch=c1,vt.TextField=bc,vt.ToastProvider=TV,vt.toast=xV,Object.defineProperty(vt,Symbol.toStringTag,{value:"Module"})});
|
|
326
|
+
`+i):o.stack=i}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Cr(this.defaults,n);const{transitional:o,paramsSerializer:r,headers:i}=n;o!==void 0&&Ic.assertOptions(o,{silentJSONParsing:mo.transitional(mo.boolean),forcedJSONParsing:mo.transitional(mo.boolean),clarifyTimeoutError:mo.transitional(mo.boolean)},!1),r!=null&&(ee.isFunction(r)?n.paramsSerializer={serialize:r}:Ic.assertOptions(r,{encode:mo.function,serialize:mo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Ic.assertOptions(n,{baseUrl:mo.spelling("baseURL"),withXsrfToken:mo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&ee.merge(i.common,i[n.method]);i&&ee.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=mn.concat(a,i);const l=[];let c=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(c=c&&h.synchronous,l.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let d,f=0,p;if(!c){const y=[W1.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,u),p=y.length,d=Promise.resolve(n);f<p;)d=d.then(y[f++],y[f++]);return d}p=l.length;let m=n;for(f=0;f<p;){const y=l[f++],h=l[f++];try{m=y(m)}catch(b){h.call(this,b);break}}try{d=W1.call(this,m)}catch(y){return Promise.reject(y)}for(f=0,p=u.length;f<p;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=Cr(this.defaults,t);const n=A1(t.baseURL,t.url,t.allowAbsoluteUrls);return T1(n,t.params,t.paramsSerializer)}};ee.forEach(["delete","get","head","options"],function(t){Sr.prototype[t]=function(n,o){return this.request(Cr(o||{},{method:t,url:n,data:(o||{}).data}))}}),ee.forEach(["post","put","patch"],function(t){function n(o){return function(i,a,l){return this.request(Cr(l||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Sr.prototype[t]=n(),Sr.prototype[t+"Form"]=n(!0)});let X8=class Ow{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 o=this;this.promise.then(r=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](r);o._listeners=null}),this.promise.then=r=>{let i;const a=new Promise(l=>{o.subscribe(l),i=l}).then(r);return a.cancel=function(){o.unsubscribe(i)},a},t(function(i,a,l){o.reason||(o.reason=new Is(i,a,l),n(o.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=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ow(function(r){t=r}),cancel:t}}};function Z8(e){return function(n){return e.apply(null,n)}}function J8(e){return ee.isObject(e)&&e.isAxiosError===!0}const Op={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(Op).forEach(([e,t])=>{Op[t]=e});function H1(e){const t=new Sr(e),n=u1(Sr.prototype.request,t);return ee.extend(n,Sr.prototype,t,{allOwnKeys:!0}),ee.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return H1(Cr(e,r))},n}const St=H1(wa);St.Axios=Sr,St.CanceledError=Is,St.CancelToken=X8,St.isCancel=M1,St.VERSION=z1,St.toFormData=Ec,St.AxiosError=ze,St.Cancel=St.CanceledError,St.all=function(t){return Promise.all(t)},St.spread=Z8,St.isAxiosError=J8,St.mergeConfig=Cr,St.AxiosHeaders=mn,St.formToJSON=e=>k1(ee.isHTMLForm(e)?new FormData(e):e),St.getAdapter=V1.getAdapter,St.HttpStatusCode=Op,St.default=St;const{Axios:jW,AxiosError:NW,CanceledError:$W,isCancel:_W,CancelToken:FW,VERSION:BW,all:LW,Cancel:VW,isAxiosError:WW,spread:zW,toFormData:UW,AxiosHeaders:HW,HttpStatusCode:qW,formToJSON:YW,getAdapter:GW,mergeConfig:KW}=St,Ep={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"};/*! js-cookie v3.0.5 | MIT */function Ac(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var Q8={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 kp(e,t){function n(r,i,a){if(!(typeof document>"u")){a=Ac({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),r=encodeURIComponent(r).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=r+"="+e.write(i,r)+l}}function o(r){if(!(typeof document>"u"||arguments.length&&!r)){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),r===d)break}catch{}}return r?a[r]:a}}return Object.create({set:n,get:o,remove:function(r,i){n(r,"",Ac({},i,{expires:-1}))},withAttributes:function(r){return kp(this.converter,Ac({},this.attributes,r))},withConverter:function(r){return kp(Ac({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var e7=kp(Q8,{path:"/"});const Go={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},Pp={BEARER:"Bearer",TENANT_ID:"tenant_id",BU_ID:"bu_id",SNOP_ID:"snop_id"},t7=[10,25,50,100],q1={MARK_ALL_READ:"MARK_ALL_READ"},n7=t7.map(e=>({label:e,value:e})),Y1={PRIMARY:"PRIMARY",SECONDARY:"SECONDARY"},Mp=vc(Go.SNOP),Rp=vc(Go.SELECTED_BU),Dp=vc(Go.USER),o7=vc(Go.SETTINGS),Tr={BU_IDS:Rp==null?void 0:Rp.business_unit_id,TOKEN:JSON.parse(e7.get(Go.TOKEN)||null),TENANT_IDS:Dp==null?void 0:Dp.tenant_id,SNOP_IDS:Mp==null?void 0:Mp.snop_id,GRID_SETTINGS:o7},Sa={headers:{"Content-Type":"application/json",Authorization:`${Pp.BEARER} ${Tr.TOKEN}`}},G1=St.create({baseURL:Ep.BASE_URL,axiosConfig:Sa});G1.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),G1.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const jc={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"},{TENANT_ID:r7,BU_ID:s7}=Pp,{TENANT_IDS:i7,BU_IDS:a7}=Tr,Nc=async({baseUrl:e,payload:t})=>{try{const n=`${e}${jc.SETTING}/v1?${r7}=${i7}&${s7}=${a7}`;return await St.post(n,t,Sa)}catch(n){return n}},l7=({columns:e,gridPath:t,baseUrl:n,isDefaultConfig:o,pageSize:r})=>{var y;let{definitions:i,defaultUserSettings:a,labels:l}=e;const c=t.split("/").filter(Boolean);let u=c.reduce((h,b)=>h==null?void 0:h[b],Tr.GRID_SETTINGS)||null;o||!u&&!a&&(async()=>{try{a=K1({definitions:i});let h=Tr.GRID_SETTINGS||{platform:{theme:"light"}};const b=(u==null?void 0:u.pageSize)??r;let x=h;for(let T=0;T<c.length;T++){const w=c[T];T===c.length-1?x[w]={columns:a,pageSize:b}:(x[w]=x[w]||{},x=x[w])}localStorage.setItem(Go.SETTINGS,JSON.stringify(h)),await Nc({baseUrl:n,payload:h})}catch(h){console.error(h)}})(),a=(u==null?void 0:u.columns)??a??K1({definitions:i});const d=a.reduce((h,b)=>(h[b.id]=b,h),{}),f=l.reduce((h,b)=>(h[b.id]=b,h),{}),p=[];for(const h of i){const b=d[h.id]||{},x=f[h.id]||{};let T={...h,...b,...x};if((y=h.children)!=null&&y.length){const w=b.children||[],O=x.children||[];T.children=h.children.map((v,E)=>({...v,...w[E],...O[E]}))}p.push(T)}return p.sort((h,b)=>h.sequenceId-b.sequenceId)},c7=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),K1=({definitions:e})=>e.map((t,n)=>({id:t.id,key:t.key,sequenceId:t.id,isHidden:!1,style:t.style||{}})),u7=()=>({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 Ip extends R.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=R.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,o=this.startPos-this.mouseX;let r=this.startWidthPrev-o;(!this.props.minWidth||r>=this.props.minWidth)&&(!this.props.maxWidth||r<=this.props.maxWidth)&&(n.previousSibling.style.width=r+"px",n.previousSibling.style.minWidth=r+"px",n.previousSibling.style.maxWidth=r+"px",n.previousSibling.style.setProperty("--column_resize_before_width",r+"px"),this.lastDraggedWidth=r)}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)"),R.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})}}Ip.defaultProps={disabled:!1,minWidth:0,className:""},Ip.propTypes={disabled:"boolean",minWidth:"number",className:"string"};const d7=(e,t,n,o)=>{const[r,i]=R.useState({isOpen:!1,column:null}),a=(u,d)=>{i({isOpen:u.currentTarget,column:d})},l=()=>{i({isOpen:!1,column:null})};return{selectedColumn:r,handleMenuClick:a,handleClose:l,handleHideClick:async()=>{l();const u=e.map(f=>{var p;return f.id===((p=r==null?void 0:r.column)==null?void 0:p.id)?{...f,isHidden:!0}:f});t({type:He.SET_GRID_DATA,payload:{visibleGridColumns:u}});let d=Tr.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};d.grid=d.grid||{},d.grid[o]=u,localStorage.setItem(Go.SETTINGS,JSON.stringify(d)),await Nc({baseUrl:n,payload:d})}}},X1=({pagination:e})=>{const{selectedPage:t,rowPerPage:n,totalRecords:o,onPageChange:r,onPageSizeChange:i}=e,a=Nt();return g.jsxs(ge,{sx:{display:"flex",p:"1rem 2rem"},children:[g.jsxs(ge,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"0.5rem",width:"100%"},children:[g.jsx(et,{sx:{fontSize:"1.1rem",color:a.palette.primary.notifyTextColor},children:`Showing ${(t-1)*n+1} to ${Math.min(t*n,o)} of ${o} rows`}),g.jsx(ge,{sx:{"& .MuiInputBase-input":{padding:"0rem 0.8rem!important"},width:"6rem"},children:g.jsx(wc,{options:n7,value:n,onChange:i})}),g.jsx(et,{sx:{fontSize:"1.1rem",color:a.palette.primary.notifyTextColor},children:"records per page"})]}),g.jsx(x0,{count:Math.ceil(o/n),page:t,onChange:(l,c)=>{r(c)},shape:"rounded",sx:{width:"100%","& .MuiPagination-ul":{width:"100%",display:"flex",justifyContent:"flex-end","& li:first-of-type":{border:`0.1rem solid ${a.palette.primary.notifyBorderColor}`,color:a.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 ${a.palette.primary.notifyBorderColor}`,color:a.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:a.palette.primary.notifyActiveText,backgroundColor:`${a.palette.brandColor.paginationBc} !important`}}})]})};X1.propTypes={pagination:s.object.isRequired};function Ap({isRenderCellContent:e,column:t,row:n,parent:o}){const r=n[t.key];return g.jsx(g.Fragment,{children:e?g.jsx(ge,{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:o})}):g.jsx(M0,{title:(r==null?void 0:r.length)>20?r:"",arrow:!0,children:g.jsx(ge,{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:cV(r)})})})}Ap.propTypes={isRenderCellContent:s.bool,column:s.object,row:s.object};const Z1=({menuOpen:e,handleClose:t,onHideClick:n})=>{const o=Nt();return g.jsx(Ti,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:g.jsx(ge,{sx:{p:"0.4rem 1rem",backgroundColor:o.palette.primary.notifyBackground,border:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:g.jsx(Un,{onClick:n,sx:{textTransform:"none",fontSize:"1.1rem",p:0,minHeight:"unset",fontWeight:"500",color:o.palette.primary.notifyTextColor},children:"Hide Column"})})})};Z1.propTypes={menuOpen:s.object,handleClose:s.func,onHideClick:s.func},H(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 Or=H(et)(({theme:e})=>({color:e.palette.primary.notifyTextColor,fontSize:"1.1rem"})),f7=H(R0)(({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)"})}})),p7=H(bi)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),h7=H(ed)(({theme:e})=>({"& .MuiBadge-badge":{right:3.5,top:2.34,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"}}));H($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 m7=H(K0)(({theme:e})=>({minHeight:"2rem","& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveText}})),jp=H(D0)(({theme:e})=>({color:e.palette.primary.notifyActiveText,textTransform:"none",fontWeight:"normal",padding:0,fontSize:"1rem",minHeight:"2rem","&.Mui-selected":{fontWeight:"bold",color:e.palette.primary.notifyActiveText}})),$c=H(Zu)(({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`}})),J1=({sortKey:e,sortField:t,sortDir:n,handleSortClick:o})=>{const r=i=>g.jsx(Do,{onClick:o,sx:{padding:"0.5rem"},children:g.jsx(ge,{component:"img",src:i})});return g.jsx(g.Fragment,{children:r(t===e?n==="asc"?nt.AscSort:nt.DescSort:nt.Unsort)})};J1.propTypes={sortKey:s.string.isRequired,sortField:s.string,sortDir:s.string,handleSortClick:s.func};function Q1({parent:e,column:t,sort:n,handleMenuClick:o,isManageable:r}){const i=t==null?void 0:t.isMandatory,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 g.jsxs(ge,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",textAlign:"center",whiteSpace:"normal"},children:[a,g.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[l&&g.jsx(J1,{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})}),r&&!i&&g.jsx(Do,{onClick:f=>o(f,t),sx:{padding:"0.5rem"},children:g.jsx(ge,{component:"img",src:nt.Menu})})]})]})}Q1.propTypes={column:s.object.isRequired,sort:s.object.isRequired,handleMenuClick:s.func,isManageable:s.bool};const g7=H($0)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"table-cell",[`&.${yd.head}`]:{color:e.palette.primary.notifyTextColor,backgroundColor:e.palette.primary.notifyBackground,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 1rem",textAlign:"center"},[`&.${yd.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 1rem",textAlign:"center"}}));function As({children:e,...t}){return g.jsx(g7,{...t,children:e})}As.propTypes={children:s.node};const y7=H(W0)(()=>({"&:last-child td":{borderBottom:0}}));function js({children:e,...t}){return g.jsx(y7,{...t,children:e})}js.propTypes={children:s.node};function ew({rows:e,sort:t,data:n,pagination:o,columns:r,nested:i,baseUrl:a,gridPath:l}){var W;const c=Nt(),{visibleGridColumns:u}=R.useContext(ya),d=R.useContext(ba),{selectedColumn:f,handleMenuClick:p,handleClose:m,handleHideClick:y}=d7(u,d,a,l),h=r==null?void 0:r.isManageable,b=(n==null?void 0:n.length)>0,x=R.useRef(null),[T,w]=R.useState(null);let O=null;const v=R.useRef(0),E=c7(((W=i==null?void 0:i.column)==null?void 0:W.definitions)||[]),k=i==null?void 0:i.isNested,M=(i==null?void 0:i.data)||[],I=i==null?void 0:i.hashKey;if(!b)return g.jsx(Or,{sx:{textAlign:"center"},children:Yo.NRF});const j=(D,N)=>{w(N),D.dataTransfer.setData("colIndex",N)},F=D=>{D.preventDefault(),V(D)},A=async(D,N)=>{if(D.preventDefault(),clearInterval(O),T===null||T===N)return;const B=[...u],[Y]=B.splice(T,1);B.splice(N,0,Y);const Z=u.slice().sort((oe,X)=>oe.sequenceId-X.sequenceId).map(oe=>oe.sequenceId),q=B.map((oe,X)=>({...oe,sequenceId:Z[X]??oe.sequenceId})),Q={...Tr.GRID_SETTINGS||{platform:{theme:"light"}}},G=l.split("/").filter(Boolean);let ne=Q;for(let oe=0;oe<G.length;oe++){const X=G[oe];if(oe===G.length-1){const re=(o==null?void 0:o.rowPerPage)??null;ne[X]={columns:q,pageSize:re}}else ne[X]=ne[X]||{},ne=ne[X]}localStorage.setItem(Go.SETTINGS,JSON.stringify(Q)),d({type:He.SET_GRID_DATA,payload:{visibleGridColumns:q}}),await Nc({baseUrl:a,payload:Q}),w(null)},V=D=>{const N=x.current,{left:B,right:Y}=N.getBoundingClientRect(),Z=50,q=D.clientX>Y-Z?1:D.clientX<B+Z?-1:0;q!==0?(clearInterval(O),O=setInterval(()=>{N.scrollLeft+=q*10},50)):clearInterval(O)},$=(D,N,B,Y)=>{var G,ne,oe;const Z=(D==null?void 0:D.isMandatory)&&(D==null?void 0:D.isSticky),q=parseFloat((ne=(G=D==null?void 0:D.style)==null?void 0:G.minWidth)==null?void 0:ne.toString().replace("rem",""))||7.5;N===0&&(v.current=0);const Q=Z?N===0?0:`${v.current}rem`:void 0;return Z&&(v.current+=q),g.jsx(As,{rowSpan:D!=null&&D.children?1:2,colSpan:(oe=D==null?void 0:D.children)==null?void 0:oe.length,style:D==null?void 0:D.style,draggable:B&&!Y&&!(D!=null&&D.isMandatory),onDragStart:B?X=>j(X,N):void 0,onDragOver:B?F:void 0,onDrop:B?X=>A(X,N):void 0,sx:{...Z&&{borderRadius:"0rem!important",position:"sticky",left:Q,zIndex:3},...D!=null&&D.children||Y?{borderRadius:"0rem!important",borderRight:X=>`0.1rem solid ${X.palette.primary.notifyBorderColor}`}:{borderLeft:X=>(D==null?void 0:D.key)==="volume_value"&&`0.1rem solid ${X.palette.primary.notifyBorderColor}`,borderRight:X=>(D==null?void 0:D.key)==="volume_value"&&`0.1rem solid ${X.palette.primary.notifyBorderColor}`}},children:g.jsx(Q1,{parent:Y,column:D,sort:t,handleMenuClick:p,isManageable:B})},N)},_=(D,N,B,Y)=>!(D!=null&&D.isMandatory)&&B?g.jsx(ge,{component:Ip,id:N,sx:{width:"4rem",maxWidth:"4rem",minWidth:"4rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,"&::after":{content:'""',position:"absolute",left:"50%",top:"50%",transform:"translate(0%, -50%)",width:"0.2rem",height:"50%",background:c.palette.primary.notifyBorderColor}},disabled:!B}):null,P=(D,N,B,Y)=>{var G,ne,oe;const Z=(D==null?void 0:D.isMandatory)&&(D==null?void 0:D.isSticky),q=parseFloat((ne=(G=D==null?void 0:D.style)==null?void 0:G.minWidth)==null?void 0:ne.toString().replace("rem",""))||7.5;B===0&&(v.current=0);const Q=Z?B===0?0:`${v.current}rem`:void 0;return Z&&(v.current+=q),g.jsxs(As,{style:D==null?void 0:D.style,className:`${D==null?void 0:D.label}`,sx:{position:"relative",...Z&&{position:"sticky",left:Q,zIndex:2,backgroundColor:X=>{var re;return e&&((re=e==null?void 0:e.selectedRow)==null?void 0:re.fhi)===(N==null?void 0:N.fhi)||N!=null&&N.isHigh?X.palette.primary.appBackground:X.palette.primary.notifyBackground}},...Y?{p:"0rem!important",borderRight:X=>`0.1rem solid ${X.palette.primary.notifyBorderColor}`}:{px:"0rem!important",borderLeft:X=>(D==null?void 0:D.key)==="volume_value"&&`0.1rem solid ${X.palette.primary.notifyBorderColor}`,borderRight:X=>(D==null?void 0:D.key)==="volume_value"&&`0.1rem solid ${X.palette.primary.notifyBorderColor}`}},children:[(e&&((oe=e==null?void 0:e.selectedRow)==null?void 0:oe.fhi)===(N==null?void 0:N.fhi)||(N==null?void 0:N.isHigh))&&g.jsx(ge,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.05rem",background:"linear-gradient(#F9B16E, #F68080)"}}),g.jsx(Ap,{isRenderCellContent:!!(D!=null&&D.cellRenderer),column:D,row:N,parent:Y})]},B)},L=(D,N,B,Y)=>!(D!=null&&D.isMandatory)&&B?g.jsx(As,{className:"column_resizer_body"},`resize-${N}`):null;return g.jsxs(g.Fragment,{children:[g.jsx(_0,{sx:{maxHeight:"100%",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem"},children:g.jsxs(A0,{ref:x,stickyHeader:!0,"aria-label":"sticky table",sx:{backgroundColor:D=>D.palette.primary.notifyBackground},children:[g.jsxs(B0,{children:[g.jsx(js,{children:u.map((D,N)=>D!=null&&D.isHidden?null:g.jsxs(R.Fragment,{children:[$(D,N,h),(r==null?void 0:r.isResizable)&&_(D,N,h)]},N))}),g.jsx(js,{children:u.flatMap((D,N)=>D!=null&&D.isHidden||!(D!=null&&D.children)?[]:D.children.map((B,Y)=>g.jsxs(R.Fragment,{children:[$(B,Y,h,D),(r==null?void 0:r.isResizable)&&_(B,Y,h)]},`${N}-${Y}`)))})]}),g.jsx(N0,{children:n.map((D,N)=>{const B=D[I],Y=M==null?void 0:M[B],Z=(Y==null?void 0:Y.length)>0;return g.jsxs(R.Fragment,{children:[g.jsx(js,{sx:{backgroundColor:q=>{var Q;return e&&((Q=e==null?void 0:e.selectedRow)==null?void 0:Q.fhi)===(D==null?void 0:D.fhi)||D!=null&&D.isHigh?q.palette.primary.appBackground:q.palette.primary.notifyBackground}},onClick:()=>e==null?void 0:e.onRowClick(D),children:u.map((q,Q)=>q!=null&&q.isHidden?null:q!=null&&q.children?q.children.map((G,ne)=>g.jsxs(R.Fragment,{children:[P(G,D,ne,q),(r==null?void 0:r.isResizable)&&L(G,ne,h)]},`${Q}-${ne}`)):g.jsxs(R.Fragment,{children:[P(q,D,Q),(r==null?void 0:r.isResizable)&&L(q,Q,h)]},Q))}),k&&Y&&g.jsx(g.Fragment,{children:Z?Y.map((q,Q)=>g.jsx(js,{children:E.map((G,ne)=>g.jsx(As,{style:G==null?void 0:G.style,children:g.jsx(Ap,{isRenderCellContent:!!(G!=null&&G.cellRenderer),column:G,row:q})},ne))},`nested-${Q}`)):g.jsx(js,{children:g.jsx(As,{colSpan:E.length,children:g.jsx(Or,{sx:{textAlign:"center"},children:Yo.NRF})})})})]},N)})})]})}),o&&g.jsx(X1,{pagination:o}),g.jsx(Z1,{menuOpen:f==null?void 0:f.isOpen,handleClose:m,onHideClick:y})]})}ew.propTypes={sort:s.object,data:s.array,pagination:s.object,columns:s.object,nested:s.object};function tw({tableProps:e,isDefaultConfig:t,gridPath:n,baseUrl:o}){var u;const{columns:r}=e,{visibleGridColumns:i=[]}=R.useContext(ya)??{},a=R.useContext(ba),l=R.useMemo(()=>{var d;return l7({columns:r,gridPath:n,baseUrl:o,isDefaultConfig:t,pageSize:(d=e==null?void 0:e.pagination)==null?void 0:d.rowPerPage})},[r,n,o,t,(u=e==null?void 0:e.pagination)==null?void 0:u.rowPerPage]),c=R.useMemo(()=>{const d=new Map(i.map(f=>[f.key,f]));return l.map(f=>{const p=d.get(f.key);return{...f,...p&&{isHidden:p.isHidden,sequenceId:p.sequenceId}}})},[l,i]);return R.useEffect(()=>{a({type:He.SET_GRID_DATA,payload:{visibleGridColumns:i.length?c:l}})},[l]),g.jsx(ew,{...e,gridPath:n,baseUrl:o})}tw.propTypes={tableProps:s.object.isRequired,mergedColumns:s.array.isRequired};const nw=({type:e})=>{const t=Nt(),o=(t==null?void 0:t.mode)==="dark"?{bgcolor:"grey.800"}:{};return{grid:g.jsxs(ge,{sx:{borderRadius:2,overflow:"hidden"},children:[g.jsx(To,{variant:"text",width:"100%",height:60,sx:o}),Array.from({length:10}).map((i,a)=>g.jsx(ge,{sx:{display:"flex",alignItems:"center",padding:"0.5rem",gap:"3rem"},children:Array.from({length:5}).map((l,c)=>g.jsx(ge,{sx:{flex:1},children:g.jsx(To,{variant:"text",height:45,sx:o})},c))},a))]}),toolbar:g.jsx(g.Fragment,{children:g.jsxs(dt,{direction:"row",justifyContent:"space-between",sx:{display:"flex",gap:"1rem"},children:[g.jsxs(dt,{direction:"row",gap:"1rem",children:[g.jsx(To,{variant:"text",width:"10.2rem",height:"5rem",sx:o}),g.jsx(To,{variant:"text",width:"3.5rem",height:"5rem",sx:o}),g.jsx(To,{variant:"text",width:"15.2rem",height:"5rem",sx:o})]}),g.jsxs(dt,{direction:"row",gap:"1rem",children:[g.jsx(To,{variant:"text",width:"10.2rem",height:"5rem",sx:o}),g.jsx(To,{variant:"text",width:"3.5rem",height:"5rem",sx:o}),g.jsx(To,{variant:"text",width:"3.5rem",height:"5rem",sx:o})]})]})})}[e]},b7=e=>{if(!e)return null;const{options:t,...n}=e,o=t?"select":"button",r={button:i=>g.jsx(hr,{...i}),select:i=>{var a;return g.jsx(ge,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"},width:(a=i.styles)==null?void 0:a.width},children:g.jsx(s1,{...i,options:t})})}};return r[o]?r[o](n):null},v7=({presentSetting:e,gridSetting:t,gridPath:n})=>{var a;if(!n)return e;const o=n.split("/").filter(Boolean),r=(a=t==null?void 0:t.grid)==null?void 0:a.map(({id:l,isHidden:c,isSortable:u,key:d,sequenceId:f})=>({id:l,isHidden:c,isSortable:u,key:d,sequenceId:f}));let i=e;for(let l=0;l<o.length;l++){const c=o[l];l===o.length-1?i[c]={columns:r,pageSize:(t==null?void 0:t.pageSize)??null}:(i[c]=i[c]||{},i=i[c])}return{settingObject:e,defaultUserSettings:r}},x7=async({baseUrl:e,gridSetting:t,gridPath:n})=>{try{const o=JSON.parse(localStorage.getItem("settings")),{settingObject:r,defaultUserSettings:i}=v7({presentSetting:o,gridSetting:t,gridPath:n});return localStorage.setItem("settings",JSON.stringify(r)),await Nc({baseUrl:e,payload:r}),i}catch(o){console.error(o)}},w7=({customTools:e})=>{var o,r;const t=(o=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===Y1.PRIMARY))==null?void 0:o.sort((i,a)=>i.sequenceId-a.sequenceId),n=(r=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===Y1.SECONDARY))==null?void 0:r.sort((i,a)=>i.sequenceId-a.sequenceId);return{primaryButtons:t,secondaryButtons:n}},ow=({customTools:e,isExpanded:t,setIsExpanded:n})=>{const{primaryButtons:o,secondaryButtons:r}=w7({customTools:e}),[i,a]=R.useState(o),l=(r==null?void 0:r.length)>0,c=d=>{d?a([...o,...r]):setTimeout(()=>{a(o)},100)},u=()=>{const d=!t;n(d),c(d)};return R.useEffect(()=>{c(t)},[e]),g.jsxs(g.Fragment,{children:[t&&g.jsx("div",{style:{position:"fixed",left:0,width:"100vw",height:"4rem",zIndex:998}}),g.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:"0.8rem",flexWrap:"nowrap",maxWidth:"100%",whiteSpace:"nowrap",zIndex:999},children:[g.jsx(K3,{mode:"popLayout",children:i.map((d,f)=>g.jsx(Ki.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},layout:!0,children:g.jsx(ge,{sx:{flexShrink:0,minWidth:"fit-content"},children:b7(d)})},`${d.id}_${f}`))}),l&&g.jsx(ge,{sx:{paddingLeft:t?"0.5rem":0},children:g.jsx(hr,{label:t?"":"More Actions",styles:{icon:t?nt.CrossWhite:nt.More,colorType:t?"danger":""},onClick:u})})]})]})};ow.propTypes={customTools:s.array.isRequired};const rw=({defaultTools:e,isManageable:t,customTools:n,baseUrl:o,gridPath:r,managableColumns:i=[],pageSize:a})=>{var b,x,T,w,O,v;const l=R.useContext(ba),{visibleGridColumns:c,triggerApi:u}=R.useContext(ya),[d,f]=R.useState([]),[p,m]=R.useState(!1);R.useEffect(()=>{if(i.length){const E=i.length?c.filter(k=>i.includes(k.id)):c;f(E)}},[i,c]);const y=async E=>{try{await x7({baseUrl:o,gridPath:r,gridSetting:{grid:E,pageSize:a}})}catch(k){console.error(k)}finally{l({type:He.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),l({type:He.TRIGGER_API,payload:{triggerApi:!1}})}};R.useEffect(()=>{u&&y(c)},[u]);const h=E=>{const k=c.map(M=>d.some(j=>j.id===M.id)?{...M,isHidden:!E.some(j=>j.id===M.id)}:M);l({type:He.SET_GRID_DATA,payload:{visibleGridColumns:k}}),l({type:He.HAS_SETTING_CHANGE,payload:{hasChange:!0}})};return g.jsxs(ge,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.6rem",width:"100%"},children:[g.jsxs(ge,{sx:{display:"flex",flexDirection:"row",gap:"0.6rem"},children:[((b=e==null?void 0:e.search)==null?void 0:b.isRequired)&&g.jsx(n1,{...e==null?void 0:e.search}),((x=e==null?void 0:e.groupBy)==null?void 0:x.isRequired)&&g.jsx(ge,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:g.jsx(wc,{styles:{icon:nt.Group},...e.groupBy})}),((T=e==null?void 0:e.refresh)==null?void 0:T.isRequired)&&g.jsx(hr,{...e==null?void 0:e.refresh,styles:{variant:"filled",icon:nt.Refresh,colorType:"empty",width:"3.2rem",height:"3.2rem"}}),t&&g.jsx(ge,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:g.jsx(wc,{placeholder:"Manage Columns",options:d,value:d.filter(E=>!E.isHidden),isMulti:!0,isDraggable:!0,showSearch:!0,onChange:h,styles:{icon:nt.Manage}})})]}),g.jsxs(ge,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[n&&g.jsx(ow,{customTools:n,setIsExpanded:m,isExpanded:p}),((w=e==null?void 0:e.save)==null?void 0:w.isRequired)&&g.jsx(ge,{sx:{px:"0.5rem"},children:g.jsx(hr,{label:p?"":"Save",styles:{icon:nt.Save,colorType:"empty"},...e==null?void 0:e.save})}),((O=e==null?void 0:e.upload)==null?void 0:O.isRequired)&&g.jsx(hr,{...e==null?void 0:e.upload,styles:{variant:p?"outlined":"filled",icon:p?nt.UploadDark:nt.Upload,colorType:"secondary",isAnimate:!0}}),((v=e==null?void 0:e.download)==null?void 0:v.isRequired)&&g.jsx(hr,{...e==null?void 0:e.download,styles:{variant:"outlined",icon:nt.Download,isAnimate:!0}})]})]})};rw.propTypes={defaultTools:s.object.isRequired,customTools:s.array,isManageable:s.bool,baseUrl:s.string,gridPath:s.gridPath};function Np({tableProps:e,toolbarProps:t,isDefaultConfig:n,isLoading:o}){var i,a;const r=(i=e.columns)==null?void 0:i.isManageable;return g.jsx(r1,{children:o?g.jsxs(g.Fragment,{children:[g.jsx(nw,{type:"toolbar"}),g.jsx(nw,{type:"grid"})]}):g.jsxs(g.Fragment,{children:[t&&g.jsx(rw,{...t,isManageable:r,pageSize:(a=e==null?void 0:e.pagination)==null?void 0:a.rowPerPage}),g.jsx(tw,{tableProps:e,isDefaultConfig:n,gridPath:(t==null?void 0:t.gridPath)||"",baseUrl:(t==null?void 0:t.baseUrl)||""})]})})}Np.propTypes={tableProps:s.object.isRequired,toolbarProps:s.object,isDefaultConfig:s.bool};const sw=({list:e,handleLinkClick:t})=>{const n=Nt(),o=({list:r})=>{var i;return(i=r==null?void 0:r.sort((a,l)=>a.order-l.order))==null?void 0:i.map((a,l)=>a!=null&&a.link?g.jsx(_o,{component:"h3",sx:{fontSize:"1rem",cursor:"pointer",color:l===(r==null?void 0:r.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):g.jsx(et,{component:"h3",sx:{fontSize:"1rem",color:l===(r==null?void 0:r.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},children:a==null?void 0:a.title},l))};return g.jsx($g,{separator:g.jsx(ge,{component:"img",src:nt.ArrowRight}),children:o({list:e})})};sw.propTypes={list:s.array.isRequired,handleLinkClick:s.func};const iw=({breadcrumbProps:e,switchProps:t,filterComponentProps:n})=>{var r,i,a,l,c,u;const o=Nt();return g.jsxs(g.Fragment,{children:[g.jsxs(dt,{sx:{background:o.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,height:"3rem",p:"0px 5.5rem 0 1.5rem",zIndex:4,position:"relative"},direction:"row",justifyContent:"space-between",alignItems:"center",children:[g.jsx(sw,{...e}),g.jsxs(dt,{direction:"row",gap:"1rem",alignItems:"center",children:[t&&g.jsx(c1,{...t}),(n==null?void 0:n.filterBtnProps)&&g.jsxs(dt,{direction:"row",children:[g.jsx(bi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"2rem!important",opacity:"1!important",borderColor:o.palette.primary.notifyBorderColor}}),g.jsxs(dt,{direction:"row",alignItems:"center",gap:"0.5rem",onClick:(r=n==null?void 0:n.filterBtnProps)==null?void 0:r.onFilterClick,sx:{cursor:"pointer"},children:[g.jsx(ge,{component:"img",src:o.icons.filter}),g.jsx(et,{sx:{fontSize:"1.1rem",color:o.palette.primary.notifyActiveText},children:(i=n==null?void 0:n.filterBtnProps)==null?void 0:i.label})]})]})]})]}),g.jsx(Ki.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:o.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,padding:"0px 5.5rem 0 1.5rem",position:"relative",alignItems:"center",display:"flex",overflow:"hidden"},children:g.jsxs(dt,{sx:{background:o.palette.primary.appBackground,height:"3.8rem",p:"0 2rem",width:"100%",borderRadius:"0.7rem",overflow:"visible"},direction:"row",alignItems:"center",children:[g.jsx(et,{sx:{fontSize:"1.2rem",fontWeight:"500",color:o.palette.primary.notifyActiveText},children:"Filters:"}),g.jsx(ge,{sx:{overflowX:"auto",overflowY:"visible",whiteSpace:"nowrap",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},margin:"0 1rem",padding:"0.5rem 0",flexGrow:1},children:g.jsx(dt,{direction:"row",gap:"1.2rem",sx:{overflow:"visible"},children:(c=n==null?void 0:n.filterItems)==null?void 0:c.map((d,f)=>g.jsx(g.Fragment,{children:g.jsxs(ge,{sx:{position:"relative",overflow:"visible",border:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,background:o.palette.primary.notifyBackground,borderRadius:"0.6rem",padding:"0.3rem 1.1rem",display:"inline-block"},children:[g.jsx(ge,{component:"img",src:nt.FilterClose,sx:{position:"absolute",top:"-0.4rem",right:"-0.6rem",cursor:"pointer"},onClick:()=>n==null?void 0:n.onFilterChipClose(d)}),g.jsx(et,{sx:{fontSize:"1rem",color:o.palette.primary.notifyTextColor},children:d==null?void 0:d.filterLabel})]},f)}))})}),g.jsx(ge,{component:et,sx:{fontSize:"1.1rem",fontWeight:"500",textDecoration:"underline",color:o.palette.brandColor.red,cursor:"pointer"},onClick:(u=n==null?void 0:n.filterContainerProps)==null?void 0:u.onClearClick,children:"Clear"})]})})]})};iw.propTypes={breadcrumbProps:s.object.isRequired,switchProps:s.object};function aw({headerProps:e}){return g.jsx(_n,{children:g.jsx(iw,{...e})})}aw.propTypes={headerProps:s.object.isRequired};const $p=R.createContext(null),lw=R.createContext(null);function C7({children:e}){const[t,n]=R.useReducer(S7,T7);return g.jsx($p.Provider,{value:t,children:g.jsx(lw.Provider,{value:n,children:e})})}function S7(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((o,r)=>new Date(r.createdAt)-new Date(o.createdAt))};case He.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case He.ERROR:return{...e,error:t.error};default:throw new Error(`${Yo.UNHANDLED}: ${t}`)}}const T7={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:_p,BU_ID:Fp,SNOP_ID:cw}=Pp,{TENANT_IDS:Bp,BU_IDS:Lp}=Tr,O7=async e=>{try{const t=`${e}${jc.NOTIFICATION}/v1?${_p}=${Bp}&${Fp}=${Lp}`;return await St.get(t,Sa)}catch(t){return t}},uw=async(e,t,n)=>{try{const o=n===q1.MARK_ALL_READ?"":`&${cw}=${n}&`,r=`${e}${jc.NOTIFICATION}${Ep.VERSION}?${_p}=${Bp}&${Fp}=${Lp}${o}`;return await St.put(r,t,Sa)}catch(o){return o}},E7=async({baseUrl:e,id:t,snopId:n})=>{try{const o=`${e}${jc.NOTIFICATION}${Ep.VERSION}?${_p}=${Bp}&${Fp}=${Lp}&${cw}=${n}&id=${t}`;return await St.get(o,Sa)}catch(o){return o}},_c={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500},dw=({baseUrl:e})=>{const t=R.useContext(lw),[n,o]=R.useState(!1),[r,i]=R.useState(!1),[a,l]=R.useState(!1),[c,u]=R.useState({}),[d,f]=R.useState(null),[p,m]=R.useState(1),[y,h]=R.useState(!1),[b,x]=R.useState(0),{loading:T,data:w,isMarkAllAsRead:O}=R.useContext($p),[v,E]=R.useState([]);R.useEffect(()=>{E(w)},[w]);const k=R.useCallback(async()=>{var $,_;try{t({type:He.LOADING,loading:!0}),t({type:He.SUCCESS,data:[]});const P=await O7(e);if(P.status===_c.OK){const L=((_=($=P.data)==null?void 0:$.responseData)==null?void 0:_.response)||[],W=xc(L);t({type:He.SUCCESS,data:xc(W)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:o1(L),boo:o1(L)>0}})}}catch{t({type:He.ERROR,error:Yo.SWR})}finally{t({type:He.LOADING,loading:!1})}},[e,t]);R.useEffect(()=>{k();const $=setInterval(k,3e5);return()=>clearInterval($)},[k]);const M=async($,_)=>{var P,L,W;if($){f($);try{const D=await E7({baseUrl:e,id:$,snopId:_});if(D.status===_c.OK){const N=((W=(L=(P=D.data)==null?void 0:P.responseData)==null?void 0:L.response)==null?void 0:W[0])||{};u(N||{}),l(!0)}else throw new Error}catch{t({type:He.ERROR,error:Yo.SWR})}finally{f(null)}}},I=async($,_)=>{if($.length){t({type:He.LOADING,loading:!0});try{if((await uw(e,$,_)).status===_c.OK){const L=w.map(D=>$.includes(D.id)?{...D,isRead:!0}:D),W=L.filter(D=>!D.isRead).length;t({type:He.SUCCESS,data:xc(L)}),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:Yo.SWR}),t({type:He.LOADING,loading:!1})}}},j=async()=>{t({type:He.LOADING,loading:!0});try{const $=aV(w);if((await uw(e,$,q1.MARK_ALL_READ)).status===_c.OK){const P=w.map(L=>({...L,isRead:!0}));t({type:He.SUCCESS,data:xc(P)}),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:Yo.SWR}),t({type:He.LOADING,loading:!1})}},F=($,_)=>{t({type:He.LOADING,loading:!0}),x(_),setTimeout(()=>{t({type:He.LOADING,loading:!1})},400)},A=$=>{const _=$||w||[];return{0:_,1:_.filter(P=>(P==null?void 0:P.type)==="INFO"),2:_.filter(P=>(P==null?void 0:P.type)==="ERROR")}},V=()=>{t({type:He.LOADING,loading:!0});const $=!y,_=$?(v||[]).filter(P=>!P.isRead):w||[];h($),E(_),m(1),setTimeout(()=>{t({type:He.LOADING,loading:!1})},400)};return{fetchNotification:k,showDetailsProps:{open:a,handleClose:()=>l(!1),setOpen:l,data:c,clickId:d},alertDialogProps:{open:n,handleClose:()=>o(!1),onRefresh:k,handleRead:I,handleMarkAllAsRead:j,setOpen:o,handleShowDetails:M,clickId:d,isMainDialog:!0},activeTab:b,loading:T,tabData:A(v)[b],data:v,mode:y,handleTabChange:F,toggleAlertMode:V,page:p,setPage:m}};var fw,pw,hw,mw;function Vp(){return Vp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Vp.apply(null,arguments)}var k7=function(t){return C.createElement("svg",Vp({xmlns:"http://www.w3.org/2000/svg",width:16,height:18,fill:"none"},t),fw||(fw=C.createElement("path",{stroke:"#666D80",strokeLinecap:"round",strokeMiterlimit:10,d:"M8.013 3.44c-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.373V7.44c0-2.2-1.8-4-4-4Z"})),pw||(pw=C.createElement("path",{stroke:"#666D80",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.247 3.633a4.503 4.503 0 0 0-2.467 0 1.324 1.324 0 0 1 2.467 0"})),hw||(hw=C.createElement("path",{stroke:"#666D80",strokeMiterlimit:10,d:"M10.014 14.207c0 1.1-.9 2-2 2a2.007 2.007 0 0 1-2-2"})),mw||(mw=C.createElement("circle",{cx:12.266,cy:3,r:2.5,fill:"#E85353",stroke:"#F8FAFB"})))};const P7=({count:e})=>(Nt(),g.jsxs(g.Fragment,{children:[g.jsx(ge,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center","& svg":{transform:"scale(1)"}},children:g.jsx(k7,{style:{scale:2}})}),g.jsx(h7,{badgeContent:e==0?"":null,color:"error"})]}));function gw({children:e,handleClose:t,open:n,isMainDialog:o}){return g.jsx(Ol,{open:n,onClose:t,...o?{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:r=>r.palette.primary.notifyBackground}}}:{fullWidth:!0,maxWidth:"md",sx:{"& .MuiPaper-root":{minHeight:250,maxHeight:500,borderRadius:"1.5rem",boxShadow:6,backgroundColor:r=>r.palette.primary.appBackground}}},children:e})}var yw;function Wp(){return Wp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Wp.apply(null,arguments)}var M7=function(t){return C.createElement("svg",Wp({xmlns:"http://www.w3.org/2000/svg",width:14,height:9,fill:"none",viewBox:"0 0 13 9"},t),yw||(yw=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"})))},bw,vw;function zp(){return zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},zp.apply(null,arguments)}var R7=function(t){return C.createElement("svg",zp({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),bw||(bw=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"})),vw||(vw=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"})))},xw;function Up(){return Up=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Up.apply(null,arguments)}var D7=function(t){return C.createElement("svg",Up({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),xw||(xw=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 ww=({type:e,item:t,handleShowDetails:n,handleRead:o,handleCTAClicked:r,clickId:i})=>{var c,u;const a=Nt(),l=(u=(c=JSON.parse(localStorage.getItem("settings")))==null?void 0:c.platform)==null?void 0:u.theme;return g.jsxs(ge,{className:"cards",sx:{pt:" 0.8rem"},children:[g.jsx(dt,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:g.jsx(ed,{sx:{width:"calc(100% - 2%)","& .MuiBadge-badge":{backgroundColor:"#6041EA",height:"0.5rem",minWidth:"0.5rem"}},variant:"dot",className:"badge",invisible:t==null?void 0:t.isRead,children:g.jsx(Or,{sx:{color:a.palette.primary.notifyActiveText},component:"p",className:["title-card",(t==null?void 0:t.isRead)&&"read"].join(" "),children:t==null?void 0:t.message})})}),g.jsx(dt,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:g.jsxs(dt,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[(t==null?void 0:t.isNotificationDetails)&&g.jsx($c,{icon:g.jsx(R7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:n,label:i===(t==null?void 0:t.id)?g.jsx(Tl,{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)&&g.jsx($c,{icon:g.jsx(D7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:o,label:"Acknowledge",component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.primaryCTAURL)&&g.jsx($c,{disabled:t==null?void 0:t.isPrimaryCTAClicked,onClick:()=>r({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)&&g.jsx($c,{disabled:t==null?void 0:t.isSecondaryCTAClicked,onClick:()=>r({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"})]})}),g.jsxs(dt,{display:"flex",flexDirection:"row",alignItems:"center",gap:.35,children:[g.jsx(Or,{sx:{fontSize:"0.8rem"},children:t==null?void 0:t.product}),g.jsx(Or,{color:a.palette.primary.notifyTextColor,children:"•"}),g.jsx(Or,{sx:{fontSize:"0.8rem"},children:iV(t==null?void 0:t.createdAt)})]})]})};ww.propTypes={type:s.string,title:s.string,subTitle:s.string,isRead:s.bool,handleShowDetails:s.func,handleRead:s.func};const Cw=({data:e,handleRead:t,handleShowDetails:n,clickId:o,mode:r,page:i,setPage:a})=>{const{isMarkAllAsRead:l}=R.useContext($p),c=new Date,u=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(c),[d,f]=R.useState([]),[p,m]=R.useState(!1),[y,h]=R.useState(!0),b=R.useRef(null),x=async w=>{m(!0);const O=e.slice((w-1)*10,w*10);await new Promise(v=>setTimeout(v,1e3)),f(v=>{const E=O.filter(k=>!v.some(M=>M.id===k.id));return[...v,...E]}),m(!1),(d==null?void 0:d.length)>=(e==null?void 0:e.length)&&h(!1)};R.useEffect(()=>{var O;let w=[];r?l!=null&&l.count?w=(O=e==null?void 0:e.filter(v=>!v.isRead))==null?void 0:O.slice(0,10):w=[]:w=e.slice(0,10),(w==null?void 0:w.length)<10&&h(!1),f(w)},[e,r,l]),R.useEffect(()=>{y&&i!==1&&x(i)},[i,e]),R.useEffect(()=>{f([...e])},[e]),R.useEffect(()=>{const w=new IntersectionObserver(O=>{O[0].isIntersecting&&!p&&y&&a(v=>v+1)},{threshold:1});return b.current&&w.observe(b.current),()=>{b.current&&w.unobserve(b.current)}},[p,y]);const T=({redirect:w,isClicked:O,url:v})=>{window.open(v,"_blank")};return g.jsxs(ge,{sx:{width:"100%"},children:[Object.entries(lV(d)).map(([w,O])=>g.jsxs(R.Fragment,{children:[w!==u&&g.jsx(p7,{children:w}),O.map((v,E)=>g.jsx(R.Fragment,{children:g.jsx(ww,{item:v,handleCTAClicked:T,handleShowDetails:()=>n(v.id,v.snopId),handleRead:()=>t([v.id],v.snopId),clickId:o})},`${E}_${v.id}`))]},w)),p&&i>1&&!!(d!=null&&d.length)&&g.jsx(ge,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:g.jsx(Tl,{size:20,sx:{color:w=>w.palette.primary.notifyIconColor}})}),!(d!=null&&d.length)&&g.jsx(et,{sx:{fontSize:"1.1rem",color:w=>w.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."}),g.jsx(ge,{ref:b,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};Cw.propTypes={data:s.array,handleRead:s.func,handleShowDetails:s.func};const I7=({onRefresh:e,handleShowDetails:t,clickId:n,handleRead:o,handleMarkAllAsRead:r})=>{var y,h,b,x;const{loading:i,activeTab:a,data:l,tabData:c,mode:u,page:d,setPage:f,handleTabChange:p,toggleAlertMode:m}=dw({});return g.jsxs(g.Fragment,{children:[g.jsxs(ge,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,pt:2},children:[g.jsx(et,{variant:"h2",sx:{fontSize:"1.2rem",color:T=>T.palette.primary.notifyTextColor},children:"Notifications"}),g.jsx(ge,{component:"img",src:nt.Refresh,alt:"refresh",onClick:e,sx:{cursor:"pointer"}})]}),g.jsx(ge,{sx:{borderBottom:1,m:"1.2rem 1.2rem 0 1.2rem",borderColor:T=>T.palette.primary.notifyBorderColor},children:g.jsxs(m7,{value:a,onChange:p,children:[g.jsx(jp,{label:g.jsxs(ge,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["All (",g.jsx(et,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((y=l==null?void 0:l.filter(T=>!(T!=null&&T.isRead)))==null?void 0:y.length)||0}),")"]})}),g.jsx(jp,{label:g.jsxs(ge,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Info (",g.jsx(et,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((h=l==null?void 0:l.filter(T=>(T==null?void 0:T.type)==="INFO"&&!(T!=null&&T.isRead)))==null?void 0:h.length)||0}),")"]}),sx:{color:T=>T.palette.brandColor.blue}}),g.jsx(jp,{label:g.jsxs(ge,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Error (",g.jsx(et,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((b=l==null?void 0:l.filter(T=>(T==null?void 0:T.type)==="ERROR"&&!(T!=null&&T.isRead)))==null?void 0:b.length)||0}),")"]}),sx:{color:T=>T.palette.brandColor.red}})]})}),g.jsx(kl,{dividers:!0,sx:{p:0,...i&&!c.length&&{alignItems:"center",justifyContent:"center"},flexGrow:1,overflowY:"auto",mx:"1.2rem",borderColor:T=>T.palette.primary.notifyBorderColor},tabIndex:-1,children:i?g.jsx(Tl,{size:30,sx:{color:T=>T.palette.primary.notifyIconColor}}):g.jsx(g.Fragment,{children:g.jsx(Cw,{data:c,handleShowDetails:t,handleRead:o,clickId:n,page:d,setPage:f,mode:u})})}),g.jsxs(El,{sx:{justifyContent:"space-between",px:"1.2rem"},children:[g.jsxs(dt,{direction:"row",gap:1,children:[g.jsx(Or,{sx:{fontSize:"1rem"},children:"Only show unread"}),g.jsx(f7,{disabled:i,checked:u,onChange:m})]}),g.jsx(Un,{variant:"outlined",className:"view-all",onClick:r,startIcon:g.jsx(M7,{}),disabled:!((x=l==null?void 0:l.filter(T=>!(T!=null&&T.isRead)))!=null&&x.length),style:{backgroundColor:"transparent"},sx:{fontSize:"1rem",fontWeight:"300",p:0,border:"none",textTransform:"none",color:T=>T.palette.primary.notifyTextColor,"&:hover":{color:T=>T.palette.primary.notifyActiveText,background:"transparent",boxShadow:"none",border:"none"},"&.Mui-disabled":{opacity:.5,color:T=>`${T.palette.primary.notifyActiveText}!important`,background:"transparent",boxShadow:"none",border:"none"}},children:"Mark all as read"})]})]})},A7=({data:e,handleClose:t})=>{var T;const[n,o]=R.useState(1),[r,i]=R.useState(10),[a,l]=R.useState(((T=e==null?void 0:e.notificationDetails)==null?void 0:T.length)||0),[c,u]=R.useState("sku_name"),[d,f]=R.useState("asc"),[p,m]=R.useState(""),y=["sku_name","node","channel_name"],h=R.useMemo(()=>!(e!=null&&e.notificationDetails)||!y.length?[]:p.trim()?e.notificationDetails.filter(w=>y.some(O=>{var v;return(v=w[O])==null?void 0:v.toString().toLowerCase().includes(p.toLowerCase())})):e.notificationDetails,[e,p,y]),b=R.useMemo(()=>c?[...h].sort((w,O)=>{const v=w[c],E=O[c];return v==null?1:E==null?-1:typeof v=="number"&&typeof E=="number"?d==="asc"?v-E:E-v:!isNaN(Date.parse(v))&&!isNaN(Date.parse(E))?d==="asc"?new Date(v).getTime()-new Date(E).getTime():new Date(E).getTime()-new Date(v).getTime():d==="asc"?v.toString().localeCompare(E.toString()):E.toString().localeCompare(v.toString())}):h,[h,c,d]),x=R.useMemo(()=>{const w=(n-1)*r,O=w+r;return b.slice(w,O)},[b,n,r]);return console.log({paginatedData:x}),g.jsxs(g.Fragment,{children:[g.jsxs(dt,{direction:"row",justifyContent:"space-between",sx:{padding:"1.5rem 2rem",borderBottom:"0.1rem solid",borderColor:w=>w.palette.primary.notifyBorderColor},children:[g.jsx(et,{component:"h2",sx:{fontSize:"1.4rem",color:w=>w.palette.primary.notifyActiveText},children:(e==null?void 0:e.message)||""}),g.jsx(ge,{component:"img",src:nt.CloseCircle,onClick:t,sx:{cursor:"pointer"}})]}),g.jsx(kl,{children:g.jsx(Np,{tableProps:{data:x,columns:{...u7(),isManageable:!1},sort:{sortField:c,sortDir:d,onSort:w=>{var v;const O=(v=w==null?void 0:w.column)==null?void 0:v.key;f(E=>c===O&&E==="asc"?"desc":"asc"),u(O)}},pagination:{selectedPage:n,rowPerPage:r,totalRecords:a,onPageChange:w=>{o(w)},onPageSizeChange:w=>{i(w==null?void 0:w.value),o(1)}}},toolbarProps:{defaultTools:{search:{isRequired:!0,onChange:w=>{m(w.target.value)},placeholder:"Search..."}}}})}),g.jsx(El,{sx:{padding:"1.5rem 2rem"}})]})},j7=({baseUrl:e})=>{const{alertDialogProps:t,showDetailsProps:n,fetchNotification:o}=dw({baseUrl:e});return g.jsxs(g.Fragment,{children:[g.jsx(ge,{sx:{display:"flex",justifyContent:"center",cursor:"pointer",marginTop:"0.6rem"},onClick:()=>{var r;o(),(r=t==null?void 0:t.setOpen)==null||r.call(t,!0)},children:g.jsx(P7,{count:0})}),g.jsx(gw,{...t,children:g.jsx(I7,{...t})}),g.jsx(gw,{...n,children:g.jsx(A7,{...n})})]})},N7=({baseUrl:e})=>g.jsx(_n,{children:g.jsx(C7,{children:g.jsx(j7,{baseUrl:e})})}),$7=({rightChild:e,leftChild:t,isDrawerMerged:n,isDrawerOpen:o,drawerTitle:r,showExpand:i,onCloseClick:a,onMergeClick:l,onExpandClick:c,isDrawerExpanded:u,styles:d,showMerge:f})=>{const p=Nt();return g.jsx(ge,{sx:{position:"relative",overflow:"hidden"},children:g.jsxs(ar,{container:!0,sx:{height:"100%"},children:[g.jsx(ar,{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}),o&&!n&&g.jsxs(g.Fragment,{children:[g.jsx(ge,{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"}}),g.jsx(ge,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"transparent",zIndex:4}})]}),e&&g.jsxs(ar,{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:o?"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:[g.jsxs(dt,{direction:"row",alignItems:"center",sx:{width:"100%",flexShrink:0,paddingBottom:"0.8rem",px:2,pt:"0.8rem",borderBottom:m=>`0.1rem solid ${m.palette.primary.notifyBorderColor}`},children:[!u&&f&&g.jsxs(g.Fragment,{children:[g.jsx(ge,{sx:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer"},onClick:l,children:g.jsx(ge,{component:"img",src:nt.Merge})}),g.jsx(bi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"auto!important",borderColor:p.palette.primary.notifyBorderColor}})]}),g.jsxs(dt,{direction:"row",justifyContent:"space-between",alignItems:"center",flexGrow:1,children:[g.jsxs(dt,{direction:"row",gap:"0.5rem",alignItems:"center",onClick:a,sx:{cursor:"pointer"},children:[g.jsx(ge,{component:"img",src:p.icons.close}),g.jsx(et,{sx:{fontSize:"1.2rem",color:p.palette.primary.notifyTextColor},children:r})]}),g.jsx(dt,{direction:"row",gap:"0.5rem",alignItems:"center",children:i&&g.jsx(ge,{onClick:c,sx:{cursor:"pointer"},children:g.jsx(ge,{component:"img",src:u?nt.Collapse:nt.Expand})})})]})]}),g.jsx(ge,{sx:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},overflow:"auto",px:2},children:e})]})]})})},Sw=({layoutChildren:e,layoutProps:t})=>g.jsx(_n,{children:g.jsx($7,{...e,...t})});Sw.propTypes={layoutChildren:s.object.isRequired,layoutProps:s.object.isRequired},vt.Button=hr,vt.Checkbox=oc,vt.DatePicker=rV,vt.Grid=Np,vt.Header=aw,vt.InputField=n1,vt.Loader=MV,vt.Notification=N7,vt.Select=s1,vt.SliderLayout=Sw,vt.Switch=c1,vt.TextField=bc,vt.ToastProvider=TV,vt.toast=xV,Object.defineProperty(vt,Symbol.toStringTag,{value:"Module"})});
|
|
327
327
|
//# sourceMappingURL=index.umd.js.map
|