botech-library 1.0.34 → 1.0.48
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/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/Header/Header.d.ts +1 -14
- package/dist/types/components/Header/Header.d.ts.map +1 -1
- package/dist/types/components/Header/types.d.ts +1 -0
- package/dist/types/components/Header/types.d.ts.map +1 -1
- package/dist/types/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/types/components/Sidebar/types.d.ts +7 -0
- package/dist/types/components/Sidebar/types.d.ts.map +1 -1
- package/dist/types/components/Sidebar/useSidebarPerformanceMode.d.ts +20 -0
- package/dist/types/components/Sidebar/useSidebarPerformanceMode.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e,Fragment as n}from"react/jsx-runtime";import*as i from"react";import s,{createContext as r,useRef as o,useLayoutEffect as a,useEffect as l,useId as c,useContext as u,useInsertionEffect as h,useMemo as d,useCallback as m,Children as p,isValidElement as f,useState as g,forwardRef as y,Fragment as v,createElement as x,Component as b}from"react";import w from"sweetalert2";import T from"axios";import{createPortal as P}from"react-dom";const S=({variant:e="primary",size:n="md",onClick:i,children:s,className:r="",disabled:o=!1})=>t("button",{className:`rounded font-medium transition-colors duration-300 ease-in-out ${{sm:"px-3 py-1.5 text-sm",md:"px-4 py-2",lg:"px-6 py-3 text-lg"}[n]} ${{primary:o?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-primary-botech hover:bg-primary-botech-400 text-white cursor-pointer",secondary:o?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-800 cursor-pointer",danger:o?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-red-500 hover:bg-red-600 text-white cursor-pointer"}[e]} ${r}`,onClick:o?void 0:i,disabled:o,children:s}),E=({leftIcon:n,rightIcon:i,children:s,onClick:r,className:o="",variant:a="primary",size:l="md",disabled:c=!1})=>e("button",{type:"button",className:`inline-flex items-center gap-2 rounded font-medium transition-colors duration-300 ease-in-out ${{sm:"px-3 py-1.5 text-sm",md:"px-4 py-2",lg:"px-6 py-3 text-lg"}[l]} ${{primary:c?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-primary-botech hover:bg-primary-botech-400 text-white cursor-pointer",secondary:c?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-800 cursor-pointer",danger:c?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-red-500 hover:bg-red-600 text-white cursor-pointer"}[a]} ${o}`,onClick:c?void 0:r,disabled:c,children:[n&&t("span",{className:"flex items-center",children:n}),s,i&&t("span",{className:"flex items-center",children:i})]});var k={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},C=s.createContext&&s.createContext(k),A=["attr","size","title"];function M(t,e){if(null==t)return{};var n,i,s=function(t,e){if(null==t)return{};var n={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){if(e.indexOf(i)>=0)continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}function N(){return N=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},N.apply(this,arguments)}function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function D(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?V(Object(n),!0).forEach(function(e){L(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function L(t,e,n){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"))?i:i+"")in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function j(t){return t&&t.map((t,e)=>s.createElement(t.tag,D({key:e},t.attr),j(t.child)))}function R(t){return e=>s.createElement(O,N({attr:D({},t.attr)},e),j(t.child))}function O(t){var e=e=>{var n,{attr:i,size:r,title:o}=t,a=M(t,A),l=r||e.size||"1em";return e.className&&(n=e.className),t.className&&(n=(n?n+" ":"")+t.className),s.createElement("svg",N({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,i,a,{className:n,style:D(D({color:t.color||e.color},e.style),t.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),o&&s.createElement("title",null,o),t.children)};return void 0!==C?s.createElement(C.Consumer,null,t=>e(t)):e(k)}function B(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(t)}function F(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"},child:[]}]})(t)}function I(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"path",attr:{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(t)}function $(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"},child:[]},{tag:"polyline",attr:{points:"16 17 21 12 16 7"},child:[]},{tag:"line",attr:{x1:"21",y1:"12",x2:"9",y2:"12"},child:[]}]})(t)}function U(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"3",y1:"12",x2:"21",y2:"12"},child:[]},{tag:"line",attr:{x1:"3",y1:"6",x2:"21",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",y1:"18",x2:"21",y2:"18"},child:[]}]})(t)}function W(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(t)}function z(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(t)}const H=({title:n,description:i,logoUrl:s,logoAlt:r="Logo",systemName:o="PASS",systemSubtitle:a="Sistema Escolar",onMenuToggle:l,showPageInfo:c=!0,className:u="flex flex-col sm:flex-row sm:items-end bg-primary-botech text-white p-3 sm:p-4 shadow-lg gap-3 sm:gap-0 justify-between",logoClassName:h="h-8 sm:h-10 object-contain",titleClassName:d="text-lg sm:text-xl font-bold",descriptionClassName:m="text-xs sm:text-sm opacity-80"})=>e("div",{className:u,children:[e("div",{className:"flex items-center gap-3 sm:gap-4",children:[t("button",{onClick:l,className:"p-2 rounded-lg hover:bg-primary-botech-600 transition-colors focus:outline-none focus:ring-2 focus:ring-white focus:ring-opacity-20 flex-shrink-0","aria-label":"Abrir menú",children:t(U,{className:"w-5 h-5 sm:w-6 sm:h-6"})}),e("div",{className:"flex items-center min-w-0 flex-1",children:[t("div",{className:"flex items-center justify-center mr-2 sm:mr-3 flex-shrink-0",children:s?t("img",{src:s,alt:r,className:h}):t("div",{className:"w-8 h-8 sm:w-10 sm:h-10 bg-white bg-opacity-20 rounded-lg flex items-center justify-center border border-white border-opacity-30",children:t("span",{className:"text-white font-bold text-sm sm:text-lg",children:o.charAt(0)})})}),e("div",{className:"min-w-0 flex-1",children:[t("h1",{className:d,children:o}),t("p",{className:m,children:a})]})]})]}),c&&e("div",{className:"text-left sm:text-right pt-2 sm:border-t-0 sm:pt-0",children:[t("h2",{className:"text-base sm:text-lg font-semibold",children:n}),t("p",{className:"text-xs sm:text-sm leading-tight opacity-80 truncate",children:i})]})]}),Y=r({});function K(t){const e=o(null);return null===e.current&&(e.current=t()),e.current}const X="undefined"!=typeof window,q=X?a:l,G=r(null);function _(t,e){-1===t.indexOf(e)&&t.push(e)}function Z(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const J=(t,e,n)=>n>e?e:n<t?t:n;let Q=()=>{},tt=()=>{};"production"!==process.env.NODE_ENV&&(Q=(t,e)=>{t||"undefined"==typeof console||console.warn(e)},tt=(t,e)=>{if(!t)throw new Error(e)});const et={},nt=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function it(t){return"object"==typeof t&&null!==t}const st=t=>/^0[^.\s]+$/u.test(t);function rt(t){let e;return()=>(void 0===e&&(e=t()),e)}const ot=t=>t,at=(t,e)=>n=>e(t(n)),lt=(...t)=>t.reduce(at),ct=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class ut{constructor(){this.subscriptions=[]}add(t){return _(this.subscriptions,t),()=>Z(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ht=t=>1e3*t,dt=t=>t/1e3;function mt(t,e){return e?t*(1e3/e):0}const pt=new Set;function ft(t,e,n){t||pt.has(e)||(console.warn(e),n&&console.warn(n),pt.add(e))}const gt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function yt(t,e,n,i){if(t===e&&n===i)return ot;const s=e=>function(t,e,n,i,s){let r,o,a=0;do{o=e+(n-e)/2,r=gt(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:gt(s(t),e,i)}const vt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,xt=t=>e=>1-t(1-e),bt=yt(.33,1.53,.69,.99),wt=xt(bt),Tt=vt(wt),Pt=t=>(t*=2)<1?.5*wt(t):.5*(2-Math.pow(2,-10*(t-1))),St=t=>1-Math.sin(Math.acos(t)),Et=xt(St),kt=vt(St),Ct=yt(.42,0,1,1),At=yt(0,0,.58,1),Mt=yt(.42,0,.58,1),Nt=t=>Array.isArray(t)&&"number"==typeof t[0],Vt={linear:ot,easeIn:Ct,easeInOut:Mt,easeOut:At,circIn:St,circInOut:kt,circOut:Et,backIn:wt,backInOut:Tt,backOut:bt,anticipate:Pt},Dt=t=>{if(Nt(t)){tt(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,i,s]=t;return yt(e,n,i,s)}return"string"==typeof t?(tt(void 0!==Vt[t],`Invalid easing type '${t}'`),Vt[t]):t},Lt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],jt={value:null,addProjectionMetrics:null};function Rt(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Lt.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){o.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,r=!1)=>{const a=r&&s?n:i;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),o.delete(t)},process:t=>{a=t,s?r=!0:(s=!0,[n,i]=[i,n],n.forEach(c),e&&jt.value&&jt.value.frameloop[e].push(l),l=0,n.clear(),s=!1,r&&(r=!1,u.process(t)))}};return u}(r,e?n:void 0),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:m,postRender:p}=o,f=()=>{const r=et.useManualTiming?s.timestamp:performance.now();n=!1,et.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(r-s.timestamp,40),1)),s.timestamp=r,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),m.process(s),p.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:Lt.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(f)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<Lt.length;e++)o[Lt[e]].cancel(t)},state:s,steps:o}}const{schedule:Ot,cancel:Bt,state:Ft,steps:It}=Rt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:ot,!0);let $t;function Ut(){$t=void 0}const Wt={now:()=>(void 0===$t&&Wt.set(Ft.isProcessing||et.useManualTiming?Ft.timestamp:performance.now()),$t),set:t=>{$t=t,queueMicrotask(Ut)}},zt=t=>e=>"string"==typeof e&&e.startsWith(t),Ht=zt("--"),Yt=zt("var(--"),Kt=t=>!!Yt(t)&&Xt.test(t.split("/*")[0].trim()),Xt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,qt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Gt={...qt,transform:t=>J(0,1,t)},_t={...qt,default:1},Zt=t=>Math.round(1e5*t)/1e5,Jt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Qt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,te=(t,e)=>n=>Boolean("string"==typeof n&&Qt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),ee=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,r,o,a]=i.match(Jt);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},ne={...qt,transform:t=>Math.round((t=>J(0,255,t))(t))},ie={test:te("rgb","red"),parse:ee("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+ne.transform(t)+", "+ne.transform(e)+", "+ne.transform(n)+", "+Zt(Gt.transform(i))+")"};const se={test:te("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:ie.transform},re=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),oe=re("deg"),ae=re("%"),le=re("px"),ce=re("vh"),ue=re("vw"),he=(()=>({...ae,parse:t=>ae.parse(t)/100,transform:t=>ae.transform(100*t)}))(),de={test:te("hsl","hue"),parse:ee("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+ae.transform(Zt(e))+", "+ae.transform(Zt(n))+", "+Zt(Gt.transform(i))+")"},me={test:t=>ie.test(t)||se.test(t)||de.test(t),parse:t=>ie.test(t)?ie.parse(t):de.test(t)?de.parse(t):se.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ie.transform(t):de.transform(t),getAnimatableNone:t=>{const e=me.parse(t);return e.alpha=0,me.transform(e)}},pe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const fe="number",ge="color",ye=/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 ve(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let r=0;const o=e.replace(ye,t=>(me.test(t)?(i.color.push(r),s.push(ge),n.push(me.parse(t))):t.startsWith("var(")?(i.var.push(r),s.push("var"),n.push(t)):(i.number.push(r),s.push(fe),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:i,types:s}}function xe(t){return ve(t).values}function be(t){const{split:e,types:n}=ve(t),i=e.length;return t=>{let s="";for(let r=0;r<i;r++)if(s+=e[r],void 0!==t[r]){const e=n[r];s+=e===fe?Zt(t[r]):e===ge?me.transform(t[r]):t[r]}return s}}const we=t=>"number"==typeof t?0:me.test(t)?me.getAnimatableNone(t):t;const Te={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Jt)?.length||0)+(t.match(pe)?.length||0)>0},parse:xe,createTransformer:be,getAnimatableNone:function(t){const e=xe(t);return be(t)(e.map(we))}};function Pe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Se(t,e){return n=>n>0?e:t}const Ee=(t,e,n)=>t+(e-t)*n,ke=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Ce=[se,ie,de];function Ae(t){const e=(n=t,Ce.find(t=>t.test(n)));var n;if(Q(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(e))return!1;let i=e.parse(t);return e===de&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Pe(a,i,t+1/3),r=Pe(a,i,t),o=Pe(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}(i)),i}const Me=(t,e)=>{const n=Ae(t),i=Ae(e);if(!n||!i)return Se(t,e);const s={...n};return t=>(s.red=ke(n.red,i.red,t),s.green=ke(n.green,i.green,t),s.blue=ke(n.blue,i.blue,t),s.alpha=Ee(n.alpha,i.alpha,t),ie.transform(s))},Ne=new Set(["none","hidden"]);function Ve(t,e){return n=>Ee(t,e,n)}function De(t){return"number"==typeof t?Ve:"string"==typeof t?Kt(t)?Se:me.test(t)?Me:Re:Array.isArray(t)?Le:"object"==typeof t?me.test(t)?Me:je:Se}function Le(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>De(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function je(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=De(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Re=(t,e)=>{const n=Te.createTransformer(e),i=ve(t),s=ve(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Ne.has(t)&&!s.values.length||Ne.has(e)&&!i.values.length?function(t,e){return Ne.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):lt(Le(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}(i,s),s.values),n):(Q(!0,`Complex values '${t}' and '${e}' 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.`),Se(t,e))};function Oe(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ee(t,e,n);return De(t)(t,e)}const Be=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Ot.update(e,t),stop:()=>Bt(e),now:()=>Ft.isProcessing?Ft.timestamp:Wt.now()}},Fe=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Ie=2e4;function $e(t){let e=0;let n=t.next(e);for(;!n.done&&e<Ie;)e+=50,n=t.next(e);return e>=Ie?1/0:e}function Ue(t,e,n){const i=Math.max(e-5,0);return mt(n-t(i),e-i)}const We=100,ze=10,He=1,Ye=0,Ke=800,Xe=.3,qe=.3,Ge={granular:.01,default:2},_e={granular:.005,default:.5},Ze=.01,Je=10,Qe=.05,tn=1,en=.001;function nn({duration:t=Ke,bounce:e=Xe,velocity:n=Ye,mass:i=He}){let s,r;Q(t<=ht(Je),"Spring duration must be 10 seconds or less");let o=1-e;o=J(Qe,tn,o),t=J(Ze,Je,dt(t)),o<1?(s=e=>{const i=e*o,s=i*t,r=i-n,a=rn(e,o),l=Math.exp(-s);return en-r/a*l},r=e=>{const i=e*o*t,r=i*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-i),c=rn(Math.pow(e,2),o);return(-s(e)+en>0?-1:1)*((r-a)*l)/c}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<sn;n++)i-=t(i)/e(i);return i}(s,r,5/t);if(t=ht(t),isNaN(a))return{stiffness:We,damping:ze,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*o*Math.sqrt(i*e),duration:t}}}const sn=12;function rn(t,e){return t*Math.sqrt(1-e*e)}const on=["duration","bounce"],an=["stiffness","damping","mass"];function ln(t,e){return e.some(e=>void 0!==t[e])}function cn(t=qe,e=Xe){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:m}=function(t){let e={velocity:Ye,stiffness:We,damping:ze,mass:He,isResolvedFromDuration:!1,...t};if(!ln(t,an)&&ln(t,on))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*J(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:He,stiffness:s,damping:r}}else{const n=nn(t);e={...e,...n,mass:He},e.isResolvedFromDuration=!0}return e}({...n,velocity:-dt(n.velocity||0)}),p=d||0,f=c/(2*Math.sqrt(l*u)),g=o-r,y=dt(Math.sqrt(l/u)),v=Math.abs(g)<5;let x;if(i||(i=v?Ge.granular:Ge.default),s||(s=v?_e.granular:_e.default),f<1){const t=rn(y,f);x=e=>{const n=Math.exp(-f*y*e);return o-n*((p+f*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===f)x=t=>o-Math.exp(-y*t)*(g+(p+y*g)*t);else{const t=y*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*y*e),i=Math.min(t*e,300);return o-n*((p+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const b={calculatedDuration:m&&h||null,next:t=>{const e=x(t);if(m)a.done=t>=h;else{let n=0===t?p:0;f<1&&(n=0===t?ht(p):Ue(x,t,e));const r=Math.abs(n)<=i,l=Math.abs(o-e)<=s;a.done=r&&l}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min($e(b),Ie),e=Fe(e=>b.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return b}function un({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},m=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let p=n*e;const f=h+p,g=void 0===o?f:o(f);g!==f&&(p=g-h);const y=t=>-p*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?g:n};let b,w;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,w=cn({keyframes:[d.value,m(d.value)],velocity:Ue(v,t,d.value),damping:s,stiffness:r,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==b||(e=!0,x(t),T(t)),void 0!==b&&t>=b?w.next(t-b):(!e&&x(t),d)}}}function hn(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const r=t.length;if(tt(r===e.length,"Both input and output ranges must be the same length"),1===r)return()=>e[0];if(2===r&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||et.mix||Oe,r=t.length-1;for(let n=0;n<r;n++){let r=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||ot:e;r=lt(t,r)}i.push(r)}return i}(e,i,s),l=a.length,c=n=>{if(o&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=ct(t[i],t[i+1],n);return a[i](s)};return n?e=>c(J(t[0],t[r-1],e)):c}function dn(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=ct(0,e,i);t.push(Ee(n,1,s))}}(e,t.length-1),e}function mn({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Dt):Dt(i),r={done:!1,value:e[0]},o=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:dn(e),t),a=hn(o,e,{ease:Array.isArray(s)?s:(l=e,c=s,l.map(()=>c||Mt).splice(0,l.length-1))});var l,c;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}cn.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min($e(i),Ie);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:dt(s)}}(t,100,cn);return t.ease=e.ease,t.duration=ht(e.duration),t.type="keyframes",t};const pn=t=>null!==t;function fn(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(pn),o=s<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==i?i:r[o]}const gn={decay:un,inertia:un,tween:mn,keyframes:mn,spring:cn};function yn(t){"string"==typeof t.type&&(t.type=gn[t.type])}class vn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const xn=t=>t/100;class bn extends vn{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==Wt.now()&&this.tick(Wt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;yn(t);const{type:e=mn,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:o}=t;const a=e||mn;"production"!==process.env.NODE_ENV&&a!==mn&&tt(o.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`),a!==mn&&"number"!=typeof o[0]&&(this.mixKeyframes=lt(xn,Oe(o[0],o[1])),o=[0,100]);const l=a({...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=$e(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:h,repeatDelay:d,type:m,onUpdate:p,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v=this.currentTime,x=n;if(u){const t=Math.min(this.currentTime,i)/o;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(x=r)),v=J(0,1,n)*o}const b=y?{done:!1,value:c[0]}:x.next(v);s&&(b.value=s(b.value));let{done:w}=b;y||null===a||(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return T&&m!==un&&(b.value=fn(c,this.options,f,this.speed)),p&&p(b.value),T&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return dt(this.calculatedDuration)}get time(){return dt(this.currentTime)}set time(t){t=ht(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Wt.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=dt(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Be,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Wt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const wn=t=>180*t/Math.PI,Tn=t=>{const e=wn(Math.atan2(t[1],t[0]));return Sn(e)},Pn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Tn,rotateZ:Tn,skewX:t=>wn(Math.atan(t[1])),skewY:t=>wn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Sn=t=>((t%=360)<0&&(t+=360),t),En=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),kn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Cn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:En,scaleY:kn,scale:t=>(En(t)+kn(t))/2,rotateX:t=>Sn(wn(Math.atan2(t[6],t[5]))),rotateY:t=>Sn(wn(Math.atan2(-t[2],t[0]))),rotateZ:Tn,rotate:Tn,skewX:t=>wn(Math.atan(t[4])),skewY:t=>wn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function An(t){return t.includes("scale")?1:0}function Mn(t,e){if(!t||"none"===t)return An(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Cn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Pn,s=e}if(!s)return An(e);const r=i[e],o=s[1].split(",").map(Nn);return"function"==typeof r?r(o):o[r]}function Nn(t){return parseFloat(t.trim())}const Vn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Dn=(()=>new Set(Vn))(),Ln=t=>t===qt||t===le,jn=new Set(["x","y","z"]),Rn=Vn.filter(t=>!jn.has(t));const On={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Mn(e,"x"),y:(t,{transform:e})=>Mn(e,"y")};On.translateX=On.x,On.translateY=On.y;const Bn=new Set;let Fn=!1,In=!1,$n=!1;function Un(){if(In){const t=Array.from(Bn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Rn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}In=!1,Fn=!1,Bn.forEach(t=>t.complete($n)),Bn.clear()}function Wn(){Bn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(In=!0)})}class zn{constructor(t,e,n,i,s,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Bn.add(this),Fn||(Fn=!0,Ot.read(Wn),Ot.resolveKeyframes(Un))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,r);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=r),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Bn.delete(this)}cancel(){"scheduled"===this.state&&(Bn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Hn=rt(()=>void 0!==window.ScrollTimeline),Yn={};function Kn(t,e){const n=rt(t);return()=>Yn[e]??n()}const Xn=Kn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),qn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Gn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qn([0,.65,.55,1]),circOut:qn([.55,0,1,.45]),backIn:qn([.31,.01,.66,-.59]),backOut:qn([.33,1.53,.69,.99])};function _n(t,e){return t?"function"==typeof t?Xn()?Fe(t,e):"ease-out":Nt(t)?qn(t):Array.isArray(t)?t.map(t=>_n(t,e)||Gn.easeOut):Gn[t]:void 0}function Zn(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=_n(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};c&&(d.pseudoElement=c);return t.animate(u,d)}function Jn(t){return"function"==typeof t&&"applyToOptions"in t}class Qn extends vn{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=r,this.options=t,tt("string"!=typeof t.type,'animateMini doesn\'t support "type" as a string. Did you mean to import { spring } from "motion"?');const l=function({type:t,...e}){return Jn(t)&&Xn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Zn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=fn(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return dt(Number(t))}get time(){return dt(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=ht(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Hn()?(this.animation.timeline=t,ot):e(this)}}const ti={anticipate:Pt,backInOut:Tt,circInOut:kt};function ei(t){"string"==typeof t.ease&&t.ease in ti&&(t.ease=ti[t.ease])}class ni extends Qn{constructor(t){ei(t),yn(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new bn({...r,autoplay:!1}),a=ht(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const ii=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Te.test(t)&&"0"!==t||t.startsWith("url(")));function si(t){return it(t)&&"offsetHeight"in t}const ri=new Set(["opacity","clipPath","filter","transform"]),oi=rt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class ai extends vn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:a,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Wt.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||zn;this.keyframeResolver=new d(o,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:r,velocity:o,delay:a,isHandoff:l,onUpdate:c}=n;this.resolvedAt=Wt.now(),function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=ii(s,e),a=ii(r,e);return Q(o===a,`You are trying to animate ${e} from "${s}" to "${r}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${r} via the \`style\` property.`),!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||Jn(n))&&i)}(t,s,r,o)||(!et.instantAnimations&&a||c?.(fn(t,n,e)),t[0]=t[t.length-1],n.duration=0,n.repeat=0);const u={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},h=!l&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o}=t;if(!si(e?.owner?.current))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return oi()&&n&&ri.has(n)&&("transform"!==n||!l)&&!a&&!i&&"mirror"!==s&&0!==r&&"inertia"!==o}(u)?new ni({...u,element:u.motionValue.owner.current}):new bn(u);h.finished.then(()=>this.notifyFinished()).catch(ot),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),$n=!0,Wn(),Un(),$n=!1),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const li=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ci(t,e,n=1){tt(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[i,s]=function(t){const e=li.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const t=r.trim();return nt(t)?parseFloat(t):t}return Kt(s)?ci(s,e,n+1):s}function ui(t,e){return t?.[e]??t?.default??t}const hi=new Set(["width","height","top","left","right","bottom",...Vn]),di=t=>e=>e.test(t),mi=[qt,le,ae,oe,ue,ce,{test:t=>"auto"===t,parse:t=>t}],pi=t=>mi.find(di(t));function fi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||st(t))}const gi=new Set(["brightness","contrast","saturate","opacity"]);function yi(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Jt)||[];if(!i)return t;const s=n.replace(i,"");let r=gi.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const vi=/\b([a-z-]*)\(.*?\)/gu,xi={...Te,getAnimatableNone:t=>{const e=t.match(vi);return e?e.map(yi).join(" "):t}},bi={...qt,transform:Math.round},wi={borderWidth:le,borderTopWidth:le,borderRightWidth:le,borderBottomWidth:le,borderLeftWidth:le,borderRadius:le,radius:le,borderTopLeftRadius:le,borderTopRightRadius:le,borderBottomRightRadius:le,borderBottomLeftRadius:le,width:le,maxWidth:le,height:le,maxHeight:le,top:le,right:le,bottom:le,left:le,padding:le,paddingTop:le,paddingRight:le,paddingBottom:le,paddingLeft:le,margin:le,marginTop:le,marginRight:le,marginBottom:le,marginLeft:le,backgroundPositionX:le,backgroundPositionY:le,...{rotate:oe,rotateX:oe,rotateY:oe,rotateZ:oe,scale:_t,scaleX:_t,scaleY:_t,scaleZ:_t,skew:oe,skewX:oe,skewY:oe,distance:le,translateX:le,translateY:le,translateZ:le,x:le,y:le,z:le,perspective:le,transformPerspective:le,opacity:Gt,originX:he,originY:he,originZ:le},zIndex:bi,fillOpacity:Gt,strokeOpacity:Gt,numOctaves:bi},Ti={...wi,color:me,backgroundColor:me,outlineColor:me,fill:me,stroke:me,borderColor:me,borderTopColor:me,borderRightColor:me,borderBottomColor:me,borderLeftColor:me,filter:xi,WebkitFilter:xi},Pi=t=>Ti[t];function Si(t,e){let n=Pi(t);return n!==xi&&(n=Te),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ei=new Set(["auto","none","0"]);class ki extends zn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),Kt(i))){const s=ci(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!hi.has(n)||2!==t.length)return;const[i,s]=t,r=pi(i),o=pi(s);if(r!==o)if(Ln(r)&&Ln(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else On[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||fi(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!Ei.has(e)&&ve(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=Si(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=On[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=On[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Ci=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class Ai{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=Wt.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty();e&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Wt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return"production"!==process.env.NODE_ENV&&ft(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new ut);const n=this.events[t].add(e);return"change"===t?()=>{n(),Ot.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Wt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return mt(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Mi(t,e){return new Ai(t,e)}const{schedule:Ni,cancel:Vi}=Rt(queueMicrotask,!1),Di={x:!1,y:!1};function Li(){return Di.x||Di.y}function ji(t,e){const n=function(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Ri(t){return!("touch"===t.pointerType||Li())}const Oi=(t,e)=>!!e&&(t===e||Oi(t,e.parentElement)),Bi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Fi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Ii=new WeakSet;function $i(t){return e=>{"Enter"===e.key&&t(e)}}function Ui(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Wi(t){return Bi(t)&&!Li()}function zi(t,e,n={}){const[i,s,r]=ji(t,n),o=t=>{const i=t.currentTarget;if(!Wi(t))return;Ii.add(i);const r=e(i,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Ii.has(i)&&Ii.delete(i),Wi(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,i===window||i===document||n.useGlobalTarget||Oi(i,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),si(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=$i(()=>{if(Ii.has(n))return;Ui(n,"down");const t=$i(()=>{Ui(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Ui(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),e=t,Fi.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}function Hi(t){return it(t)&&"ownerSVGElement"in t}const Yi=t=>Boolean(t&&t.getVelocity),Ki=[...mi,me,Te],Xi=r({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class qi extends i.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=e.offsetParent,n=si(t)&&t.offsetWidth||0,i=this.props.sizeRef.current;i.height=e.offsetHeight||0,i.width=e.offsetWidth||0,i.top=e.offsetTop,i.left=e.offsetLeft,i.right=n-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Gi({children:e,isPresent:n,anchorX:s}){const r=c(),a=o(null),l=o({width:0,height:0,top:0,left:0,right:0}),{nonce:d}=u(Xi);return h(()=>{const{width:t,height:e,top:i,left:o,right:c}=l.current;if(n||!a.current||!t||!e)return;const u="left"===s?`left: ${o}`:`right: ${c}`;a.current.dataset.motionPopId=r;const h=document.createElement("style");return d&&(h.nonce=d),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`\n [data-motion-pop-id="${r}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${u}px !important;\n top: ${i}px !important;\n }\n `),()=>{document.head.contains(h)&&document.head.removeChild(h)}},[n]),t(qi,{isPresent:n,childRef:a,sizeRef:l,children:i.cloneElement(e,{ref:a})})}const _i=({children:e,initial:n,isPresent:s,onExitComplete:r,custom:o,presenceAffectsLayout:a,mode:l,anchorX:u})=>{const h=K(Zi),m=c();let p=!0,f=d(()=>(p=!1,{id:m,initial:n,isPresent:s,custom:o,onExitComplete:t=>{h.set(t,!0);for(const t of h.values())if(!t)return;r&&r()},register:t=>(h.set(t,!1),()=>h.delete(t))}),[s,h,r]);return a&&p&&(f={...f}),d(()=>{h.forEach((t,e)=>h.set(e,!1))},[s]),i.useEffect(()=>{!s&&!h.size&&r&&r()},[s]),"popLayout"===l&&(e=t(Gi,{isPresent:s,anchorX:u,children:e})),t(G.Provider,{value:f,children:e})};function Zi(){return new Map}function Ji(t=!0){const e=u(G);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=e,r=c();l(()=>{if(t)return s(r)},[t]);const o=m(()=>t&&i&&i(r),[r,i,t]);return!n&&i?[!1,o]:[!0]}const Qi=t=>t.key||"";function ts(t){const e=[];return p.forEach(t,t=>{f(t)&&e.push(t)}),e}const es=({children:e,custom:i,initial:s=!0,onExitComplete:r,presenceAffectsLayout:a=!0,mode:l="sync",propagate:c=!1,anchorX:h="left"})=>{const[m,p]=Ji(c),f=d(()=>ts(e),[e]),y=c&&!m?[]:f.map(Qi),v=o(!0),x=o(f),b=K(()=>new Map),[w,T]=g(f),[P,S]=g(f);q(()=>{v.current=!1,x.current=f;for(let t=0;t<P.length;t++){const e=Qi(P[t]);y.includes(e)?b.delete(e):!0!==b.get(e)&&b.set(e,!1)}},[P,y.length,y.join("-")]);const E=[];if(f!==w){let t=[...f];for(let e=0;e<P.length;e++){const n=P[e],i=Qi(n);y.includes(i)||(t.splice(e,0,n),E.push(n))}return"wait"===l&&E.length&&(t=E),S(ts(t)),T(f),null}"production"!==process.env.NODE_ENV&&"wait"===l&&P.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.');const{forceRender:k}=u(Y);return t(n,{children:P.map(e=>{const n=Qi(e),o=!(c&&!m)&&(f===P||y.includes(n));return t(_i,{isPresent:o,initial:!(v.current&&!s)&&void 0,custom:i,presenceAffectsLayout:a,mode:l,onExitComplete:o?void 0:()=>{if(!b.has(n))return;b.set(n,!0);let t=!0;b.forEach(e=>{e||(t=!1)}),t&&(k?.(),S(x.current),c&&p?.(),r&&r())},anchorX:h,children:e},n)})})},ns=r({strict:!1}),is={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"]},ss={};for(const t in is)ss[t]={isEnabled:e=>is[t].some(t=>!!e[t])};const rs=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 os(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||rs.has(t)}let as=t=>!os(t);try{"function"==typeof(ls=require("@emotion/is-prop-valid").default)&&(as=t=>t.startsWith("on")?!os(t):ls(t))}catch{}var ls;function cs(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy((...e)=>("production"!==process.env.NODE_ENV&&ft(!1,"motion() is deprecated. Use motion.create() instead."),t(...e)),{get:(n,i)=>"create"===i?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const us=r({});function hs(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ds(t){return"string"==typeof t||Array.isArray(t)}const ms=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ps=["initial",...ms];function fs(t){return hs(t.animate)||ps.some(e=>ds(t[e]))}function gs(t){return Boolean(fs(t)||t.variants)}function ys(t){const{initial:e,animate:n}=function(t,e){if(fs(t)){const{initial:e,animate:n}=t;return{initial:!1===e||ds(e)?e:void 0,animate:ds(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,u(us));return d(()=>({initial:e,animate:n}),[vs(e),vs(n)])}function vs(t){return Array.isArray(t)?t.join(" "):t}const xs=Symbol.for("motionComponentSymbol");function bs(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function ws(t,e,n){return m(i=>{i&&t.onMount&&t.onMount(i),e&&(i?e.mount(i):e.unmount()),n&&("function"==typeof n?n(i):bs(n)&&(n.current=i))},[e])}const Ts=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ps="data-"+Ts("framerAppearId"),Ss=r({});function Es(t,e,n,i,s){const{visualElement:r}=u(us),a=u(ns),c=u(G),d=u(Xi).reducedMotion,m=o(null);i=i||a.renderer,!m.current&&i&&(m.current=i(t,{visualState:e,parent:r,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:d}));const p=m.current,f=u(Ss);!p||p.projection||!s||"html"!==p.type&&"svg"!==p.type||function(t,e,n,i){const{layoutId:s,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ks(t.parent)),t.projection.setOptions({layoutId:s,layout:r,alwaysMeasureLayout:Boolean(o)||a&&bs(a),visualElement:t,animationType:"string"==typeof r?r:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:c})}(m.current,n,s,f);const g=o(!1);h(()=>{p&&g.current&&p.update(n,c)});const y=n[Ps],v=o(Boolean(y)&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return q(()=>{p&&(g.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),Ni.render(p.render),v.current&&p.animationState&&p.animationState.animateChanges())}),l(()=>{p&&(!v.current&&p.animationState&&p.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),v.current=!1))}),p}function ks(t){if(t)return!1!==t.options.allowProjection?t.projection:ks(t.parent)}function Cs({preloadedFeatures:n,createVisualElement:i,useRender:s,useVisualState:r,Component:o}){function a(a,l){let c;const h={...u(Xi),...a,layoutId:As(a)},{isStatic:d}=h,m=ys(a),p=r(a,d);if(!d&&X){!function(t,e){const n=u(ns).strict;if("production"!==process.env.NODE_ENV&&e&&n){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Q(!1,e):tt(!1,e)}}(h,n);const t=function(t){const{drag:e,layout:n}=ss;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(h);c=t.MeasureLayout,m.visualElement=Es(o,p,h,i,t.ProjectionNode)}return e(us.Provider,{value:m,children:[c&&m.visualElement?t(c,{visualElement:m.visualElement,...h}):null,s(o,a,ws(p,m.visualElement,l),p,d,m.visualElement)]})}n&&function(t){for(const e in t)ss[e]={...ss[e],...t[e]}}(n),a.displayName=`motion.${"string"==typeof o?o:`create(${o.displayName??o.name??""})`}`;const l=y(a);return l[xs]=o,l}function As({layoutId:t}){const e=u(Y).id;return e&&void 0!==t?e+"-"+t:t}const Ms={};function Ns(t,{layout:e,layoutId:n}){return Dn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ms[t]||"opacity"===t)}const Vs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ds=Vn.length;function Ls(t,e,n){const{style:i,vars:s,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(Dn.has(t))o=!0;else if(Ht(t))s[t]=n;else{const e=Ci(n,wi[t]);t.startsWith("origin")?(a=!0,r[t]=e):i[t]=e}}if(e.transform||(o||n?i.transform=function(t,e,n){let i="",s=!0;for(let r=0;r<Ds;r++){const o=Vn[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=Ci(a,wi[o]);l||(s=!1,i+=`${Vs[o]||o}(${t}) `),n&&(e[o]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;i.transformOrigin=`${t} ${e} ${n}`}}const js=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Rs(t,e,n){for(const i in e)Yi(e[i])||Ns(i,n)||(t[i]=e[i])}function Os(t,e){const n={};return Rs(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return d(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Ls(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Bs(t,e){const n={},i=Os(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Fs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Is={offset:"strokeDashoffset",array:"strokeDasharray"};function $s(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:o=0,...a},l,c,u){if(Ls(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?Fs:Is;t[r.offset]=le.transform(-i);const o=le.transform(e),a=le.transform(n);t[r.array]=`${o} ${a}`}(h,s,r,o,!1)}const Us=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Ws=t=>"string"==typeof t&&"svg"===t.toLowerCase();function zs(t,e,n,i){const s=d(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return $s(n,e,Ws(i),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Rs(e,t.style,t),s.style={...e,...s.style}}return s}const Hs=["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 Ys(t){return"string"==typeof t&&!t.includes("-")&&!!(Hs.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ks(t=!1){return(e,n,i,{latestValues:s},r)=>{const o=(Ys(e)?zs:Bs)(n,s,r,e),a=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(as(s)||!0===n&&os(s)||!e&&!os(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(n,"string"==typeof e,t),l=e!==v?{...a,...o,ref:i}:{},{children:c}=n,u=d(()=>Yi(c)?c.get():c,[c]);return x(e,{...l,children:u})}}function Xs(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function qs(t,e,n,i){if("function"==typeof e){const[s,r]=Xs(i);e=e(void 0!==n?n:t.custom,s,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,r]=Xs(i);e=e(void 0!==n?n:t.custom,s,r)}return e}function Gs(t){return Yi(t)?t.get():t}const _s=t=>(e,n)=>{const i=u(us),s=u(G),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Zs(n,i,s,t),renderState:e()}}(t,e,i,s);return n?r():K(r)};function Zs(t,e,n,i){const s={},r=i(t,{});for(const t in r)s[t]=Gs(r[t]);let{initial:o,animate:a}=t;const l=fs(t),c=gs(t);e&&c&&!l&&!1!==t.inherit&&(void 0===o&&(o=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===o;const h=u?a:o;if(h&&"boolean"!=typeof h&&!hs(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=qs(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}function Js(t,e,n){const{style:i}=t,s={};for(const r in i)(Yi(i[r])||e.style&&Yi(e.style[r])||Ns(r,t)||void 0!==n?.getValue(r)?.liveStyle)&&(s[r]=i[r]);return s}const Qs={useVisualState:_s({scrapeMotionValuesFromProps:Js,createRenderState:js})};function tr(t,e,n){const i=Js(t,e,n);for(const n in t)if(Yi(t[n])||Yi(e[n])){i[-1!==Vn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const er={useVisualState:_s({scrapeMotionValuesFromProps:tr,createRenderState:Us})};function nr(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return Cs({...Ys(n)?er:Qs,preloadedFeatures:t,useRender:Ks(i),createVisualElement:e,Component:n})}}function ir(t,e,n){const i=t.getProps();return qs(i,e,void 0!==n?n:i.custom,t)}const sr=t=>Array.isArray(t);function rr(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Mi(n))}function or(t){return sr(t)?t[t.length-1]||0:t}function ar(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Yi(i)&&i.add))return n.add(e);if(!n&&et.WillChange){const n=new et.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function lr(t){return t.props[Ps]}const cr=t=>null!==t;const ur={type:"spring",stiffness:500,damping:25,restSpeed:10},hr={type:"keyframes",duration:.8},dr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mr=(t,{keyframes:e})=>e.length>2?hr:Dn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ur:dr;const pr=(t,e,n,i={},s,r)=>o=>{const a=ui(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=ht(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||Object.assign(u,mr(t,u)),u.duration&&(u.duration=ht(u.duration)),u.repeatDelay&&(u.repeatDelay=ht(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(h=!0)),(et.instantAnimations||et.skipAnimations)&&(h=!0,u.duration=0,u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(cr),r=e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}(u.keyframes,a);if(void 0!==t)return void Ot.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new bn(u):new ai(u)};function fr({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function gr(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;i&&(r=i);const l=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||c&&fr(c,e))continue;const o={delay:n,...ui(r||{},e)},u=i.get();if(void 0!==u&&!i.isAnimating&&!Array.isArray(s)&&s===u&&!o.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){const n=lr(t);if(n){const t=window.MotionHandoffAnimation(n,e,Ot);null!==t&&(o.startTime=t,h=!0)}}ar(t,e),i.start(pr(e,i,s,t.shouldReduceMotion&&hi.has(e)?{type:!1}:o,t,h));const d=i.animation;d&&l.push(d)}return o&&Promise.all(l).then(()=>{Ot.update(()=>{o&&function(t,e){const n=ir(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r)rr(t,e,or(r[e]))}(t,o)})}),l}function yr(t,e,n={}){const i=ir(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(gr(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=1,r){const o=[],a=(t.variantChildren.size-1)*i,l=1===s?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(vr).forEach((t,i)=>{t.notify("AnimationStart",e),o.push(yr(t,e,{...r,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(o)}(t,e,r+i,o,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then(()=>e())}return Promise.all([r(),o(n.delay)])}function vr(t,e){return t.sortNodePosition(e)}function xr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const br=ps.length;function wr(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&wr(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<br;n++){const i=ps[n],s=t.props[i];(ds(s)||!1===s)&&(e[i]=s)}return e}const Tr=[...ms].reverse(),Pr=ms.length;function Sr(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>yr(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=yr(t,e,n);else{const s="function"==typeof e?ir(t,e,n.custom):e;i=Promise.all(gr(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function Er(t){let e=Sr(t),n=Ar(),i=!0;const s=e=>(n,i)=>{const s=ir(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:o}=t,a=wr(t.parent)||{},l=[],c=new Set;let u={},h=1/0;for(let e=0;e<Pr;e++){const d=Tr[e],m=n[d],p=void 0!==o[d]?o[d]:a[d],f=ds(p),g=d===r?m.isActive:null;!1===g&&(h=e);let y=p===a[d]&&p!==o[d]&&f;if(y&&i&&t.manuallyAnimateOnMount&&(y=!1),m.protectedKeys={...u},!m.isActive&&null===g||!p&&!m.prevProp||hs(p)||"boolean"==typeof p)continue;const v=kr(m.prevProp,p);let x=v||d===r&&m.isActive&&!y&&f||e>h&&f,b=!1;const w=Array.isArray(p)?p:[p];let T=w.reduce(s(d),{});!1===g&&(T={});const{prevResolvedValues:P={}}=m,S={...P,...T},E=e=>{x=!0,c.has(e)&&(b=!0,c.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in S){const e=T[t],n=P[t];if(u.hasOwnProperty(t))continue;let i=!1;i=sr(e)&&sr(n)?!xr(e,n):e!==n,i?null!=e?E(t):c.add(t):void 0!==e&&c.has(t)?E(t):m.protectedKeys[t]=!0}m.prevProp=p,m.prevResolvedValues=T,m.isActive&&(u={...u,...T}),i&&t.blockInitialAnimation&&(x=!1);x&&(!(y&&v)||b)&&l.push(...w.map(t=>({animation:t,options:{type:d}})))}if(c.size){const e={};if("boolean"!=typeof o.initial){const n=ir(t,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==o.initial&&o.initial!==o.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Ar(),i=!0}}}function kr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!xr(e,t)}function Cr(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ar(){return{animate:Cr(!0),whileInView:Cr(),whileHover:Cr(),whileTap:Cr(),whileDrag:Cr(),whileFocus:Cr(),exit:Cr()}}class Mr{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Nr=0;const Vr={animation:{Feature:class extends Mr{constructor(t){super(t),t.animationState||(t.animationState=Er(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();hs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends Mr{constructor(){super(...arguments),this.id=Nr++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Dr(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Lr(t){return{point:{x:t.pageX,y:t.pageY}}}function jr(t,e,n,i){return Dr(t,e,(t=>e=>Bi(e)&&t(e,Lr(e)))(n),i)}function Rr({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Or(t){return t.max-t.min}function Br(t,e,n,i=.5){t.origin=i,t.originPoint=Ee(e.min,e.max,t.origin),t.scale=Or(n)/Or(e),t.translate=Ee(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Fr(t,e,n,i){Br(t.x,e.x,n.x,i?i.originX:void 0),Br(t.y,e.y,n.y,i?i.originY:void 0)}function Ir(t,e,n){t.min=n.min+e.min,t.max=t.min+Or(e)}function $r(t,e,n){t.min=e.min-n.min,t.max=t.min+Or(e)}function Ur(t,e,n){$r(t.x,e.x,n.x),$r(t.y,e.y,n.y)}const Wr=()=>({x:{min:0,max:0},y:{min:0,max:0}});function zr(t){return[t("x"),t("y")]}function Hr(t){return void 0===t||1===t}function Yr({scale:t,scaleX:e,scaleY:n}){return!Hr(t)||!Hr(e)||!Hr(n)}function Kr(t){return Yr(t)||Xr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Xr(t){return qr(t.x)||qr(t.y)}function qr(t){return t&&"0%"!==t}function Gr(t,e,n){return n+e*(t-n)}function _r(t,e,n,i,s){return void 0!==s&&(t=Gr(t,s,i)),Gr(t,n,i)+e}function Zr(t,e=0,n=1,i,s){t.min=_r(t.min,e,n,i,s),t.max=_r(t.max,e,n,i,s)}function Jr(t,{x:e,y:n}){Zr(t.x,e.translate,e.scale,e.originPoint),Zr(t.y,n.translate,n.scale,n.originPoint)}const Qr=.999999999999,to=1.0000000000001;function eo(t,e){t.min=t.min+e,t.max=t.max+e}function no(t,e,n,i,s=.5){Zr(t,e,n,Ee(t.min,t.max,s),i)}function io(t,e){no(t.x,e.x,e.scaleX,e.scale,e.originX),no(t.y,e.y,e.scaleY,e.scale,e.originY)}function so(t,e){return Rr(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const ro=({current:t})=>t?t.ownerDocument.defaultView:null,oo=(t,e)=>Math.abs(t-e);class ao{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!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 t=uo(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=oo(t.x,e.x),i=oo(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=Ft;this.history.push({...i,timestamp:s});const{onStart:r,onMove:o}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=lo(e,this.transformPagePoint),Ot.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const r=uo("pointercancel"===t.type?this.lastMoveEventInfo:lo(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,r),i&&i(t,r)},!Bi(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;const r=lo(Lr(t),this.transformPagePoint),{point:o}=r,{timestamp:a}=Ft;this.history=[{...o,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,uo(r,this.history)),this.removeListeners=lt(jr(this.contextWindow,"pointermove",this.handlePointerMove),jr(this.contextWindow,"pointerup",this.handlePointerUp),jr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Bt(this.updatePoint)}}function lo(t,e){return e?{point:e(t.point)}:t}function co(t,e){return{x:t.x-e.x,y:t.y-e.y}}function uo({point:t},e){return{point:t,delta:co(t,mo(e)),offset:co(t,ho(e)),velocity:po(e,.1)}}function ho(t){return t[0]}function mo(t){return t[t.length-1]}function po(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=mo(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>ht(e)));)n--;if(!i)return{x:0,y:0};const r=dt(s.timestamp-i.timestamp);if(0===r)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function fo(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function go(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const yo=.35;function vo(t,e,n){return{min:xo(t,e),max:xo(t,n)}}function xo(t,e){return"number"==typeof t?t:t[e]||0}const bo=new WeakMap;class wo{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={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new ao(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(Lr(t).point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(r=n)||"y"===r?Di[r]?null:(Di[r]=!0,()=>{Di[r]=!1}):Di.x||Di.y?null:(Di.x=Di.y=!0,()=>{Di.x=Di.y=!1}),!this.openDragLock))return;var r;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),zr(t=>{let e=this.getAxisMotionValue(t).get()||0;if(ae.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Or(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&Ot.postRender(()=>s(t,e)),ar(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:r}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:o}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(o),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,o),this.updateAxis("y",e.point,o),this.visualElement.render(),r&&r(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>zr(t=>"paused"===this.getAnimationState(t)&&this.getAxisMotionValue(t).animation?.play())},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:ro(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Ot.postRender(()=>s(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!To(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?Ee(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Ee(n,t,i.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),s.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&bs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:fo(t.x,n,s),y:fo(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=yo){return!1===t?t=0:!0===t&&(t=yo),{x:vo(t,"left","right"),y:vo(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&zr(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!bs(t))return!1;const n=t.current;tt(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=so(t,n),{scroll:s}=e;return s&&(eo(i.x,s.offset.x),eo(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:go(t.x,e.x),y:go(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=Rr(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:r,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{},l=zr(o=>{if(!To(o,e,this.currentDirection))return;let l=a&&a[o]||{};r&&(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[o]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(o,h)});return Promise.all(l).then(o)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return ar(this.visualElement,t),n.start(pr(t,n,0,e,this.visualElement,!1))}stopAnimation(){zr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){zr(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){zr(e=>{const{drag:n}=this.getProps();if(!To(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:r}=i.layout.layoutBox[e];s.set(t[e]-Ee(n,r,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!bs(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};zr(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=Or(t),s=Or(e);return s>i?n=ct(e.min,e.max-i,t.min):i>s&&(n=ct(t.min,t.max-s,e.min)),J(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),zr(e=>{if(!To(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:r}=this.constraints[e];n.set(Ee(s,r,i[e]))})}addListeners(){if(!this.visualElement.current)return;bo.set(this.visualElement,this);const t=jr(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();bs(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),Ot.read(e);const s=Dr(window,"resize",()=>this.scalePositionWithinConstraints()),r=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(zr(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),i(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:r=yo,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:r,dragMomentum:o}}}function To(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Po=t=>(e,n)=>{t&&Ot.postRender(()=>t(e,n))};const So={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Eo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ko={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!le.test(t))return t;t=parseFloat(t)}return`${Eo(t,e.target.x)}% ${Eo(t,e.target.y)}%`}},Co={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Te.parse(t);if(s.length>5)return i;const r=Te.createTransformer(t),o="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const c=Ee(a,l,.5);return"number"==typeof s[2+o]&&(s[2+o]/=c),"number"==typeof s[3+o]&&(s[3+o]/=c),r(s)}};class Ao extends b{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;!function(t){for(const e in t)Ms[e]=t[e],Ht(e)&&(Ms[e].isCSSVariable=!0)}(No),s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),So.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,{projection:r}=n;return r?(r.isPresent=s,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?r.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?r.promote():r.relegate()||Ot.postRender(()=>{const t=r.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ni.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Mo(e){const[n,i]=Ji(),s=u(Y);return t(Ao,{...e,layoutGroup:s,switchLayoutGroup:u(Ss),isPresent:n,safeToRemove:i})}const No={borderRadius:{...ko,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ko,borderTopRightRadius:ko,borderBottomLeftRadius:ko,borderBottomRightRadius:ko,boxShadow:Co};const Vo=(t,e)=>t.depth-e.depth;class Do{constructor(){this.children=[],this.isDirty=!1}add(t){_(this.children,t),this.isDirty=!0}remove(t){Z(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Vo),this.isDirty=!1,this.children.forEach(t)}}const Lo=["TopLeft","TopRight","BottomLeft","BottomRight"],jo=Lo.length,Ro=t=>"string"==typeof t?parseFloat(t):t,Oo=t=>"number"==typeof t||le.test(t);function Bo(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Fo=$o(0,.5,Et),Io=$o(.5,.95,ot);function $o(t,e,n){return i=>i<t?0:i>e?1:n(ct(t,e,i))}function Uo(t,e){t.min=e.min,t.max=e.max}function Wo(t,e){Uo(t.x,e.x),Uo(t.y,e.y)}function zo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Ho(t,e,n,i,s){return t=Gr(t-=e,1/n,i),void 0!==s&&(t=Gr(t,1/s,i)),t}function Yo(t,e,[n,i,s],r,o){!function(t,e=0,n=1,i=.5,s,r=t,o=t){ae.test(e)&&(e=parseFloat(e),e=Ee(o.min,o.max,e/100)-o.min);if("number"!=typeof e)return;let a=Ee(r.min,r.max,i);t===r&&(a-=e),t.min=Ho(t.min,e,n,a,s),t.max=Ho(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,r,o)}const Ko=["x","scaleX","originX"],Xo=["y","scaleY","originY"];function qo(t,e,n,i){Yo(t.x,e,Ko,n?n.x:void 0,i?i.x:void 0),Yo(t.y,e,Xo,n?n.y:void 0,i?i.y:void 0)}function Go(t){return 0===t.translate&&1===t.scale}function _o(t){return Go(t.x)&&Go(t.y)}function Zo(t,e){return t.min===e.min&&t.max===e.max}function Jo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Qo(t,e){return Jo(t.x,e.x)&&Jo(t.y,e.y)}function ta(t){return Or(t.x)/Or(t.y)}function ea(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class na{constructor(){this.members=[]}add(t){_(this.members,t),t.scheduleRender()}remove(t){if(Z(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const ia=["","X","Y","Z"],sa={visibility:"hidden"};let ra=0;function oa(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function aa(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=lr(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Ot,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&aa(i)}function la({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=e?.()){this.id=ra++,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(ha),this.nodes.forEach(va),this.nodes.forEach(xa),this.nodes.forEach(da)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Do)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new ut),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;var n;this.isSVG=Hi(e)&&!(Hi(n=e)&&"svg"===n.tagName),this.instance=e;const{layoutId:i,layout:s,visualElement:r}=this.options;if(r&&!r.current&&r.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(s||i)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=Wt.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(Bt(i),t(r-e))};return Ot.setup(i,!0),()=>Bt(i)}(i,250),So.hasAnimatedSinceResize&&(So.hasAnimatedSinceResize=!1,this.nodes.forEach(ya))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&r&&(i||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||r.getDefaultTransition()||Ea,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!Qo(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...ui(s,"layout"),onPlay:o,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c)}else e||ya(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Bt(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(ba),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&aa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(pa);this.isUpdating||this.nodes.forEach(fa),this.isUpdating=!1,this.nodes.forEach(ga),this.nodes.forEach(ca),this.nodes.forEach(ua),this.clearAllSnapshots();const t=Wt.now();Ft.delta=J(0,1e3/60,t-Ft.timestamp),Ft.timestamp=t,Ft.isProcessing=!0,It.update.process(Ft),It.preRender.process(Ft),It.render.process(Ft),Ft.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ni.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ma),this.sharedNodes.forEach(wa)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ot.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ot.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Or(this.snapshot.measuredBox.x)||Or(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!_o(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,r=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||Kr(this.latestValues)||r)&&(s(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),Aa((i=n).x),Aa(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Na))){const{scroll:t}=this.root;t&&(eo(e.x,t.offset.x),eo(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(Wo(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:s,options:r}=i;i!==this.root&&s&&r.layoutScroll&&(s.wasRoot&&Wo(e,t),eo(e.x,s.offset.x),eo(e.y,s.offset.y))}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Wo(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&io(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),Kr(i.latestValues)&&io(n,i.latestValues)}return Kr(this.latestValues)&&io(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Wo(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!Kr(n.latestValues))continue;Yr(n.latestValues)&&n.updateSnapshot();const i=Wr();Wo(i,n.measurePageBox()),qo(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return Kr(this.latestValues)&&qo(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ft.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==e;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:i,layoutId:s}=this.options;if(this.layout&&(i||s)){if(this.resolvedRelativeTargetAt=Ft.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ur(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Wo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var r,o,a;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),r=this.target,o=this.relativeTarget,a=this.relativeParent.target,Ir(r.x,o.x,a.x),Ir(r.y,o.y,a.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Wo(this.target,this.layout.layoutBox),Jr(this.target,this.targetDelta)):Wo(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ur(this.relativeTargetOrigin,this.target,t.target),Wo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Yr(this.parent.latestValues)&&!Xr(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Ft.timestamp&&(n=!1),n)return;const{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!s)return;Wo(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,o=this.treeScale.y;!function(t,e,n,i=!1){const s=n.length;if(!s)return;let r,o;e.x=e.y=1;for(let a=0;a<s;a++){r=n[a],o=r.projectionDelta;const{visualElement:s}=r.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&r.options.layoutScroll&&r.scroll&&r!==r.root&&io(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Jr(t,o)),i&&Kr(r.latestValues)&&io(t,r.latestValues))}e.x<to&&e.x>Qr&&(e.x=1),e.y<to&&e.y>Qr&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(zo(this.prevProjectionDelta.x,this.projectionDelta.x),zo(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Fr(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===r&&this.treeScale.y===o&&ea(this.projectionDelta.x,this.prevProjectionDelta.x)&&ea(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const o={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(Sa));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,m,p,f,g;Ta(r.x,t.x,n),Ta(r.y,t.y,n),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ur(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),m=this.relativeTarget,p=this.relativeTargetOrigin,f=o,g=n,Pa(m.x,p.x,f.x,g),Pa(m.y,p.y,f.y,g),h&&(l=this.relativeTarget,d=h,Zo(l.x,d.x)&&Zo(l.y,d.y))&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),Wo(h,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,r){s?(t.opacity=Ee(0,n.opacity??1,Fo(i)),t.opacityExit=Ee(e.opacity??1,0,Io(i))):r&&(t.opacity=Ee(e.opacity??1,n.opacity??1,i));for(let s=0;s<jo;s++){const r=`border${Lo[s]}Radius`;let o=Bo(e,r),a=Bo(n,r);void 0===o&&void 0===a||(o||(o=0),a||(a=0),0===o||0===a||Oo(o)===Oo(a)?(t[r]=Math.max(Ee(Ro(o),Ro(a),i),0),(ae.test(a)||ae.test(o))&&(t[r]+="%")):t[r]=a)}(e.rotate||n.rotate)&&(t.rotate=Ee(e.rotate||0,n.rotate||0,i))}(s,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Bt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ot.update(()=>{So.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Mi(0)),this.currentAnimation=function(t,e,n){const i=Yi(t)?t:Mi(t);return i.start(pr("",i,e,n)),i.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{t.onComplete&&t.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 t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Ma(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Or(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Or(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Wo(e,n),io(e,s),Fr(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new na);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&oa("z",t,i,this.animationValues);for(let e=0;e<ia.length;e++)oa(`rotate${ia[e]}`,t,i,this.animationValues),oa(`skew${ia[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}getProjectionStyles(t){if(!this.instance||this.isSVG)return;if(!this.isVisible)return sa;const e={visibility:""},n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,e.opacity="",e.pointerEvents=Gs(t?.pointerEvents)||"",e.transform=n?n(this.latestValues,""):"none",e;const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Gs(t?.pointerEvents)||""),this.hasProjected&&!Kr(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1),e}const s=i.animationValues||i.latestValues;this.applyTransformsToTarget(),e.transform=function(t,e,n){let i="";const s=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((s||r||o)&&(i=`translate3d(${s}px, ${r}px, ${o}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:r,skewX:o,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),r&&(i+=`rotateY(${r}deg) `),o&&(i+=`skewX(${o}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,s),n&&(e.transform=n(s,e.transform));const{x:r,y:o}=this.projectionDelta;e.transformOrigin=`${100*r.origin}% ${100*o.origin}% 0`,i.animationValues?e.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:e.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const t in Ms){if(void 0===s[t])continue;const{correct:n,applyTo:r,isCSSVariable:o}=Ms[t],a="none"===e.transform?s[t]:n(s[t],i);if(r){const t=r.length;for(let n=0;n<t;n++)e[r[n]]=a}else o?this.options.visualElement.renderState.vars[t]=a:e[t]=a}return this.options.layoutId&&(e.pointerEvents=i===this?Gs(t?.pointerEvents)||"":"none"),e}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(pa),this.root.sharedNodes.clear()}}}function ca(t){t.updateLayout()}function ua(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,r=e.source!==t.layout.source;"size"===s?zr(t=>{const i=r?e.measuredBox[t]:e.layoutBox[t],s=Or(i);i.min=n[t].min,i.max=i.min+s}):Ma(s,e.layoutBox,n)&&zr(i=>{const s=r?e.measuredBox[i]:e.layoutBox[i],o=Or(n[i]);s.max=s.min+o,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+o)});const o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Fr(o,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r?Fr(a,t.applyTransform(i,!0),e.measuredBox):Fr(a,n,e.layoutBox);const l=!_o(o);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:r}=i;if(s&&r){const o={x:{min:0,max:0},y:{min:0,max:0}};Ur(o,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ur(a,n,r.layoutBox),Qo(o,a)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=o,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function ha(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function da(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ma(t){t.clearSnapshot()}function pa(t){t.clearMeasurements()}function fa(t){t.isLayoutDirty=!1}function ga(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ya(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function va(t){t.resolveTargetDelta()}function xa(t){t.calcProjection()}function ba(t){t.resetSkewAndRotation()}function wa(t){t.removeLeadSnapshot()}function Ta(t,e,n){t.translate=Ee(e.translate,0,n),t.scale=Ee(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Pa(t,e,n,i){t.min=Ee(e.min,n.min,i),t.max=Ee(e.max,n.max,i)}function Sa(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Ea={duration:.45,ease:[.4,0,.1,1]},ka=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ca=ka("applewebkit/")&&!ka("chrome/")?Math.round:ot;function Aa(t){t.min=Ca(t.min),t.max=Ca(t.max)}function Ma(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=ta(e),s=ta(n),r=.2,!(Math.abs(i-s)<=r));var i,s,r}function Na(t){return t!==t.root&&t.scroll?.wasRoot}const Va=la({attachResizeListener:(t,e)=>Dr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Da={current:void 0},La=la({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Da.current){const t=new Va({});t.mount(window),t.setOptions({layoutScroll:!0}),Da.current=t}return Da.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ja={pan:{Feature:class extends Mr{constructor(){super(...arguments),this.removePointerDownListener=ot}onPointerDown(t){this.session=new ao(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ro(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Po(t),onStart:Po(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&Ot.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=jr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Mr{constructor(t){super(t),this.removeGroupControls=ot,this.removeListeners=ot,this.controls=new wo(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ot}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:La,MeasureLayout:Mo}};function Ra(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&Ot.postRender(()=>s(e,Lr(e)))}function Oa(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&Ot.postRender(()=>s(e,Lr(e)))}const Ba=new WeakMap,Fa=new WeakMap,Ia=t=>{const e=Ba.get(t.target);e&&e(t)},$a=t=>{t.forEach(Ia)};function Ua(t,e,n){const i=function({root:t,...e}){const n=t||document;Fa.has(n)||Fa.set(n,{});const i=Fa.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver($a,{root:t,...e})),i[s]}(e);return Ba.set(t,n),i.observe(t),()=>{Ba.delete(t),i.unobserve(t)}}const Wa={some:0,all:1};const za={inView:{Feature:class extends Mr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Wa[i]};return Ua(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),r=e?n:i;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Mr{mount(){const{current:t}=this.node;t&&(this.unmount=zi(t,(t,e)=>(Oa(this.node,e,"Start"),(t,{success:e})=>Oa(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Mr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){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=lt(Dr(this.node.current,"focus",()=>this.onFocus()),Dr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Mr{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,r]=ji(t,n),o=t=>{if(!Ri(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const r=t=>{Ri(t)&&(i(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,s)};return i.forEach(t=>{t.addEventListener("pointerenter",o,s)}),r}(t,(t,e)=>(Ra(this.node,e,"Start"),t=>Ra(this.node,t,"End"))))}unmount(){}}}},Ha={layout:{ProjectionNode:La,MeasureLayout:Mo}},Ya={current:null},Ka={current:!1};const Xa=new WeakMap;const qa=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ga{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=zn,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 t=Wt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Ot.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=fs(e),this.isVariantNode=gs(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in u){const e=u[t];void 0!==a[t]&&Yi(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Xa.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((t,e)=>this.bindToMotionValue(e,t)),Ka.current||function(){if(Ka.current=!0,X)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ya.current=t.matches;t.addListener(e),e()}else Ya.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ya.current),"production"!==process.env.NODE_ENV&&ft(!0!==this.shouldReduceMotion,"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(),Bt(this.notifyUpdate),Bt(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 e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Dn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Ot.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s(),r&&r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ss){const e=ss[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<qa.length;e++){const n=qa[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],r=n[i];if(Yi(s))t.addValue(i,s);else if(Yi(r))t.addValue(i,Mi(s,{owner:t}));else if(r!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,Mi(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}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 e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Mi(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=n&&("string"==typeof n&&(nt(n)||st(n))?n=parseFloat(n):(i=n,!Ki.find(di(i))&&Te.test(e)&&(n=Si(t,e))),this.setBaseTarget(t,Yi(n)?n.get():n)),Yi(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=qs(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Yi(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new ut),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class _a extends Ga{constructor(){super(...arguments),this.KeyframeResolver=ki}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Yi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Za(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const e in n)t.style.setProperty(e,n[e])}class Ja extends _a{constructor(){super(...arguments),this.type="html",this.renderInstance=Za}readValueFromInstance(t,e){if(Dn.has(e))return this.projection?.isProjecting?An(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Mn(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(Ht(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return so(t,e)}build(t,e,n){Ls(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Js(t,e,n)}}const Qa=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"]);class tl extends _a{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Wr}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Dn.has(e)){const t=Pi(e);return t&&t.default||0}return e=Qa.has(e)?e:Ts(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return tr(t,e,n)}build(t,e,n){$s(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Za(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Qa.has(n)?n:Ts(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Ws(t.tagName),super.mount(t)}}const el=(t,e)=>Ys(t)?new tl(e):new Ja(e,{allowProjection:t!==v}),nl=cs(nr({...Vr,...za,...ja,...Ha},el)),il=({isOpen:i,onClose:s,onToggle:r,menuItems:o,logoUrl:a,logoAlt:l="Logo",systemName:c="PASS",className:u="fixed inset-y-0 left-0 z-50 w-80 bg-white shadow-xl",overlayClassName:h="fixed inset-0 bg-black bg-opacity-25 z-40",desktopMenuClassName:d="h-full flex flex-col",showBottomMenu:m=!0,bottomMenuItems:p=[{id:"settings",label:"Configuración",icon:W,action:()=>{}},{id:"help",label:"Ayuda",icon:I,action:()=>{}},{id:"logout",label:"Cerrar Sesión",icon:$,action:()=>{}}],activePath:f="",onNavigate:y,children:v})=>{const[x,b]=g(new Set),w=t=>f.includes(t),T=(n,i=!1)=>e(nl.button,{whileHover:{scale:1.02},whileTap:{scale:.98},className:`w-full flex items-center justify-between py-3 rounded-lg transition-colors group ${i?"pr-4 pl-10":"px-4"} ${w(n.path)?"bg-primary-botech text-white":"text-gray-700 hover:bg-gray-100"}`,onClick:()=>{return t=n.path,y&&y(t),void s();var t},children:[e("div",{className:"flex items-center space-x-3",children:[t(n.icon,{className:"w-5 h-5"}),t("span",{className:"font-medium text-sm",children:n.label})]}),t(F,{className:"w-4 h-4 transition-transform "+(w(n.path)?"rotate-90":"group-hover:translate-x-1")})]},n.id),P=n=>{const i=x.has(n.id);return e("div",{className:"mb-2",children:[e(nl.button,{whileHover:{scale:1.02},whileTap:{scale:.98},className:"w-full flex items-center justify-between px-4 py-3 rounded-lg transition-colors group text-gray-700 hover:bg-gray-100",onClick:()=>{return t=n.id,void b(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t},children:[e("div",{className:"flex items-center space-x-3",children:[t(n.icon,{className:"w-5 h-5"}),t("span",{className:"font-medium text-sm",children:n.label})]}),t(B,{className:"w-4 h-4 transition-transform "+(i?"rotate-180":"")})]}),t(es,{children:i&&t(nl.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:t("div",{className:"pt-2 space-y-1",children:n.children.map(t=>T(t,!0))})})})]},n.id)};return e(n,{children:[t(es,{children:i&&t(nl.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:h,onClick:s})}),t(nl.div,{initial:{x:"-100%"},animate:{x:i?0:"-100%"},transition:{type:"spring",stiffness:300,damping:30},className:u,children:e("div",{className:d,children:[e("div",{className:"p-4 border-b border-gray-200 flex items-center justify-between",children:[e("div",{className:"flex items-center space-x-3",children:[t("div",{className:"w-8 h-8 flex items-center justify-center",children:a?t("img",{src:a,alt:l,className:"h-full object-contain"}):t("div",{className:"h-full w-full bg-primary-botech rounded-lg flex items-center justify-center",children:t("span",{className:"text-white font-bold text-sm",children:c.charAt(0)})})}),t("h1",{className:"text-lg font-bold text-gray-800",children:c})]}),t("button",{onClick:s,className:"p-1 rounded-lg text-gray-500 hover:bg-gray-100 transition-colors",children:t(z,{className:"w-5 h-5"})})]}),t("div",{className:"flex-1 overflow-y-auto p-4",children:t("nav",{className:"space-y-2",children:o.map(t=>"folder"===t.type?P(t.data):T(t.data))})}),m&&t("div",{className:"p-4 border-t border-gray-200",children:t("div",{className:"space-y-2",children:p.map(n=>e("button",{onClick:n.action,className:"w-full flex items-center space-x-3 px-4 py-2 rounded-lg text-gray-700 hover:bg-gray-100 transition-colors",children:[t(n.icon,{className:"w-5 h-5"}),t("span",{className:"text-sm",children:n.label})]},n.id))})}),v&&t("div",{className:"p-4 border-t border-gray-200",children:v})]})})]})};function sl(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n}function rl(t,e,n,i){return new(n||(n=Promise))(function(s,r){function o(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const ol=t=>{if("85"===t)return"/back85";if("87"===t)return"/back87";if("undefined"!=typeof window){if(window.location.hostname.toLowerCase().includes("seguimiento"))return"/back85"}return"/back87"},al=(t,e)=>rl(void 0,void 0,void 0,function*(){const n=`${ol(t)}/student/downloadExcel/${e||"PASS"}`;return(yield T.get(n,{responseType:"blob"})).data}),ll=(t,e,n)=>rl(void 0,void 0,void 0,function*(){const i=`${ol(e)}/student/uploadExcel`,s=new FormData;s.append("receivedExcelFile",t),"85"===e&&n&&s.append("clientName",n);return(yield T.post(i,s,{transformRequest:[t=>t]})).data}),cl=({backend:e,label:n="Descargar Lista de Estudiantes en Excel",fileName:i="students.xlsx",className:s,variant:r="primary",clientName:o,onSuccess:a,onError:l})=>{const[c,u]=g(!1);return t(S,{variant:r,onClick:()=>rl(void 0,void 0,void 0,function*(){var t,n,s,r,c,h,d;try{u(!0);let t=o;if("85"===e&&!t){const{value:e}=yield w.fire({title:"Cliente requerido",text:"Ingrese el nombre del cliente:",input:"text",inputPlaceholder:"Ej: GIMNASIO FEMENINO",showCancelButton:!0,confirmButtonText:"Continuar",cancelButtonText:"Cancelar",inputValidator:t=>{if(!t||""===t.trim())return"El nombre del cliente es requerido"}});if(!e)return void u(!1);t=e}const n=yield al(e,t),s=URL.createObjectURL(n),r=document.createElement("a");r.href=s,r.download=i,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(s),yield w.fire({title:"¡Descarga exitosa!",text:"El archivo se ha descargado correctamente",icon:"success",confirmButtonText:"OK"}),null==a||a()}catch(e){console.error("Download students excel failed",e);let i="No se pudo descargar el archivo. Por favor, inténtelo nuevamente.";const o=e;i=null!==(d=null!==(c=null!==(s=null===(n=null===(t=null==o?void 0:o.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.message)&&void 0!==s?s:"string"==typeof(null===(r=null==o?void 0:o.response)||void 0===r?void 0:r.data)?o.response.data:void 0)&&void 0!==c?c:(null===(h=null==o?void 0:o.response)||void 0===h?void 0:h.statusText)?`Error ${o.response.status}: ${o.response.statusText}`:void 0)&&void 0!==d?d:i,yield w.fire({title:"Error en la descarga",text:i,icon:"error",confirmButtonText:"OK"}),null==l||l(e)}finally{u(!1)}}),className:s,children:c?"Descargando...":n})},ul=({backend:i,label:s="Cargar Lista de Estudiantes en Excel",className:r,variant:a="primary",clientName:l,onSuccess:c,onError:u})=>{const h=o(null),[d,m]=g(!1);return e(n,{children:[t(S,{variant:a,onClick:()=>{var t;null===(t=h.current)||void 0===t||t.click()},className:r,children:d?"Subiendo...":s}),t("input",{type:"file",accept:".xlsx,.xls",ref:h,className:"hidden",onChange:t=>rl(void 0,void 0,void 0,function*(){var e,n,s,r,o,a,d,p;const f=null===(e=t.target.files)||void 0===e?void 0:e[0];if(!f)return;if([/\.xlsx$/i,/\.xls$/i].some(t=>t.test(f.name)))if(0!==f.size)try{m(!0);let t=l;if("85"===i&&!t){const{value:e}=yield w.fire({title:"Cliente requerido",text:"Ingrese el nombre del cliente:",input:"text",inputPlaceholder:"Ej: GIMNASIO FEMENINO",showCancelButton:!0,confirmButtonText:"Continuar",cancelButtonText:"Cancelar",inputValidator:t=>{if(!t||""===t.trim())return"El nombre del cliente es requerido"}});if(!e)return void m(!1);t=e}const e=yield ll(f,i,t);let n="El archivo se ha cargado correctamente";(null==e?void 0:e.message)?n=e.message:"string"==typeof e&&(n=e),yield w.fire({title:"¡Carga exitosa!",text:n,icon:"success",confirmButtonText:"OK"}),null==c||c()}catch(t){console.error("Upload students excel failed",t),console.error("Error details:",t);let e="Hubo un problema al subir el archivo";const i=t;e=null!==(p=null!==(a=null!==(r=null===(s=null===(n=null==i?void 0:i.response)||void 0===n?void 0:n.data)||void 0===s?void 0:s.message)&&void 0!==r?r:"string"==typeof(null===(o=null==i?void 0:i.response)||void 0===o?void 0:o.data)?i.response.data:void 0)&&void 0!==a?a:(null===(d=null==i?void 0:i.response)||void 0===d?void 0:d.statusText)?`Error ${i.response.status}: ${i.response.statusText}`:void 0)&&void 0!==p?p:e,yield w.fire({title:"Error en la carga",text:e,icon:"error",confirmButtonText:"OK"}),null==u||u(t)}finally{h.current&&(h.current.value=""),m(!1)}else yield w.fire({title:"Archivo vacío",text:"El archivo seleccionado está vacío",icon:"warning",confirmButtonText:"OK"});else yield w.fire({title:"Archivo inválido",text:"El archivo debe ser un Excel (.xlsx o .xls)",icon:"warning",confirmButtonText:"OK"})})})]})},hl=({items:n,selectedItem:i=null,onSelectionChange:s,placeholder:r="Seleccionar elemento",searchPlaceholder:a="Buscar...",className:u="",disabled:h=!1,searchBy:p="both",caseSensitive:f=!1,exactMatch:y=!0,renderItem:v,renderSelectedItem:x})=>{const[b,w]=g(!1),[T,P]=g(""),S=o(null),E=o(null),k=o(null),C=o([]),A=c();l(()=>{const t=t=>{S.current&&!S.current.contains(t.target)&&w(!1)};if(b)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[b]),l(()=>{b&&k.current&&k.current.focus()},[b]),l(()=>{b||P("")},[b]);const M=d(()=>((t,e)=>{if(!e.trim())return t;const n=e.trim(),i=f?n:n.toLowerCase();return t.filter(t=>{const e=f?t.name:t.name.toLowerCase(),n=f?t.id:t.id.toLowerCase();if(y)switch(p){case"name":return e===i;case"id":return n===i;case"both":return e===i||n===i;default:return!1}else switch(p){case"name":return e.includes(i);case"id":return n.includes(i);case"both":return e.includes(i)||n.includes(i);default:return!1}})})(n,T),[n,T,f,y,p]),[N,V]=g(-1),D=m(()=>{w(!1)},[]),L=t=>{var e;s(t),D(),null===(e=E.current)||void 0===e||e.focus()},j=()=>{h||w(!b)},R=m(t=>{M.length&&V(e=>((-1===e?1===t?-1:0:e)+t+M.length)%M.length)},[M.length]);l(()=>{if(b){const t=i?M.findIndex(t=>t.id===i.id):-1;-1!==t?V(t):M.length?V(t=>t>=0&&t<M.length?t:0):V(-1)}else V(-1)},[b,M,i]),l(()=>{if(N<0)return;const t=C.current[N];null==t||t.scrollIntoView({block:"nearest"})},[N]);return C.current=[],e("div",{ref:S,className:`relative w-full ${u}`,onKeyDown:t=>{var e;if(h)return;const n=t.target,i=n===E.current;if(!b)return void(!i||"Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),j()));if("Escape"===t.key)return t.preventDefault(),D(),void(null===(e=E.current)||void 0===e||e.focus());if(n instanceof HTMLButtonElement)return;const s=n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement;switch(t.key){case"ArrowDown":t.preventDefault(),R(1);break;case"ArrowUp":t.preventDefault(),R(-1);break;case"Enter":N>=0&&N<M.length&&(t.preventDefault(),L(M[N]));break;case" ":case"Spacebar":if(s)break;N>=0&&N<M.length&&(t.preventDefault(),L(M[N]))}},children:[e("div",{ref:E,className:`\n min-h-10 w-full flex items-center justify-between px-3 py-2 \n text-sm bg-white border border-gray-300 rounded-md shadow-sm cursor-pointer\n transition-colors duration-200\n ${h?"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200":"hover:border-primary-botech-400 focus-within:border-primary-botech focus-within:ring-1 focus-within:ring-primary-botech"}\n ${b?"border-primary-botech ring-1 ring-primary-botech":""}\n `,onClick:j,role:"button",tabIndex:h?-1:0,"aria-haspopup":"listbox","aria-expanded":b,"aria-disabled":h,children:[t("div",{className:"flex-1 truncate",children:t("span",i?{className:"text-gray-900",children:x?x(i):i.name}:{className:"text-gray-500",children:r})}),e("div",{className:"flex items-center space-x-1 ml-2",children:[i&&!h&&t("button",{type:"button",onClick:t=>{t.stopPropagation(),s(null)},className:"text-gray-400 hover:text-gray-600 transition-colors duration-200",children:t(()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),{})}),t("div",{className:"text-gray-400 transition-transform duration-200 "+(b?"rotate-180":""),children:t(()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),{})})]})]}),b&&e("div",{className:"absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg",children:[t("div",{className:"p-2 border-b border-gray-100",children:e("div",{className:"relative",children:[t("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:t(()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),{})}),t("input",{ref:k,type:"text",className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md text-sm placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-primary-botech focus:border-primary-botech",placeholder:a,value:T,onChange:t=>P(t.target.value),onClick:t=>t.stopPropagation(),"aria-autocomplete":"list","aria-controls":A})]})}),t("div",{id:A,className:"max-h-60 overflow-auto",role:"listbox","aria-activedescendant":N>=0?`${A}-option-${N}`:void 0,children:0===M.length?t("div",{className:"px-3 py-2 text-sm text-gray-500",children:T?"No se encontraron coincidencias exactas":"No hay elementos disponibles"}):M.map((e,n)=>t("div",{id:`${A}-option-${n}`,ref:t=>{C.current[n]=t},className:"px-3 py-2 text-sm cursor-pointer transition-colors duration-200 border-b border-gray-50 last:border-b-0 "+(N===n?"bg-primary-botech-100":"hover:bg-primary-botech-50"),onClick:()=>L(e),role:"option","aria-selected":(null==i?void 0:i.id)===e.id,onMouseEnter:()=>V(n),children:v?v(e):t("span",{className:"text-gray-900",children:e.name})},e.id))})]})]})},dl=({items:i,selectedItems:s=[],onSelectionChange:r,placeholder:a="Seleccionar elementos",searchPlaceholder:c="Buscar...",className:u="",disabled:h=!1,searchBy:d="both",caseSensitive:m=!1,exactMatch:p=!0,maxSelectedDisplay:f=3,renderItem:y,renderSelectedItem:v,renderSelectedBadge:x})=>{const[b,w]=g(!1),[T,P]=g(""),S=o(null),E=o(null);l(()=>{const t=t=>{S.current&&!S.current.contains(t.target)&&w(!1)};if(b)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[b]),l(()=>{b&&E.current&&E.current.focus()},[b]),l(()=>{b||P("")},[b]);const k=((t,e)=>{if(!e.trim())return t;const n=e.trim(),i=m?n:n.toLowerCase();return t.filter(t=>{const e=m?t.name:t.name.toLowerCase(),n=m?t.id:t.id.toLowerCase();if(p)switch(d){case"name":return e===i;case"id":return n===i;case"both":return e===i||n===i;default:return!1}else switch(d){case"name":return e.includes(i);case"id":return n.includes(i);case"both":return e.includes(i)||n.includes(i);default:return!1}})})(i,T),C=t=>s.some(e=>e.id===t.id),A=t=>{r(s.filter(e=>e.id!==t.id))},M=()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),N=()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),V=({item:n,onRemove:i})=>e("span",{className:"inline-flex items-center px-2 py-1 text-xs font-medium bg-primary-botech-100 text-primary-botech-800 rounded-md",children:[v?v(n):n.name,t("button",{type:"button",onClick:t=>{t.stopPropagation(),i()},className:"ml-1 text-primary-botech-600 hover:text-primary-botech-800 transition-colors duration-200",children:t(M,{})})]}),D=s.slice(0,f),L=s.length-f;return e("div",{ref:S,className:`relative w-full ${u}`,children:[e("div",{className:`\n min-h-10 w-full flex items-center justify-between px-3 py-2 \n text-sm bg-white border border-gray-300 rounded-md shadow-sm cursor-pointer\n transition-colors duration-200\n ${h?"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200":"hover:border-primary-botech-400 focus-within:border-primary-botech focus-within:ring-1 focus-within:ring-primary-botech"}\n ${b?"border-primary-botech ring-1 ring-primary-botech":""}\n `,onClick:()=>{h||w(!b)},children:[t("div",{className:"flex-1 flex flex-wrap gap-1 items-center",children:0===s.length?t("span",{className:"text-gray-500",children:a}):e(n,{children:[D.map(e=>t("div",{onClick:t=>t.stopPropagation(),children:x?x(e,()=>A(e)):t(V,{item:e,onRemove:()=>A(e)})},e.id)),L>0&&e("span",{className:"text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded-md",children:["+",L," más"]})]})}),e("div",{className:"flex items-center space-x-1 ml-2",children:[s.length>0&&!h&&t("button",{type:"button",onClick:t=>{t.stopPropagation(),r([])},className:"text-gray-400 hover:text-gray-600 transition-colors duration-200",children:t(M,{})}),t("div",{className:"text-gray-400 transition-transform duration-200 "+(b?"rotate-180":""),children:t(()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),{})})]})]}),b&&e("div",{className:"absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg",children:[t("div",{className:"p-2 border-b border-gray-100",children:e("div",{className:"relative",children:[t("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:t(()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),{})}),t("input",{ref:E,type:"text",className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md text-sm placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-primary-botech focus:border-primary-botech",placeholder:c,value:T,onChange:t=>P(t.target.value),onClick:t=>t.stopPropagation()})]})}),s.length>0&&e("div",{className:"px-3 py-2 text-xs text-gray-600 bg-gray-50 border-b border-gray-100",children:[s.length," elemento(s) seleccionado(s)"]}),t("div",{className:"max-h-60 overflow-auto",children:0===k.length?t("div",{className:"px-3 py-2 text-sm text-gray-500",children:T?"No se encontraron coincidencias exactas":"No hay elementos disponibles"}):k.map(n=>{const i=C(n);return e("div",{className:`\n px-3 py-2 text-sm cursor-pointer transition-colors duration-200 \n border-b border-gray-50 last:border-b-0 flex items-center justify-between\n ${i?"bg-primary-botech-50 hover:bg-primary-botech-100":"hover:bg-gray-50"}\n `,onClick:()=>(t=>{C(t)?r(s.filter(e=>e.id!==t.id)):r([...s,t])})(n),children:[t("div",{className:"flex-1",children:y?y(n):t("span",{className:""+(i?"text-primary-botech-900 font-medium":"text-gray-900"),children:n.name})}),i&&t("div",{className:"ml-2 text-primary-botech-600",children:t(N,{})})]},n.id)})})]})]})};function ml(t){return R({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(t)}const pl=n=>{var{title:i,description:s,onClose:r,showCloseIcon:o=!0,icon:a,actions:l,className:c=""}=n,u=sl(n,["title","description","onClose","showCloseIcon","icon","actions","className"]);return e("div",Object.assign({className:`flex items-center justify-between gap-4 p-4 sm:p-6 bg-primary-botech text-white sm:rounded-t-xl ${c}`},u,{children:[e("div",{className:"flex items-start gap-3 min-w-0",children:[a&&t("span",{className:"mt-0.5 text-white text-xl",children:a}),e("div",{className:"flex-1 min-w-0",children:[i&&t("h2",{className:"text-xl font-semibold text-white",id:"bo-modal-title",children:i}),s&&t("p",{className:"mt-1 text-sm text-white/80",id:"bo-modal-description",children:s})]})]}),e("div",{className:"flex items-center gap-2",children:[l,o&&t("button",{type:"button","aria-label":"Cerrar",onClick:r,className:"shrink-0 inline-flex items-center justify-center rounded-md p-2 text-white hover:text-gray-200 hover:bg-white/10 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-white/50",children:t(ml,{className:"text-xl"})})]})]}))},fl=e=>{var{className:n=""}=e,i=sl(e,["className"]);return t("div",Object.assign({className:`p-4 sm:p-6 ${n}`},i))},gl=e=>{var{className:n=""}=e,i=sl(e,["className"]);return t("div",Object.assign({className:`flex justify-end gap-3 p-3 sm:p-4 border-t border-gray-200 bg-gray-50 ${n}`},i))},yl={sm:"sm:max-w-sm",md:"sm:max-w-2xl",lg:"sm:max-w-4xl",xl:"sm:max-w-6xl"},vl={hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},xl={hidden:{opacity:0,scale:.98,y:12},visible:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:12}};const bl=({open:n,onClose:i,title:s,description:r,size:a="md",footer:c,showCloseIcon:u=!0,hideHeader:h=!1,closeOnEsc:d=!0,closeOnClickOutside:p=!0,className:f="",children:g,initialFocusRef:y,headerClassName:v,overlayClassName:x,headerIcon:b,headerActions:w,zIndex:T})=>{const S=o(null),E=o(null);var k;l(()=>{if(!k)return;const{overflow:t}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[k=n]),function(t,e,n){l(()=>{if(!t)return;const i=e.current;if(!i)return;const s=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],r=()=>Array.from(i.querySelectorAll(s.join(","))).filter(t=>!t.hasAttribute("disabled")&&!t.getAttribute("aria-hidden")),o=document.activeElement;((null==n?void 0:n.current)||r()[0]||i).focus();const a=t=>{if("Tab"!==t.key)return;const e=r();if(0===e.length)return;const n=e[0],s=e[e.length-1];t.shiftKey?document.activeElement!==n&&document.activeElement!==i||(s.focus(),t.preventDefault()):document.activeElement===s&&(n.focus(),t.preventDefault())};return document.addEventListener("keydown",a),()=>{var t;document.removeEventListener("keydown",a),null===(t=null==o?void 0:o.focus)||void 0===t||t.call(o)}},[t,e,n])}(n,S,y);const C=m(t=>{n&&"Escape"===t.key&&d&&(t.stopPropagation(),i())},[n,d,i]);l(()=>{if(n)return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[n,C]);const A=t(es,{children:n&&e("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center",style:T?{zIndex:T}:void 0,"aria-hidden":!n,ref:E,children:[t(nl.button,{type:"button","aria-label":"Cerrar modal",initial:"hidden",animate:"visible",exit:"exit",variants:vl,onClick:()=>{p&&i()},className:`fixed inset-0 bg-black/50 ${null!=x?x:""}`}),e(nl.div,{role:"dialog","aria-modal":"true","aria-labelledby":s?"bo-modal-title":void 0,"aria-describedby":r?"bo-modal-description":void 0,initial:"hidden",animate:"visible",exit:"exit",variants:xl,transition:{duration:.18,ease:"easeOut"},className:`relative w-screen h-[100dvh] sm:w-full sm:h-auto ${yl[a]} sm:mx-4 sm:max-h-[90vh] overflow-hidden sm:rounded-xl bg-white shadow-2xl ring-1 ring-black/5 flex flex-col ${f}`,onClick:t=>t.stopPropagation(),ref:S,children:[!h&&t(pl,{title:s,description:r,onClose:i,showCloseIcon:u,className:v,icon:b,actions:w}),t("div",{className:"flex-1 overflow-y-auto",children:g}),c&&t(gl,{children:c})]})]})});return"undefined"!=typeof document?P(A,document.body):A};function wl(t=!1){const[e,n]=g(t);return{open:e,onOpen:m(()=>n(!0),[]),onClose:m(()=>n(!1),[]),toggle:m(()=>n(t=>!t),[]),setOpen:n}}var Tl,Pl,Sl;bl.Header=pl,bl.Body=fl,bl.Footer=gl,function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}(Tl||(Tl={})),function(t){t.EVEN="even",t.ODD="odd",t.HOVER="hover"}(Pl||(Pl={})),function(t){t.SM="sm",t.MD="md",t.LG="lg"}(Sl||(Sl={}));const El=t=>{switch(t){case Tl.CENTER:return"text-center";case Tl.RIGHT:return"text-right";default:return"text-left"}},kl=t=>{switch(t){case Sl.SM:return{header:"px-2 py-2 text-xs",cell:"px-2 py-2 text-xs",table:"text-xs"};case Sl.LG:return{header:"px-6 py-4 text-base",cell:"px-6 py-4 text-base",table:"text-base"};default:return{header:"px-3 md:px-6 py-3 text-sm",cell:"px-3 md:px-6 py-4 text-sm",table:"text-sm"}}},Cl=t=>t%2==0?"bg-white":"bg-gray-50",Al=({columns:n,size:i,hasActions:s})=>{const r=kl(i);return t("thead",{className:"text-xs text-gray-700 uppercase bg-gray-50 sticky top-0 z-10",children:e("tr",{children:[n.map(e=>t("th",{className:`${r.header} ${El(e.alignment)} ${e.className||""}`,style:e.width?{width:e.width}:void 0,children:e.header},e.key)),s&&t("th",{className:`${r.header} text-center sticky right-0 bg-gray-50`,children:"ACCIONES"})]})})},Ml=({columns:n,data:i,renderActions:s,size:r,onRowClick:o})=>{const a=kl(r);return t("tbody",{children:i.map((i,r)=>e("tr",{className:`${Cl(r)} hover:bg-gray-100 transition-colors duration-150 ${o?"cursor-pointer":""}`,onClick:()=>null==o?void 0:o(i),children:[n.map(e=>t("td",{className:`${a.cell} ${El(e.alignment)} ${e.className||""}`,children:e.accessor(i)},e.key)),s&&t("td",{className:`${a.cell} text-center sticky right-0 ${Cl(r)} shadow-[-2px_0_4px_rgba(0,0,0,0.1)]`,children:s(i)})]},r))})},Nl=({columns:n,data:i,renderActions:s,size:r=Sl.MD,className:a="",onRowClick:c,isLoading:u=!1,emptyMessage:h="No hay datos disponibles"})=>{const d=o(null),{visibleData:m}=((t,e)=>{const[n,i]=g(t);return l(()=>{const n=()=>{if(!e.current)return;const n=e.current.getBoundingClientRect(),s=window.innerHeight-n.top-100,r=Math.max(1,Math.floor(s/60));i(t.slice(0,r))};n();const s=()=>{n()};window.addEventListener("resize",s);const r=new ResizeObserver(n);return e.current&&r.observe(e.current),()=>{window.removeEventListener("resize",s),r.disconnect()}},[t,e]),{visibleData:n}})(i,d);return u?t("div",{className:"w-full shadow-md sm:rounded-lg bg-white",children:t("div",{className:"flex items-center justify-center py-8",children:t("div",{"data-testid":"loading-spinner",className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})})}):0===i.length?t("div",{className:"w-full shadow-md sm:rounded-lg bg-white",children:t("div",{className:"text-center py-8",children:t("p",{className:"text-gray-500",children:h})})}):t("div",{ref:d,className:`w-full shadow-md sm:rounded-lg bg-white ${a}`,children:t("div",{className:"overflow-x-auto",children:e("table",{className:"w-full text-left text-gray-500",style:{minWidth:"max-content"},children:[t(Al,{columns:n,size:r,hasActions:!!s}),t(Ml,{columns:n,data:m,renderActions:s,size:r,onRowClick:c})]})})})};function Vl(t,e){return Object.keys(t).filter(t=>-1===e.indexOf(t)).map(t=>({key:t,header:t.charAt(0).toUpperCase()+t.slice(1).replace(/([A-Z])/g," $1").trim(),accessor:e=>{var n;return null!==(n=e[t])&&void 0!==n?n:"-"}}))}export{S as Button,cl as DownloadStudentsExcelButton,Nl as GenericTable,H as Header,E as IconButton,bl as Modal,fl as ModalBody,gl as ModalFooter,pl as ModalHeader,dl as MultiSelector,il as Sidebar,hl as SingleSelector,ul as UploadStudentsExcelButton,al as downloadStudentsExcel,Vl as generateTableColumns,ol as getBackendPrefix,ll as uploadStudentsExcel,wl as useModal};
|
|
1
|
+
import{jsx as t,jsxs as e,Fragment as n}from"react/jsx-runtime";import*as i from"react";import s,{createContext as r,useRef as o,useLayoutEffect as a,useEffect as l,useId as c,useContext as u,useInsertionEffect as h,useMemo as d,useCallback as m,Children as p,isValidElement as f,useState as g,forwardRef as y,Fragment as v,createElement as x,Component as b}from"react";import w from"sweetalert2";import T from"axios";import{createPortal as P}from"react-dom";const S=({variant:e="primary",size:n="md",onClick:i,children:s,className:r="",disabled:o=!1})=>t("button",{className:`rounded font-medium transition-colors duration-300 ease-in-out ${{sm:"px-3 py-1.5 text-sm",md:"px-4 py-2",lg:"px-6 py-3 text-lg"}[n]} ${{primary:o?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-primary-botech hover:bg-primary-botech-400 text-white cursor-pointer",secondary:o?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-800 cursor-pointer",danger:o?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-red-500 hover:bg-red-600 text-white cursor-pointer"}[e]} ${r}`,onClick:o?void 0:i,disabled:o,children:s}),E=({leftIcon:n,rightIcon:i,children:s,onClick:r,className:o="",variant:a="primary",size:l="md",disabled:c=!1})=>e("button",{type:"button",className:`inline-flex items-center gap-2 rounded font-medium transition-colors duration-300 ease-in-out ${{sm:"px-3 py-1.5 text-sm",md:"px-4 py-2",lg:"px-6 py-3 text-lg"}[l]} ${{primary:c?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-primary-botech hover:bg-primary-botech-400 text-white cursor-pointer",secondary:c?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-800 cursor-pointer",danger:c?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-red-500 hover:bg-red-600 text-white cursor-pointer"}[a]} ${o}`,onClick:c?void 0:r,disabled:c,children:[n&&t("span",{className:"flex items-center",children:n}),s,i&&t("span",{className:"flex items-center",children:i})]});var k={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},C=s.createContext&&s.createContext(k),A=["attr","size","title"];function M(t,e){if(null==t)return{};var n,i,s=function(t,e){if(null==t)return{};var n={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){if(e.indexOf(i)>=0)continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}function N(){return N=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},N.apply(this,arguments)}function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function D(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?V(Object(n),!0).forEach(function(e){L(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function L(t,e,n){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"))?i:i+"")in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function j(t){return t&&t.map((t,e)=>s.createElement(t.tag,D({key:e},t.attr),j(t.child)))}function R(t){return e=>s.createElement(O,N({attr:D({},t.attr)},e),j(t.child))}function O(t){var e=e=>{var n,{attr:i,size:r,title:o}=t,a=M(t,A),l=r||e.size||"1em";return e.className&&(n=e.className),t.className&&(n=(n?n+" ":"")+t.className),s.createElement("svg",N({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,i,a,{className:n,style:D(D({color:t.color||e.color},e.style),t.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),o&&s.createElement("title",null,o),t.children)};return void 0!==C?s.createElement(C.Consumer,null,t=>e(t)):e(k)}function B(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(t)}function F(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"},child:[]}]})(t)}function I(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"path",attr:{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(t)}function $(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"},child:[]},{tag:"polyline",attr:{points:"16 17 21 12 16 7"},child:[]},{tag:"line",attr:{x1:"21",y1:"12",x2:"9",y2:"12"},child:[]}]})(t)}function U(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"3",y1:"12",x2:"21",y2:"12"},child:[]},{tag:"line",attr:{x1:"3",y1:"6",x2:"21",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",y1:"18",x2:"21",y2:"18"},child:[]}]})(t)}function W(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(t)}function z(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(t)}const H=({title:n,description:i,logoUrl:s,defaultLogoUrl:r,logoAlt:o="Logo",systemName:a="PASS",systemSubtitle:l="Sistema Escolar",onMenuToggle:c,showPageInfo:u=!0,className:h="flex flex-col sm:flex-row sm:items-end bg-primary-botech text-white p-3 sm:p-4 shadow-lg gap-3 sm:gap-0 justify-between",logoClassName:d="h-8 sm:h-10 object-contain",titleClassName:m="text-lg sm:text-xl font-bold",descriptionClassName:p="text-xs sm:text-sm opacity-80"})=>{const f="string"==typeof r&&""!==r.trim()?r:void 0,g="string"==typeof s&&""!==s.trim()?s:f;return e("div",{className:h,children:[e("div",{className:"flex items-center gap-3 sm:gap-4",children:[t("button",{onClick:c,className:"p-2 rounded-lg hover:bg-primary-botech-600 transition-colors focus:outline-none focus:ring-2 focus:ring-white focus:ring-opacity-20 flex-shrink-0","aria-label":"Abrir menú",children:t(U,{className:"w-5 h-5 sm:w-6 sm:h-6"})}),e("div",{className:"flex items-center min-w-0 flex-1",children:[t("div",{className:"flex items-center justify-center mr-2 sm:mr-3 flex-shrink-0",children:g?t("img",{src:g,alt:o,className:d}):t("div",{className:"w-8 h-8 sm:w-10 sm:h-10 bg-white bg-opacity-20 rounded-lg flex items-center justify-center border border-white border-opacity-30",children:t("span",{className:"text-white font-bold text-sm sm:text-lg",children:a.charAt(0)})})}),e("div",{className:"min-w-0 flex-1",children:[t("h1",{className:m,children:a}),t("p",{className:p,children:l})]})]})]}),u&&e("div",{className:"text-left sm:text-right pt-2 sm:border-t-0 sm:pt-0",children:[t("h2",{className:"text-base sm:text-lg font-semibold",children:n}),t("p",{className:"text-xs sm:text-sm leading-tight opacity-80 truncate",children:i})]})]})},X=r({});function Y(t){const e=o(null);return null===e.current&&(e.current=t()),e.current}const K="undefined"!=typeof window,q=K?a:l,G=r(null);function _(t,e){-1===t.indexOf(e)&&t.push(e)}function Z(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const J=(t,e,n)=>n>e?e:n<t?t:n;let Q=()=>{},tt=()=>{};"production"!==process.env.NODE_ENV&&(Q=(t,e)=>{t||"undefined"==typeof console||console.warn(e)},tt=(t,e)=>{if(!t)throw new Error(e)});const et={},nt=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function it(t){return"object"==typeof t&&null!==t}const st=t=>/^0[^.\s]+$/u.test(t);function rt(t){let e;return()=>(void 0===e&&(e=t()),e)}const ot=t=>t,at=(t,e)=>n=>e(t(n)),lt=(...t)=>t.reduce(at),ct=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class ut{constructor(){this.subscriptions=[]}add(t){return _(this.subscriptions,t),()=>Z(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ht=t=>1e3*t,dt=t=>t/1e3;function mt(t,e){return e?t*(1e3/e):0}const pt=new Set;function ft(t,e,n){t||pt.has(e)||(console.warn(e),n&&console.warn(n),pt.add(e))}const gt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function yt(t,e,n,i){if(t===e&&n===i)return ot;const s=e=>function(t,e,n,i,s){let r,o,a=0;do{o=e+(n-e)/2,r=gt(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:gt(s(t),e,i)}const vt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,xt=t=>e=>1-t(1-e),bt=yt(.33,1.53,.69,.99),wt=xt(bt),Tt=vt(wt),Pt=t=>(t*=2)<1?.5*wt(t):.5*(2-Math.pow(2,-10*(t-1))),St=t=>1-Math.sin(Math.acos(t)),Et=xt(St),kt=vt(St),Ct=yt(.42,0,1,1),At=yt(0,0,.58,1),Mt=yt(.42,0,.58,1),Nt=t=>Array.isArray(t)&&"number"==typeof t[0],Vt={linear:ot,easeIn:Ct,easeInOut:Mt,easeOut:At,circIn:St,circInOut:kt,circOut:Et,backIn:wt,backInOut:Tt,backOut:bt,anticipate:Pt},Dt=t=>{if(Nt(t)){tt(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,i,s]=t;return yt(e,n,i,s)}return"string"==typeof t?(tt(void 0!==Vt[t],`Invalid easing type '${t}'`),Vt[t]):t},Lt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],jt={value:null,addProjectionMetrics:null};function Rt(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Lt.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){o.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,r=!1)=>{const a=r&&s?n:i;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),o.delete(t)},process:t=>{a=t,s?r=!0:(s=!0,[n,i]=[i,n],n.forEach(c),e&&jt.value&&jt.value.frameloop[e].push(l),l=0,n.clear(),s=!1,r&&(r=!1,u.process(t)))}};return u}(r,e?n:void 0),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:m,postRender:p}=o,f=()=>{const r=et.useManualTiming?s.timestamp:performance.now();n=!1,et.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(r-s.timestamp,40),1)),s.timestamp=r,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),m.process(s),p.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:Lt.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(f)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<Lt.length;e++)o[Lt[e]].cancel(t)},state:s,steps:o}}const{schedule:Ot,cancel:Bt,state:Ft,steps:It}=Rt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:ot,!0);let $t;function Ut(){$t=void 0}const Wt={now:()=>(void 0===$t&&Wt.set(Ft.isProcessing||et.useManualTiming?Ft.timestamp:performance.now()),$t),set:t=>{$t=t,queueMicrotask(Ut)}},zt=t=>e=>"string"==typeof e&&e.startsWith(t),Ht=zt("--"),Xt=zt("var(--"),Yt=t=>!!Xt(t)&&Kt.test(t.split("/*")[0].trim()),Kt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,qt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Gt={...qt,transform:t=>J(0,1,t)},_t={...qt,default:1},Zt=t=>Math.round(1e5*t)/1e5,Jt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Qt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,te=(t,e)=>n=>Boolean("string"==typeof n&&Qt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),ee=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,r,o,a]=i.match(Jt);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},ne={...qt,transform:t=>Math.round((t=>J(0,255,t))(t))},ie={test:te("rgb","red"),parse:ee("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+ne.transform(t)+", "+ne.transform(e)+", "+ne.transform(n)+", "+Zt(Gt.transform(i))+")"};const se={test:te("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:ie.transform},re=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),oe=re("deg"),ae=re("%"),le=re("px"),ce=re("vh"),ue=re("vw"),he=(()=>({...ae,parse:t=>ae.parse(t)/100,transform:t=>ae.transform(100*t)}))(),de={test:te("hsl","hue"),parse:ee("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+ae.transform(Zt(e))+", "+ae.transform(Zt(n))+", "+Zt(Gt.transform(i))+")"},me={test:t=>ie.test(t)||se.test(t)||de.test(t),parse:t=>ie.test(t)?ie.parse(t):de.test(t)?de.parse(t):se.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ie.transform(t):de.transform(t),getAnimatableNone:t=>{const e=me.parse(t);return e.alpha=0,me.transform(e)}},pe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const fe="number",ge="color",ye=/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 ve(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let r=0;const o=e.replace(ye,t=>(me.test(t)?(i.color.push(r),s.push(ge),n.push(me.parse(t))):t.startsWith("var(")?(i.var.push(r),s.push("var"),n.push(t)):(i.number.push(r),s.push(fe),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:i,types:s}}function xe(t){return ve(t).values}function be(t){const{split:e,types:n}=ve(t),i=e.length;return t=>{let s="";for(let r=0;r<i;r++)if(s+=e[r],void 0!==t[r]){const e=n[r];s+=e===fe?Zt(t[r]):e===ge?me.transform(t[r]):t[r]}return s}}const we=t=>"number"==typeof t?0:me.test(t)?me.getAnimatableNone(t):t;const Te={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Jt)?.length||0)+(t.match(pe)?.length||0)>0},parse:xe,createTransformer:be,getAnimatableNone:function(t){const e=xe(t);return be(t)(e.map(we))}};function Pe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Se(t,e){return n=>n>0?e:t}const Ee=(t,e,n)=>t+(e-t)*n,ke=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Ce=[se,ie,de];function Ae(t){const e=(n=t,Ce.find(t=>t.test(n)));var n;if(Q(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(e))return!1;let i=e.parse(t);return e===de&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Pe(a,i,t+1/3),r=Pe(a,i,t),o=Pe(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}(i)),i}const Me=(t,e)=>{const n=Ae(t),i=Ae(e);if(!n||!i)return Se(t,e);const s={...n};return t=>(s.red=ke(n.red,i.red,t),s.green=ke(n.green,i.green,t),s.blue=ke(n.blue,i.blue,t),s.alpha=Ee(n.alpha,i.alpha,t),ie.transform(s))},Ne=new Set(["none","hidden"]);function Ve(t,e){return n=>Ee(t,e,n)}function De(t){return"number"==typeof t?Ve:"string"==typeof t?Yt(t)?Se:me.test(t)?Me:Re:Array.isArray(t)?Le:"object"==typeof t?me.test(t)?Me:je:Se}function Le(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>De(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function je(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=De(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Re=(t,e)=>{const n=Te.createTransformer(e),i=ve(t),s=ve(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Ne.has(t)&&!s.values.length||Ne.has(e)&&!i.values.length?function(t,e){return Ne.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):lt(Le(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}(i,s),s.values),n):(Q(!0,`Complex values '${t}' and '${e}' 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.`),Se(t,e))};function Oe(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ee(t,e,n);return De(t)(t,e)}const Be=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Ot.update(e,t),stop:()=>Bt(e),now:()=>Ft.isProcessing?Ft.timestamp:Wt.now()}},Fe=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Ie=2e4;function $e(t){let e=0;let n=t.next(e);for(;!n.done&&e<Ie;)e+=50,n=t.next(e);return e>=Ie?1/0:e}function Ue(t,e,n){const i=Math.max(e-5,0);return mt(n-t(i),e-i)}const We=100,ze=10,He=1,Xe=0,Ye=800,Ke=.3,qe=.3,Ge={granular:.01,default:2},_e={granular:.005,default:.5},Ze=.01,Je=10,Qe=.05,tn=1,en=.001;function nn({duration:t=Ye,bounce:e=Ke,velocity:n=Xe,mass:i=He}){let s,r;Q(t<=ht(Je),"Spring duration must be 10 seconds or less");let o=1-e;o=J(Qe,tn,o),t=J(Ze,Je,dt(t)),o<1?(s=e=>{const i=e*o,s=i*t,r=i-n,a=rn(e,o),l=Math.exp(-s);return en-r/a*l},r=e=>{const i=e*o*t,r=i*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-i),c=rn(Math.pow(e,2),o);return(-s(e)+en>0?-1:1)*((r-a)*l)/c}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<sn;n++)i-=t(i)/e(i);return i}(s,r,5/t);if(t=ht(t),isNaN(a))return{stiffness:We,damping:ze,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*o*Math.sqrt(i*e),duration:t}}}const sn=12;function rn(t,e){return t*Math.sqrt(1-e*e)}const on=["duration","bounce"],an=["stiffness","damping","mass"];function ln(t,e){return e.some(e=>void 0!==t[e])}function cn(t=qe,e=Ke){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:m}=function(t){let e={velocity:Xe,stiffness:We,damping:ze,mass:He,isResolvedFromDuration:!1,...t};if(!ln(t,an)&&ln(t,on))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*J(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:He,stiffness:s,damping:r}}else{const n=nn(t);e={...e,...n,mass:He},e.isResolvedFromDuration=!0}return e}({...n,velocity:-dt(n.velocity||0)}),p=d||0,f=c/(2*Math.sqrt(l*u)),g=o-r,y=dt(Math.sqrt(l/u)),v=Math.abs(g)<5;let x;if(i||(i=v?Ge.granular:Ge.default),s||(s=v?_e.granular:_e.default),f<1){const t=rn(y,f);x=e=>{const n=Math.exp(-f*y*e);return o-n*((p+f*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===f)x=t=>o-Math.exp(-y*t)*(g+(p+y*g)*t);else{const t=y*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*y*e),i=Math.min(t*e,300);return o-n*((p+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const b={calculatedDuration:m&&h||null,next:t=>{const e=x(t);if(m)a.done=t>=h;else{let n=0===t?p:0;f<1&&(n=0===t?ht(p):Ue(x,t,e));const r=Math.abs(n)<=i,l=Math.abs(o-e)<=s;a.done=r&&l}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min($e(b),Ie),e=Fe(e=>b.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return b}function un({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},m=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let p=n*e;const f=h+p,g=void 0===o?f:o(f);g!==f&&(p=g-h);const y=t=>-p*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?g:n};let b,w;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,w=cn({keyframes:[d.value,m(d.value)],velocity:Ue(v,t,d.value),damping:s,stiffness:r,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==b||(e=!0,x(t),T(t)),void 0!==b&&t>=b?w.next(t-b):(!e&&x(t),d)}}}function hn(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const r=t.length;if(tt(r===e.length,"Both input and output ranges must be the same length"),1===r)return()=>e[0];if(2===r&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||et.mix||Oe,r=t.length-1;for(let n=0;n<r;n++){let r=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||ot:e;r=lt(t,r)}i.push(r)}return i}(e,i,s),l=a.length,c=n=>{if(o&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=ct(t[i],t[i+1],n);return a[i](s)};return n?e=>c(J(t[0],t[r-1],e)):c}function dn(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=ct(0,e,i);t.push(Ee(n,1,s))}}(e,t.length-1),e}function mn({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Dt):Dt(i),r={done:!1,value:e[0]},o=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:dn(e),t),a=hn(o,e,{ease:Array.isArray(s)?s:(l=e,c=s,l.map(()=>c||Mt).splice(0,l.length-1))});var l,c;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}cn.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min($e(i),Ie);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:dt(s)}}(t,100,cn);return t.ease=e.ease,t.duration=ht(e.duration),t.type="keyframes",t};const pn=t=>null!==t;function fn(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(pn),o=s<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==i?i:r[o]}const gn={decay:un,inertia:un,tween:mn,keyframes:mn,spring:cn};function yn(t){"string"==typeof t.type&&(t.type=gn[t.type])}class vn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const xn=t=>t/100;class bn extends vn{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==Wt.now()&&this.tick(Wt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;yn(t);const{type:e=mn,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:o}=t;const a=e||mn;"production"!==process.env.NODE_ENV&&a!==mn&&tt(o.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`),a!==mn&&"number"!=typeof o[0]&&(this.mixKeyframes=lt(xn,Oe(o[0],o[1])),o=[0,100]);const l=a({...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=$e(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:h,repeatDelay:d,type:m,onUpdate:p,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v=this.currentTime,x=n;if(u){const t=Math.min(this.currentTime,i)/o;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(x=r)),v=J(0,1,n)*o}const b=y?{done:!1,value:c[0]}:x.next(v);s&&(b.value=s(b.value));let{done:w}=b;y||null===a||(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return T&&m!==un&&(b.value=fn(c,this.options,f,this.speed)),p&&p(b.value),T&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return dt(this.calculatedDuration)}get time(){return dt(this.currentTime)}set time(t){t=ht(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Wt.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=dt(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Be,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Wt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const wn=t=>180*t/Math.PI,Tn=t=>{const e=wn(Math.atan2(t[1],t[0]));return Sn(e)},Pn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Tn,rotateZ:Tn,skewX:t=>wn(Math.atan(t[1])),skewY:t=>wn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Sn=t=>((t%=360)<0&&(t+=360),t),En=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),kn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Cn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:En,scaleY:kn,scale:t=>(En(t)+kn(t))/2,rotateX:t=>Sn(wn(Math.atan2(t[6],t[5]))),rotateY:t=>Sn(wn(Math.atan2(-t[2],t[0]))),rotateZ:Tn,rotate:Tn,skewX:t=>wn(Math.atan(t[4])),skewY:t=>wn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function An(t){return t.includes("scale")?1:0}function Mn(t,e){if(!t||"none"===t)return An(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Cn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Pn,s=e}if(!s)return An(e);const r=i[e],o=s[1].split(",").map(Nn);return"function"==typeof r?r(o):o[r]}function Nn(t){return parseFloat(t.trim())}const Vn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Dn=(()=>new Set(Vn))(),Ln=t=>t===qt||t===le,jn=new Set(["x","y","z"]),Rn=Vn.filter(t=>!jn.has(t));const On={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Mn(e,"x"),y:(t,{transform:e})=>Mn(e,"y")};On.translateX=On.x,On.translateY=On.y;const Bn=new Set;let Fn=!1,In=!1,$n=!1;function Un(){if(In){const t=Array.from(Bn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Rn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}In=!1,Fn=!1,Bn.forEach(t=>t.complete($n)),Bn.clear()}function Wn(){Bn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(In=!0)})}class zn{constructor(t,e,n,i,s,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Bn.add(this),Fn||(Fn=!0,Ot.read(Wn),Ot.resolveKeyframes(Un))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,r);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=r),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Bn.delete(this)}cancel(){"scheduled"===this.state&&(Bn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Hn=rt(()=>void 0!==window.ScrollTimeline),Xn={};function Yn(t,e){const n=rt(t);return()=>Xn[e]??n()}const Kn=Yn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),qn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Gn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qn([0,.65,.55,1]),circOut:qn([.55,0,1,.45]),backIn:qn([.31,.01,.66,-.59]),backOut:qn([.33,1.53,.69,.99])};function _n(t,e){return t?"function"==typeof t?Kn()?Fe(t,e):"ease-out":Nt(t)?qn(t):Array.isArray(t)?t.map(t=>_n(t,e)||Gn.easeOut):Gn[t]:void 0}function Zn(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=_n(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};c&&(d.pseudoElement=c);return t.animate(u,d)}function Jn(t){return"function"==typeof t&&"applyToOptions"in t}class Qn extends vn{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=r,this.options=t,tt("string"!=typeof t.type,'animateMini doesn\'t support "type" as a string. Did you mean to import { spring } from "motion"?');const l=function({type:t,...e}){return Jn(t)&&Kn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Zn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=fn(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return dt(Number(t))}get time(){return dt(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=ht(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Hn()?(this.animation.timeline=t,ot):e(this)}}const ti={anticipate:Pt,backInOut:Tt,circInOut:kt};function ei(t){"string"==typeof t.ease&&t.ease in ti&&(t.ease=ti[t.ease])}class ni extends Qn{constructor(t){ei(t),yn(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new bn({...r,autoplay:!1}),a=ht(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const ii=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Te.test(t)&&"0"!==t||t.startsWith("url(")));function si(t){return it(t)&&"offsetHeight"in t}const ri=new Set(["opacity","clipPath","filter","transform"]),oi=rt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class ai extends vn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:a,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Wt.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||zn;this.keyframeResolver=new d(o,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:r,velocity:o,delay:a,isHandoff:l,onUpdate:c}=n;this.resolvedAt=Wt.now(),function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=ii(s,e),a=ii(r,e);return Q(o===a,`You are trying to animate ${e} from "${s}" to "${r}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${r} via the \`style\` property.`),!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||Jn(n))&&i)}(t,s,r,o)||(!et.instantAnimations&&a||c?.(fn(t,n,e)),t[0]=t[t.length-1],n.duration=0,n.repeat=0);const u={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},h=!l&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o}=t;if(!si(e?.owner?.current))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return oi()&&n&&ri.has(n)&&("transform"!==n||!l)&&!a&&!i&&"mirror"!==s&&0!==r&&"inertia"!==o}(u)?new ni({...u,element:u.motionValue.owner.current}):new bn(u);h.finished.then(()=>this.notifyFinished()).catch(ot),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),$n=!0,Wn(),Un(),$n=!1),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const li=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ci(t,e,n=1){tt(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[i,s]=function(t){const e=li.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const t=r.trim();return nt(t)?parseFloat(t):t}return Yt(s)?ci(s,e,n+1):s}function ui(t,e){return t?.[e]??t?.default??t}const hi=new Set(["width","height","top","left","right","bottom",...Vn]),di=t=>e=>e.test(t),mi=[qt,le,ae,oe,ue,ce,{test:t=>"auto"===t,parse:t=>t}],pi=t=>mi.find(di(t));function fi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||st(t))}const gi=new Set(["brightness","contrast","saturate","opacity"]);function yi(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Jt)||[];if(!i)return t;const s=n.replace(i,"");let r=gi.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const vi=/\b([a-z-]*)\(.*?\)/gu,xi={...Te,getAnimatableNone:t=>{const e=t.match(vi);return e?e.map(yi).join(" "):t}},bi={...qt,transform:Math.round},wi={borderWidth:le,borderTopWidth:le,borderRightWidth:le,borderBottomWidth:le,borderLeftWidth:le,borderRadius:le,radius:le,borderTopLeftRadius:le,borderTopRightRadius:le,borderBottomRightRadius:le,borderBottomLeftRadius:le,width:le,maxWidth:le,height:le,maxHeight:le,top:le,right:le,bottom:le,left:le,padding:le,paddingTop:le,paddingRight:le,paddingBottom:le,paddingLeft:le,margin:le,marginTop:le,marginRight:le,marginBottom:le,marginLeft:le,backgroundPositionX:le,backgroundPositionY:le,...{rotate:oe,rotateX:oe,rotateY:oe,rotateZ:oe,scale:_t,scaleX:_t,scaleY:_t,scaleZ:_t,skew:oe,skewX:oe,skewY:oe,distance:le,translateX:le,translateY:le,translateZ:le,x:le,y:le,z:le,perspective:le,transformPerspective:le,opacity:Gt,originX:he,originY:he,originZ:le},zIndex:bi,fillOpacity:Gt,strokeOpacity:Gt,numOctaves:bi},Ti={...wi,color:me,backgroundColor:me,outlineColor:me,fill:me,stroke:me,borderColor:me,borderTopColor:me,borderRightColor:me,borderBottomColor:me,borderLeftColor:me,filter:xi,WebkitFilter:xi},Pi=t=>Ti[t];function Si(t,e){let n=Pi(t);return n!==xi&&(n=Te),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ei=new Set(["auto","none","0"]);class ki extends zn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),Yt(i))){const s=ci(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!hi.has(n)||2!==t.length)return;const[i,s]=t,r=pi(i),o=pi(s);if(r!==o)if(Ln(r)&&Ln(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else On[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||fi(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!Ei.has(e)&&ve(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=Si(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=On[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=On[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Ci=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class Ai{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=Wt.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty();e&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Wt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return"production"!==process.env.NODE_ENV&&ft(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new ut);const n=this.events[t].add(e);return"change"===t?()=>{n(),Ot.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Wt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return mt(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Mi(t,e){return new Ai(t,e)}const{schedule:Ni,cancel:Vi}=Rt(queueMicrotask,!1),Di={x:!1,y:!1};function Li(){return Di.x||Di.y}function ji(t,e){const n=function(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Ri(t){return!("touch"===t.pointerType||Li())}const Oi=(t,e)=>!!e&&(t===e||Oi(t,e.parentElement)),Bi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Fi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Ii=new WeakSet;function $i(t){return e=>{"Enter"===e.key&&t(e)}}function Ui(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Wi(t){return Bi(t)&&!Li()}function zi(t,e,n={}){const[i,s,r]=ji(t,n),o=t=>{const i=t.currentTarget;if(!Wi(t))return;Ii.add(i);const r=e(i,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Ii.has(i)&&Ii.delete(i),Wi(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,i===window||i===document||n.useGlobalTarget||Oi(i,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),si(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=$i(()=>{if(Ii.has(n))return;Ui(n,"down");const t=$i(()=>{Ui(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Ui(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),e=t,Fi.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}function Hi(t){return it(t)&&"ownerSVGElement"in t}const Xi=t=>Boolean(t&&t.getVelocity),Yi=[...mi,me,Te],Ki=r({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class qi extends i.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=e.offsetParent,n=si(t)&&t.offsetWidth||0,i=this.props.sizeRef.current;i.height=e.offsetHeight||0,i.width=e.offsetWidth||0,i.top=e.offsetTop,i.left=e.offsetLeft,i.right=n-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Gi({children:e,isPresent:n,anchorX:s}){const r=c(),a=o(null),l=o({width:0,height:0,top:0,left:0,right:0}),{nonce:d}=u(Ki);return h(()=>{const{width:t,height:e,top:i,left:o,right:c}=l.current;if(n||!a.current||!t||!e)return;const u="left"===s?`left: ${o}`:`right: ${c}`;a.current.dataset.motionPopId=r;const h=document.createElement("style");return d&&(h.nonce=d),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`\n [data-motion-pop-id="${r}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${u}px !important;\n top: ${i}px !important;\n }\n `),()=>{document.head.contains(h)&&document.head.removeChild(h)}},[n]),t(qi,{isPresent:n,childRef:a,sizeRef:l,children:i.cloneElement(e,{ref:a})})}const _i=({children:e,initial:n,isPresent:s,onExitComplete:r,custom:o,presenceAffectsLayout:a,mode:l,anchorX:u})=>{const h=Y(Zi),m=c();let p=!0,f=d(()=>(p=!1,{id:m,initial:n,isPresent:s,custom:o,onExitComplete:t=>{h.set(t,!0);for(const t of h.values())if(!t)return;r&&r()},register:t=>(h.set(t,!1),()=>h.delete(t))}),[s,h,r]);return a&&p&&(f={...f}),d(()=>{h.forEach((t,e)=>h.set(e,!1))},[s]),i.useEffect(()=>{!s&&!h.size&&r&&r()},[s]),"popLayout"===l&&(e=t(Gi,{isPresent:s,anchorX:u,children:e})),t(G.Provider,{value:f,children:e})};function Zi(){return new Map}function Ji(t=!0){const e=u(G);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=e,r=c();l(()=>{if(t)return s(r)},[t]);const o=m(()=>t&&i&&i(r),[r,i,t]);return!n&&i?[!1,o]:[!0]}const Qi=t=>t.key||"";function ts(t){const e=[];return p.forEach(t,t=>{f(t)&&e.push(t)}),e}const es=({children:e,custom:i,initial:s=!0,onExitComplete:r,presenceAffectsLayout:a=!0,mode:l="sync",propagate:c=!1,anchorX:h="left"})=>{const[m,p]=Ji(c),f=d(()=>ts(e),[e]),y=c&&!m?[]:f.map(Qi),v=o(!0),x=o(f),b=Y(()=>new Map),[w,T]=g(f),[P,S]=g(f);q(()=>{v.current=!1,x.current=f;for(let t=0;t<P.length;t++){const e=Qi(P[t]);y.includes(e)?b.delete(e):!0!==b.get(e)&&b.set(e,!1)}},[P,y.length,y.join("-")]);const E=[];if(f!==w){let t=[...f];for(let e=0;e<P.length;e++){const n=P[e],i=Qi(n);y.includes(i)||(t.splice(e,0,n),E.push(n))}return"wait"===l&&E.length&&(t=E),S(ts(t)),T(f),null}"production"!==process.env.NODE_ENV&&"wait"===l&&P.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.');const{forceRender:k}=u(X);return t(n,{children:P.map(e=>{const n=Qi(e),o=!(c&&!m)&&(f===P||y.includes(n));return t(_i,{isPresent:o,initial:!(v.current&&!s)&&void 0,custom:i,presenceAffectsLayout:a,mode:l,onExitComplete:o?void 0:()=>{if(!b.has(n))return;b.set(n,!0);let t=!0;b.forEach(e=>{e||(t=!1)}),t&&(k?.(),S(x.current),c&&p?.(),r&&r())},anchorX:h,children:e},n)})})},ns=r({strict:!1}),is={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"]},ss={};for(const t in is)ss[t]={isEnabled:e=>is[t].some(t=>!!e[t])};const rs=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 os(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||rs.has(t)}let as=t=>!os(t);try{"function"==typeof(ls=require("@emotion/is-prop-valid").default)&&(as=t=>t.startsWith("on")?!os(t):ls(t))}catch{}var ls;function cs(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy((...e)=>("production"!==process.env.NODE_ENV&&ft(!1,"motion() is deprecated. Use motion.create() instead."),t(...e)),{get:(n,i)=>"create"===i?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const us=r({});function hs(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ds(t){return"string"==typeof t||Array.isArray(t)}const ms=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ps=["initial",...ms];function fs(t){return hs(t.animate)||ps.some(e=>ds(t[e]))}function gs(t){return Boolean(fs(t)||t.variants)}function ys(t){const{initial:e,animate:n}=function(t,e){if(fs(t)){const{initial:e,animate:n}=t;return{initial:!1===e||ds(e)?e:void 0,animate:ds(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,u(us));return d(()=>({initial:e,animate:n}),[vs(e),vs(n)])}function vs(t){return Array.isArray(t)?t.join(" "):t}const xs=Symbol.for("motionComponentSymbol");function bs(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function ws(t,e,n){return m(i=>{i&&t.onMount&&t.onMount(i),e&&(i?e.mount(i):e.unmount()),n&&("function"==typeof n?n(i):bs(n)&&(n.current=i))},[e])}const Ts=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ps="data-"+Ts("framerAppearId"),Ss=r({});function Es(t,e,n,i,s){const{visualElement:r}=u(us),a=u(ns),c=u(G),d=u(Ki).reducedMotion,m=o(null);i=i||a.renderer,!m.current&&i&&(m.current=i(t,{visualState:e,parent:r,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:d}));const p=m.current,f=u(Ss);!p||p.projection||!s||"html"!==p.type&&"svg"!==p.type||function(t,e,n,i){const{layoutId:s,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ks(t.parent)),t.projection.setOptions({layoutId:s,layout:r,alwaysMeasureLayout:Boolean(o)||a&&bs(a),visualElement:t,animationType:"string"==typeof r?r:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:c})}(m.current,n,s,f);const g=o(!1);h(()=>{p&&g.current&&p.update(n,c)});const y=n[Ps],v=o(Boolean(y)&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return q(()=>{p&&(g.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),Ni.render(p.render),v.current&&p.animationState&&p.animationState.animateChanges())}),l(()=>{p&&(!v.current&&p.animationState&&p.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),v.current=!1))}),p}function ks(t){if(t)return!1!==t.options.allowProjection?t.projection:ks(t.parent)}function Cs({preloadedFeatures:n,createVisualElement:i,useRender:s,useVisualState:r,Component:o}){function a(a,l){let c;const h={...u(Ki),...a,layoutId:As(a)},{isStatic:d}=h,m=ys(a),p=r(a,d);if(!d&&K){!function(t,e){const n=u(ns).strict;if("production"!==process.env.NODE_ENV&&e&&n){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Q(!1,e):tt(!1,e)}}(h,n);const t=function(t){const{drag:e,layout:n}=ss;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(h);c=t.MeasureLayout,m.visualElement=Es(o,p,h,i,t.ProjectionNode)}return e(us.Provider,{value:m,children:[c&&m.visualElement?t(c,{visualElement:m.visualElement,...h}):null,s(o,a,ws(p,m.visualElement,l),p,d,m.visualElement)]})}n&&function(t){for(const e in t)ss[e]={...ss[e],...t[e]}}(n),a.displayName=`motion.${"string"==typeof o?o:`create(${o.displayName??o.name??""})`}`;const l=y(a);return l[xs]=o,l}function As({layoutId:t}){const e=u(X).id;return e&&void 0!==t?e+"-"+t:t}const Ms={};function Ns(t,{layout:e,layoutId:n}){return Dn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ms[t]||"opacity"===t)}const Vs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ds=Vn.length;function Ls(t,e,n){const{style:i,vars:s,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(Dn.has(t))o=!0;else if(Ht(t))s[t]=n;else{const e=Ci(n,wi[t]);t.startsWith("origin")?(a=!0,r[t]=e):i[t]=e}}if(e.transform||(o||n?i.transform=function(t,e,n){let i="",s=!0;for(let r=0;r<Ds;r++){const o=Vn[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=Ci(a,wi[o]);l||(s=!1,i+=`${Vs[o]||o}(${t}) `),n&&(e[o]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;i.transformOrigin=`${t} ${e} ${n}`}}const js=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Rs(t,e,n){for(const i in e)Xi(e[i])||Ns(i,n)||(t[i]=e[i])}function Os(t,e){const n={};return Rs(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return d(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Ls(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Bs(t,e){const n={},i=Os(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Fs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Is={offset:"strokeDashoffset",array:"strokeDasharray"};function $s(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:o=0,...a},l,c,u){if(Ls(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?Fs:Is;t[r.offset]=le.transform(-i);const o=le.transform(e),a=le.transform(n);t[r.array]=`${o} ${a}`}(h,s,r,o,!1)}const Us=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Ws=t=>"string"==typeof t&&"svg"===t.toLowerCase();function zs(t,e,n,i){const s=d(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return $s(n,e,Ws(i),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Rs(e,t.style,t),s.style={...e,...s.style}}return s}const Hs=["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 Xs(t){return"string"==typeof t&&!t.includes("-")&&!!(Hs.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ys(t=!1){return(e,n,i,{latestValues:s},r)=>{const o=(Xs(e)?zs:Bs)(n,s,r,e),a=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(as(s)||!0===n&&os(s)||!e&&!os(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(n,"string"==typeof e,t),l=e!==v?{...a,...o,ref:i}:{},{children:c}=n,u=d(()=>Xi(c)?c.get():c,[c]);return x(e,{...l,children:u})}}function Ks(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function qs(t,e,n,i){if("function"==typeof e){const[s,r]=Ks(i);e=e(void 0!==n?n:t.custom,s,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,r]=Ks(i);e=e(void 0!==n?n:t.custom,s,r)}return e}function Gs(t){return Xi(t)?t.get():t}const _s=t=>(e,n)=>{const i=u(us),s=u(G),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Zs(n,i,s,t),renderState:e()}}(t,e,i,s);return n?r():Y(r)};function Zs(t,e,n,i){const s={},r=i(t,{});for(const t in r)s[t]=Gs(r[t]);let{initial:o,animate:a}=t;const l=fs(t),c=gs(t);e&&c&&!l&&!1!==t.inherit&&(void 0===o&&(o=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===o;const h=u?a:o;if(h&&"boolean"!=typeof h&&!hs(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=qs(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}function Js(t,e,n){const{style:i}=t,s={};for(const r in i)(Xi(i[r])||e.style&&Xi(e.style[r])||Ns(r,t)||void 0!==n?.getValue(r)?.liveStyle)&&(s[r]=i[r]);return s}const Qs={useVisualState:_s({scrapeMotionValuesFromProps:Js,createRenderState:js})};function tr(t,e,n){const i=Js(t,e,n);for(const n in t)if(Xi(t[n])||Xi(e[n])){i[-1!==Vn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const er={useVisualState:_s({scrapeMotionValuesFromProps:tr,createRenderState:Us})};function nr(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return Cs({...Xs(n)?er:Qs,preloadedFeatures:t,useRender:Ys(i),createVisualElement:e,Component:n})}}function ir(t,e,n){const i=t.getProps();return qs(i,e,void 0!==n?n:i.custom,t)}const sr=t=>Array.isArray(t);function rr(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Mi(n))}function or(t){return sr(t)?t[t.length-1]||0:t}function ar(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Xi(i)&&i.add))return n.add(e);if(!n&&et.WillChange){const n=new et.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function lr(t){return t.props[Ps]}const cr=t=>null!==t;const ur={type:"spring",stiffness:500,damping:25,restSpeed:10},hr={type:"keyframes",duration:.8},dr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mr=(t,{keyframes:e})=>e.length>2?hr:Dn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ur:dr;const pr=(t,e,n,i={},s,r)=>o=>{const a=ui(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=ht(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||Object.assign(u,mr(t,u)),u.duration&&(u.duration=ht(u.duration)),u.repeatDelay&&(u.repeatDelay=ht(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(h=!0)),(et.instantAnimations||et.skipAnimations)&&(h=!0,u.duration=0,u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(cr),r=e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}(u.keyframes,a);if(void 0!==t)return void Ot.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new bn(u):new ai(u)};function fr({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function gr(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;i&&(r=i);const l=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||c&&fr(c,e))continue;const o={delay:n,...ui(r||{},e)},u=i.get();if(void 0!==u&&!i.isAnimating&&!Array.isArray(s)&&s===u&&!o.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){const n=lr(t);if(n){const t=window.MotionHandoffAnimation(n,e,Ot);null!==t&&(o.startTime=t,h=!0)}}ar(t,e),i.start(pr(e,i,s,t.shouldReduceMotion&&hi.has(e)?{type:!1}:o,t,h));const d=i.animation;d&&l.push(d)}return o&&Promise.all(l).then(()=>{Ot.update(()=>{o&&function(t,e){const n=ir(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r)rr(t,e,or(r[e]))}(t,o)})}),l}function yr(t,e,n={}){const i=ir(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(gr(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=1,r){const o=[],a=(t.variantChildren.size-1)*i,l=1===s?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(vr).forEach((t,i)=>{t.notify("AnimationStart",e),o.push(yr(t,e,{...r,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(o)}(t,e,r+i,o,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then(()=>e())}return Promise.all([r(),o(n.delay)])}function vr(t,e){return t.sortNodePosition(e)}function xr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const br=ps.length;function wr(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&wr(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<br;n++){const i=ps[n],s=t.props[i];(ds(s)||!1===s)&&(e[i]=s)}return e}const Tr=[...ms].reverse(),Pr=ms.length;function Sr(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>yr(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=yr(t,e,n);else{const s="function"==typeof e?ir(t,e,n.custom):e;i=Promise.all(gr(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function Er(t){let e=Sr(t),n=Ar(),i=!0;const s=e=>(n,i)=>{const s=ir(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:o}=t,a=wr(t.parent)||{},l=[],c=new Set;let u={},h=1/0;for(let e=0;e<Pr;e++){const d=Tr[e],m=n[d],p=void 0!==o[d]?o[d]:a[d],f=ds(p),g=d===r?m.isActive:null;!1===g&&(h=e);let y=p===a[d]&&p!==o[d]&&f;if(y&&i&&t.manuallyAnimateOnMount&&(y=!1),m.protectedKeys={...u},!m.isActive&&null===g||!p&&!m.prevProp||hs(p)||"boolean"==typeof p)continue;const v=kr(m.prevProp,p);let x=v||d===r&&m.isActive&&!y&&f||e>h&&f,b=!1;const w=Array.isArray(p)?p:[p];let T=w.reduce(s(d),{});!1===g&&(T={});const{prevResolvedValues:P={}}=m,S={...P,...T},E=e=>{x=!0,c.has(e)&&(b=!0,c.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in S){const e=T[t],n=P[t];if(u.hasOwnProperty(t))continue;let i=!1;i=sr(e)&&sr(n)?!xr(e,n):e!==n,i?null!=e?E(t):c.add(t):void 0!==e&&c.has(t)?E(t):m.protectedKeys[t]=!0}m.prevProp=p,m.prevResolvedValues=T,m.isActive&&(u={...u,...T}),i&&t.blockInitialAnimation&&(x=!1);x&&(!(y&&v)||b)&&l.push(...w.map(t=>({animation:t,options:{type:d}})))}if(c.size){const e={};if("boolean"!=typeof o.initial){const n=ir(t,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==o.initial&&o.initial!==o.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Ar(),i=!0}}}function kr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!xr(e,t)}function Cr(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ar(){return{animate:Cr(!0),whileInView:Cr(),whileHover:Cr(),whileTap:Cr(),whileDrag:Cr(),whileFocus:Cr(),exit:Cr()}}class Mr{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Nr=0;const Vr={animation:{Feature:class extends Mr{constructor(t){super(t),t.animationState||(t.animationState=Er(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();hs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends Mr{constructor(){super(...arguments),this.id=Nr++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Dr(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Lr(t){return{point:{x:t.pageX,y:t.pageY}}}function jr(t,e,n,i){return Dr(t,e,(t=>e=>Bi(e)&&t(e,Lr(e)))(n),i)}function Rr({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Or(t){return t.max-t.min}function Br(t,e,n,i=.5){t.origin=i,t.originPoint=Ee(e.min,e.max,t.origin),t.scale=Or(n)/Or(e),t.translate=Ee(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Fr(t,e,n,i){Br(t.x,e.x,n.x,i?i.originX:void 0),Br(t.y,e.y,n.y,i?i.originY:void 0)}function Ir(t,e,n){t.min=n.min+e.min,t.max=t.min+Or(e)}function $r(t,e,n){t.min=e.min-n.min,t.max=t.min+Or(e)}function Ur(t,e,n){$r(t.x,e.x,n.x),$r(t.y,e.y,n.y)}const Wr=()=>({x:{min:0,max:0},y:{min:0,max:0}});function zr(t){return[t("x"),t("y")]}function Hr(t){return void 0===t||1===t}function Xr({scale:t,scaleX:e,scaleY:n}){return!Hr(t)||!Hr(e)||!Hr(n)}function Yr(t){return Xr(t)||Kr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Kr(t){return qr(t.x)||qr(t.y)}function qr(t){return t&&"0%"!==t}function Gr(t,e,n){return n+e*(t-n)}function _r(t,e,n,i,s){return void 0!==s&&(t=Gr(t,s,i)),Gr(t,n,i)+e}function Zr(t,e=0,n=1,i,s){t.min=_r(t.min,e,n,i,s),t.max=_r(t.max,e,n,i,s)}function Jr(t,{x:e,y:n}){Zr(t.x,e.translate,e.scale,e.originPoint),Zr(t.y,n.translate,n.scale,n.originPoint)}const Qr=.999999999999,to=1.0000000000001;function eo(t,e){t.min=t.min+e,t.max=t.max+e}function no(t,e,n,i,s=.5){Zr(t,e,n,Ee(t.min,t.max,s),i)}function io(t,e){no(t.x,e.x,e.scaleX,e.scale,e.originX),no(t.y,e.y,e.scaleY,e.scale,e.originY)}function so(t,e){return Rr(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const ro=({current:t})=>t?t.ownerDocument.defaultView:null,oo=(t,e)=>Math.abs(t-e);class ao{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!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 t=uo(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=oo(t.x,e.x),i=oo(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=Ft;this.history.push({...i,timestamp:s});const{onStart:r,onMove:o}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=lo(e,this.transformPagePoint),Ot.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const r=uo("pointercancel"===t.type?this.lastMoveEventInfo:lo(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,r),i&&i(t,r)},!Bi(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;const r=lo(Lr(t),this.transformPagePoint),{point:o}=r,{timestamp:a}=Ft;this.history=[{...o,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,uo(r,this.history)),this.removeListeners=lt(jr(this.contextWindow,"pointermove",this.handlePointerMove),jr(this.contextWindow,"pointerup",this.handlePointerUp),jr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Bt(this.updatePoint)}}function lo(t,e){return e?{point:e(t.point)}:t}function co(t,e){return{x:t.x-e.x,y:t.y-e.y}}function uo({point:t},e){return{point:t,delta:co(t,mo(e)),offset:co(t,ho(e)),velocity:po(e,.1)}}function ho(t){return t[0]}function mo(t){return t[t.length-1]}function po(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=mo(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>ht(e)));)n--;if(!i)return{x:0,y:0};const r=dt(s.timestamp-i.timestamp);if(0===r)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function fo(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function go(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const yo=.35;function vo(t,e,n){return{min:xo(t,e),max:xo(t,n)}}function xo(t,e){return"number"==typeof t?t:t[e]||0}const bo=new WeakMap;class wo{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={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new ao(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(Lr(t).point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(r=n)||"y"===r?Di[r]?null:(Di[r]=!0,()=>{Di[r]=!1}):Di.x||Di.y?null:(Di.x=Di.y=!0,()=>{Di.x=Di.y=!1}),!this.openDragLock))return;var r;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),zr(t=>{let e=this.getAxisMotionValue(t).get()||0;if(ae.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Or(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&Ot.postRender(()=>s(t,e)),ar(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:r}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:o}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(o),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,o),this.updateAxis("y",e.point,o),this.visualElement.render(),r&&r(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>zr(t=>"paused"===this.getAnimationState(t)&&this.getAxisMotionValue(t).animation?.play())},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:ro(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Ot.postRender(()=>s(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!To(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?Ee(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Ee(n,t,i.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),s.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&bs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:fo(t.x,n,s),y:fo(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=yo){return!1===t?t=0:!0===t&&(t=yo),{x:vo(t,"left","right"),y:vo(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&zr(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!bs(t))return!1;const n=t.current;tt(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=so(t,n),{scroll:s}=e;return s&&(eo(i.x,s.offset.x),eo(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:go(t.x,e.x),y:go(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=Rr(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:r,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{},l=zr(o=>{if(!To(o,e,this.currentDirection))return;let l=a&&a[o]||{};r&&(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[o]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(o,h)});return Promise.all(l).then(o)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return ar(this.visualElement,t),n.start(pr(t,n,0,e,this.visualElement,!1))}stopAnimation(){zr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){zr(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){zr(e=>{const{drag:n}=this.getProps();if(!To(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:r}=i.layout.layoutBox[e];s.set(t[e]-Ee(n,r,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!bs(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};zr(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=Or(t),s=Or(e);return s>i?n=ct(e.min,e.max-i,t.min):i>s&&(n=ct(t.min,t.max-s,e.min)),J(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),zr(e=>{if(!To(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:r}=this.constraints[e];n.set(Ee(s,r,i[e]))})}addListeners(){if(!this.visualElement.current)return;bo.set(this.visualElement,this);const t=jr(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();bs(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),Ot.read(e);const s=Dr(window,"resize",()=>this.scalePositionWithinConstraints()),r=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(zr(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),i(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:r=yo,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:r,dragMomentum:o}}}function To(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Po=t=>(e,n)=>{t&&Ot.postRender(()=>t(e,n))};const So={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Eo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ko={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!le.test(t))return t;t=parseFloat(t)}return`${Eo(t,e.target.x)}% ${Eo(t,e.target.y)}%`}},Co={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Te.parse(t);if(s.length>5)return i;const r=Te.createTransformer(t),o="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const c=Ee(a,l,.5);return"number"==typeof s[2+o]&&(s[2+o]/=c),"number"==typeof s[3+o]&&(s[3+o]/=c),r(s)}};class Ao extends b{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;!function(t){for(const e in t)Ms[e]=t[e],Ht(e)&&(Ms[e].isCSSVariable=!0)}(No),s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),So.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,{projection:r}=n;return r?(r.isPresent=s,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?r.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?r.promote():r.relegate()||Ot.postRender(()=>{const t=r.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ni.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Mo(e){const[n,i]=Ji(),s=u(X);return t(Ao,{...e,layoutGroup:s,switchLayoutGroup:u(Ss),isPresent:n,safeToRemove:i})}const No={borderRadius:{...ko,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ko,borderTopRightRadius:ko,borderBottomLeftRadius:ko,borderBottomRightRadius:ko,boxShadow:Co};const Vo=(t,e)=>t.depth-e.depth;class Do{constructor(){this.children=[],this.isDirty=!1}add(t){_(this.children,t),this.isDirty=!0}remove(t){Z(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Vo),this.isDirty=!1,this.children.forEach(t)}}const Lo=["TopLeft","TopRight","BottomLeft","BottomRight"],jo=Lo.length,Ro=t=>"string"==typeof t?parseFloat(t):t,Oo=t=>"number"==typeof t||le.test(t);function Bo(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Fo=$o(0,.5,Et),Io=$o(.5,.95,ot);function $o(t,e,n){return i=>i<t?0:i>e?1:n(ct(t,e,i))}function Uo(t,e){t.min=e.min,t.max=e.max}function Wo(t,e){Uo(t.x,e.x),Uo(t.y,e.y)}function zo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Ho(t,e,n,i,s){return t=Gr(t-=e,1/n,i),void 0!==s&&(t=Gr(t,1/s,i)),t}function Xo(t,e,[n,i,s],r,o){!function(t,e=0,n=1,i=.5,s,r=t,o=t){ae.test(e)&&(e=parseFloat(e),e=Ee(o.min,o.max,e/100)-o.min);if("number"!=typeof e)return;let a=Ee(r.min,r.max,i);t===r&&(a-=e),t.min=Ho(t.min,e,n,a,s),t.max=Ho(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,r,o)}const Yo=["x","scaleX","originX"],Ko=["y","scaleY","originY"];function qo(t,e,n,i){Xo(t.x,e,Yo,n?n.x:void 0,i?i.x:void 0),Xo(t.y,e,Ko,n?n.y:void 0,i?i.y:void 0)}function Go(t){return 0===t.translate&&1===t.scale}function _o(t){return Go(t.x)&&Go(t.y)}function Zo(t,e){return t.min===e.min&&t.max===e.max}function Jo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Qo(t,e){return Jo(t.x,e.x)&&Jo(t.y,e.y)}function ta(t){return Or(t.x)/Or(t.y)}function ea(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class na{constructor(){this.members=[]}add(t){_(this.members,t),t.scheduleRender()}remove(t){if(Z(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const ia=["","X","Y","Z"],sa={visibility:"hidden"};let ra=0;function oa(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function aa(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=lr(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Ot,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&aa(i)}function la({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=e?.()){this.id=ra++,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(ha),this.nodes.forEach(va),this.nodes.forEach(xa),this.nodes.forEach(da)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Do)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new ut),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;var n;this.isSVG=Hi(e)&&!(Hi(n=e)&&"svg"===n.tagName),this.instance=e;const{layoutId:i,layout:s,visualElement:r}=this.options;if(r&&!r.current&&r.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(s||i)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=Wt.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(Bt(i),t(r-e))};return Ot.setup(i,!0),()=>Bt(i)}(i,250),So.hasAnimatedSinceResize&&(So.hasAnimatedSinceResize=!1,this.nodes.forEach(ya))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&r&&(i||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||r.getDefaultTransition()||Ea,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!Qo(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...ui(s,"layout"),onPlay:o,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c)}else e||ya(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Bt(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(ba),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&aa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(pa);this.isUpdating||this.nodes.forEach(fa),this.isUpdating=!1,this.nodes.forEach(ga),this.nodes.forEach(ca),this.nodes.forEach(ua),this.clearAllSnapshots();const t=Wt.now();Ft.delta=J(0,1e3/60,t-Ft.timestamp),Ft.timestamp=t,Ft.isProcessing=!0,It.update.process(Ft),It.preRender.process(Ft),It.render.process(Ft),Ft.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ni.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ma),this.sharedNodes.forEach(wa)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ot.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ot.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Or(this.snapshot.measuredBox.x)||Or(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!_o(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,r=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||Yr(this.latestValues)||r)&&(s(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),Aa((i=n).x),Aa(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Na))){const{scroll:t}=this.root;t&&(eo(e.x,t.offset.x),eo(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(Wo(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:s,options:r}=i;i!==this.root&&s&&r.layoutScroll&&(s.wasRoot&&Wo(e,t),eo(e.x,s.offset.x),eo(e.y,s.offset.y))}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Wo(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&io(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),Yr(i.latestValues)&&io(n,i.latestValues)}return Yr(this.latestValues)&&io(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Wo(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!Yr(n.latestValues))continue;Xr(n.latestValues)&&n.updateSnapshot();const i=Wr();Wo(i,n.measurePageBox()),qo(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return Yr(this.latestValues)&&qo(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ft.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==e;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:i,layoutId:s}=this.options;if(this.layout&&(i||s)){if(this.resolvedRelativeTargetAt=Ft.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ur(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Wo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var r,o,a;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),r=this.target,o=this.relativeTarget,a=this.relativeParent.target,Ir(r.x,o.x,a.x),Ir(r.y,o.y,a.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Wo(this.target,this.layout.layoutBox),Jr(this.target,this.targetDelta)):Wo(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ur(this.relativeTargetOrigin,this.target,t.target),Wo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Xr(this.parent.latestValues)&&!Kr(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Ft.timestamp&&(n=!1),n)return;const{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!s)return;Wo(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,o=this.treeScale.y;!function(t,e,n,i=!1){const s=n.length;if(!s)return;let r,o;e.x=e.y=1;for(let a=0;a<s;a++){r=n[a],o=r.projectionDelta;const{visualElement:s}=r.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&r.options.layoutScroll&&r.scroll&&r!==r.root&&io(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Jr(t,o)),i&&Yr(r.latestValues)&&io(t,r.latestValues))}e.x<to&&e.x>Qr&&(e.x=1),e.y<to&&e.y>Qr&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(zo(this.prevProjectionDelta.x,this.projectionDelta.x),zo(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Fr(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===r&&this.treeScale.y===o&&ea(this.projectionDelta.x,this.prevProjectionDelta.x)&&ea(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const o={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(Sa));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,m,p,f,g;Ta(r.x,t.x,n),Ta(r.y,t.y,n),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ur(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),m=this.relativeTarget,p=this.relativeTargetOrigin,f=o,g=n,Pa(m.x,p.x,f.x,g),Pa(m.y,p.y,f.y,g),h&&(l=this.relativeTarget,d=h,Zo(l.x,d.x)&&Zo(l.y,d.y))&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),Wo(h,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,r){s?(t.opacity=Ee(0,n.opacity??1,Fo(i)),t.opacityExit=Ee(e.opacity??1,0,Io(i))):r&&(t.opacity=Ee(e.opacity??1,n.opacity??1,i));for(let s=0;s<jo;s++){const r=`border${Lo[s]}Radius`;let o=Bo(e,r),a=Bo(n,r);void 0===o&&void 0===a||(o||(o=0),a||(a=0),0===o||0===a||Oo(o)===Oo(a)?(t[r]=Math.max(Ee(Ro(o),Ro(a),i),0),(ae.test(a)||ae.test(o))&&(t[r]+="%")):t[r]=a)}(e.rotate||n.rotate)&&(t.rotate=Ee(e.rotate||0,n.rotate||0,i))}(s,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Bt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ot.update(()=>{So.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Mi(0)),this.currentAnimation=function(t,e,n){const i=Xi(t)?t:Mi(t);return i.start(pr("",i,e,n)),i.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{t.onComplete&&t.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 t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Ma(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Or(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Or(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Wo(e,n),io(e,s),Fr(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new na);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&oa("z",t,i,this.animationValues);for(let e=0;e<ia.length;e++)oa(`rotate${ia[e]}`,t,i,this.animationValues),oa(`skew${ia[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}getProjectionStyles(t){if(!this.instance||this.isSVG)return;if(!this.isVisible)return sa;const e={visibility:""},n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,e.opacity="",e.pointerEvents=Gs(t?.pointerEvents)||"",e.transform=n?n(this.latestValues,""):"none",e;const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Gs(t?.pointerEvents)||""),this.hasProjected&&!Yr(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1),e}const s=i.animationValues||i.latestValues;this.applyTransformsToTarget(),e.transform=function(t,e,n){let i="";const s=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((s||r||o)&&(i=`translate3d(${s}px, ${r}px, ${o}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:r,skewX:o,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),r&&(i+=`rotateY(${r}deg) `),o&&(i+=`skewX(${o}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,s),n&&(e.transform=n(s,e.transform));const{x:r,y:o}=this.projectionDelta;e.transformOrigin=`${100*r.origin}% ${100*o.origin}% 0`,i.animationValues?e.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:e.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const t in Ms){if(void 0===s[t])continue;const{correct:n,applyTo:r,isCSSVariable:o}=Ms[t],a="none"===e.transform?s[t]:n(s[t],i);if(r){const t=r.length;for(let n=0;n<t;n++)e[r[n]]=a}else o?this.options.visualElement.renderState.vars[t]=a:e[t]=a}return this.options.layoutId&&(e.pointerEvents=i===this?Gs(t?.pointerEvents)||"":"none"),e}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(pa),this.root.sharedNodes.clear()}}}function ca(t){t.updateLayout()}function ua(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,r=e.source!==t.layout.source;"size"===s?zr(t=>{const i=r?e.measuredBox[t]:e.layoutBox[t],s=Or(i);i.min=n[t].min,i.max=i.min+s}):Ma(s,e.layoutBox,n)&&zr(i=>{const s=r?e.measuredBox[i]:e.layoutBox[i],o=Or(n[i]);s.max=s.min+o,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+o)});const o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Fr(o,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r?Fr(a,t.applyTransform(i,!0),e.measuredBox):Fr(a,n,e.layoutBox);const l=!_o(o);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:r}=i;if(s&&r){const o={x:{min:0,max:0},y:{min:0,max:0}};Ur(o,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ur(a,n,r.layoutBox),Qo(o,a)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=o,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function ha(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function da(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ma(t){t.clearSnapshot()}function pa(t){t.clearMeasurements()}function fa(t){t.isLayoutDirty=!1}function ga(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ya(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function va(t){t.resolveTargetDelta()}function xa(t){t.calcProjection()}function ba(t){t.resetSkewAndRotation()}function wa(t){t.removeLeadSnapshot()}function Ta(t,e,n){t.translate=Ee(e.translate,0,n),t.scale=Ee(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Pa(t,e,n,i){t.min=Ee(e.min,n.min,i),t.max=Ee(e.max,n.max,i)}function Sa(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Ea={duration:.45,ease:[.4,0,.1,1]},ka=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ca=ka("applewebkit/")&&!ka("chrome/")?Math.round:ot;function Aa(t){t.min=Ca(t.min),t.max=Ca(t.max)}function Ma(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=ta(e),s=ta(n),r=.2,!(Math.abs(i-s)<=r));var i,s,r}function Na(t){return t!==t.root&&t.scroll?.wasRoot}const Va=la({attachResizeListener:(t,e)=>Dr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Da={current:void 0},La=la({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Da.current){const t=new Va({});t.mount(window),t.setOptions({layoutScroll:!0}),Da.current=t}return Da.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ja={pan:{Feature:class extends Mr{constructor(){super(...arguments),this.removePointerDownListener=ot}onPointerDown(t){this.session=new ao(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ro(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Po(t),onStart:Po(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&Ot.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=jr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Mr{constructor(t){super(t),this.removeGroupControls=ot,this.removeListeners=ot,this.controls=new wo(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ot}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:La,MeasureLayout:Mo}};function Ra(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&Ot.postRender(()=>s(e,Lr(e)))}function Oa(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&Ot.postRender(()=>s(e,Lr(e)))}const Ba=new WeakMap,Fa=new WeakMap,Ia=t=>{const e=Ba.get(t.target);e&&e(t)},$a=t=>{t.forEach(Ia)};function Ua(t,e,n){const i=function({root:t,...e}){const n=t||document;Fa.has(n)||Fa.set(n,{});const i=Fa.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver($a,{root:t,...e})),i[s]}(e);return Ba.set(t,n),i.observe(t),()=>{Ba.delete(t),i.unobserve(t)}}const Wa={some:0,all:1};const za={inView:{Feature:class extends Mr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Wa[i]};return Ua(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),r=e?n:i;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Mr{mount(){const{current:t}=this.node;t&&(this.unmount=zi(t,(t,e)=>(Oa(this.node,e,"Start"),(t,{success:e})=>Oa(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Mr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){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=lt(Dr(this.node.current,"focus",()=>this.onFocus()),Dr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Mr{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,r]=ji(t,n),o=t=>{if(!Ri(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const r=t=>{Ri(t)&&(i(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,s)};return i.forEach(t=>{t.addEventListener("pointerenter",o,s)}),r}(t,(t,e)=>(Ra(this.node,e,"Start"),t=>Ra(this.node,t,"End"))))}unmount(){}}}},Ha={layout:{ProjectionNode:La,MeasureLayout:Mo}},Xa={current:null},Ya={current:!1};const Ka=new WeakMap;const qa=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ga{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=zn,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 t=Wt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Ot.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=fs(e),this.isVariantNode=gs(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in u){const e=u[t];void 0!==a[t]&&Xi(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Ka.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((t,e)=>this.bindToMotionValue(e,t)),Ya.current||function(){if(Ya.current=!0,K)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Xa.current=t.matches;t.addListener(e),e()}else Xa.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Xa.current),"production"!==process.env.NODE_ENV&&ft(!0!==this.shouldReduceMotion,"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(),Bt(this.notifyUpdate),Bt(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 e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Dn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Ot.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s(),r&&r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ss){const e=ss[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<qa.length;e++){const n=qa[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],r=n[i];if(Xi(s))t.addValue(i,s);else if(Xi(r))t.addValue(i,Mi(s,{owner:t}));else if(r!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,Mi(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}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 e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Mi(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=n&&("string"==typeof n&&(nt(n)||st(n))?n=parseFloat(n):(i=n,!Yi.find(di(i))&&Te.test(e)&&(n=Si(t,e))),this.setBaseTarget(t,Xi(n)?n.get():n)),Xi(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=qs(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Xi(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new ut),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class _a extends Ga{constructor(){super(...arguments),this.KeyframeResolver=ki}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Xi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Za(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const e in n)t.style.setProperty(e,n[e])}class Ja extends _a{constructor(){super(...arguments),this.type="html",this.renderInstance=Za}readValueFromInstance(t,e){if(Dn.has(e))return this.projection?.isProjecting?An(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Mn(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(Ht(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return so(t,e)}build(t,e,n){Ls(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Js(t,e,n)}}const Qa=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"]);class tl extends _a{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Wr}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Dn.has(e)){const t=Pi(e);return t&&t.default||0}return e=Qa.has(e)?e:Ts(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return tr(t,e,n)}build(t,e,n){$s(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Za(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Qa.has(n)?n:Ts(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Ws(t.tagName),super.mount(t)}}const el=(t,e)=>Xs(t)?new tl(e):new Ja(e,{allowProjection:t!==v}),nl=cs(nr({...Vr,...za,...ja,...Ha},el));const il=({isOpen:i,onClose:s,onToggle:r,menuItems:a,logoUrl:c,logoAlt:u="Logo",systemName:h="PASS",defaultLogoUrl:m,dashboardPath:p,className:f="fixed inset-y-0 left-0 z-50 w-80 bg-white shadow-xl",overlayClassName:y="fixed inset-0 bg-black bg-opacity-25 z-40",desktopMenuClassName:v="h-full flex flex-col",showBottomMenu:x=!0,bottomMenuItems:b=[{id:"settings",label:"Configuración",icon:W,action:()=>{}},{id:"help",label:"Ayuda",icon:I,action:()=>{}},{id:"logout",label:"Cerrar Sesión",icon:$,action:()=>{}}],activePath:w="",onNavigate:T,children:P,performanceMode:S="auto",fpsThreshold:E,fpsSampleSize:k,compatibilityMode:C=!1,onPerformanceModeChange:A})=>{const[M,N]=g(new Set),{effectiveMode:V}=function({mode:t="auto",fpsThreshold:e=45,fpsSampleSize:n=90,compatibilityFlag:i=!1,onModeChange:s}={}){const[r,a]=g(!1),[c,u]=g(!1),h=o("full");l(()=>{if("undefined"==typeof window||"full"===t||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)"),n=()=>a(e.matches);return n(),e.addEventListener("change",n),()=>e.removeEventListener("change",n)},[t]),l(()=>{if("undefined"==typeof window||"undefined"==typeof performance||"auto"!==t||r||i)return;let s=0,o=0,a=performance.now(),l=null;const c=Math.min(Math.max(30,n),240),h=t=>{const n=t-a;a=t,s>0&&(o+=1e3/n),s+=1,s>=c?o/(s-1||1)<e&&u(!0):l=window.requestAnimationFrame(h)};return l=window.requestAnimationFrame(h),()=>{null!==l&&window.cancelAnimationFrame(l)}},[t,r,i,n,e]);const m=d(()=>"full"===t||"lite"===t?t:i||r||c?"lite":"full",[t,i,r,c]);return l(()=>{s?h.current!==m&&(s(m),h.current=m):h.current=m},[m,s]),{effectiveMode:m,prefersReducedMotion:r,detectedLowPerformance:c,compatibilityFlag:i}}({mode:S,fpsThreshold:E,fpsSampleSize:k,compatibilityFlag:C,onModeChange:A}),D="lite"===V,L=d(()=>D?{boxShadow:"0 4px 12px rgba(15, 23, 42, 0.12)",backgroundColor:"rgba(255, 255, 255, 0.96)",transform:i?"translateX(0)":"translateX(-100%)",transition:"none"}:{willChange:"transform"},[D,i]),j=d(()=>D?{backgroundColor:"rgba(15, 23, 42, 0.28)"}:{willChange:"opacity"},[D]),R="string"==typeof m&&""!==m.trim()?m:void 0,O="string"==typeof c&&""!==c.trim()?c:R,U=t=>w.includes(t),H=t=>{T&&T(t),s()},X=(n,i=!1)=>e(nl.button,{whileHover:D?void 0:{scale:1.01},whileTap:D?void 0:{scale:.99},transition:D?{duration:.1}:{duration:.16,ease:[.4,0,.2,1]},style:D?void 0:{willChange:"transform"},className:`w-full flex items-center justify-between py-3 rounded-lg transition-colors group ${i?"pr-4 pl-10":"px-4"} ${U(n.path)?"bg-primary-botech text-white":"text-gray-700 hover:bg-gray-100"}`,onClick:()=>H(n.path),children:[e("div",{className:"flex items-center space-x-3",children:[t(n.icon,{className:"w-5 h-5"}),t("span",{className:"font-medium text-sm",children:n.label})]}),t(F,{className:"w-4 h-4 transition-transform "+(U(n.path)?"rotate-90":"group-hover:translate-x-1")})]},n.id),Y=n=>{const i=M.has(n.id);return e("div",{className:"mb-2",children:[e(nl.button,{whileHover:D?void 0:{scale:1.01},whileTap:D?void 0:{scale:.99},transition:D?{duration:.1}:{duration:.16,ease:[.4,0,.2,1]},style:D?void 0:{willChange:"transform"},className:"w-full flex items-center justify-between px-4 py-3 rounded-lg transition-colors group text-gray-700 hover:bg-gray-100",onClick:()=>{return t=n.id,void N(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t},children:[e("div",{className:"flex items-center space-x-3",children:[t(n.icon,{className:"w-5 h-5"}),t("span",{className:"font-medium text-sm",children:n.label})]}),t(B,{className:"w-4 h-4 transition-transform "+(i?"rotate-180":"")})]}),D?i&&t("div",{className:"pt-2 space-y-1",children:n.children.map(t=>X(t,!0))}):t(es,{initial:!1,children:i&&t(nl.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.22,ease:[.33,1,.68,1]},className:"overflow-hidden pt-2 space-y-1",style:{willChange:"transform, opacity"},children:n.children.map(t=>X(t,!0))},`${n.id}-content`)})]},n.id)},K=e("div",{className:v,children:[e("div",{className:"p-4 border-b border-gray-200 flex items-center justify-between",children:[e("button",{type:"button",onClick:()=>{p&&H(p)},className:"flex items-center space-x-3 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-botech rounded-lg",children:[t("div",{className:"w-8 h-8 flex items-center justify-center",children:O?t("img",{src:O,alt:u,className:"h-full object-contain"}):t("div",{className:"h-full w-full bg-primary-botech rounded-lg flex items-center justify-center",children:t("span",{className:"text-white font-bold text-sm",children:h.charAt(0)})})}),t("h1",{className:"text-lg font-bold text-gray-800",children:h})]}),t("button",{onClick:s,className:"p-1 rounded-lg text-gray-500 hover:bg-gray-100 transition-colors",children:t(z,{className:"w-5 h-5"})})]}),t("div",{className:"flex-1 overflow-y-auto p-4",children:t("nav",{className:"space-y-2",children:a.map(t=>"folder"===t.type?Y(t.data):X(t.data))})}),x&&t("div",{className:"p-4 border-t border-gray-200",children:t("div",{className:"space-y-2",children:b.map(n=>e("button",{onClick:n.action,className:"w-full flex items-center space-x-3 px-4 py-2 rounded-lg text-gray-700 hover:bg-gray-100 transition-colors",children:[t(n.icon,{className:"w-5 h-5"}),t("span",{className:"text-sm",children:n.label})]},n.id))})}),P&&t("div",{className:"p-4 border-t border-gray-200",children:P})]});return e(n,{children:[D?i&&t("div",{className:y,style:j,onClick:s,"data-motion-mode":V}):t(es,{initial:!1,children:i&&t(nl.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2,ease:[.25,1,.5,1]},className:y,style:j,onClick:s})}),D?t("div",{className:f,style:L,"data-motion-mode":V,children:K}):t(nl.div,{initial:!1,animate:{x:i?0:"-100%",opacity:1},transition:{type:"spring",stiffness:280,damping:32,mass:.9},className:f,style:L,"data-motion-mode":V,children:K})]})};function sl(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n}function rl(t,e,n,i){return new(n||(n=Promise))(function(s,r){function o(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const ol=t=>{if("85"===t)return"/back85";if("87"===t)return"/back87";if("undefined"!=typeof window){if(window.location.hostname.toLowerCase().includes("seguimiento"))return"/back85"}return"/back87"},al=(t,e)=>rl(void 0,void 0,void 0,function*(){const n=`${ol(t)}/student/downloadExcel/${e||"PASS"}`;return(yield T.get(n,{responseType:"blob"})).data}),ll=(t,e,n)=>rl(void 0,void 0,void 0,function*(){const i=`${ol(e)}/student/uploadExcel`,s=new FormData;s.append("receivedExcelFile",t),"85"===e&&n&&s.append("clientName",n);return(yield T.post(i,s,{transformRequest:[t=>t]})).data}),cl=({backend:e,label:n="Descargar Lista de Estudiantes en Excel",fileName:i="students.xlsx",className:s,variant:r="primary",clientName:o,onSuccess:a,onError:l})=>{const[c,u]=g(!1);return t(S,{variant:r,onClick:()=>rl(void 0,void 0,void 0,function*(){var t,n,s,r,c,h,d;try{u(!0);let t=o;if("85"===e&&!t){const{value:e}=yield w.fire({title:"Cliente requerido",text:"Ingrese el nombre del cliente:",input:"text",inputPlaceholder:"Ej: GIMNASIO FEMENINO",showCancelButton:!0,confirmButtonText:"Continuar",cancelButtonText:"Cancelar",inputValidator:t=>{if(!t||""===t.trim())return"El nombre del cliente es requerido"}});if(!e)return void u(!1);t=e}const n=yield al(e,t),s=URL.createObjectURL(n),r=document.createElement("a");r.href=s,r.download=i,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(s),yield w.fire({title:"¡Descarga exitosa!",text:"El archivo se ha descargado correctamente",icon:"success",confirmButtonText:"OK"}),null==a||a()}catch(e){console.error("Download students excel failed",e);let i="No se pudo descargar el archivo. Por favor, inténtelo nuevamente.";const o=e;i=null!==(d=null!==(c=null!==(s=null===(n=null===(t=null==o?void 0:o.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.message)&&void 0!==s?s:"string"==typeof(null===(r=null==o?void 0:o.response)||void 0===r?void 0:r.data)?o.response.data:void 0)&&void 0!==c?c:(null===(h=null==o?void 0:o.response)||void 0===h?void 0:h.statusText)?`Error ${o.response.status}: ${o.response.statusText}`:void 0)&&void 0!==d?d:i,yield w.fire({title:"Error en la descarga",text:i,icon:"error",confirmButtonText:"OK"}),null==l||l(e)}finally{u(!1)}}),className:s,children:c?"Descargando...":n})},ul=({backend:i,label:s="Cargar Lista de Estudiantes en Excel",className:r,variant:a="primary",clientName:l,onSuccess:c,onError:u})=>{const h=o(null),[d,m]=g(!1);return e(n,{children:[t(S,{variant:a,onClick:()=>{var t;null===(t=h.current)||void 0===t||t.click()},className:r,children:d?"Subiendo...":s}),t("input",{type:"file",accept:".xlsx,.xls",ref:h,className:"hidden",onChange:t=>rl(void 0,void 0,void 0,function*(){var e,n,s,r,o,a,d,p;const f=null===(e=t.target.files)||void 0===e?void 0:e[0];if(!f)return;if([/\.xlsx$/i,/\.xls$/i].some(t=>t.test(f.name)))if(0!==f.size)try{m(!0);let t=l;if("85"===i&&!t){const{value:e}=yield w.fire({title:"Cliente requerido",text:"Ingrese el nombre del cliente:",input:"text",inputPlaceholder:"Ej: GIMNASIO FEMENINO",showCancelButton:!0,confirmButtonText:"Continuar",cancelButtonText:"Cancelar",inputValidator:t=>{if(!t||""===t.trim())return"El nombre del cliente es requerido"}});if(!e)return void m(!1);t=e}const e=yield ll(f,i,t);let n="El archivo se ha cargado correctamente";(null==e?void 0:e.message)?n=e.message:"string"==typeof e&&(n=e),yield w.fire({title:"¡Carga exitosa!",text:n,icon:"success",confirmButtonText:"OK"}),null==c||c()}catch(t){console.error("Upload students excel failed",t),console.error("Error details:",t);let e="Hubo un problema al subir el archivo";const i=t;e=null!==(p=null!==(a=null!==(r=null===(s=null===(n=null==i?void 0:i.response)||void 0===n?void 0:n.data)||void 0===s?void 0:s.message)&&void 0!==r?r:"string"==typeof(null===(o=null==i?void 0:i.response)||void 0===o?void 0:o.data)?i.response.data:void 0)&&void 0!==a?a:(null===(d=null==i?void 0:i.response)||void 0===d?void 0:d.statusText)?`Error ${i.response.status}: ${i.response.statusText}`:void 0)&&void 0!==p?p:e,yield w.fire({title:"Error en la carga",text:e,icon:"error",confirmButtonText:"OK"}),null==u||u(t)}finally{h.current&&(h.current.value=""),m(!1)}else yield w.fire({title:"Archivo vacío",text:"El archivo seleccionado está vacío",icon:"warning",confirmButtonText:"OK"});else yield w.fire({title:"Archivo inválido",text:"El archivo debe ser un Excel (.xlsx o .xls)",icon:"warning",confirmButtonText:"OK"})})})]})},hl=({items:n,selectedItem:i=null,onSelectionChange:s,placeholder:r="Seleccionar elemento",searchPlaceholder:a="Buscar...",className:u="",disabled:h=!1,searchBy:p="both",caseSensitive:f=!1,exactMatch:y=!0,renderItem:v,renderSelectedItem:x})=>{const[b,w]=g(!1),[T,P]=g(""),S=o(null),E=o(null),k=o(null),C=o([]),A=c();l(()=>{const t=t=>{S.current&&!S.current.contains(t.target)&&w(!1)};if(b)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[b]),l(()=>{b&&k.current&&k.current.focus()},[b]),l(()=>{b||P("")},[b]);const M=d(()=>((t,e)=>{if(!e.trim())return t;const n=e.trim(),i=f?n:n.toLowerCase();return t.filter(t=>{const e=f?t.name:t.name.toLowerCase(),n=f?t.id:t.id.toLowerCase();if(y)switch(p){case"name":return e===i;case"id":return n===i;case"both":return e===i||n===i;default:return!1}else switch(p){case"name":return e.includes(i);case"id":return n.includes(i);case"both":return e.includes(i)||n.includes(i);default:return!1}})})(n,T),[n,T,f,y,p]),[N,V]=g(-1),D=m(()=>{w(!1)},[]),L=t=>{var e;s(t),D(),null===(e=E.current)||void 0===e||e.focus()},j=()=>{h||w(!b)},R=m(t=>{M.length&&V(e=>((-1===e?1===t?-1:0:e)+t+M.length)%M.length)},[M.length]);l(()=>{if(b){const t=i?M.findIndex(t=>t.id===i.id):-1;-1!==t?V(t):M.length?V(t=>t>=0&&t<M.length?t:0):V(-1)}else V(-1)},[b,M,i]),l(()=>{if(N<0)return;const t=C.current[N];null==t||t.scrollIntoView({block:"nearest"})},[N]);return C.current=[],e("div",{ref:S,className:`relative w-full ${u}`,onKeyDown:t=>{var e;if(h)return;const n=t.target,i=n===E.current;if(!b)return void(!i||"Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),j()));if("Escape"===t.key)return t.preventDefault(),D(),void(null===(e=E.current)||void 0===e||e.focus());if(n instanceof HTMLButtonElement)return;const s=n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement;switch(t.key){case"ArrowDown":t.preventDefault(),R(1);break;case"ArrowUp":t.preventDefault(),R(-1);break;case"Enter":N>=0&&N<M.length&&(t.preventDefault(),L(M[N]));break;case" ":case"Spacebar":if(s)break;N>=0&&N<M.length&&(t.preventDefault(),L(M[N]))}},children:[e("div",{ref:E,className:`\n min-h-10 w-full flex items-center justify-between px-3 py-2 \n text-sm bg-white border border-gray-300 rounded-md shadow-sm cursor-pointer\n transition-colors duration-200\n ${h?"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200":"hover:border-primary-botech-400 focus-within:border-primary-botech focus-within:ring-1 focus-within:ring-primary-botech"}\n ${b?"border-primary-botech ring-1 ring-primary-botech":""}\n `,onClick:j,role:"button",tabIndex:h?-1:0,"aria-haspopup":"listbox","aria-expanded":b,"aria-disabled":h,children:[t("div",{className:"flex-1 truncate",children:t("span",i?{className:"text-gray-900",children:x?x(i):i.name}:{className:"text-gray-500",children:r})}),e("div",{className:"flex items-center space-x-1 ml-2",children:[i&&!h&&t("button",{type:"button",onClick:t=>{t.stopPropagation(),s(null)},className:"text-gray-400 hover:text-gray-600 transition-colors duration-200",children:t(()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),{})}),t("div",{className:"text-gray-400 transition-transform duration-200 "+(b?"rotate-180":""),children:t(()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),{})})]})]}),b&&e("div",{className:"absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg",children:[t("div",{className:"p-2 border-b border-gray-100",children:e("div",{className:"relative",children:[t("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:t(()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),{})}),t("input",{ref:k,type:"text",className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md text-sm placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-primary-botech focus:border-primary-botech",placeholder:a,value:T,onChange:t=>P(t.target.value),onClick:t=>t.stopPropagation(),"aria-autocomplete":"list","aria-controls":A})]})}),t("div",{id:A,className:"max-h-60 overflow-auto",role:"listbox","aria-activedescendant":N>=0?`${A}-option-${N}`:void 0,children:0===M.length?t("div",{className:"px-3 py-2 text-sm text-gray-500",children:T?"No se encontraron coincidencias exactas":"No hay elementos disponibles"}):M.map((e,n)=>t("div",{id:`${A}-option-${n}`,ref:t=>{C.current[n]=t},className:"px-3 py-2 text-sm cursor-pointer transition-colors duration-200 border-b border-gray-50 last:border-b-0 "+(N===n?"bg-primary-botech-100":"hover:bg-primary-botech-50"),onClick:()=>L(e),role:"option","aria-selected":(null==i?void 0:i.id)===e.id,onMouseEnter:()=>V(n),children:v?v(e):t("span",{className:"text-gray-900",children:e.name})},e.id))})]})]})},dl=({items:i,selectedItems:s=[],onSelectionChange:r,placeholder:a="Seleccionar elementos",searchPlaceholder:c="Buscar...",className:u="",disabled:h=!1,searchBy:d="both",caseSensitive:m=!1,exactMatch:p=!0,maxSelectedDisplay:f=3,renderItem:y,renderSelectedItem:v,renderSelectedBadge:x})=>{const[b,w]=g(!1),[T,P]=g(""),S=o(null),E=o(null);l(()=>{const t=t=>{S.current&&!S.current.contains(t.target)&&w(!1)};if(b)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[b]),l(()=>{b&&E.current&&E.current.focus()},[b]),l(()=>{b||P("")},[b]);const k=((t,e)=>{if(!e.trim())return t;const n=e.trim(),i=m?n:n.toLowerCase();return t.filter(t=>{const e=m?t.name:t.name.toLowerCase(),n=m?t.id:t.id.toLowerCase();if(p)switch(d){case"name":return e===i;case"id":return n===i;case"both":return e===i||n===i;default:return!1}else switch(d){case"name":return e.includes(i);case"id":return n.includes(i);case"both":return e.includes(i)||n.includes(i);default:return!1}})})(i,T),C=t=>s.some(e=>e.id===t.id),A=t=>{r(s.filter(e=>e.id!==t.id))},M=()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),N=()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),V=({item:n,onRemove:i})=>e("span",{className:"inline-flex items-center px-2 py-1 text-xs font-medium bg-primary-botech-100 text-primary-botech-800 rounded-md",children:[v?v(n):n.name,t("button",{type:"button",onClick:t=>{t.stopPropagation(),i()},className:"ml-1 text-primary-botech-600 hover:text-primary-botech-800 transition-colors duration-200",children:t(M,{})})]}),D=s.slice(0,f),L=s.length-f;return e("div",{ref:S,className:`relative w-full ${u}`,children:[e("div",{className:`\n min-h-10 w-full flex items-center justify-between px-3 py-2 \n text-sm bg-white border border-gray-300 rounded-md shadow-sm cursor-pointer\n transition-colors duration-200\n ${h?"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200":"hover:border-primary-botech-400 focus-within:border-primary-botech focus-within:ring-1 focus-within:ring-primary-botech"}\n ${b?"border-primary-botech ring-1 ring-primary-botech":""}\n `,onClick:()=>{h||w(!b)},children:[t("div",{className:"flex-1 flex flex-wrap gap-1 items-center",children:0===s.length?t("span",{className:"text-gray-500",children:a}):e(n,{children:[D.map(e=>t("div",{onClick:t=>t.stopPropagation(),children:x?x(e,()=>A(e)):t(V,{item:e,onRemove:()=>A(e)})},e.id)),L>0&&e("span",{className:"text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded-md",children:["+",L," más"]})]})}),e("div",{className:"flex items-center space-x-1 ml-2",children:[s.length>0&&!h&&t("button",{type:"button",onClick:t=>{t.stopPropagation(),r([])},className:"text-gray-400 hover:text-gray-600 transition-colors duration-200",children:t(M,{})}),t("div",{className:"text-gray-400 transition-transform duration-200 "+(b?"rotate-180":""),children:t(()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),{})})]})]}),b&&e("div",{className:"absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg",children:[t("div",{className:"p-2 border-b border-gray-100",children:e("div",{className:"relative",children:[t("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:t(()=>t("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),{})}),t("input",{ref:E,type:"text",className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md text-sm placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-primary-botech focus:border-primary-botech",placeholder:c,value:T,onChange:t=>P(t.target.value),onClick:t=>t.stopPropagation()})]})}),s.length>0&&e("div",{className:"px-3 py-2 text-xs text-gray-600 bg-gray-50 border-b border-gray-100",children:[s.length," elemento(s) seleccionado(s)"]}),t("div",{className:"max-h-60 overflow-auto",children:0===k.length?t("div",{className:"px-3 py-2 text-sm text-gray-500",children:T?"No se encontraron coincidencias exactas":"No hay elementos disponibles"}):k.map(n=>{const i=C(n);return e("div",{className:`\n px-3 py-2 text-sm cursor-pointer transition-colors duration-200 \n border-b border-gray-50 last:border-b-0 flex items-center justify-between\n ${i?"bg-primary-botech-50 hover:bg-primary-botech-100":"hover:bg-gray-50"}\n `,onClick:()=>(t=>{C(t)?r(s.filter(e=>e.id!==t.id)):r([...s,t])})(n),children:[t("div",{className:"flex-1",children:y?y(n):t("span",{className:""+(i?"text-primary-botech-900 font-medium":"text-gray-900"),children:n.name})}),i&&t("div",{className:"ml-2 text-primary-botech-600",children:t(N,{})})]},n.id)})})]})]})};function ml(t){return R({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(t)}const pl=n=>{var{title:i,description:s,onClose:r,showCloseIcon:o=!0,icon:a,actions:l,className:c=""}=n,u=sl(n,["title","description","onClose","showCloseIcon","icon","actions","className"]);return e("div",Object.assign({className:`flex items-center justify-between gap-4 p-4 sm:p-6 bg-primary-botech text-white sm:rounded-t-xl ${c}`},u,{children:[e("div",{className:"flex items-start gap-3 min-w-0",children:[a&&t("span",{className:"mt-0.5 text-white text-xl",children:a}),e("div",{className:"flex-1 min-w-0",children:[i&&t("h2",{className:"text-xl font-semibold text-white",id:"bo-modal-title",children:i}),s&&t("p",{className:"mt-1 text-sm text-white/80",id:"bo-modal-description",children:s})]})]}),e("div",{className:"flex items-center gap-2",children:[l,o&&t("button",{type:"button","aria-label":"Cerrar",onClick:r,className:"shrink-0 inline-flex items-center justify-center rounded-md p-2 text-white hover:text-gray-200 hover:bg-white/10 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-white/50",children:t(ml,{className:"text-xl"})})]})]}))},fl=e=>{var{className:n=""}=e,i=sl(e,["className"]);return t("div",Object.assign({className:`p-4 sm:p-6 ${n}`},i))},gl=e=>{var{className:n=""}=e,i=sl(e,["className"]);return t("div",Object.assign({className:`flex justify-end gap-3 p-3 sm:p-4 border-t border-gray-200 bg-gray-50 ${n}`},i))},yl={sm:"sm:max-w-sm",md:"sm:max-w-2xl",lg:"sm:max-w-4xl",xl:"sm:max-w-6xl"},vl={hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},xl={hidden:{opacity:0,scale:.98,y:12},visible:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:12}};const bl=({open:n,onClose:i,title:s,description:r,size:a="md",footer:c,showCloseIcon:u=!0,hideHeader:h=!1,closeOnEsc:d=!0,closeOnClickOutside:p=!0,className:f="",children:g,initialFocusRef:y,headerClassName:v,overlayClassName:x,headerIcon:b,headerActions:w,zIndex:T})=>{const S=o(null),E=o(null);var k;l(()=>{if(!k)return;const{overflow:t}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[k=n]),function(t,e,n){l(()=>{if(!t)return;const i=e.current;if(!i)return;const s=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],r=()=>Array.from(i.querySelectorAll(s.join(","))).filter(t=>!t.hasAttribute("disabled")&&!t.getAttribute("aria-hidden")),o=document.activeElement;((null==n?void 0:n.current)||r()[0]||i).focus();const a=t=>{if("Tab"!==t.key)return;const e=r();if(0===e.length)return;const n=e[0],s=e[e.length-1];t.shiftKey?document.activeElement!==n&&document.activeElement!==i||(s.focus(),t.preventDefault()):document.activeElement===s&&(n.focus(),t.preventDefault())};return document.addEventListener("keydown",a),()=>{var t;document.removeEventListener("keydown",a),null===(t=null==o?void 0:o.focus)||void 0===t||t.call(o)}},[t,e,n])}(n,S,y);const C=m(t=>{n&&"Escape"===t.key&&d&&(t.stopPropagation(),i())},[n,d,i]);l(()=>{if(n)return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[n,C]);const A=t(es,{children:n&&e("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center",style:T?{zIndex:T}:void 0,"aria-hidden":!n,ref:E,children:[t(nl.button,{type:"button","aria-label":"Cerrar modal",initial:"hidden",animate:"visible",exit:"exit",variants:vl,onClick:()=>{p&&i()},className:`fixed inset-0 bg-black/50 ${null!=x?x:""}`}),e(nl.div,{role:"dialog","aria-modal":"true","aria-labelledby":s?"bo-modal-title":void 0,"aria-describedby":r?"bo-modal-description":void 0,initial:"hidden",animate:"visible",exit:"exit",variants:xl,transition:{duration:.18,ease:"easeOut"},className:`relative w-screen h-[100dvh] sm:w-full sm:h-auto ${yl[a]} sm:mx-4 sm:max-h-[90vh] overflow-hidden sm:rounded-xl bg-white shadow-2xl ring-1 ring-black/5 flex flex-col ${f}`,onClick:t=>t.stopPropagation(),ref:S,children:[!h&&t(pl,{title:s,description:r,onClose:i,showCloseIcon:u,className:v,icon:b,actions:w}),t("div",{className:"flex-1 overflow-y-auto",children:g}),c&&t(gl,{children:c})]})]})});return"undefined"!=typeof document?P(A,document.body):A};function wl(t=!1){const[e,n]=g(t);return{open:e,onOpen:m(()=>n(!0),[]),onClose:m(()=>n(!1),[]),toggle:m(()=>n(t=>!t),[]),setOpen:n}}var Tl,Pl,Sl;bl.Header=pl,bl.Body=fl,bl.Footer=gl,function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}(Tl||(Tl={})),function(t){t.EVEN="even",t.ODD="odd",t.HOVER="hover"}(Pl||(Pl={})),function(t){t.SM="sm",t.MD="md",t.LG="lg"}(Sl||(Sl={}));const El=t=>{switch(t){case Tl.CENTER:return"text-center";case Tl.RIGHT:return"text-right";default:return"text-left"}},kl=t=>{switch(t){case Sl.SM:return{header:"px-2 py-2 text-xs",cell:"px-2 py-2 text-xs",table:"text-xs"};case Sl.LG:return{header:"px-6 py-4 text-base",cell:"px-6 py-4 text-base",table:"text-base"};default:return{header:"px-3 md:px-6 py-3 text-sm",cell:"px-3 md:px-6 py-4 text-sm",table:"text-sm"}}},Cl=t=>t%2==0?"bg-white":"bg-gray-50",Al=({columns:n,size:i,hasActions:s})=>{const r=kl(i);return t("thead",{className:"text-xs text-gray-700 uppercase bg-gray-50 sticky top-0 z-10",children:e("tr",{children:[n.map(e=>t("th",{className:`${r.header} ${El(e.alignment)} ${e.className||""}`,style:e.width?{width:e.width}:void 0,children:e.header},e.key)),s&&t("th",{className:`${r.header} text-center sticky right-0 bg-gray-50`,children:"ACCIONES"})]})})},Ml=({columns:n,data:i,renderActions:s,size:r,onRowClick:o})=>{const a=kl(r);return t("tbody",{children:i.map((i,r)=>e("tr",{className:`${Cl(r)} hover:bg-gray-100 transition-colors duration-150 ${o?"cursor-pointer":""}`,onClick:()=>null==o?void 0:o(i),children:[n.map(e=>t("td",{className:`${a.cell} ${El(e.alignment)} ${e.className||""}`,children:e.accessor(i)},e.key)),s&&t("td",{className:`${a.cell} text-center sticky right-0 ${Cl(r)} shadow-[-2px_0_4px_rgba(0,0,0,0.1)]`,children:s(i)})]},r))})},Nl=({columns:n,data:i,renderActions:s,size:r=Sl.MD,className:a="",onRowClick:c,isLoading:u=!1,emptyMessage:h="No hay datos disponibles"})=>{const d=o(null),{visibleData:m}=((t,e)=>{const[n,i]=g(t);return l(()=>{const n=()=>{if(!e.current)return;const n=e.current.getBoundingClientRect(),s=window.innerHeight-n.top-100,r=Math.max(1,Math.floor(s/60));i(t.slice(0,r))};n();const s=()=>{n()};window.addEventListener("resize",s);const r=new ResizeObserver(n);return e.current&&r.observe(e.current),()=>{window.removeEventListener("resize",s),r.disconnect()}},[t,e]),{visibleData:n}})(i,d);return u?t("div",{className:"w-full shadow-md sm:rounded-lg bg-white",children:t("div",{className:"flex items-center justify-center py-8",children:t("div",{"data-testid":"loading-spinner",className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})})}):0===i.length?t("div",{className:"w-full shadow-md sm:rounded-lg bg-white",children:t("div",{className:"text-center py-8",children:t("p",{className:"text-gray-500",children:h})})}):t("div",{ref:d,className:`w-full shadow-md sm:rounded-lg bg-white ${a}`,children:t("div",{className:"overflow-x-auto",children:e("table",{className:"w-full text-left text-gray-500",style:{minWidth:"max-content"},children:[t(Al,{columns:n,size:r,hasActions:!!s}),t(Ml,{columns:n,data:m,renderActions:s,size:r,onRowClick:c})]})})})};function Vl(t,e){return Object.keys(t).filter(t=>-1===e.indexOf(t)).map(t=>({key:t,header:t.charAt(0).toUpperCase()+t.slice(1).replace(/([A-Z])/g," $1").trim(),accessor:e=>{var n;return null!==(n=e[t])&&void 0!==n?n:"-"}}))}export{S as Button,cl as DownloadStudentsExcelButton,Nl as GenericTable,H as Header,E as IconButton,bl as Modal,fl as ModalBody,gl as ModalFooter,pl as ModalHeader,dl as MultiSelector,il as Sidebar,hl as SingleSelector,ul as UploadStudentsExcelButton,al as downloadStudentsExcel,Vl as generateTableColumns,ol as getBackendPrefix,ll as uploadStudentsExcel,wl as useModal};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|