botech-library 1.0.79 → 1.0.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/esm/index.js +1 -1
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/types/__tests__/components/StudentSummary/StudentSummaryGeneral.test.d.ts +2 -0
  6. package/dist/types/__tests__/components/StudentSummary/StudentSummaryGeneral.test.d.ts.map +1 -0
  7. package/dist/types/__tests__/components/StudentSummary/StudentSummaryModal.test.d.ts +2 -0
  8. package/dist/types/__tests__/components/StudentSummary/StudentSummaryModal.test.d.ts.map +1 -0
  9. package/dist/types/__tests__/components/StudentSummary/StudentSummaryMovimientos.test.d.ts +2 -0
  10. package/dist/types/__tests__/components/StudentSummary/StudentSummaryMovimientos.test.d.ts.map +1 -0
  11. package/dist/types/__tests__/components/StudentSummary/StudentSummaryNovedades.test.d.ts +2 -0
  12. package/dist/types/__tests__/components/StudentSummary/StudentSummaryNovedades.test.d.ts.map +1 -0
  13. package/dist/types/__tests__/components/StudentSummary/StudentSummaryParadas.test.d.ts +2 -0
  14. package/dist/types/__tests__/components/StudentSummary/StudentSummaryParadas.test.d.ts.map +1 -0
  15. package/dist/types/__tests__/components/StudentSummary/StudentSummaryPersonasAutorizadas.test.d.ts +2 -0
  16. package/dist/types/__tests__/components/StudentSummary/StudentSummaryPersonasAutorizadas.test.d.ts.map +1 -0
  17. package/dist/types/__tests__/components/StudentSummary/StudentSummaryRecorridos.test.d.ts +2 -0
  18. package/dist/types/__tests__/components/StudentSummary/StudentSummaryRecorridos.test.d.ts.map +1 -0
  19. package/dist/types/__tests__/components/StudentSummary/studentSummaryContext.test.d.ts +2 -0
  20. package/dist/types/__tests__/components/StudentSummary/studentSummaryContext.test.d.ts.map +1 -0
  21. package/dist/types/__tests__/components/StudentSummary/studentSummaryFormat.test.d.ts +2 -0
  22. package/dist/types/__tests__/components/StudentSummary/studentSummaryFormat.test.d.ts.map +1 -0
  23. package/dist/types/components/StudentSummary/StudentSummaryModal.d.ts +4 -2
  24. package/dist/types/components/StudentSummary/StudentSummaryModal.d.ts.map +1 -1
  25. package/dist/types/components/StudentSummary/StudentSummarySections.d.ts +21 -0
  26. package/dist/types/components/StudentSummary/StudentSummarySections.d.ts.map +1 -0
  27. package/dist/types/components/StudentSummary/index.d.ts +2 -0
  28. package/dist/types/components/StudentSummary/index.d.ts.map +1 -1
  29. package/dist/types/components/StudentSummary/studentSummaryContext.d.ts +17 -0
  30. package/dist/types/components/StudentSummary/studentSummaryContext.d.ts.map +1 -0
  31. package/dist/types/components/StudentSummary/studentSummaryFormat.d.ts +6 -0
  32. package/dist/types/components/StudentSummary/studentSummaryFormat.d.ts.map +1 -0
  33. package/dist/types/components/StudentSummary/studentSummaryMocks.d.ts +19 -0
  34. package/dist/types/components/StudentSummary/studentSummaryMocks.d.ts.map +1 -0
  35. package/dist/types/components/index.d.ts +2 -2
  36. package/dist/types/components/index.d.ts.map +1 -1
  37. 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 o,{createContext as r,useRef as s,useLayoutEffect as a,useEffect as l,useId as c,useContext as d,useInsertionEffect as h,useMemo as u,useCallback as p,Children as m,isValidElement as f,useState as g,Fragment as y,createElement as v,forwardRef as x,Component as b}from"react";import w from"sweetalert2";import S from"axios";import{createPortal as C}from"react-dom";const k=({variant:e="primary",size:n="md",onClick:i,children:o,className:r="",disabled:s=!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:s?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-primary-botech hover:bg-primary-botech-400 text-white cursor-pointer",secondary:s?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-800 cursor-pointer",danger:s?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-red-500 hover:bg-red-600 text-white cursor-pointer"}[e]} ${r}`,onClick:s?void 0:i,disabled:s,children:o}),T=({leftIcon:n,rightIcon:i,children:o,onClick:r,className:s="",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]} ${s}`,onClick:c?void 0:r,disabled:c,children:[n&&t("span",{className:"flex items-center",children:n}),o,i&&t("span",{className:"flex items-center",children:i})]});var E={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},N=o.createContext&&o.createContext(E),P=["attr","size","title"];function M(){return M=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},M.apply(null,arguments)}function A(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 L(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?A(Object(n),!0).forEach(function(e){V(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function V(t,e,n){return(e=function(t){var e=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)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D(t){return t&&t.map((t,e)=>o.createElement(t.tag,L({key:e},t.attr),D(t.child)))}function R(t){return e=>o.createElement(z,M({attr:L({},t.attr)},e),D(t.child))}function z(t){var e=e=>{var n,{attr:i,size:r,title:s}=t,a=function(t,e){if(null==t)return{};var n,i,o=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))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],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,P),l=r||e.size||"1em";return e.className&&(n=e.className),t.className&&(n=(n?n+" ":"")+t.className),o.createElement("svg",M({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,i,a,{className:n,style:L(L({color:t.color||e.color},e.style),t.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&o.createElement("title",null,s),t.children)};return void 0!==N?o.createElement(N.Consumer,null,t=>e(t)):e(E)}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:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(t)}function j(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 I(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 F(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 O(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:"polyline",attr:{points:"9 18 15 12 9 6"},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:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(t)}const U=({title:n,description:i,logoUrl:o,defaultLogoUrl:r,logoAlt:s="Logo",systemName:a="PASS",systemSubtitle:l="Sistema Escolar",onMenuToggle:c,showPageInfo:d=!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:u="h-8 sm:h-10 object-contain",titleClassName:p="text-lg sm:text-xl font-bold",descriptionClassName:m="text-xs sm:text-sm opacity-80"})=>{const f="string"==typeof r&&""!==r.trim()?r:void 0,g="string"==typeof o&&""!==o.trim()?o: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(I,{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:s,className:u}):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:p,children:a}),t("p",{className:m,children:l})]})]})]}),d&&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 H(t){const e=s(null);return null===e.current&&(e.current=t()),e.current}const Y="undefined"!=typeof window?a:l,_=r(null);function G(t,e){-1===t.indexOf(e)&&t.push(e)}function K(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const q=(t,e,n)=>n>e?e:n<t?t:n;function Z(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let J=()=>{},Q=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(J=(t,e,n)=>{t||"undefined"==typeof console||console.warn(Z(e,n))},Q=(t,e,n)=>{if(!t)throw new Error(Z(e,n))});const tt={},et=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function nt(t){return"object"==typeof t&&null!==t}const it=t=>/^0[^.\s]+$/u.test(t);function ot(t){let e;return()=>(void 0===e&&(e=t()),e)}const rt=t=>t,st=(t,e)=>n=>e(t(n)),at=(...t)=>t.reduce(st),lt=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class ct{constructor(){this.subscriptions=[]}add(t){return G(this.subscriptions,t),()=>K(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 o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const dt=t=>1e3*t,ht=t=>t/1e3;function ut(t,e){return e?t*(1e3/e):0}const pt=new Set;function mt(t,e,n){t||pt.has(e)||(console.warn(Z(e,n)),pt.add(e))}const ft=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function gt(t,e,n,i){if(t===e&&n===i)return rt;const o=e=>function(t,e,n,i,o){let r,s,a=0;do{s=e+(n-e)/2,r=ft(s,i,o)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++a<12);return s}(e,0,1,t,n);return t=>0===t||1===t?t:ft(o(t),e,i)}const yt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,vt=t=>e=>1-t(1-e),xt=gt(.33,1.53,.69,.99),bt=vt(xt),wt=yt(bt),St=t=>t>=1?1:(t*=2)<1?.5*bt(t):.5*(2-Math.pow(2,-10*(t-1))),Ct=t=>1-Math.sin(Math.acos(t)),kt=vt(Ct),Tt=yt(Ct),Et=gt(.42,0,1,1),Nt=gt(0,0,.58,1),Pt=gt(.42,0,.58,1),Mt=t=>Array.isArray(t)&&"number"==typeof t[0],At={linear:rt,easeIn:Et,easeInOut:Pt,easeOut:Nt,circIn:Ct,circInOut:Tt,circOut:kt,backIn:bt,backInOut:wt,backOut:xt,anticipate:St},Lt=t=>{if(Mt(t)){Q(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,o]=t;return gt(e,n,i,o)}return"string"==typeof t?(Q(void 0!==At[t],`Invalid easing type '${t}'`,"invalid-easing-type"),At[t]):t},Vt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Dt={value:null,addProjectionMetrics:null};function Rt(t,e){let n=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,s=Vt.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,o=!1,r=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){s.has(e)&&(d.schedule(e),t()),l++,e(a)}const d={schedule:(t,e=!1,r=!1)=>{const a=r&&o?n:i;return e&&s.add(t),a.add(t),t},cancel:t=>{i.delete(t),s.delete(t)},process:t=>{if(a=t,o)return void(r=!0);o=!0;const s=n;n=i,i=s,n.forEach(c),e&&Dt.value&&Dt.value.frameloop[e].push(l),l=0,n.clear(),o=!1,r&&(r=!1,d.process(t))}};return d}(r,e?n:void 0),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:d,update:h,preRender:u,render:p,postRender:m}=s,f=()=>{const r=tt.useManualTiming,s=r?o.timestamp:performance.now();n=!1,r||(o.delta=i?1e3/60:Math.max(Math.min(s-o.timestamp,40),1)),o.timestamp=s,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),d.process(o),h.process(o),u.process(o),p.process(o),m.process(o),o.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:Vt.reduce((e,r)=>{const a=s[r];return e[r]=(e,r=!1,s=!1)=>(n||(n=!0,i=!0,o.isProcessing||t(f)),a.schedule(e,r,s)),e},{}),cancel:t=>{for(let e=0;e<Vt.length;e++)s[Vt[e]].cancel(t)},state:o,steps:s}}const{schedule:zt,cancel:Bt,state:jt,steps:It}=Rt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:rt,!0);let Ft;function Ot(){Ft=void 0}const $t={now:()=>(void 0===Ft&&$t.set(jt.isProcessing||tt.useManualTiming?jt.timestamp:performance.now()),Ft),set:t=>{Ft=t,queueMicrotask(Ot)}},Wt=t=>e=>"string"==typeof e&&e.startsWith(t),Ut=Wt("--"),Xt=Wt("var(--"),Ht=t=>!!Xt(t)&&Yt.test(t.split("/*")[0].trim()),Yt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _t(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const Gt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Kt={...Gt,transform:t=>q(0,1,t)},qt={...Gt,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[o,r,s,a]=i.match(Jt);return{[t]:parseFloat(o),[e]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ne={...Gt,transform:t=>Math.round((t=>q(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(Kt.transform(i))+")"};const oe={test:te("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,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}`}),se=re("deg"),ae=re("%"),le=re("px"),ce=re("vh"),de=re("vw"),he=(()=>({...ae,parse:t=>ae.parse(t)/100,transform:t=>ae.transform(100*t)}))(),ue={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(Kt.transform(i))+")"},pe={test:t=>ie.test(t)||oe.test(t)||ue.test(t),parse:t=>ie.test(t)?ie.parse(t):ue.test(t)?ue.parse(t):oe.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ie.transform(t):ue.transform(t),getAnimatableNone:t=>{const e=pe.parse(t);return e.alpha=0,pe.transform(e)}},me=/(?:#[\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:[]},o=[];let r=0;const s=e.replace(ye,t=>(pe.test(t)?(i.color.push(r),o.push(ge),n.push(pe.parse(t))):t.startsWith("var(")?(i.var.push(r),o.push("var"),n.push(t)):(i.number.push(r),o.push(fe),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:s,indexes:i,types:o}}function xe({split:t,types:e}){const n=t.length;return i=>{let o="";for(let r=0;r<n;r++)if(o+=t[r],void 0!==i[r]){const t=e[r];o+=t===fe?Zt(i[r]):t===ge?pe.transform(i[r]):i[r]}return o}}const be=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:pe.test(n)?pe.getAnimatableNone(n):n;var n};const we={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Jt)?.length||0)+(t.match(me)?.length||0)>0},parse:function(t){return ve(t).values},createTransformer:function(t){return xe(ve(t))},getAnimatableNone:function(t){const e=ve(t);return xe(e)(e.values.map((t,n)=>be(t,e.split[n])))}};function Se(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 Ce(t,e){return n=>n>0?e:t}const ke=(t,e,n)=>t+(e-t)*n,Te=(t,e,n)=>{const i=t*t,o=n*(e*e-i)+i;return o<0?0:Math.sqrt(o)},Ee=[oe,ie,ue];function Ne(t){const e=(n=t,Ee.find(t=>t.test(n)));var n;if(J(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===ue&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,r=0,s=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=Se(a,i,t+1/3),r=Se(a,i,t),s=Se(a,i,t-1/3)}else o=r=s=n;return{red:Math.round(255*o),green:Math.round(255*r),blue:Math.round(255*s),alpha:i}}(i)),i}const Pe=(t,e)=>{const n=Ne(t),i=Ne(e);if(!n||!i)return Ce(t,e);const o={...n};return t=>(o.red=Te(n.red,i.red,t),o.green=Te(n.green,i.green,t),o.blue=Te(n.blue,i.blue,t),o.alpha=ke(n.alpha,i.alpha,t),ie.transform(o))},Me=new Set(["none","hidden"]);function Ae(t,e){return n=>ke(t,e,n)}function Le(t){return"number"==typeof t?Ae:"string"==typeof t?Ht(t)?Ce:pe.test(t)?Pe:Re:Array.isArray(t)?Ve:"object"==typeof t?pe.test(t)?Pe:De:Ce}function Ve(t,e){const n=[...t],i=n.length,o=t.map((t,n)=>Le(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}}function De(t,e){const n={...t,...e},i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=Le(t[o])(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Re=(t,e)=>{const n=we.createTransformer(e),i=ve(t),o=ve(e);return i.indexes.var.length===o.indexes.var.length&&i.indexes.color.length===o.indexes.color.length&&i.indexes.number.length>=o.indexes.number.length?Me.has(t)&&!o.values.length||Me.has(e)&&!i.values.length?function(t,e){return Me.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):at(Ve(function(t,e){const n=[],i={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],s=t.indexes[r][i[r]],a=t.values[s]??0;n[o]=a,i[r]++}return n}(i,o),o.values),n):(J(!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.`,"complex-values-different"),Ce(t,e))};function ze(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return ke(t,e,n);return Le(t)(t,e)}const Be=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>zt.update(e,t),stop:()=>Bt(e),now:()=>jt.isProcessing?jt.timestamp:$t.now()}},je=(t,e,n=10)=>{let i="";const o=Math.max(Math.round(e/n),2);for(let e=0;e<o;e++)i+=Math.round(1e4*t(e/(o-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Ie=2e4;function Fe(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}const Oe=100,$e=10,We=1,Ue=0,Xe=800,He=.3,Ye=.3,_e={granular:.01,default:2},Ge={granular:.005,default:.5},Ke=.01,qe=10,Ze=.05,Je=1;function Qe(t,e){return t*Math.sqrt(1-e*e)}const tn=.001;const en=["duration","bounce"],nn=["stiffness","damping","mass"];function on(t,e){return e.some(e=>void 0!==t[e])}function rn(t){let e={velocity:Ue,stiffness:Oe,damping:$e,mass:We,isResolvedFromDuration:!1,...t};if(!on(t,nn)&&on(t,en))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),o=i*i,r=2*q(.05,1,1-(t.bounce||0))*Math.sqrt(o);e={...e,mass:We,stiffness:o,damping:r}}else{const n=function({duration:t=Xe,bounce:e=He,velocity:n=Ue,mass:i=We}){let o,r;J(t<=dt(qe),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-e;s=q(Ze,Je,s),t=q(Ke,qe,ht(t)),s<1?(o=e=>{const i=e*s,o=i*t,r=i-n,a=Qe(e,s),l=Math.exp(-o);return tn-r/a*l},r=e=>{const i=e*s*t,r=i*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-i),c=Qe(Math.pow(e,2),s);return(-o(e)+tn>0?-1:1)*((r-a)*l)/c}):(o=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<12;n++)i-=t(i)/e(i);return i}(o,r,5/t);if(t=dt(t),isNaN(a))return{stiffness:Oe,damping:$e,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*s*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:We},e.isResolvedFromDuration=!0}return e}function sn(t=Ye,e=He){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:o}=n;const r=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:d,duration:h,velocity:u,isResolvedFromDuration:p}=rn({...n,velocity:-ht(n.velocity||0)}),m=u||0,f=c/(2*Math.sqrt(l*d)),g=s-r,y=ht(Math.sqrt(l/d)),v=Math.abs(g)<5;let x,b,w,S,C,k;if(i||(i=v?_e.granular:_e.default),o||(o=v?Ge.granular:Ge.default),f<1)w=Qe(y,f),S=(m+f*y*g)/w,x=t=>{const e=Math.exp(-f*y*t);return s-e*(S*Math.sin(w*t)+g*Math.cos(w*t))},C=f*y*S+g*w,k=f*y*g-S*w,b=t=>Math.exp(-f*y*t)*(C*Math.sin(w*t)+k*Math.cos(w*t));else if(1===f){x=t=>s-Math.exp(-y*t)*(g+(m+y*g)*t);const t=m+y*g;b=e=>Math.exp(-y*e)*(y*t*e-m)}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 s-n*((m+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(m+f*y*g)/t,n=f*y*e-g*t,i=f*y*g-e*t;b=e=>{const o=Math.exp(-f*y*e),r=Math.min(t*e,300);return o*(n*Math.sinh(r)+i*Math.cosh(r))}}const T={calculatedDuration:p&&h||null,velocity:t=>dt(b(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*y*t),n=Math.sin(w*t),r=Math.cos(w*t),l=s-e*(S*n+g*r),c=dt(e*(C*n+k*r));return a.done=Math.abs(c)<=i&&Math.abs(s-l)<=o,a.value=a.done?s:l,a}const e=x(t);if(p)a.done=t>=h;else{const n=dt(b(t));a.done=Math.abs(n)<=i&&Math.abs(s-e)<=o}return a.value=a.done?s:e,a},toString:()=>{const t=Math.min(Fe(T),Ie),e=je(e=>T.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return T}sn.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),o=Math.min(Fe(i),Ie);return{type:"keyframes",ease:t=>i.next(o*t).value/e,duration:ht(o)}}(t,100,sn);return t.ease=e.ease,t.duration=dt(e.duration),t.type="keyframes",t};function an(t,e,n){const i=Math.max(e-5,0);return ut(n-t(i),e-i)}function ln({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:o=10,bounceStiffness:r=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:d}){const h=t[0],u={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,g=void 0===s?f:s(f);g!==f&&(m=g-h);const y=t=>-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);u.done=Math.abs(e)<=c,u.value=u.done?g:n};let b,w;const S=t=>{var e;(e=u.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,w=sn({keyframes:[u.value,p(u.value)],velocity:an(v,t,u.value),damping:o,stiffness:r,restDelta:c,restSpeed:d}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==b||(e=!0,x(t),S(t)),void 0!==b&&t>=b?w.next(t-b):(!e&&x(t),u)}}}function cn(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const r=t.length;if(Q(r===e.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>e[0];if(2===r&&e[0]===e[1])return()=>e[1];const s=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],o=n||tt.mix||ze,r=t.length-1;for(let n=0;n<r;n++){let r=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||rt:e;r=at(t,r)}i.push(r)}return i}(e,i,o),l=a.length,c=n=>{if(s&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const o=lt(t[i],t[i+1],n);return a[i](o)};return n?e=>c(q(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 o=lt(0,e,i);t.push(ke(n,1,o))}}(e,t.length-1),e}function hn({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const o=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Lt):Lt(i),r={done:!1,value:e[0]},s=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:dn(e),t),a=cn(s,e,{ease:Array.isArray(o)?o:(l=e,c=o,l.map(()=>c||Pt).splice(0,l.length-1))});var l,c;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}const un=t=>null!==t;function pn(t,{repeat:e,repeatType:n="loop"},i,o=1){const r=t.filter(un),s=o<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return s&&void 0!==i?i:r[s]}const mn={decay:ln,inertia:ln,tween:hn,keyframes:hn,spring:sn};function fn(t){"string"==typeof t.type&&(t.type=mn[t.type])}class gn{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 yn=t=>t/100;class vn extends gn{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==$t.now()&&this.tick($t.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;fn(t);const{type:e=hn,repeat:n=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=t;let{keyframes:s}=t;const a=e||hn;"production"!==process.env.NODE_ENV&&a!==hn&&Q(s.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${s}`,"spring-two-frames"),a!==hn&&"number"!=typeof s[0]&&(this.mixKeyframes=at(yn,ze(s[0],s[1])),s=[0,100]);const l=a({...t,keyframes:s});"mirror"===o&&(this.mirroredGenerator=a({...t,keyframes:[...s].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=Fe(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:o,mirroredGenerator:r,resolvedDuration:s,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:d,repeatType:h,repeatDelay:u,type:p,onUpdate:m,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,x=this.currentTime,b=n;if(d){const t=Math.min(this.currentTime,i)/s;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===h?(n=1-n,u&&(n-=u/s)):"mirror"===h&&(b=r)),x=q(0,1,n)*s}y?(this.delayState.value=c[0],v=this.delayState):v=b.next(x),o&&!y&&(v.value=o(v.value));let{done:w}=v;y||null===a||(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return S&&p!==ln&&(v.value=pn(c,this.options,f,this.speed)),m&&m(v.value),S&&this.finish(),v}then(t,e){return this.finished.then(t,e)}get duration(){return ht(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ht(t)}get time(){return ht(this.currentTime)}set time(t){t=dt(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?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return an(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime($t.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=ht(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($t.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 xn=t=>180*t/Math.PI,bn=t=>{const e=xn(Math.atan2(t[1],t[0]));return Sn(e)},wn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:bn,rotateZ:bn,skewX:t=>xn(Math.atan(t[1])),skewY:t=>xn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Sn=t=>((t%=360)<0&&(t+=360),t),Cn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),kn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Tn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Cn,scaleY:kn,scale:t=>(Cn(t)+kn(t))/2,rotateX:t=>Sn(xn(Math.atan2(t[6],t[5]))),rotateY:t=>Sn(xn(Math.atan2(-t[2],t[0]))),rotateZ:bn,rotate:bn,skewX:t=>xn(Math.atan(t[4])),skewY:t=>xn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function En(t){return t.includes("scale")?1:0}function Nn(t,e){if(!t||"none"===t)return En(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,o;if(n)i=Tn,o=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=wn,o=e}if(!o)return En(e);const r=i[e],s=o[1].split(",").map(Pn);return"function"==typeof r?r(s):s[r]}function Pn(t){return parseFloat(t.trim())}const Mn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],An=(()=>new Set(Mn))(),Ln=t=>t===Gt||t===le,Vn=new Set(["x","y","z"]),Dn=Mn.filter(t=>!Vn.has(t));const Rn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-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})=>Nn(e,"x"),y:(t,{transform:e})=>Nn(e,"y")};Rn.translateX=Rn.x,Rn.translateY=Rn.y;const zn=new Set;let Bn=!1,jn=!1,In=!1;function Fn(){if(jn){const t=Array.from(zn).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 Dn.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)})}jn=!1,Bn=!1,zn.forEach(t=>t.complete(In)),zn.clear()}function On(){zn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(jn=!0)})}class $n{constructor(t,e,n,i,o,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=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(zn.add(this),Bn||(Bn=!0,zt.read(On),zt.resolveKeyframes(Fn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const o=i?.get(),r=t[t.length-1];if(void 0!==o)t[0]=o;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===o&&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),zn.delete(this)}cancel(){"scheduled"===this.state&&(zn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function Wn(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const Un={};function Xn(t,e){const n=ot(t);return()=>Un[e]??n()}const Hn=Xn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Yn=Xn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),_n=([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:_n([0,.65,.55,1]),circOut:_n([.55,0,1,.45]),backIn:_n([.31,.01,.66,-.59]),backOut:_n([.33,1.53,.69,.99])};function Kn(t,e){return t?"function"==typeof t?Yn()?je(t,e):"ease-out":Mt(t)?_n(t):Array.isArray(t)?t.map(t=>Kn(t,e)||Gn.easeOut):Gn[t]:void 0}function qn(t,e,n,{delay:i=0,duration:o=300,repeat:r=0,repeatType:s="loop",ease:a="easeOut",times:l}={},c=void 0){const d={[e]:n};l&&(d.offset=l);const h=Kn(a,o);Array.isArray(h)&&(d.easing=h);const u={delay:i,duration:o,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===s?"alternate":"normal"};c&&(u.pseudoElement=c);return t.animate(d,u)}function Zn(t){return"function"==typeof t&&"applyToOptions"in t}class Jn extends gn{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:s,onComplete:a}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=t,Q("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Zn(t)&&Yn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=qn(e,n,i,l,o),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=pn(i,this.options,s,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Wn(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,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(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return ht(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ht(t)}get time(){return ht(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=dt(t),e&&this.animation.pause()}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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Hn()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),rt):i(this)}}const Qn={anticipate:St,backInOut:wt,circInOut:Tt};function ti(t){"string"==typeof t.ease&&t.ease in Qn&&(t.ease=Qn[t.ease])}class ei extends Jn{constructor(t){ti(t),fn(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:o,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const s=new vn({...r,autoplay:!1}),a=Math.max(10,$t.now()-this.startTime),l=q(0,10,a-10),c=s.sample(a).value,{name:d}=this.options;o&&d&&Wn(o,d,c),e.setWithVelocity(s.sample(Math.max(0,a-l)).value,c,l),s.stop()}}const ni=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!we.test(t)&&"0"!==t||t.startsWith("url(")));function ii(t){t.duration=0,t.type="keyframes"}const oi=new Set(["opacity","clipPath","filter","transform"]),ri=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const si=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),ai=ot(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function li(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:o,damping:r,type:s,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=e.owner.getProps();return ai()&&n&&(oi.has(n)||si.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&ri.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!d)&&!c&&!i&&"mirror"!==o&&0!==r&&"inertia"!==s}class ci extends gn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:s,name:a,motionValue:l,element:c,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=$t.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:o,repeatType:r,name:a,motionValue:l,element:c,...d},u=c?.KeyframeResolver||$n;this.keyframeResolver=new u(s,(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:o,type:r,velocity:s,delay:a,isHandoff:l,onUpdate:c}=n;this.resolvedAt=$t.now();let d=!0;(function(t,e,n,i){const o=t[0];if(null===o)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],s=ni(o,e),a=ni(r,e);return J(s===a,`You are trying to animate ${e} from "${o}" to "${r}". "${s?r:o}" is not an animatable value.`,"value-not-animatable"),!(!s||!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||Zn(n))&&i)})(t,o,r,s)||(d=!1,!tt.instantAnimations&&a||c?.(pn(t,n,e)),t[0]=t[t.length-1],ii(n),n.repeat=0);const h={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},u=d&&!l&&li(h),p=h.motionValue?.owner?.current;let m;if(u)try{m=new ei({...h,element:p})}catch{m=new vn(h)}else m=new vn(h);m.finished.then(()=>{this.notifyFinished()}).catch(rt),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}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(),In=!0,On(),Fn(),In=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}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()}}function di(t,e,n,i=0,o=1){const r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),s=t.size,a=(s-1)*i;return"function"==typeof n?n(r,s):1===o?r*i:a-r*i}const hi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ui(t,e,n=1){Q(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,o]=function(t){const e=hi.exec(t);if(!e)return[,];const[,n,i,o]=e;return[`--${n??i}`,o]}(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const t=r.trim();return et(t)?parseFloat(t):t}return Ht(o)?ui(o,e,n+1):o}const pi={type:"spring",stiffness:500,damping:25,restSpeed:10},mi={type:"keyframes",duration:.8},fi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},gi=(t,{keyframes:e})=>e.length>2?mi:An.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:pi:fi;function yi(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function vi(t,e){const n=t?.[e]??t?.default??t;return n!==t?yi(n,t):n}const xi=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const bi=(t,e,n,i={},o,r)=>s=>{const a=vi(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=dt(l);const d={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:()=>{s(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:o};(function(t){for(const e in t)if(!xi.has(e))return!0;return!1})(a)||Object.assign(d,gi(t,d)),d.duration&&(d.duration=dt(d.duration)),d.repeatDelay&&(d.repeatDelay=dt(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let h=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(ii(d),0===d.delay&&(h=!0)),(tt.instantAnimations||tt.skipAnimations||o?.shouldSkipAnimations)&&(h=!0,ii(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,h&&!r&&void 0!==e.get()){const t=pn(d.keyframes,a);if(void 0!==t)return void zt.update(()=>{d.onUpdate(t),d.onComplete()})}return a.isSync?new vn(d):new ci(d)};function wi(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Si(t,e,n,i){if("function"==typeof e){const[o,r]=wi(i);e=e(void 0!==n?n:t.custom,o,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[o,r]=wi(i);e=e(void 0!==n?n:t.custom,o,r)}return e}function Ci(t,e,n){const i=t.getProps();return Si(i,e,void 0!==n?n:i.custom,t)}const ki=new Set(["width","height","top","left","right","bottom",...Mn]);class Ti{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=$t.now();if(this.updatedAt!==e&&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()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=$t.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&&mt(!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 ct);const n=this.events[t].add(e);return"change"===t?()=>{n(),zt.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){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}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=$t.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return ut(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 Ei(t,e){return new Ti(t,e)}const Ni=t=>Array.isArray(t);function Pi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ei(n))}function Mi(t){return Ni(t)?t[t.length-1]||0:t}const Ai=t=>Boolean(t&&t.getVelocity);function Li(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Ai(i)&&i.add))return n.add(e);if(!n&&tt.WillChange){const n=new tt.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Vi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Di="data-"+Vi("framerAppearId");function Ri(t){return t.props[Di]}function zi({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Bi(t,e,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:r,transitionEnd:s,...a}=e;const l=t.getDefaultTransition();r=r?yi(r,l):l;const c=r?.reduceMotion;i&&(r=i);const d=[],h=o&&t.animationState&&t.animationState.getState()[o];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),o=a[e];if(void 0===o||h&&zi(h,e))continue;const s={delay:n,...vi(r||{},e)},l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(o)&&o===l&&!s.velocity){zt.update(()=>i.set(o));continue}let u=!1;if(window.MotionHandoffAnimation){const n=Ri(t);if(n){const t=window.MotionHandoffAnimation(n,e,zt);null!==t&&(s.startTime=t,u=!0)}}Li(t,e);const p=c??t.shouldReduceMotion;i.start(bi(e,i,o,p&&ki.has(e)?{type:!1}:s,t,u));const m=i.animation;m&&d.push(m)}if(s){const e=()=>zt.update(()=>{s&&function(t,e){const n=Ci(t,e);let{transitionEnd:i={},transition:o={},...r}=n||{};r={...r,...i};for(const e in r)Pi(t,e,Mi(r[e]))}(t,s)});d.length?Promise.all(d).then(e):e()}return d}function ji(t,e,n={}){const i=Ci(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const r=i?()=>Promise.all(Bi(t,i,n)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:r=0,staggerChildren:s,staggerDirection:a}=o;return function(t,e,n=0,i=0,o=0,r=1,s){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(ji(l,e,{...s,delay:n+("function"==typeof i?0:i)+di(t.variantChildren,l,i,o,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,r,s,a,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[t,e]="beforeChildren"===a?[r,s]:[s,r];return t().then(()=>e())}return Promise.all([r(),s(n.delay)])}const Ii=t=>e=>e.test(t),Fi=[Gt,le,ae,se,de,ce,{test:t=>"auto"===t,parse:t=>t}],Oi=t=>Fi.find(Ii(t));function $i(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||it(t))}const Wi=new Set(["brightness","contrast","saturate","opacity"]);function Ui(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 o=n.replace(i,"");let r=Wi.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+o+")"}const Xi=/\b([a-z-]*)\(.*?\)/gu,Hi={...we,getAnimatableNone:t=>{const e=t.match(Xi);return e?e.map(Ui).join(" "):t}},Yi={...we,getAnimatableNone:t=>{const e=we.parse(t);return we.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},_i={...Gt,transform:Math.round},Gi={borderWidth:le,borderTopWidth:le,borderRightWidth:le,borderBottomWidth:le,borderLeftWidth:le,borderRadius: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,inset:le,insetBlock:le,insetBlockStart:le,insetBlockEnd:le,insetInline:le,insetInlineStart:le,insetInlineEnd:le,padding:le,paddingTop:le,paddingRight:le,paddingBottom:le,paddingLeft:le,paddingBlock:le,paddingBlockStart:le,paddingBlockEnd:le,paddingInline:le,paddingInlineStart:le,paddingInlineEnd:le,margin:le,marginTop:le,marginRight:le,marginBottom:le,marginLeft:le,marginBlock:le,marginBlockStart:le,marginBlockEnd:le,marginInline:le,marginInlineStart:le,marginInlineEnd:le,fontSize:le,backgroundPositionX:le,backgroundPositionY:le,...{rotate:se,rotateX:se,rotateY:se,rotateZ:se,scale:qt,scaleX:qt,scaleY:qt,scaleZ:qt,skew:se,skewX:se,skewY:se,distance:le,translateX:le,translateY:le,translateZ:le,x:le,y:le,z:le,perspective:le,transformPerspective:le,opacity:Kt,originX:he,originY:he,originZ:le},zIndex:_i,fillOpacity:Kt,strokeOpacity:Kt,numOctaves:_i},Ki={...Gi,color:pe,backgroundColor:pe,outlineColor:pe,fill:pe,stroke:pe,borderColor:pe,borderTopColor:pe,borderRightColor:pe,borderBottomColor:pe,borderLeftColor:pe,filter:Hi,WebkitFilter:Hi,mask:Yi,WebkitMask:Yi},qi=t=>Ki[t],Zi=new Set([Hi,Yi]);function Ji(t,e){let n=qi(t);return Zi.has(n)||(n=we),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Qi=new Set(["auto","none","0"]);class to extends $n{constructor(t,e,n,i,o){super(t,e,n,i,o,!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(),Ht(i))){const o=ui(i,e.current);void 0!==o&&(t[n]=o),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!ki.has(n)||2!==t.length)return;const[i,o]=t,r=Oi(i),s=Oi(o);if(_t(i)!==_t(o)&&Rn[n])this.needsMeasurement=!0;else if(r!==s)if(Ln(r)&&Ln(s))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else Rn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||$i(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,o=0;for(;o<t.length&&!i;){const e=t[o];"string"==typeof e&&!Qi.has(e)&&ve(e).values.length&&(i=t[o]),o++}if(i&&n)for(const o of e)t[o]=Ji(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=Rn[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 o=n.length-1,r=n[o];n[o]=Rn[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()}}function eo(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const o=n?.[t]??i.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t).filter(t=>null!=t)}const no=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function io(t){return nt(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:oo,cancel:ro}=Rt(queueMicrotask,!1),so={x:!1,y:!1};function ao(){return so.x||so.y}function lo(t,e){const n=eo(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function co(t,e,n={}){const[i,o,r]=lo(t,n);return i.forEach(t=>{let n,i=!1,r=!1;const s=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),r&&(r=!1,s(t))},l=t=>{"touch"!==t.pointerType&&(i?r=!0:s(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||ao())return;r=!1;const s=e(t,i);"function"==typeof s&&(n=s,t.addEventListener("pointerleave",l,o))},o),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",a,o)},o)}),r}const ho=(t,e)=>!!e&&(t===e||ho(t,e.parentElement)),uo=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,po=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const mo=new Set(["INPUT","SELECT","TEXTAREA"]);const fo=new WeakSet;function go(t){return e=>{"Enter"===e.key&&t(e)}}function yo(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function vo(t){return uo(t)&&!ao()}const xo=new WeakSet;function bo(t,e,n={}){const[i,o,r]=lo(t,n),s=t=>{const i=t.currentTarget;if(!vo(t))return;if(xo.has(t))return;fo.add(i),n.stopPropagation&&xo.add(t);const r=e(i,t),s=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),fo.has(i)&&fo.delete(i),vo(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{s(t,i===window||i===document||n.useGlobalTarget||ho(i,t.target))},l=t=>{s(t,!1)};window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",l,o)};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",s,o),io(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=go(()=>{if(fo.has(n))return;yo(n,"down");const t=go(()=>{yo(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>yo(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,o)),e=t,po.has(e.tagName)||!0===e.isContentEditable||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}function wo(t){return nt(t)&&"ownerSVGElement"in t}const So=new WeakMap;let Co;const ko=(t,e,n)=>(i,o)=>o&&o[0]?o[0][t+"Size"]:wo(i)&&"getBBox"in i?i.getBBox()[e]:i[n],To=ko("inline","width","offsetWidth"),Eo=ko("block","height","offsetHeight");function No({target:t,borderBoxSize:e}){So.get(t)?.forEach(n=>{n(t,{get width(){return To(t,e)},get height(){return Eo(t,e)}})})}function Po(t){t.forEach(No)}function Mo(t,e){Co||"undefined"!=typeof ResizeObserver&&(Co=new ResizeObserver(Po));const n=eo(t);return n.forEach(t=>{let n=So.get(t);n||(n=new Set,So.set(t,n)),n.add(e),Co?.observe(t)}),()=>{n.forEach(t=>{const n=So.get(t);n?.delete(e),n?.size||Co?.unobserve(t)})}}const Ao=new Set;let Lo;function Vo(t){return Ao.add(t),Lo||(Lo=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ao.forEach(e=>e(t))},window.addEventListener("resize",Lo)),()=>{Ao.delete(t),Ao.size||"function"!=typeof Lo||(window.removeEventListener("resize",Lo),Lo=void 0)}}function Do(t,e){return"function"==typeof t?Vo(t):Mo(t,e)}const Ro=[...Fi,pe,we],zo=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Bo=new WeakMap;function jo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Io(t){return"string"==typeof t||Array.isArray(t)}const Fo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Oo=["initial",...Fo];function $o(t){return jo(t.animate)||Oo.some(e=>Io(t[e]))}function Wo(t){return Boolean($o(t)||t.variants)}const Uo={current:null},Xo={current:!1},Ho="undefined"!=typeof window;function Yo(){if(Xo.current=!0,Ho)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Uo.current=t.matches;t.addEventListener("change",e),e()}else Uo.current=!1}const _o=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Go={};function Ko(t){Go=t}class qo{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:r,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=$n,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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=$t.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,zt.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=o,this.options=a,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=$o(e),this.isVariantNode=Wo(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==l[t]&&Ai(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Bo.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)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Xo.current||Yo(),this.shouldReduceMotion=Uo.current),"production"!==process.env.NODE_ENV&&mt(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}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?.removeChild(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}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&oi.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:o,ease:r,duration:s}=e.accelerate,a=new Jn({element:this.current,name:t,keyframes:i,times:o,ease:r,duration:dt(s)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=An.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&zt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),o&&o(),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 Go){const e=Go[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<_o.length;e++){const n=_o[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 o=e[i],r=n[i];if(Ai(o))t.addValue(i,o);else if(Ai(r))t.addValue(i,Ei(o,{owner:t}));else if(r!==o)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(o):e.hasAnimated||e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,Ei(void 0!==e?e:o,{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=Ei(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&&(et(n)||it(n))?n=parseFloat(n):(i=n,!Ro.find(Ii(i))&&we.test(e)&&(n=Ji(t,e))),this.setBaseTarget(t,Ai(n)?n.get():n)),Ai(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=Si(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||Ai(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 ct),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){oo.render(this.render)}}class Zo extends qo{constructor(){super(...arguments),this.KeyframeResolver=to}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[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;Ai(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class Jo{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Qo({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function tr(t){return void 0===t||1===t}function er({scale:t,scaleX:e,scaleY:n}){return!tr(t)||!tr(e)||!tr(n)}function nr(t){return er(t)||ir(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ir(t){return or(t.x)||or(t.y)}function or(t){return t&&"0%"!==t}function rr(t,e,n){return n+e*(t-n)}function sr(t,e,n,i,o){return void 0!==o&&(t=rr(t,o,i)),rr(t,n,i)+e}function ar(t,e=0,n=1,i,o){t.min=sr(t.min,e,n,i,o),t.max=sr(t.max,e,n,i,o)}function lr(t,{x:e,y:n}){ar(t.x,e.translate,e.scale,e.originPoint),ar(t.y,n.translate,n.scale,n.originPoint)}const cr=.999999999999,dr=1.0000000000001;function hr(t,e){t.min+=e,t.max+=e}function ur(t,e,n,i,o=.5){ar(t,e,n,ke(t.min,t.max,o),i)}function pr(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function mr(t,e,n){const i=n??t;ur(t.x,pr(e.x,i.x),e.scaleX,e.scale,e.originX),ur(t.y,pr(e.y,i.y),e.scaleY,e.scale,e.originY)}function fr(t,e){return Qo(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 gr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yr=Mn.length;function vr(t,e,n){const{style:i,vars:o,transformOrigin:r}=t;let s=!1,a=!1;for(const t in e){const n=e[t];if(An.has(t))s=!0;else if(Ut(t))o[t]=n;else{const e=no(n,Gi[t]);t.startsWith("origin")?(a=!0,r[t]=e):i[t]=e}}if(e.transform||(s||n?i.transform=function(t,e,n){let i="",o=!0;for(let r=0;r<yr;r++){const s=Mn[r],a=t[s];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(s.startsWith("scale")?1:0);else{const t=parseFloat(a);l=s.startsWith("scale")?1===t:0===t}if(!l||n){const t=no(a,Gi[s]);l||(o=!1,i+=`${gr[s]||s}(${t}) `),n&&(e[s]=t)}}return i=i.trim(),n?i=n(e,o?"":i):o&&(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}`}}function xr(t,{style:e,vars:n},i,o){const r=t.style;let s;for(s in e)r[s]=e[s];for(s in o?.applyProjectionStyles(r,i),n)r.setProperty(s,n[s])}function br(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const wr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!le.test(t))return t;t=parseFloat(t)}return`${br(t,e.target.x)}% ${br(t,e.target.y)}%`}},Sr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=we.parse(t);if(o.length>5)return i;const r=we.createTransformer(t),s="number"!=typeof o[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;o[0+s]/=a,o[1+s]/=l;const c=ke(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),r(o)}},Cr={borderRadius:{...wr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wr,borderTopRightRadius:wr,borderBottomLeftRadius:wr,borderBottomRightRadius:wr,boxShadow:Sr};function kr(t,{layout:e,layoutId:n}){return An.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Cr[t]||"opacity"===t)}function Tr(t,e,n){const i=t.style,o=e?.style,r={};if(!i)return r;for(const e in i)(Ai(i[e])||o&&Ai(o[e])||kr(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(r[e]=i[e]);return r}class Er extends Zo{constructor(){super(...arguments),this.type="html",this.renderInstance=xr}readValueFromInstance(t,e){if(An.has(e))return this.projection?.isProjecting?En(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Nn(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),o=(Ut(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return fr(t,e)}build(t,e,n){vr(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Tr(t,e,n)}}const Nr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Pr={offset:"strokeDashoffset",array:"strokeDasharray"};const Mr=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ar(t,{attrX:e,attrY:n,attrScale:i,pathLength:o,pathSpacing:r=1,pathOffset:s=0,...a},l,c,d){if(vr(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:u}=t;h.transform&&(u.transform=h.transform,delete h.transform),(u.transform||h.transformOrigin)&&(u.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),u.transform&&(u.transformBox=d?.transformBox??"fill-box",delete h.transformBox);for(const t of Mr)void 0!==h[t]&&(u[t]=h[t],delete h[t]);void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==o&&function(t,e,n=1,i=0,o=!0){t.pathLength=1;const r=o?Nr:Pr;t[r.offset]=""+-i,t[r.array]=`${e} ${n}`}(h,o,r,s,!1)}const Lr=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"]),Vr=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Dr(t,e,n){const i=Tr(t,e,n);for(const n in t)if(Ai(t[n])||Ai(e[n])){i[-1!==Mn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Rr extends Zo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=zo}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(An.has(e)){const t=qi(e);return t&&t.default||0}return e=Lr.has(e)?e:Vi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Dr(t,e,n)}build(t,e,n){Ar(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){xr(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Lr.has(n)?n:Vi(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Vr(t.tagName),super.mount(t)}}const zr=Oo.length;function Br(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Br(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<zr;n++){const i=Oo[n],o=t.props[i];(Io(o)||!1===o)&&(e[i]=o)}return e}function jr(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 Ir=[...Fo].reverse(),Fr=Fo.length;function Or(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 o=e.map(e=>ji(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=ji(t,e,n);else{const o="function"==typeof e?Ci(t,e,n.custom):e;i=Promise.all(Bi(t,o,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function $r(t){let e=Or(t),n=Xr(),i=!0,o=!1;const r=e=>(n,i)=>{const o=Ci(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function s(s){const{props:a}=t,l=Br(t.parent)||{},c=[],d=new Set;let h={},u=1/0;for(let e=0;e<Fr;e++){const p=Ir[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],g=Io(f),y=p===s?m.isActive:null;!1===y&&(u=e);let v=f===l[p]&&f!==a[p]&&g;if(v&&(i||o)&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...h},!m.isActive&&null===y||!f&&!m.prevProp||jo(f)||"boolean"==typeof f)continue;if("exit"===p&&m.isActive&&!0!==y){m.prevResolvedValues&&(h={...h,...m.prevResolvedValues});continue}const x=Wr(m.prevProp,f);let b=x||p===s&&m.isActive&&!v&&g||e>u&&g,w=!1;const S=Array.isArray(f)?f:[f];let C=S.reduce(r(p),{});!1===y&&(C={});const{prevResolvedValues:k={}}=m,T={...k,...C},E=e=>{b=!0,d.has(e)&&(w=!0,d.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in T){const e=C[t],n=k[t];if(h.hasOwnProperty(t))continue;let i=!1;i=Ni(e)&&Ni(n)?!jr(e,n):e!==n,i?null!=e?E(t):d.add(t):void 0!==e&&d.has(t)?E(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=C,m.isActive&&(h={...h,...C}),(i||o)&&t.blockInitialAnimation&&(b=!1);const N=v&&x;b&&(!N||w)&&c.push(...S.map(e=>{const n={type:p};if("string"==typeof e&&(i||o)&&!N&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,o=Ci(i,e);if(i.enteringChildren&&o){const{delayChildren:e}=o.transition||{};n.delay=di(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(d.size){const e={};if("boolean"!=typeof a.initial){const n=Ci(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}d.forEach(n=>{const i=t.getBaseTarget(n),o=t.getValue(n);o&&(o.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,o=!1,p?e(c):Promise.resolve()}return{animateChanges:s,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 o=s(e);for(const t in n)n[t].protectedKeys={};return o},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Xr(),o=!0}}}function Wr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!jr(e,t)}function Ur(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Xr(){return{animate:Ur(!0),whileInView:Ur(),whileHover:Ur(),whileTap:Ur(),whileDrag:Ur(),whileFocus:Ur(),exit:Ur()}}function Hr(t,e){t.min=e.min,t.max=e.max}function Yr(t,e){Hr(t.x,e.x),Hr(t.y,e.y)}function _r(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Gr(t){return t.max-t.min}function Kr(t,e,n,i=.5){t.origin=i,t.originPoint=ke(e.min,e.max,t.origin),t.scale=Gr(n)/Gr(e),t.translate=ke(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 qr(t,e,n,i){Kr(t.x,e.x,n.x,i?i.originX:void 0),Kr(t.y,e.y,n.y,i?i.originY:void 0)}function Zr(t,e,n,i=0){const o=i?ke(n.min,n.max,i):n.min;t.min=o+e.min,t.max=t.min+Gr(e)}function Jr(t,e,n,i=0){const o=i?ke(n.min,n.max,i):n.min;t.min=e.min-o,t.max=t.min+Gr(e)}function Qr(t,e,n,i){Jr(t.x,e.x,n.x,i?.x),Jr(t.y,e.y,n.y,i?.y)}function ts(t,e,n,i,o){return t=rr(t-=e,1/n,i),void 0!==o&&(t=rr(t,1/o,i)),t}function es(t,e,[n,i,o],r,s){!function(t,e=0,n=1,i=.5,o,r=t,s=t){ae.test(e)&&(e=parseFloat(e),e=ke(s.min,s.max,e/100)-s.min);if("number"!=typeof e)return;let a=ke(r.min,r.max,i);t===r&&(a-=e),t.min=ts(t.min,e,n,a,o),t.max=ts(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,r,s)}const ns=["x","scaleX","originX"],is=["y","scaleY","originY"];function os(t,e,n,i){es(t.x,e,ns,n?n.x:void 0,i?i.x:void 0),es(t.y,e,is,n?n.y:void 0,i?i.y:void 0)}function rs(t){return 0===t.translate&&1===t.scale}function ss(t){return rs(t.x)&&rs(t.y)}function as(t,e){return t.min===e.min&&t.max===e.max}function ls(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function cs(t,e){return ls(t.x,e.x)&&ls(t.y,e.y)}function ds(t){return Gr(t.x)/Gr(t.y)}function hs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function us(t){return[t("x"),t("y")]}const ps=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],ms=ps.length,fs=t=>"string"==typeof t?parseFloat(t):t,gs=t=>"number"==typeof t||le.test(t);function ys(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const vs=bs(0,.5,kt),xs=bs(.5,.95,rt);function bs(t,e,n){return i=>i<t?0:i>e?1:n(lt(t,e,i))}function ws(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const Ss=(t,e)=>t.depth-e.depth;class Cs{constructor(){this.children=[],this.isDirty=!1}add(t){G(this.children,t),this.isDirty=!0}remove(t){K(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ss),this.isDirty=!1,this.children.forEach(t)}}function ks(t){return Ai(t)?t.get():t}class Ts{constructor(){this.members=[]}add(t){G(this.members,t);for(let e=this.members.length-1;e>=0;e--){const n=this.members[e];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1!==i.isConnected||n.snapshot||(K(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(K(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){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:o}=t.options;void 0!==i&&i===o||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Es={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ns=["","X","Y","Z"];let Ps=0;function Ms(t,e,n,i){const{latestValues:o}=e;o[t]&&(n[t]=o[t],e.setStaticValue(t,0),i&&(i[t]=0))}function As(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ri(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",zt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&As(i)}function Ls({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t={},n=e?.()){this.id=Ps++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Rs),this.nodes.forEach(Us),this.nodes.forEach(Xs),this.nodes.forEach(zs)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=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 Cs)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new ct),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=wo(e)&&!(wo(n=e)&&"svg"===n.tagName),this.instance=e;const{layoutId:i,layout:o,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&&(o||i)&&(this.isLayoutDirty=!0),t){let n,i=0;const o=()=>this.root.updateBlockedByResize=!1;zt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=$t.now(),i=({timestamp:o})=>{const r=o-n;r>=e&&(Bt(i),t(r-e))};return zt.setup(i,!0),()=>Bt(i)}(o,250),Es.hasAnimatedSinceResize&&(Es.hasAnimatedSinceResize=!1,this.nodes.forEach(Ws)))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&r&&(i||o)&&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 o=this.options.transition||r.getDefaultTransition()||qs,{onLayoutAnimationStart:s,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!cs(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={...vi(o,"layout"),onPlay:s,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c)}else e||Ws(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(Hs),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&&As(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,"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!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()){const t=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),t&&this.nodes.forEach(Is),void this.nodes.forEach(js)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Fs);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Os),this.nodes.forEach($s),this.nodes.forEach(Vs),this.nodes.forEach(Ds)):this.nodes.forEach(Fs),this.clearAllSnapshots();const t=$t.now();jt.delta=q(0,1e3/60,t-jt.timestamp),jt.timestamp=t,jt.isProcessing=!0,It.update.process(jt),It.preRender.process(jt),It.render.process(jt),jt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,oo.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Bs),this.sharedNodes.forEach(Ys)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Gr(this.snapshot.measuredBox.x)||Gr(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.layoutVersion++,this.layoutCorrected||(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(!o)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!ss(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,r=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||nr(this.latestValues)||r)&&(o(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)),Qs((i=n).x),Qs(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(ea))){const{scroll:t}=this.root;t&&(hr(e.x,t.offset.x),hr(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(Yr(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:r}=i;i!==this.root&&o&&r.layoutScroll&&(o.wasRoot&&Yr(e,t),hr(e.x,o.offset.x),hr(e.y,o.offset.y))}return e}applyTransform(t,e=!1,n){const i=n||{x:{min:0,max:0},y:{min:0,max:0}};Yr(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(hr(i.x,-n.scroll.offset.x),hr(i.y,-n.scroll.offset.y)),nr(n.latestValues)&&mr(i,n.latestValues,n.layout?.layoutBox)}return nr(this.latestValues)&&mr(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Yr(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!nr(n.latestValues))continue;let i;n.instance&&(er(n.latestValues)&&n.updateSnapshot(),i=zo(),Yr(i,n.measurePageBox())),os(e,n.latestValues,n.snapshot?.layoutBox,i)}return nr(this.latestValues)&&os(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!==jt.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:o}=this.options;if(!this.layout||!i&&!o)return;this.resolvedRelativeTargetAt=jt.timestamp;const r=this.getClosestProjectingParent();var s,a,l,c;(r&&this.linkedParentVersion!==r.layoutVersion&&!r.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta)&&(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(),s=this.target,a=this.relativeTarget,l=this.relativeParent.target,c=this.options.layoutAnchor||void 0,Zr(s.x,a.x,l.x,c?.x),Zr(s.y,a.y,l.y,c?.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):Yr(this.target,this.layout.layoutBox),lr(this.target,this.targetDelta)):Yr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&r&&Boolean(r.resumingFrom)===Boolean(this.resumingFrom)&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(this.parent&&!er(this.parent.latestValues)&&!ir(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,n){this.relativeParent=t,this.linkedParentVersion=t.layoutVersion,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}},Qr(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),Yr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}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===jt.timestamp&&(n=!1),n)return;const{layout:i,layoutId:o}=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&&!o)return;Yr(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,s=this.treeScale.y;!function(t,e,n,i=!1){const o=n.length;if(!o)return;let r,s;e.x=e.y=1;for(let a=0;a<o;a++){r=n[a],s=r.projectionDelta;const{visualElement:o}=r.options;o&&o.props.style&&"contents"===o.props.style.display||(i&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(hr(t.x,-r.scroll.offset.x),hr(t.y,-r.scroll.offset.y)),s&&(e.x*=s.x.scale,e.y*=s.y.scale,lr(t,s)),i&&nr(r.latestValues)&&mr(t,r.latestValues,r.layout?.layoutBox))}e.x<dr&&e.x>cr&&(e.x=1),e.y<dr&&e.y>cr&&(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?(_r(this.prevProjectionDelta.x,this.projectionDelta.x),_r(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),qr(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===r&&this.treeScale.y===s&&hs(this.projectionDelta.x,this.prevProjectionDelta.x)&&hs(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:{},o={...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 s={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,d=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(Ks));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,u,p,m,f,g;_s(r.x,t.x,n),_s(r.y,t.y,n),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qr(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),p=this.relativeTarget,m=this.relativeTargetOrigin,f=s,g=n,Gs(p.x,m.x,f.x,g),Gs(p.y,m.y,f.y,g),h&&(l=this.relativeTarget,u=h,as(l.x,u.x)&&as(l.y,u.y))&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),Yr(h,this.relativeTarget)),a&&(this.animationValues=o,function(t,e,n,i,o,r){o?(t.opacity=ke(0,n.opacity??1,vs(i)),t.opacityExit=ke(e.opacity??1,0,xs(i))):r&&(t.opacity=ke(e.opacity??1,n.opacity??1,i));for(let o=0;o<ms;o++){const r=ps[o];let s=ys(e,r),a=ys(n,r);void 0===s&&void 0===a||(s||(s=0),a||(a=0),0===s||0===a||gs(s)===gs(a)?(t[r]=Math.max(ke(fs(s),fs(a),i),0),(ae.test(a)||ae.test(s))&&(t[r]+="%")):t[r]=a)}(e.rotate||n.rotate)&&(t.rotate=ke(e.rotate||0,n.rotate||0,i))}(o,i,this.latestValues,n,d,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=zt.update(()=>{Es.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ei(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(t,e,n){const i=Ai(t)?t:Ei(t);return i.start(bi("",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:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&ta(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Gr(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Gr(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Yr(e,n),mr(e,o),qr(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ts);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&&Ms("z",t,i,this.animationValues);for(let e=0;e<Ns.length;e++)Ms(`rotate${Ns[e]}`,t,i,this.animationValues),Ms(`skew${Ns[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()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=ks(e?.pointerEvents)||"",void(t.transform=n?n(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=ks(e?.pointerEvents)||""),void(this.hasProjected&&!nr(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1));t.visibility="";const o=i.animationValues||i.latestValues;this.applyTransformsToTarget();let r=function(t,e,n){let i="";const o=t.x.translate/e.x,r=t.y.translate/e.y,s=n?.z||0;if((o||r||s)&&(i=`translate3d(${o}px, ${r}px, ${s}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:o,rotateY:r,skewX:s,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),s&&(i+=`skewX(${s}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,o);n&&(r=n(o,r)),t.transform=r;const{x:s,y:a}=this.projectionDelta;t.transformOrigin=`${100*s.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?o.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:o.opacityExit:t.opacity=i===this?void 0!==o.opacity?o.opacity:"":void 0!==o.opacityExit?o.opacityExit:0;for(const e in Cr){if(void 0===o[e])continue;const{correct:n,applyTo:s,isCSSVariable:a}=Cr[e],l="none"===r?o[e]:n(o[e],i);if(s){const e=s.length;for(let n=0;n<e;n++)t[s[n]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=i===this?ks(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(js),this.root.sharedNodes.clear()}}}function Vs(t){t.updateLayout()}function Ds(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:o}=t.options,r=e.source!==t.layout.source;if("size"===o)us(t=>{const i=r?e.measuredBox[t]:e.layoutBox[t],o=Gr(i);i.min=n[t].min,i.max=i.min+o});else if("x"===o||"y"===o){const t="x"===o?"y":"x";Hr(r?e.measuredBox[t]:e.layoutBox[t],n[t])}else ta(o,e.layoutBox,n)&&us(i=>{const o=r?e.measuredBox[i]:e.layoutBox[i],s=Gr(n[i]);o.max=o.min+s,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+s)});const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};qr(s,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r?qr(a,t.applyTransform(i,!0),e.measuredBox):qr(a,n,e.layoutBox);const l=!ss(s);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:o,layout:r}=i;if(o&&r){const s=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};Qr(a,e.layoutBox,o.layoutBox,s);const l={x:{min:0,max:0},y:{min:0,max:0}};Qr(l,n,r.layoutBox,s),cs(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Rs(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 zs(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Bs(t){t.clearSnapshot()}function js(t){t.clearMeasurements()}function Is(t){t.isLayoutDirty=!0,t.updateLayout()}function Fs(t){t.isLayoutDirty=!1}function Os(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function $s(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ws(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Us(t){t.resolveTargetDelta()}function Xs(t){t.calcProjection()}function Hs(t){t.resetSkewAndRotation()}function Ys(t){t.removeLeadSnapshot()}function _s(t,e,n){t.translate=ke(e.translate,0,n),t.scale=ke(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Gs(t,e,n,i){t.min=ke(e.min,n.min,i),t.max=ke(e.max,n.max,i)}function Ks(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const qs={duration:.45,ease:[.4,0,.1,1]},Zs=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Js=Zs("applewebkit/")&&!Zs("chrome/")?Math.round:rt;function Qs(t){t.min=Js(t.min),t.max=Js(t.max)}function ta(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=ds(e),o=ds(n),r=.2,!(Math.abs(i-o)<=r));var i,o,r}function ea(t){return t!==t.root&&t.scroll?.wasRoot}const na=Ls({attachResizeListener:(t,e)=>ws(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ia={current:void 0},oa=Ls({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ia.current){const t=new na({});t.mount(window),t.setOptions({layoutScroll:!0}),ia.current=t}return ia.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ra=r({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function sa(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}function aa(...t){return i.useCallback(function(...t){return e=>{let n=!1;const i=t.map(t=>{const i=sa(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;e<i.length;e++){const n=i[e];"function"==typeof n?n():sa(t[e],null)}}}}(...t),t)}class la extends i.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(io(e)&&t.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const t=e.offsetParent,n=io(t)&&t.offsetWidth||0,i=io(t)&&t.offsetHeight||0,o=getComputedStyle(e),r=this.props.sizeRef.current;r.height=parseFloat(o.height),r.width=parseFloat(o.width),r.top=e.offsetTop,r.left=e.offsetLeft,r.right=n-r.width-r.left,r.bottom=i-r.height-r.top}return null}componentDidUpdate(){}render(){return this.props.children}}function ca({children:e,isPresent:n,anchorX:o,anchorY:r,root:a,pop:l}){const u=c(),p=s(null),m=s({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:f}=d(ra),g=e.props?.ref??e?.ref,y=aa(p,g);return h(()=>{const{width:t,height:e,top:i,left:s,right:c,bottom:d}=m.current;if(n||!1===l||!p.current||!t||!e)return;const h="left"===o?`left: ${s}`:`right: ${c}`,g="bottom"===r?`bottom: ${d}`:`top: ${i}`;p.current.dataset.motionPopId=u;const y=document.createElement("style");f&&(y.nonce=f);const v=a??document.head;return v.appendChild(y),y.sheet&&y.sheet.insertRule(`\n [data-motion-pop-id="${u}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${h}px !important;\n ${g}px !important;\n }\n `),()=>{p.current?.removeAttribute("data-motion-pop-id"),v.contains(y)&&v.removeChild(y)}},[n]),t(la,{isPresent:n,childRef:p,sizeRef:m,pop:l,children:!1===l?e:i.cloneElement(e,{ref:y})})}const da=({children:e,initial:n,isPresent:o,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:l,anchorX:d,anchorY:h,root:p})=>{const m=H(ha),f=c();let g=!0,y=u(()=>(g=!1,{id:f,initial:n,isPresent:o,custom:s,onExitComplete:t=>{m.set(t,!0);for(const t of m.values())if(!t)return;r&&r()},register:t=>(m.set(t,!1),()=>m.delete(t))}),[o,m,r]);return a&&g&&(y={...y}),u(()=>{m.forEach((t,e)=>m.set(e,!1))},[o]),i.useEffect(()=>{!o&&!m.size&&r&&r()},[o]),e=t(ca,{pop:"popLayout"===l,isPresent:o,anchorX:d,anchorY:h,root:p,children:e}),t(_.Provider,{value:y,children:e})};function ha(){return new Map}function ua(t=!0){const e=d(_);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:i,register:o}=e,r=c();l(()=>{if(t)return o(r)},[t]);const s=p(()=>t&&i&&i(r),[r,i,t]);return!n&&i?[!1,s]:[!0]}const pa=t=>t.key||"";function ma(t){const e=[];return m.forEach(t,t=>{f(t)&&e.push(t)}),e}const fa=({children:e,custom:i,initial:o=!0,onExitComplete:r,presenceAffectsLayout:a=!0,mode:l="sync",propagate:c=!1,anchorX:h="left",anchorY:p="top",root:m})=>{const[f,y]=ua(c),v=u(()=>ma(e),[e]),x=c&&!f?[]:v.map(pa),b=s(!0),w=s(v),S=H(()=>new Map),C=s(new Set),[k,T]=g(v),[E,N]=g(v);Y(()=>{b.current=!1,w.current=v;for(let t=0;t<E.length;t++){const e=pa(E[t]);x.includes(e)?(S.delete(e),C.current.delete(e)):!0!==S.get(e)&&S.set(e,!1)}},[E,x.length,x.join("-")]);const P=[];if(v!==k){let t=[...v];for(let e=0;e<E.length;e++){const n=E[e],i=pa(n);x.includes(i)||(t.splice(e,0,n),P.push(n))}return"wait"===l&&P.length&&(t=P),N(ma(t)),T(v),null}"production"!==process.env.NODE_ENV&&"wait"===l&&E.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:M}=d(X);return t(n,{children:E.map(e=>{const n=pa(e),s=!(c&&!f)&&(v===E||x.includes(n));return t(da,{isPresent:s,initial:!(b.current&&!o)&&void 0,custom:i,presenceAffectsLayout:a,mode:l,root:m,onExitComplete:s?void 0:()=>{if(C.current.has(n))return;if(!S.has(n))return;C.current.add(n),S.set(n,!0);let t=!0;S.forEach(e=>{e||(t=!1)}),t&&(M?.(),N(w.current),c&&y?.(),r&&r())},anchorX:h,anchorY:p,children:e},n)})})},ga=r({strict:!1}),ya={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"]};let va=!1;function xa(){return function(){if(va)return;const t={};for(const e in ya)t[e]={isEnabled:t=>ya[e].some(e=>!!t[e])};Ko(t),va=!0}(),Go}const ba=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","propagate","ignoreStrict","viewport"]);function wa(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||ba.has(t)}let Sa=t=>!wa(t);try{"function"==typeof(Ca=require("@emotion/is-prop-valid").default)&&(Sa=t=>t.startsWith("on")?!wa(t):Ca(t))}catch{}var Ca;const ka=r({});function Ta(t){const{initial:e,animate:n}=function(t,e){if($o(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Io(e)?e:void 0,animate:Io(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,d(ka));return u(()=>({initial:e,animate:n}),[Ea(e),Ea(n)])}function Ea(t){return Array.isArray(t)?t.join(" "):t}const Na=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Pa(t,e,n){for(const i in e)Ai(e[i])||kr(i,n)||(t[i]=e[i])}function Ma(t,e){const n={};return Pa(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return u(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return vr(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Aa(t,e){const n={},i=Ma(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 La=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Va(t,e,n,i){const o=u(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Ar(n,e,Vr(i),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Pa(e,t.style,t),o.style={...e,...o.style}}return o}const Da=["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 Ra(t){return"string"==typeof t&&!t.includes("-")&&!!(Da.indexOf(t)>-1||/[A-Z]/u.test(t))}function za(t,e,n,{latestValues:i},o,r=!1,s){const a=(s??Ra(t)?Va:Aa)(e,i,o,t),l=function(t,e,n){const i={};for(const o in t)"values"===o&&"object"==typeof t.values||Ai(t[o])||(Sa(o)||!0===n&&wa(o)||!e&&!wa(o)||t.draggable&&o.startsWith("onDrag"))&&(i[o]=t[o]);return i}(e,"string"==typeof t,r),c=t!==y?{...l,...a,ref:n}:{},{children:d}=e,h=u(()=>Ai(d)?d.get():d,[d]);return v(t,{...c,children:h})}function Ba(t,e,n,i){const o={},r=i(t,{});for(const t in r)o[t]=ks(r[t]);let{initial:s,animate:a}=t;const l=$o(t),c=Wo(t);e&&c&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let d=!!n&&!1===n.initial;d=d||!1===s;const h=d?a:s;if(h&&"boolean"!=typeof h&&!jo(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=Si(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[d?e.length-1:0]}null!==e&&(o[t]=e)}for(const e in t)o[e]=t[e]}}}return o}const ja=t=>(e,n)=>{const i=d(ka),o=d(_),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,o){return{latestValues:Ba(n,i,o,t),renderState:e()}}(t,e,i,o);return n?r():H(r)},Ia=ja({scrapeMotionValuesFromProps:Tr,createRenderState:Na}),Fa=ja({scrapeMotionValuesFromProps:Dr,createRenderState:La}),Oa=Symbol.for("motionComponentSymbol");function $a(t,e,n){const i=s(n);h(()=>{i.current=n});const o=s(null);return p(n=>{n&&t.onMount?.(n);const r=i.current;if("function"==typeof r)if(n){const t=r(n);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):r(n);else r&&(r.current=n);e&&(n?e.mount(n):e.unmount())},[e])}const Wa=r({});function Ua(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Xa(t,e,n,i,o,r){const{visualElement:a}=d(ka),c=d(ga),u=d(_),p=d(ra),m=p.reducedMotion,f=p.skipAnimations,g=s(null),y=s(!1);i=i||c.renderer,!g.current&&i&&(g.current=i(t,{visualState:e,parent:a,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:m,skipAnimations:f,isSVG:r}),y.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const v=g.current,x=d(Wa);!v||v.projection||!o||"html"!==v.type&&"svg"!==v.type||function(t,e,n,i){const{layoutId:o,layout:r,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:d,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ha(t.parent)),t.projection.setOptions({layoutId:o,layout:r,alwaysMeasureLayout:Boolean(s)||a&&Ua(a),visualElement:t,animationType:"string"==typeof r?r:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:d})}(g.current,n,o,x);const b=s(!1);h(()=>{v&&b.current&&v.update(n,u)});const w=n[Di],S=s(Boolean(w)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return Y(()=>{y.current=!0,v&&(b.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),S.current&&v.animationState&&v.animationState.animateChanges())}),l(()=>{v&&(!S.current&&v.animationState&&v.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),S.current=!1),v.enteringChildren=void 0)}),v}function Ha(t){if(t)return!1!==t.options.allowProjection?t.projection:Ha(t.parent)}function Ya(n,{forwardMotionProps:i=!1,type:o}={},r,s){r&&function(t){const e=xa();for(const n in t)e[n]={...e[n],...t[n]};Ko(e)}(r);const a=o?"svg"===o:Ra(n),l=a?Fa:Ia;function c(o,c){let h;const u={...d(ra),...o,layoutId:_a(o)},{isStatic:p}=u,m=Ta(o),f=l(o,p);if(!p&&"undefined"!=typeof window){!function(t,e){const n=d(ga).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?J(!1,e,"lazy-strict-mode"):Q(!1,e,"lazy-strict-mode")}}(u,r);const t=function(t){const e=xa(),{drag:n,layout:i}=e;if(!n&&!i)return{};const o={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(u);h=t.MeasureLayout,m.visualElement=Xa(n,f,u,s,t.ProjectionNode,a)}return e(ka.Provider,{value:m,children:[h&&m.visualElement?t(h,{visualElement:m.visualElement,...u}):null,za(n,o,$a(f,m.visualElement,c),f,p,i,a)]})}c.displayName=`motion.${"string"==typeof n?n:`create(${n.displayName??n.name??""})`}`;const h=x(c);return h[Oa]=n,h}function _a({layoutId:t}){const e=d(X).id;return e&&void 0!==t?e+"-"+t:t}function Ga(t,e){if("undefined"==typeof Proxy)return Ya;const n=new Map,i=(n,i)=>Ya(n,i,t,e);return new Proxy((t,e)=>("production"!==process.env.NODE_ENV&&mt(!1,"motion() is deprecated. Use motion.create() instead."),i(t,e)),{get:(o,r)=>"create"===r?i:(n.has(r)||n.set(r,Ya(r,void 0,t,e)),n.get(r))})}const Ka=(t,e)=>e.isSVG??Ra(t)?new Rr(e):new Er(e,{allowProjection:t!==y});let qa=0;const Za={animation:{Feature:class extends Jo{constructor(t){super(t),t.animationState||(t.animationState=$r(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();jo(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 Jo{constructor(){super(...arguments),this.id=qa++,this.isExitComplete=!1}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;if(t&&!1===n){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t){const n=Ci(this.node,t,e);if(n){const{transition:t,transitionEnd:e,...i}=n;for(const t in i)this.node.getValue(t)?.jump(i[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Ja(t){return{point:{x:t.pageX,y:t.pageY}}}function Qa(t,e,n,i){return ws(t,e,(t=>e=>uo(e)&&t(e,Ja(e)))(n),i)}const tl=({current:t})=>t?t.ownerDocument.defaultView:null,el=(t,e)=>Math.abs(t-e);const nl=new Set(["auto","scroll"]);class il{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3,element:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ol(this.lastRawMoveEventInfo,this.transformPagePoint));const t=sl(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=el(t.x,e.x),i=el(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=jt;this.history.push({...i,timestamp:o});const{onStart:r,onMove:s}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=ol(e,this.transformPagePoint),zt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:o}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const r=sl("pointercancel"===t.type?this.lastMoveEventInfo:ol(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,r),i&&i(t,r)},!uo(t))return;this.dragSnapToOrigin=o,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=r,this.contextWindow=i||window;const a=ol(Ja(t),this.transformPagePoint),{point:l}=a,{timestamp:c}=jt;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=e;d&&d(t,sl(a,this.history)),this.removeListeners=at(Qa(this.contextWindow,"pointermove",this.handlePointerMove),Qa(this.contextWindow,"pointerup",this.handlePointerUp),Qa(this.contextWindow,"pointercancel",this.handlePointerUp)),s&&this.startScrollTracking(s)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(nl.has(t.overflowX)||nl.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o=i.x-e.x,r=i.y-e.y;0===o&&0===r||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o,this.lastMoveEventInfo.point.y+=r):this.history.length>0&&(this.history[0].x-=o,this.history[0].y-=r),this.scrollPositions.set(t,i),zt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Bt(this.updatePoint)}}function ol(t,e){return e?{point:e(t.point)}:t}function rl(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sl({point:t},e){return{point:t,delta:rl(t,ll(e)),offset:rl(t,al(e)),velocity:cl(e,.1)}}function al(t){return t[0]}function ll(t){return t[t.length-1]}function cl(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=ll(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>dt(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&o.timestamp-i.timestamp>2*dt(e)&&(i=t[1]);const r=ht(o.timestamp-i.timestamp);if(0===r)return{x:0,y:0};const s={x:(o.x-i.x)/r,y:(o.y-i.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function dl(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 hl(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 ul=.35;function pl(t,e,n){return{min:ml(t,e),max:ml(t,n)}}function ml(t,e){return"number"==typeof t?t:t[e]||0}const fl=new WeakMap;class gl{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.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:o}=this.getProps();this.panSession=new il(t,{onSessionStart:t=>{e&&this.snapToCursor(Ja(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:o}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(r=n)||"y"===r?so[r]?null:(so[r]=!0,()=>{so[r]=!1}):so.x||so.y?null:(so.x=so.y=!0,()=>{so.x=so.y=!1}),!this.openDragLock))return;var r;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),us(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=Gr(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),o&&zt.update(()=>o(t,e),!1,!0),Li(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:r}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:s}=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}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),r&&zt.update(()=>r(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:o,distanceThreshold:n,contextWindow:tl(this.visualElement),element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!n)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&zt.postRender(()=>s(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!vl(t,i,this.currentDirection))return;const o=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?ke(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?ke(n,t,i.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),o.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&&Ua(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:dl(t.x,n,o),y:dl(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=ul){return!1===t?t=0:!0===t&&(t=ul),{x:pl(t,"left","right"),y:pl(t,"top","bottom")}}(e),i!==this.constraints&&!Ua(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&us(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||!Ua(t))return!1;const n=t.current;Q(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=function(t,e,n){const i=fr(t,n),{scroll:o}=e;return o&&(hr(i.x,o.offset.x),hr(i.y,o.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:hl(t.x,e.x),y:hl(t.y,e.y)}}(i.layout.layoutBox,o);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=Qo(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=us(s=>{if(!vl(s,e,this.currentDirection))return;let l=a&&a[s]||{};!0!==r&&r!==s||(l={min:0,max:0});const c=i?200:1e6,d=i?40:1e7,h={type:"inertia",velocity:n?t[s]:0,bounceStiffness:c,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,h)});return Promise.all(l).then(s)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Li(this.visualElement,t),n.start(bi(t,n,0,e,this.visualElement,!1))}stopAnimation(){us(t=>this.getAxisMotionValue(t).stop())}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){us(e=>{const{drag:n}=this.getProps();if(!vl(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:r}=i.layout.layoutBox[e],s=o.get()||0;o.set(t[e]-ke(n,r,.5)+s)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Ua(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};us(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=Gr(t),o=Gr(e);return o>i?n=lt(e.min,e.max-i,t.min):i>o&&(n=lt(t.min,t.max-o,e.min)),q(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),us(e=>{if(!vl(e,t,null))return;const n=this.getAxisMotionValue(e),{min:o,max:r}=this.constraints[e];n.set(ke(o,r,i[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;fl.set(this.visualElement,this);const t=this.visualElement.current,e=Qa(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),o=e.target,r=o!==t&&function(t){return mo.has(t.tagName)||!0===t.isContentEditable}(o);n&&i&&!r&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps();Ua(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Do(t,yl(n)),o=Do(e,yl(n));return()=>{i(),o()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,r=o.addEventListener("measure",i);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),zt.read(i);const s=ws(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(us(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(),e(),r(),a&&a(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=ul,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:s}}}function yl(t){let e=!0;return()=>{e?e=!1:t()}}function vl(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const xl=t=>(e,n)=>{t&&zt.update(()=>t(e,n),!1,!0)};let bl=!1;class wl extends b{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),bl&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Es.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,{projection:r}=n;return r?(r.isPresent=o,t.layoutDependency!==e&&r.setOptions({...r.options,layoutDependency:e}),bl=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==o?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||zt.postRender(()=>{const t=r.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=e,n.root.didUpdate(),oo.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;bl=!0,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 Sl(e){const[n,i]=ua(),o=d(X);return t(wl,{...e,layoutGroup:o,switchLayoutGroup:d(Wa),isPresent:n,safeToRemove:i})}const Cl={pan:{Feature:class extends Jo{constructor(){super(...arguments),this.removePointerDownListener=rt}onPointerDown(t){this.session=new il(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tl(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:xl(t),onStart:xl(e),onMove:xl(n),onEnd:(t,e)=>{delete this.session,i&&zt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Qa(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 Jo{constructor(t){super(t),this.removeGroupControls=rt,this.removeListeners=rt,this.controls=new gl(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||rt}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:oa,MeasureLayout:Sl}};function kl(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const o=i["onHover"+n];o&&zt.postRender(()=>o(e,Ja(e)))}function Tl(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 o=i["onTap"+("End"===n?"":n)];o&&zt.postRender(()=>o(e,Ja(e)))}const El=new WeakMap,Nl=new WeakMap,Pl=t=>{const e=El.get(t.target);e&&e(t)},Ml=t=>{t.forEach(Pl)};function Al(t,e,n){const i=function({root:t,...e}){const n=t||document;Nl.has(n)||Nl.set(n,{});const i=Nl.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(Ml,{root:t,...e})),i[o]}(e);return El.set(t,n),i.observe(t),()=>{El.delete(t),i.unobserve(t)}}const Ll={some:0,all:1};const Vl=Ga({...Za,...{inView:{Feature:class extends Jo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:o}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Ll[i]};this.stopObserver=Al(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,o&&!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(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends Jo{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=bo(t,(t,e)=>(Tl(this.node,e,"Start"),(t,{success:e})=>Tl(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends Jo{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=at(ws(this.node.current,"focus",()=>this.onFocus()),ws(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Jo{mount(){const{current:t}=this.node;t&&(this.unmount=co(t,(t,e)=>(kl(this.node,e,"Start"),t=>kl(this.node,t,"End"))))}unmount(){}}}},...Cl,...{layout:{ProjectionNode:oa,MeasureLayout:Sl}}},Ka);function Dl(){!Xo.current&&Yo();const[t]=g(Uo.current);return"production"!==process.env.NODE_ENV&&mt(!0!==t,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),t}const Rl=({isOpen:i,onClose:o,onToggle:r,menuItems:a,logoUrl:c,logoAlt:d="Logo",systemName:h="PASS",defaultLogoUrl:p,dashboardPath:m,className:f="fixed inset-y-0 left-0 z-50 w-80 bg-white shadow-xl",overlayClassName:y="fixed inset-0 bg-black/25 z-40",desktopMenuClassName:v="h-full flex flex-col",showBottomMenu:x=!0,bottomMenuItems:b=[{id:"settings",label:"Configuración",icon:j,action:()=>{}},{id:"help",label:"Ayuda",icon:O,action:()=>{}},{id:"logout",label:"Cerrar Sesión",icon:F,action:()=>{}}],activePath:w="",onNavigate:S,children:C,performanceMode:k="auto",fpsThreshold:T,fpsSampleSize:E,compatibilityMode:N=!1,onPerformanceModeChange:P})=>{const[M,A]=g(new Set),{effectiveMode:L}=function({mode:t="auto",fpsThreshold:e=45,fpsSampleSize:n=90,compatibilityFlag:i=!1,onModeChange:o}={}){const[r,a]=g(!1),[c,d]=g(!1),h=s("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 o=0,s=0,a=performance.now(),l=null;const c=Math.min(Math.max(30,n),240),h=t=>{const n=t-a;a=t,o>0&&(s+=1e3/n),o+=1,o>=c?s/(o-1||1)<e&&d(!0):l=window.requestAnimationFrame(h)};return l=window.requestAnimationFrame(h),()=>{null!==l&&window.cancelAnimationFrame(l)}},[t,r,i,n,e]);const p=u(()=>"full"===t||"lite"===t?t:i||r||c?"lite":"full",[t,i,r,c]);return l(()=>{o?h.current!==p&&(o(p),h.current=p):h.current=p},[p,o]),{effectiveMode:p,prefersReducedMotion:r,detectedLowPerformance:c,compatibilityFlag:i}}({mode:k,fpsThreshold:T,fpsSampleSize:E,compatibilityFlag:N,onModeChange:P}),V="lite"===L,D=u(()=>V?{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"},[V,i]),R=u(()=>V?{backgroundColor:"rgba(15, 23, 42, 0.28)"}:{willChange:"opacity"},[V]),z="string"==typeof p&&""!==p.trim()?p:void 0,I="string"==typeof c&&""!==c.trim()?c:z,U=t=>w.includes(t),X=t=>{S&&S(t),o()},H=(n,i=!1)=>e(Vl.button,{whileHover:V?void 0:{scale:1.01},whileTap:V?void 0:{scale:.99},transition:V?{duration:.1}:{duration:.16,ease:[.4,0,.2,1]},style:V?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:()=>X(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($,{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(Vl.button,{whileHover:V?void 0:{scale:1.01},whileTap:V?void 0:{scale:.99},transition:V?{duration:.1}:{duration:.16,ease:[.4,0,.2,1]},style:V?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 A(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(W,{className:"w-4 h-4 transition-transform "+(i?"rotate-180":"")})]}),V?i&&t("div",{className:"pt-2 space-y-1",children:n.children.map(t=>H(t,!0))}):t(fa,{initial:!1,children:i&&t(Vl.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=>H(t,!0))},`${n.id}-content`)})]},n.id)},_=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:()=>{m&&X(m)},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:I?t("img",{src:I,alt:d,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:o,className:"p-1 rounded-lg text-gray-500 hover:bg-gray-100 transition-colors",children:t(B,{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):H(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))})}),C&&t("div",{className:"p-4 border-t border-gray-200",children:C})]});return e(n,{children:[V?i&&t("div",{className:y,style:R,onClick:o,"data-motion-mode":L}):t(fa,{initial:!1,children:i&&t(Vl.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2,ease:[.25,1,.5,1]},className:y,style:R,onClick:o})}),V?t("div",{className:f,style:D,"data-motion-mode":L,children:_}):t(Vl.div,{initial:!1,animate:{x:i?0:"-100%",opacity:1},transition:{type:"spring",stiffness:280,damping:32,mass:.9},className:f,style:D,"data-motion-mode":L,children:_})]})},zl=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"},Bl=async(t,e)=>{const n=`${zl(t)}/student/downloadExcel/${e||"PASS"}`;return(await S.get(n,{responseType:"blob"})).data},jl=async(t,e,n)=>{const i=`${zl(e)}/student/uploadExcel`,o=new FormData;o.append("receivedExcelFile",t),"85"===e&&n&&o.append("clientName",n);return(await S.post(i,o,{transformRequest:[t=>t]})).data},Il=({backend:e,label:n="Descargar Lista de Estudiantes en Excel",fileName:i="students.xlsx",className:o,variant:r="primary",clientName:s,onSuccess:a,onError:l})=>{const[c,d]=g(!1);return t(k,{variant:r,onClick:async()=>{try{d(!0);let t=s;if("85"===e&&!t){const{value:e}=await 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 d(!1);t=e}const n=await Bl(e,t),o=URL.createObjectURL(n),r=document.createElement("a");r.href=o,r.download=i,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(o),await w.fire({title:"¡Descarga exitosa!",text:"El archivo se ha descargado correctamente",icon:"success",confirmButtonText:"OK"}),a?.()}catch(t){console.error("Download students excel failed",t);let e="No se pudo descargar el archivo. Por favor, inténtelo nuevamente.";const n=t;e=n?.response?.data?.message??("string"==typeof n?.response?.data?n.response.data:void 0)??(n?.response?.statusText?`Error ${n.response.status}: ${n.response.statusText}`:void 0)??e,await w.fire({title:"Error en la descarga",text:e,icon:"error",confirmButtonText:"OK"}),l?.(t)}finally{d(!1)}},className:o,children:c?"Descargando...":n})},Fl=({backend:i,label:o="Cargar Lista de Estudiantes en Excel",className:r,variant:a="primary",clientName:l,onSuccess:c,onError:d})=>{const h=s(null),[u,p]=g(!1);return e(n,{children:[t(k,{variant:a,onClick:()=>{h.current?.click()},className:r,children:u?"Subiendo...":o}),t("input",{type:"file",accept:".xlsx,.xls",ref:h,className:"hidden",onChange:async t=>{const e=t.target.files?.[0];if(!e)return;if([/\.xlsx$/i,/\.xls$/i].some(t=>t.test(e.name)))if(0!==e.size)try{p(!0);let t=l;if("85"===i&&!t){const{value:e}=await 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 p(!1);t=e}const n=await jl(e,i,t);let o="El archivo se ha cargado correctamente";n?.message?o=n.message:"string"==typeof n&&(o=n),await w.fire({title:"¡Carga exitosa!",text:o,icon:"success",confirmButtonText:"OK"}),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 n=t;e=n?.response?.data?.message??("string"==typeof n?.response?.data?n.response.data:void 0)??(n?.response?.statusText?`Error ${n.response.status}: ${n.response.statusText}`:void 0)??e,await w.fire({title:"Error en la carga",text:e,icon:"error",confirmButtonText:"OK"}),d?.(t)}finally{h.current&&(h.current.value=""),p(!1)}else await w.fire({title:"Archivo vacío",text:"El archivo seleccionado está vacío",icon:"warning",confirmButtonText:"OK"});else await w.fire({title:"Archivo inválido",text:"El archivo debe ser un Excel (.xlsx o .xls)",icon:"warning",confirmButtonText:"OK"})}})]})},Ol=({items:n,selectedItem:i=null,onSelectionChange:o,placeholder:r="Seleccionar elemento",searchPlaceholder:a="Buscar...",className:d="",disabled:h=!1,searchBy:m="both",caseSensitive:f=!1,exactMatch:y=!0,renderItem:v,renderSelectedItem:x})=>{const[b,w]=g(!1),[S,C]=g(""),k=s(null),T=s(null),E=s(null),N=s([]),P=c();l(()=>{const t=t=>{k.current&&!k.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||C("")},[b]);const M=u(()=>((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(m){case"name":return e===i;case"id":return n===i;case"both":return e===i||n===i;default:return!1}else switch(m){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,S),[n,S,f,y,m]),[A,L]=g(-1),V=p(()=>{w(!1)},[]),D=t=>{o(t),V(),T.current?.focus()},R=()=>{h||w(!b)},z=p(t=>{M.length&&L(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?L(t):M.length?L(t=>t>=0&&t<M.length?t:0):L(-1)}else L(-1)},[b,M,i]),l(()=>{if(A<0)return;const t=N.current[A];t?.scrollIntoView({block:"nearest"})},[A]);return N.current=[],e("div",{ref:k,className:`relative w-full ${d}`,onKeyDown:t=>{if(h)return;const e=t.target,n=e===T.current;if(!b)return void(!n||"Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),R()));if("Escape"===t.key)return t.preventDefault(),V(),void T.current?.focus();if(e instanceof HTMLButtonElement)return;const i=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement;switch(t.key){case"ArrowDown":t.preventDefault(),z(1);break;case"ArrowUp":t.preventDefault(),z(-1);break;case"Enter":A>=0&&A<M.length&&(t.preventDefault(),D(M[A]));break;case" ":case"Spacebar":if(i)break;A>=0&&A<M.length&&(t.preventDefault(),D(M[A]))}},children:[e("div",{ref:T,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:R,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(),o(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: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:a,value:S,onChange:t=>C(t.target.value),onClick:t=>t.stopPropagation(),"aria-autocomplete":"list","aria-controls":P})]})}),t("div",{id:P,className:"max-h-60 overflow-auto",role:"listbox","aria-activedescendant":A>=0?`${P}-option-${A}`:void 0,children:0===M.length?t("div",{className:"px-3 py-2 text-sm text-gray-500",children:S?"No se encontraron coincidencias exactas":"No hay elementos disponibles"}):M.map((e,n)=>t("div",{id:`${P}-option-${n}`,ref:t=>{N.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 "+(A===n?"bg-primary-botech-100":"hover:bg-primary-botech-50"),onClick:()=>D(e),role:"option","aria-selected":i?.id===e.id,onMouseEnter:()=>L(n),children:v?v(e):t("span",{className:"text-gray-900",children:e.name})},e.id))})]})]})},$l=({items:i,selectedItems:o=[],onSelectionChange:r,placeholder:a="Seleccionar elementos",searchPlaceholder:c="Buscar...",className:d="",disabled:h=!1,searchBy:u="both",caseSensitive:p=!1,exactMatch:m=!0,maxSelectedDisplay:f=3,renderItem:y,renderSelectedItem:v,renderSelectedBadge:x})=>{const[b,w]=g(!1),[S,C]=g(""),k=s(null),T=s(null);l(()=>{const t=t=>{k.current&&!k.current.contains(t.target)&&w(!1)};if(b)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[b]),l(()=>{b&&T.current&&T.current.focus()},[b]),l(()=>{b||C("")},[b]);const E=((t,e)=>{if(!e.trim())return t;const n=e.trim(),i=p?n:n.toLowerCase();return t.filter(t=>{const e=p?t.name:t.name.toLowerCase(),n=p?t.id:t.id.toLowerCase();if(m)switch(u){case"name":return e===i;case"id":return n===i;case"both":return e===i||n===i;default:return!1}else switch(u){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,S),N=t=>o.some(e=>e.id===t.id),P=t=>{r(o.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"})}),A=()=>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"})}),L=({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,{})})]}),V=o.slice(0,f),D=o.length-f;return e("div",{ref:k,className:`relative w-full ${d}`,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===o.length?t("span",{className:"text-gray-500",children:a}):e(n,{children:[V.map(e=>t("div",{onClick:t=>t.stopPropagation(),children:x?x(e,()=>P(e)):t(L,{item:e,onRemove:()=>P(e)})},e.id)),D>0&&e("span",{className:"text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded-md",children:["+",D," más"]})]})}),e("div",{className:"flex items-center space-x-1 ml-2",children:[o.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:T,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:S,onChange:t=>C(t.target.value),onClick:t=>t.stopPropagation()})]})}),o.length>0&&e("div",{className:"px-3 py-2 text-xs text-gray-600 bg-gray-50 border-b border-gray-100",children:[o.length," elemento(s) seleccionado(s)"]}),t("div",{className:"max-h-60 overflow-auto",children:0===E.length?t("div",{className:"px-3 py-2 text-sm text-gray-500",children:S?"No se encontraron coincidencias exactas":"No hay elementos disponibles"}):E.map(n=>{const i=N(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=>{N(t)?r(o.filter(e=>e.id!==t.id)):r([...o,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(A,{})})]},n.id)})})]})]})};function Wl(t){return R({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M622.3 271.1l-115.2-45c-4.1-1.6-12.6-3.7-22.2 0l-115.2 45c-10.7 4.2-17.7 14-17.7 24.9 0 111.6 68.7 188.8 132.9 213.9 9.6 3.7 18 1.6 22.2 0C558.4 489.9 640 420.5 640 296c0-10.9-7-20.7-17.7-24.9zM496 462.4V273.3l95.5 37.3c-5.6 87.1-60.9 135.4-95.5 151.8zM224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm96 40c0-2.5.8-4.8 1.1-7.2-2.5-.1-4.9-.8-7.5-.8h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c6.8 0 13.3-1.5 19.2-4-54-42.9-99.2-116.7-99.2-212z"},child:[]}]})(t)}function Ul(t){return R({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 96c48.6 0 88 39.4 88 88s-39.4 88-88 88-88-39.4-88-88 39.4-88 88-88zm0 344c-58.7 0-111.3-26.6-146.5-68.2 18.8-35.4 55.6-59.8 98.5-59.8 2.4 0 4.8.4 7.1 1.1 13 4.2 26.6 6.9 40.9 6.9 14.3 0 28-2.7 40.9-6.9 2.3-.7 4.7-1.1 7.1-1.1 42.9 0 79.7 24.4 98.5 59.8C359.3 421.4 306.7 448 248 448z"},child:[]}]})(t)}function Xl(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)}function Hl(t){return R({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M573.19 402.67l-139.79-320C428.43 71.29 417.6 64 405.68 64h-97.59l2.45 23.16c.5 4.72-3.21 8.84-7.96 8.84h-29.16c-4.75 0-8.46-4.12-7.96-8.84L267.91 64h-97.59c-11.93 0-22.76 7.29-27.73 18.67L2.8 402.67C-6.45 423.86 8.31 448 30.54 448h196.84l10.31-97.68c.86-8.14 7.72-14.32 15.91-14.32h68.8c8.19 0 15.05 6.18 15.91 14.32L348.62 448h196.84c22.23 0 36.99-24.14 27.73-45.33zM260.4 135.16a8 8 0 0 1 7.96-7.16h39.29c4.09 0 7.53 3.09 7.96 7.16l4.6 43.58c.75 7.09-4.81 13.26-11.93 13.26h-40.54c-7.13 0-12.68-6.17-11.93-13.26l4.59-43.58zM315.64 304h-55.29c-9.5 0-16.91-8.23-15.91-17.68l5.07-48c.86-8.14 7.72-14.32 15.91-14.32h45.15c8.19 0 15.05 6.18 15.91 14.32l5.07 48c1 9.45-6.41 17.68-15.91 17.68z"},child:[]}]})(t)}function Yl(t){return R({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z"},child:[]}]})(t)}function _l(t){return R({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},child:[]}]})(t)}function Gl(t){return R({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 255.531c.253 136.64-111.18 248.372-247.82 248.468-59.015.042-113.223-20.53-155.822-54.911-11.077-8.94-11.905-25.541-1.839-35.607l11.267-11.267c8.609-8.609 22.353-9.551 31.891-1.984C173.062 425.135 212.781 440 256 440c101.705 0 184-82.311 184-184 0-101.705-82.311-184-184-184-48.814 0-93.149 18.969-126.068 49.932l50.754 50.754c10.08 10.08 2.941 27.314-11.313 27.314H24c-8.837 0-16-7.163-16-16V38.627c0-14.254 17.234-21.393 27.314-11.314l49.372 49.372C129.209 34.136 189.552 8 256 8c136.81 0 247.747 110.78 248 247.531zm-180.912 78.784l9.823-12.63c8.138-10.463 6.253-25.542-4.21-33.679L288 256.349V152c0-13.255-10.745-24-24-24h-16c-13.255 0-24 10.745-24 24v135.651l65.409 50.874c10.463 8.137 25.541 6.253 33.679-4.21z"},child:[]}]})(t)}function Kl(t){return R({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm92.49,313h0l-20,25a16,16,0,0,1-22.49,2.5h0l-67-49.72a40,40,0,0,1-15-31.23V112a16,16,0,0,1,16-16h32a16,16,0,0,1,16,16V256l58,42.5A16,16,0,0,1,348.49,321Z"},child:[]}]})(t)}function ql(t){return R({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM96 424c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zm0-96c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zm0-96c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zm96-192c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm128 368c0 4.4-3.6 8-8 8H168c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-96c0 4.4-3.6 8-8 8H168c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-96c0 4.4-3.6 8-8 8H168c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16z"},child:[]}]})(t)}function Zl(t){return R({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"},child:[]}]})(t)}function Jl(t){return R({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"},child:[]}]})(t)}function Ql(t){return R({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M436 160H12c-6.627 0-12-5.373-12-12v-36c0-26.51 21.49-48 48-48h48V12c0-6.627 5.373-12 12-12h40c6.627 0 12 5.373 12 12v52h128V12c0-6.627 5.373-12 12-12h40c6.627 0 12 5.373 12 12v52h48c26.51 0 48 21.49 48 48v36c0 6.627-5.373 12-12 12zM12 192h424c6.627 0 12 5.373 12 12v260c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V204c0-6.627 5.373-12 12-12zm333.296 95.947l-28.169-28.398c-4.667-4.705-12.265-4.736-16.97-.068L194.12 364.665l-45.98-46.352c-4.667-4.705-12.266-4.736-16.971-.068l-28.397 28.17c-4.705 4.667-4.736 12.265-.068 16.97l82.601 83.269c4.667 4.705 12.265 4.736 16.97.068l142.953-141.805c4.705-4.667 4.736-12.265.068-16.97z"},child:[]}]})(t)}function tc(t){return R({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M488 128h-8V80c0-44.8-99.2-80-224-80S32 35.2 32 80v48h-8c-13.25 0-24 10.74-24 24v80c0 13.25 10.75 24 24 24h8v160c0 17.67 14.33 32 32 32v32c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32v-32h192v32c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32v-32h6.4c16 0 25.6-12.8 25.6-25.6V256h8c13.25 0 24-10.75 24-24v-80c0-13.26-10.75-24-24-24zM112 400c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32zm16-112c-17.67 0-32-14.33-32-32V128c0-17.67 14.33-32 32-32h256c17.67 0 32 14.33 32 32v128c0 17.67-14.33 32-32 32H128zm272 112c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32z"},child:[]}]})(t)}const ec=({title:n,description:i,onClose:o,showCloseIcon:r=!0,icon:s,actions:a,className:l="",...c})=>e("div",{className:`flex items-center justify-between gap-4 p-4 sm:p-6 bg-primary-botech text-white sm:rounded-t-xl ${l}`,...c,children:[e("div",{className:"flex items-start gap-3 min-w-0",children:[s&&t("span",{className:"mt-0.5 text-white text-xl",children:s}),e("div",{className:"flex-1 min-w-0",children:[n&&t("h2",{className:"text-xl font-semibold text-white",id:"bo-modal-title",children:n}),i&&t("p",{className:"mt-1 text-sm text-white/80",id:"bo-modal-description",children:i})]})]}),e("div",{className:"flex items-center gap-2",children:[a,r&&t("button",{type:"button","aria-label":"Cerrar",onClick:o,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(Xl,{className:"text-xl"})})]})]}),nc=({className:e="",...n})=>t("div",{className:`p-4 sm:p-6 ${e}`,...n}),ic=({className:e="",...n})=>t("div",{className:`flex justify-end gap-3 p-3 sm:p-4 border-t border-gray-200 bg-gray-50 ${e}`,...n}),oc={sm:"sm:max-w-sm",md:"sm:max-w-2xl",lg:"sm:max-w-4xl",xl:"sm:max-w-6xl"};const rc=({open:n,onClose:i,title:o,description:r,size:a="md",footer:c,showCloseIcon:d=!0,hideHeader:h=!1,closeOnEsc:u=!0,closeOnClickOutside:m=!0,className:f="",children:g,initialFocusRef:y,headerClassName:v,overlayClassName:x,headerIcon:b,headerActions:w,zIndex:S,animate:k=!1})=>{const T=s(null),E=s(null),N=Dl(),P=k&&!N;var M;l(()=>{if(!M)return;const{overflow:t}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[M=n]),function(t,e,n){l(()=>{if(!t)return;const i=e.current;if(!i)return;const o=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],r=()=>Array.from(i.querySelectorAll(o.join(","))).filter(t=>!t.hasAttribute("disabled")&&!t.getAttribute("aria-hidden")),s=document.activeElement;(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],o=e[e.length-1];t.shiftKey?document.activeElement!==n&&document.activeElement!==i||(o.focus(),t.preventDefault()):document.activeElement===o&&(n.focus(),t.preventDefault())};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),s?.focus?.()}},[t,e,n])}(n,T,y);const A=p(t=>{n&&"Escape"===t.key&&u&&(t.stopPropagation(),i())},[n,u,i]);l(()=>{if(n)return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[n,A]);const L=e("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center",style:S?{zIndex:S}:void 0,"aria-hidden":!n,ref:E,children:[t("button",{type:"button","aria-label":"Cerrar modal",onClick:()=>{m&&i()},className:`fixed inset-0 bg-black/50 ${x??""}`}),e("div",{role:"dialog","aria-modal":"true","aria-labelledby":o?"bo-modal-title":void 0,"aria-describedby":r?"bo-modal-description":void 0,className:`relative w-screen h-[100dvh] sm:w-full sm:h-auto ${oc[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:T,children:[!h&&t(ec,{title:o,description:r,onClose:i,showCloseIcon:d,className:v,icon:b,actions:w}),t("div",{className:"flex-1 overflow-y-auto",children:g}),c&&t(ic,{children:c})]})]}),V=t(fa,{children:n&&e("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center",style:S?{zIndex:S}:void 0,"aria-hidden":!n,ref:E,children:[t(Vl.button,{type:"button","aria-label":"Cerrar modal",initial:"hidden",animate:"visible",exit:"exit",variants:{hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},transition:{duration:.12,ease:"linear"},onClick:()=>{m&&i()},className:`fixed inset-0 bg-black/50 ${x??""}`}),e(Vl.div,{role:"dialog","aria-modal":"true","aria-labelledby":o?"bo-modal-title":void 0,"aria-describedby":r?"bo-modal-description":void 0,initial:"hidden",animate:"visible",exit:"exit",variants:{hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},transition:{duration:.12,ease:"linear"},className:`relative w-screen h-[100dvh] sm:w-full sm:h-auto ${oc[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:T,children:[!h&&t(ec,{title:o,description:r,onClose:i,showCloseIcon:d,className:v,icon:b,actions:w}),t("div",{className:"flex-1 overflow-y-auto",children:g}),c&&t(ic,{children:c})]})]})}),D=P?V:n?L:null;return"undefined"!=typeof document?C(D,document.body):D};function sc(t=!1){const[e,n]=g(t);return{open:e,onOpen:p(()=>n(!0),[]),onClose:p(()=>n(!1),[]),toggle:p(()=>n(t=>!t),[]),setOpen:n}}var ac,lc,cc;rc.Header=ec,rc.Body=nc,rc.Footer=ic,function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}(ac||(ac={})),function(t){t.EVEN="even",t.ODD="odd",t.HOVER="hover"}(lc||(lc={})),function(t){t.SM="sm",t.MD="md",t.LG="lg"}(cc||(cc={}));const dc=t=>{switch(t){case ac.CENTER:return"text-center";case ac.RIGHT:return"text-right";default:return"text-left"}},hc=t=>{switch(t){case cc.SM:return{header:"px-2 py-2 text-xs",cell:"px-2 py-2 text-xs",table:"text-xs"};case cc.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"}}},uc=t=>t%2==0?"bg-white":"bg-gray-50",pc=({columns:n,size:i,hasActions:o})=>{const r=hc(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} ${dc(e.alignment)} ${e.className||""}`,style:e.width?{width:e.width}:void 0,children:e.header},e.key)),o&&t("th",{className:`${r.header} text-center sticky right-0 bg-gray-50`,children:"ACCIONES"})]})})},mc=({columns:n,data:i,renderActions:o,size:r,onRowClick:s})=>{const a=hc(r);return t("tbody",{children:i.map((i,r)=>e("tr",{className:`${uc(r)} hover:bg-gray-100 transition-colors duration-150 ${s?"cursor-pointer":""}`,onClick:()=>s?.(i),children:[n.map(e=>t("td",{className:`${a.cell} ${dc(e.alignment)} ${e.className||""}`,children:e.accessor(i)},e.key)),o&&t("td",{className:`${a.cell} text-center sticky right-0 ${uc(r)} shadow-[-2px_0_4px_rgba(0,0,0,0.1)]`,children:o(i)})]},r))})},fc=({columns:n,data:i,renderActions:o,size:r=cc.MD,className:a="",onRowClick:c,isLoading:d=!1,emptyMessage:h="No hay datos disponibles"})=>{const u=s(null),{visibleData:p}=((t,e)=>{const[n,i]=g(t);return l(()=>{const n=()=>{if(!e.current)return;const n=e.current.getBoundingClientRect(),o=window.innerHeight-n.top-100,r=Math.max(1,Math.floor(o/60));i(t.slice(0,r))};n();const o=()=>{n()};window.addEventListener("resize",o);const r=new ResizeObserver(n);return e.current&&r.observe(e.current),()=>{window.removeEventListener("resize",o),r.disconnect()}},[t,e]),{visibleData:n}})(i,u);return d?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:u,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(pc,{columns:n,size:r,hasActions:!!o}),t(mc,{columns:n,data:p,renderActions:o,size:r,onRowClick:c})]})})})},gc=t=>new Intl.DateTimeFormat("es-CO",{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(t)),yc={datos_basicos:Ul,transporte:tc,contacto:Yl},vc={nombres:Ul,apellidos:Ul,curso:function(t){return R({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M622.34 153.2L343.4 67.5c-15.2-4.67-31.6-4.67-46.79 0L17.66 153.2c-23.54 7.23-23.54 38.36 0 45.59l48.63 14.94c-10.67 13.19-17.23 29.28-17.88 46.9C38.78 266.15 32 276.11 32 288c0 10.78 5.68 19.85 13.86 25.65L20.33 428.53C18.11 438.52 25.71 448 35.94 448h56.11c10.24 0 17.84-9.48 15.62-19.47L82.14 313.65C90.32 307.85 96 298.78 96 288c0-11.57-6.47-21.25-15.66-26.87.76-15.02 8.44-28.3 20.69-36.72L296.6 284.5c9.06 2.78 26.44 6.25 46.79 0l278.95-85.7c23.55-7.24 23.55-38.36 0-45.6zM352.79 315.09c-28.53 8.76-52.84 3.92-65.59 0l-145.02-44.55L128 384c0 35.35 85.96 64 192 64s192-28.65 192-64l-14.18-113.47-145.03 44.56z"},child:[]}]})(t)},codigoFamilia:function(t){return R({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z"},child:[]}]})(t)},transporte:tc,saleSolo:function(t){return R({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M208 96c26.5 0 48-21.5 48-48S234.5 0 208 0s-48 21.5-48 48 21.5 48 48 48zm94.5 149.1l-23.3-11.8-9.7-29.4c-14.7-44.6-55.7-75.8-102.2-75.9-36-.1-55.9 10.1-93.3 25.2-21.6 8.7-39.3 25.2-49.7 46.2L17.6 213c-7.8 15.8-1.5 35 14.2 42.9 15.6 7.9 34.6 1.5 42.5-14.3L81 228c3.5-7 9.3-12.5 16.5-15.4l26.8-10.8-15.2 60.7c-5.2 20.8.4 42.9 14.9 58.8l59.9 65.4c7.2 7.9 12.3 17.4 14.9 27.7l18.3 73.3c4.3 17.1 21.7 27.6 38.8 23.3 17.1-4.3 27.6-21.7 23.3-38.8l-22.2-89c-2.6-10.3-7.7-19.9-14.9-27.7l-45.5-49.7 17.2-68.7 5.5 16.5c5.3 16.1 16.7 29.4 31.7 37l23.3 11.8c15.6 7.9 34.6 1.5 42.5-14.3 7.7-15.7 1.4-35.1-14.3-43zM73.6 385.8c-3.2 8.1-8 15.4-14.2 21.5l-50 50.1c-12.5 12.5-12.5 32.8 0 45.3s32.7 12.5 45.2 0l59.4-59.4c6.1-6.1 10.9-13.4 14.2-21.5l13.5-33.8c-55.3-60.3-38.7-41.8-47.4-53.7l-20.7 51.5z"},child:[]}]})(t)},bajaSolo:function(t){return R({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M120 72c0-39.765 32.235-72 72-72s72 32.235 72 72c0 39.764-32.235 72-72 72s-72-32.236-72-72zm254.627 1.373c-12.496-12.497-32.758-12.497-45.254 0L242.745 160H141.254L54.627 73.373c-12.496-12.497-32.758-12.497-45.254 0-12.497 12.497-12.497 32.758 0 45.255L104 213.254V480c0 17.673 14.327 32 32 32h16c17.673 0 32-14.327 32-32V368h16v112c0 17.673 14.327 32 32 32h16c17.673 0 32-14.327 32-32V213.254l94.627-94.627c12.497-12.497 12.497-32.757 0-45.254z"},child:[]}]})(t)},direccionCasa:function(t){return R({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"},child:[]}]})(t)},rfid:function(t){return R({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 32H48C21.5 32 0 53.5 0 80v16h576V80c0-26.5-21.5-48-48-48zM0 432c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V128H0v304zm352-232c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zm0 64c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zm0 64c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zM176 192c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zM67.1 396.2C75.5 370.5 99.6 352 128 352h8.2c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h8.2c28.4 0 52.5 18.5 60.9 44.2 3.2 9.9-5.2 19.8-15.6 19.8H82.7c-10.4 0-18.8-10-15.6-19.8z"},child:[]}]})(t)},idSchoolRegistration:ql},xc={informacion_general:Ul,ultimas_novedades:ql,personas_autorizadas:Wl,ultimos_movimientos:Gl},bc={INGRESO:function(t){return R({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 448h-84c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h84c17.7 0 32-14.3 32-32V160c0-17.7-14.3-32-32-32h-84c-6.6 0-12-5.4-12-12V76c0-6.6 5.4-12 12-12h84c53 0 96 43 96 96v192c0 53-43 96-96 96zm-47-201L201 79c-15-15-41-4.5-41 17v96H24c-13.3 0-24 10.7-24 24v96c0 13.3 10.7 24 24 24h136v96c0 21.5 26 32 41 17l168-168c9.3-9.4 9.3-24.6 0-34z"},child:[]}]})(t)},SALIDA:function(t){return R({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497 273L329 441c-15 15-41 4.5-41-17v-96H152c-13.3 0-24-10.7-24-24v-96c0-13.3 10.7-24 24-24h136V88c0-21.4 25.9-32 41-17l168 168c9.3 9.4 9.3 24.6 0 34zM192 436v-40c0-6.6-5.4-12-12-12H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h84c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12H96c-53 0-96 43-96 96v192c0 53 43 96 96 96h84c6.6 0 12-5.4 12-12z"},child:[]}]})(t)}},wc="#FFFFFF",Sc="#F7F9FC",Cc="#E5E9F2",kc="#0F172A",Tc="#64748B",Ec="#94A3B8",Nc="#111F4B",Pc="#E2E8FF",Mc="#1D4ED8",Ac={informacion_general:"Información general",ultimas_novedades:"Últimas novedades",personas_autorizadas:"Personas autorizadas",ultimos_movimientos:"Últimos movimientos"},Lc=({open:n,onClose:i,context:o="pass",student:r,generalGroups:s,sections:a=[],photoUrl:c,title:d="Resumen del estudiante",description:h="Información consolidada del estudiante.",loading:p=!1,error:m,onReload:f})=>{const[y,v]=g(!0),[x,b]=g(!1),[w,S]=g("desktop");l(()=>{if("undefined"==typeof window)return;const t=()=>{const t=window.innerWidth;S(t<768?"mobile":t<1200?"tablet":"desktop")};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const C="mobile"===w,T="tablet"===w;l(()=>{if(p)v(!0),b(!1);else if(c){v(!0),b(!1);const t=new Image;t.onload=()=>{v(!1)},t.onerror=()=>{v(!1),b(!0)},t.src=c}else v(!1),b(!0)},[c,p]),l(()=>{n||(v(!0),b(!1))},[n,r.id]);const E=u(()=>{const t=s??[{id:"datos_basicos",title:"Datos básicos",rows:[{id:"nombres",label:"Nombres",value:r.nombres??""},{id:"apellidos",label:"Apellidos",value:r.apellidos??""},{id:"curso",label:"Curso",value:r.curso??""},{id:"codigoFamilia",label:"Código familia",value:r.codigoFamilia??""}]},{id:"transporte",title:"Transporte",rows:[{id:"transporte",label:"Transporte",value:r.transporte??""},{id:"saleSolo",label:"Sale solo",value:r.saleSolo??""},{id:"bajaSolo",label:"Baja solo",value:r.bajaSolo??""}]},{id:"contacto",title:"Contacto y registro",rows:[{id:"direccionCasa",label:"Dirección casa",value:r.direccionCasa??""},{id:"rfid",label:"RFID",value:r.rfid??""},{id:"idSchoolRegistration",label:"Registro escolar",value:r.idSchoolRegistration??""}]}];return{id:"informacion_general",title:Ac.informacion_general,items:t}},[s,r]),N=u(()=>`${r.nombres??""} ${r.apellidos??""}`.trim(),[r.nombres,r.apellidos]),P=n=>{switch(n.id){case"ultimas_novedades":return(i=n.items).length?t("div",{className:"space-y-4",children:i.map(n=>e("article",{className:"rounded-2xl border border-blue-200 bg-gradient-to-br from-blue-50 to-blue-100/50 p-4 text-sm shadow-sm ring-1 ring-blue-100",style:{borderRadius:24,border:"1px solid #BFDBFE",background:"linear-gradient(135deg, #EFF6FF 0%, rgba(219, 234, 254, 0.7) 100%)",padding:20,boxShadow:"0 18px 32px rgba(59, 130, 246, 0.15)"},children:[e("header",{className:"flex items-center justify-between",children:[e("span",{className:"inline-flex items-center gap-2 rounded-full bg-blue-100 px-3 py-1 text-xs font-semibold uppercase tracking-wide text-blue-800",children:[t(ql,{className:"h-3.5 w-3.5"})," ",n.tipo]}),e("time",{dateTime:n.fecha,className:"flex items-center gap-2 text-xs font-medium text-blue-700",children:[t(Ql,{className:"h-3.5 w-3.5"}),gc(n.fecha)]})]}),e("div",{className:"mt-3 space-y-2 text-blue-900",children:[e("p",{className:"text-xs font-semibold uppercase tracking-wide text-blue-600",children:["Estado: ",t("span",{className:"text-sm font-bold",children:n.estado})]}),e("p",{className:"text-sm",children:[t("span",{className:"font-semibold",children:"Responsable:"})," ",n.responsable]}),t("p",{className:"text-sm leading-relaxed",children:n.descripcion})]}),n.respuesta&&e("p",{className:"rounded-xl bg-white/70 px-3 py-2 text-sm text-blue-900 shadow-inner ring-1 ring-blue-100",children:[t("span",{className:"font-semibold",children:"Respuesta:"})," ",n.respuesta]})]},n.id))}):t("p",{className:"text-sm text-gray-500",children:"Sin novedades recientes."});case"personas_autorizadas":return(n=>n.length?t("div",{className:"grid gap-4",children:n.map(n=>e("article",{className:"rounded-2xl border border-emerald-200 bg-gradient-to-br from-emerald-50 to-emerald-100/40 p-4 text-sm shadow-sm ring-1 ring-emerald-100",style:{borderRadius:24,border:"1px solid #A7F3D0",background:"linear-gradient(135deg, #ECFDF5 0%, rgba(209, 250, 229, 0.65) 100%)",padding:20,boxShadow:"0 18px 32px rgba(16, 185, 129, 0.12)"},children:[e("header",{className:"flex items-center justify-between",children:[e("div",{className:"flex items-center gap-3",children:[t("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-white text-emerald-600 shadow-inner ring-1 ring-emerald-100",children:t(Wl,{className:"h-5 w-5"})}),e("div",{children:[t("span",{className:"text-sm font-semibold text-emerald-900",children:n.nombreCompleto}),e("p",{className:"text-xs text-emerald-700",children:[n.tipoDocumento," • ",n.numeroDocumento]})]})]}),t("span",{className:"rounded-full bg-emerald-100 px-3 py-1 text-xs font-semibold uppercase tracking-wide text-emerald-700",children:n.estado})]}),e("dl",{className:"mt-4 grid gap-3 text-xs text-emerald-900 sm:grid-cols-2",children:[e("div",{className:"rounded-xl bg-white/70 px-3 py-2 shadow-inner ring-1 ring-emerald-100",children:[t("dt",{className:"text-[0.65rem] font-semibold uppercase tracking-wide text-emerald-600",children:"Código familia"}),t("dd",{className:"text-sm font-semibold",children:n.codigoFamilia})]}),e("div",{className:"rounded-xl bg-white/70 px-3 py-2 shadow-inner ring-1 ring-emerald-100",children:[t("dt",{className:"text-[0.65rem] font-semibold uppercase tracking-wide text-emerald-600",children:"Vigencia"}),e("dd",{className:"text-sm font-semibold",children:[n.vigencia.desde," – ",n.vigencia.hasta]})]}),e("div",{className:"rounded-xl bg-white/70 px-3 py-2 shadow-inner ring-1 ring-emerald-100 sm:col-span-2",children:[t("dt",{className:"text-[0.65rem] font-semibold uppercase tracking-wide text-emerald-600",children:"Autorizado por"}),t("dd",{className:"text-sm font-semibold",children:n.autorizadoPor})]})]})]},`${n.numeroDocumento}-${n.vigencia.desde}`))}):t("p",{className:"text-sm text-gray-500",children:"No hay personas autorizadas registradas."}))(n.items);case"ultimos_movimientos":return(n=>n.length?e("div",{className:"relative space-y-4 text-sm",style:{position:"relative"},children:[t("div",{className:"absolute left-[1.15rem] top-3 bottom-3 w-px bg-slate-200",style:{position:"absolute",left:28,top:12,bottom:12,width:2,backgroundColor:Cc}}),n.map((n,i)=>{const o=bc[n.tipo.toUpperCase()]??Gl;return e("div",{className:"relative pl-14",style:{position:"relative",paddingLeft:74},children:[t("div",{className:"absolute left-0 top-1 flex h-10 w-10 items-center justify-center rounded-full bg-white text-slate-600 shadow-sm ring-1 ring-slate-200",style:{position:"absolute",left:6,top:4,width:46,height:46,borderRadius:"50%",backgroundColor:wc,color:Tc,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 16px 30px rgba(15, 23, 42, 0.08)",border:`1px solid ${Cc}`},children:t(o,{size:16})}),e("div",{className:"rounded-2xl border border-slate-200 bg-white p-4 shadow-sm ring-1 ring-slate-100",style:{borderRadius:24,border:`1px solid ${Cc}`,backgroundColor:wc,padding:20,boxShadow:"0 18px 32px rgba(15, 23, 42, 0.08)"},children:[e("header",{className:"flex items-center justify-between text-xs text-slate-500",children:[t("span",{className:"inline-flex items-center gap-2 rounded-full bg-slate-100 px-3 py-1 text-xs font-semibold uppercase tracking-wide text-slate-700",children:n.tipo}),t("time",{dateTime:n.fecha,children:gc(n.fecha)})]}),e("div",{className:"mt-3 space-y-2 text-slate-700",children:[e("p",{children:[t("span",{className:"font-semibold",children:"Lector:"})," ",n.lector.descripcion," (",n.lector.id,")"]}),n.observaciones&&t("p",{className:"rounded-xl bg-slate-50 px-3 py-2 text-sm shadow-inner ring-1 ring-slate-100",children:n.observaciones})]})]})]},`${n.fecha}-${i}`)})]}):t("p",{className:"text-sm text-gray-500",children:"Sin movimientos recientes."}))(n.items);case"paradas":return(n=>n.length?t("div",{className:"student-summary-paradas",style:{display:"grid",gap:C?14:T?16:18},children:n.map((n,i)=>{const o=`Parada ${n.orden??i+1}`,r=n.time??n.horaProgramada;return e("article",{style:{borderRadius:24,border:`1px solid ${Cc}`,backgroundColor:wc,padding:20,boxShadow:"0 20px 38px rgba(59, 130, 246, 0.08)"},children:[e("header",{style:{display:"flex",flexDirection:C?"column":"row",alignItems:C?"flex-start":"center",justifyContent:"space-between",gap:16},children:[e("div",{style:{display:"flex",alignItems:"center",gap:12},children:[t("div",{style:{width:44,height:44,borderRadius:14,backgroundColor:"#EFF6FF",color:"#1D4ED8",display:"flex",alignItems:"center",justifyContent:"center"},children:t(Yl,{size:20})}),e("div",{children:[t("p",{style:{margin:0,fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:Ec},children:o}),t("p",{style:{margin:"4px 0 0",fontSize:15,fontWeight:600,color:kc},children:n.address??"Dirección no disponible"})]})]}),r&&e("span",{style:{display:"inline-flex",alignItems:"center",gap:8,borderRadius:999,padding:C?"6px 12px":"6px 14px",backgroundColor:Sc,border:`1px solid ${Cc}`,fontSize:12,fontWeight:600,color:Tc},children:[t(Kl,{size:12}),r]})]}),e("div",{style:{marginTop:16,display:"grid",gap:C?10:12,gridTemplateColumns:C?"1fr":"repeat(auto-fit, minmax(180px, 1fr))"},children:[n.estado&&e("div",{style:{borderRadius:18,backgroundColor:Sc,border:`1px solid ${Cc}`,padding:"12px 16px"},children:[t("p",{style:{margin:0,fontSize:11,letterSpacing:"0.08em",textTransform:"uppercase",fontWeight:700,color:Ec},children:"Estado"}),t("p",{style:{margin:"6px 0 0",fontSize:14,fontWeight:600,color:kc},children:n.estado})]}),n.horaReal&&e("div",{style:{borderRadius:18,backgroundColor:Sc,border:`1px solid ${Cc}`,padding:"12px 16px"},children:[t("p",{style:{margin:0,fontSize:11,letterSpacing:"0.08em",textTransform:"uppercase",fontWeight:700,color:Ec},children:"Hora real"}),t("p",{style:{margin:"6px 0 0",fontSize:14,fontWeight:600,color:kc},children:n.horaReal})]}),n.observaciones&&t("div",{style:{borderRadius:18,backgroundColor:"#EEF2FF",border:`1px solid ${Cc}`,padding:"12px 16px",gridColumn:"1 / -1"},children:t("p",{style:{margin:0,fontSize:12,fontWeight:600,color:"#4338CA"},children:n.observaciones})}),n.coordinates&&e("div",{style:{borderRadius:18,backgroundColor:Sc,border:`1px solid ${Cc}`,padding:"12px 16px",gridColumn:"1 / -1"},children:[t("p",{style:{margin:0,fontSize:11,letterSpacing:"0.08em",textTransform:"uppercase",fontWeight:700,color:Ec},children:"Coordenadas"}),e("p",{style:{margin:"6px 0 0",fontSize:14,fontWeight:600,color:kc},children:[n.coordinates.lat.toFixed(6),", ",n.coordinates.lng.toFixed(6)]})]})]})]},n.id??`${i}`)})}):t("p",{className:"text-sm text-gray-500",children:"Sin paradas registradas."}))(n.items);case"recorridos":return(n=>n.length?t("div",{className:"student-summary-recorridos",style:{display:"grid",gap:C?16:T?18:20},children:n.map(n=>e("article",{style:{borderRadius:26,border:`1px solid ${Cc}`,backgroundColor:wc,padding:22,boxShadow:"0 22px 44px rgba(79, 70, 229, 0.1)"},children:[e("header",{style:{display:"flex",flexDirection:C?"column":"row",alignItems:"flex-start",justifyContent:"space-between",gap:18},children:[e("div",{style:{display:"flex",alignItems:"center",gap:12},children:[t("div",{style:{width:C?42:46,height:C?42:46,borderRadius:16,backgroundColor:"#EDE9FE",color:"#4338CA",display:"flex",alignItems:"center",justifyContent:"center"},children:t(Hl,{size:C?18:20})}),e("div",{children:[t("p",{style:{margin:0,fontSize:C?11:12,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:Ec},children:"Recorrido"}),t("p",{style:{margin:"4px 0 0",fontSize:C?15:16,fontWeight:600,color:kc},children:n.nombreRecorrido}),n.tipoRecorrido&&t("p",{style:{margin:"2px 0 0",fontSize:C?12:13,color:Tc},children:n.tipoRecorrido})]})]}),e("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-end"},children:[n.estadoActual&&t("span",{style:{display:"inline-flex",alignItems:"center",padding:C?"5px 12px":"6px 14px",borderRadius:999,backgroundColor:"#E0E7FF",color:"#312E81",fontSize:12,fontWeight:600},children:n.estadoActual}),n.numeroFlota&&e("span",{style:{display:"inline-flex",alignItems:"center",padding:C?"5px 12px":"6px 14px",borderRadius:999,backgroundColor:Sc,color:Tc,fontSize:12,fontWeight:600},children:["Flota ",n.numeroFlota]}),n.placaBus&&t("span",{style:{display:"inline-flex",alignItems:"center",padding:C?"5px 12px":"6px 14px",borderRadius:999,backgroundColor:Sc,color:Tc,fontSize:12,fontWeight:600},children:n.placaBus})]})]}),e("div",{style:{marginTop:20,display:"grid",gap:C?12:14,gridTemplateColumns:C?"1fr":"repeat(auto-fit, minmax(220px, 1fr))"},children:[(n.horaInicio||n.horaFin)&&e("div",{style:{borderRadius:20,backgroundColor:Sc,border:`1px solid ${Cc}`,padding:C?"12px 16px":"14px 18px"},children:[t("p",{style:{margin:0,fontSize:C?10:11,letterSpacing:"0.08em",textTransform:"uppercase",fontWeight:700,color:Ec},children:"Horario"}),e("p",{style:{margin:"6px 0 0",fontSize:14,fontWeight:600,color:kc},children:[n.horaInicio??"—"," – ",n.horaFin??"—"]})]}),(n.nombreAuxiliar||n.nombreOperario)&&e("div",{style:{borderRadius:20,backgroundColor:Sc,border:`1px solid ${Cc}`,padding:C?"12px 16px":"14px 18px"},children:[t("p",{style:{margin:0,fontSize:C?10:11,letterSpacing:"0.08em",textTransform:"uppercase",fontWeight:700,color:Ec},children:"Equipo"}),e("p",{style:{margin:"6px 0 0",fontSize:14,fontWeight:600,color:kc},children:["Auxiliar: ",n.nombreAuxiliar??"—"]}),e("p",{style:{margin:"2px 0 0",fontSize:14,fontWeight:600,color:kc},children:["Operario: ",n.nombreOperario??"—"]})]}),n.diasRecorrido&&e("div",{style:{borderRadius:20,backgroundColor:Sc,border:`1px solid ${Cc}`,padding:C?"12px 16px":"14px 18px"},children:[t("p",{style:{margin:0,fontSize:C?10:11,letterSpacing:"0.08em",textTransform:"uppercase",fontWeight:700,color:Ec},children:"Días programados"}),t("p",{style:{margin:"6px 0 0",fontSize:14,fontWeight:600,color:kc},children:n.diasRecorrido})]})]}),n.ultimoEvento&&t("div",{style:{marginTop:18,borderRadius:20,backgroundColor:"#EEF2FF",border:`1px solid ${Cc}`,padding:C?"12px 16px":"14px 18px",color:"#312E81",fontSize:14,fontWeight:600},children:n.ultimoEvento})]},n.idRecorrido))}):t("p",{className:"text-sm text-gray-500",children:"Sin recorridos asociados."}))(n.items);default:return null}var i},M=a??[];return e(rc,{open:n,onClose:i,size:"xl",overlayClassName:"z-[1000]",className:"z-[1001] [&_.modal-content]:!max-h-[80vh] [&_.modal-body]:!max-h-none [&_.modal-body]:!overflow-visible",title:d,description:h,children:[e(nc,{className:"px-4 pb-6",children:[m&&e("div",{className:"rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-700",children:[t("p",{className:"font-semibold",children:"No se pudo cargar el resumen."}),t("p",{className:"mt-1",children:m}),f&&t(k,{variant:"secondary",onClick:f,className:"mt-3",children:"Reintentar"})]}),e("div",{className:"space-y-8 px-1",style:{display:"flex",flexDirection:"column",gap:C?24:32,maxWidth:1180,margin:"0 auto",width:"100%"},children:[e("div",{className:"student-summary-layout",style:{display:"grid",gap:C?20:T?24:28,gridTemplateColumns:C||T?"1fr":"minmax(320px, 360px) minmax(640px, 1fr)",alignItems:"stretch",width:"100%"},children:[t("aside",{className:"student-summary-profile",style:{borderRadius:26,border:`1px solid ${Cc}`,backgroundColor:wc,padding:C?20:T?26:32,textAlign:"center",boxShadow:"0 26px 48px rgba(15, 23, 42, 0.1)"},children:e("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:C?18:24},children:[t("div",{style:{position:"relative",width:C?110:T?128:140,height:C?110:T?128:140,overflow:"hidden",borderRadius:"50%",border:`4px solid ${wc}`,backgroundColor:Sc,boxShadow:"0 20px 40px rgba(15, 23, 42, 0.14)"},children:y?t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",backgroundColor:Sc},children:t("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-slate-300 border-t-slate-500"})}):c&&!x?t("img",{src:c,alt:N||"Foto del estudiante",style:{width:"100%",height:"100%",objectFit:"cover"},loading:"lazy"}):t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",backgroundColor:Sc,color:Tc},children:t(Ul,{size:C?48:T?56:60})})}),e("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[t("h2",{style:{margin:0,fontSize:C?18:22,fontWeight:600,color:kc},children:N||"Nombre no disponible"}),r.curso&&e("p",{style:{margin:0,fontSize:C?13:15,color:Tc},children:["Curso"," ",t("span",{style:{fontWeight:600,color:"#4338CA"},children:r.curso})]})]}),e("div",{style:{display:"flex",flexDirection:"column",gap:12,alignItems:"center"},children:[r.id&&e("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,backgroundColor:Sc,border:`1px solid ${Cc}`,borderRadius:20,padding:C?"10px 16px":"12px 20px",boxShadow:"0 14px 28px rgba(15, 23, 42, 0.08)",minWidth:C?200:240},children:[t("span",{style:{fontSize:C?10:11,letterSpacing:"0.08em",textTransform:"uppercase",color:Ec,fontWeight:700},children:"Identificador estudiante"}),t("span",{style:{fontSize:17,fontWeight:600,color:kc},children:r.id})]}),e("span",{style:{display:"inline-flex",alignItems:"center",padding:C?"5px 14px":"6px 16px",borderRadius:999,fontSize:12,fontWeight:600,backgroundColor:Pc,color:Mc,letterSpacing:"0.04em"},children:["Contexto: ",o.toUpperCase()]})]})]})}),t("div",{className:"student-summary-general-wrapper",style:{borderRadius:26,border:`1px solid ${Cc}`,backgroundColor:wc,padding:32,boxShadow:"0 24px 45px rgba(15, 23, 42, 0.08)"},children:(n=>{const i=xc[n.id]??_l,o=C?1:T?2:3,r=Math.min(Math.max(n.items.length,1),o);return e("section",{className:"student-summary-general",style:{display:"flex",flexDirection:"column",gap:24},children:[e("header",{className:"student-summary-general__header",style:{display:"flex",flexDirection:C?"column":"row",gap:16,alignItems:"flex-start",paddingLeft:C?0:4},children:[t("div",{className:"student-summary-general__header-icon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:C?46:56,height:C?46:56,borderRadius:18,backgroundColor:Nc,color:wc,boxShadow:"0 18px 30px rgba(17, 24, 39, 0.18)"},children:t(i,{size:C?18:22})}),e("div",{children:[t("h3",{style:{margin:0,fontSize:C?16:18,fontWeight:600,color:kc},children:n.title}),t("p",{style:{margin:"6px 0 0",fontSize:C?13:14,color:Tc},children:"Información clave agrupada en tarjetas para una lectura rápida."})]})]}),t("div",{className:"student-summary-general__grid",style:{display:"grid",gap:C?14:T?18:20,gridTemplateColumns:`repeat(${r}, minmax(0, 1fr))`},children:n.items.map(n=>{const o=yc[n.id]??i;return e("article",{className:"student-summary-card",style:{borderRadius:26,border:`1px solid ${Cc}`,backgroundColor:wc,boxShadow:"0 18px 35px rgba(15, 23, 42, 0.08)",padding:C?16:T?18:20,display:"flex",flexDirection:"column",gap:14},children:[e("div",{style:{display:"flex",alignItems:"center",gap:12,paddingBottom:12,borderBottom:`1px solid ${Cc}`},children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:16,backgroundColor:Sc,color:Tc},children:t(o,{size:20})}),t("h4",{style:{margin:0,fontSize:14,fontWeight:600,color:kc},children:n.title})]}),t("div",{style:{display:"flex",flexDirection:"column",gap:12},children:n.rows.map(n=>{const i=vc[n.id]??_l;return e("div",{style:{display:"flex",alignItems:"center",gap:C?10:12,borderRadius:20,backgroundColor:Sc,border:`1px solid ${Cc}`,padding:C?"10px 14px":"12px 16px",boxShadow:"0 12px 22px rgba(15, 23, 42, 0.05)"},children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:C?36:40,height:C?36:40,borderRadius:"50%",backgroundColor:wc,color:Tc,boxShadow:"0 12px 20px rgba(15, 23, 42, 0.06)"},children:t(i,{size:C?14:16})}),e("div",{style:{minWidth:0},children:[t("p",{style:{margin:0,fontSize:C?10:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:Ec},children:n.label}),t("p",{style:{margin:"4px 0 0",fontSize:C?13:14,fontWeight:600,color:kc,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:(o=n.value,null==o?"—":"string"==typeof o?o.trim()?o:"—":o)})]})]},n.id);var o})})]},n.id)})})]})})(E)})]}),M.length>0?t("div",{className:"student-summary-modules",style:{display:"grid",gap:C?18:T?20:24,gridTemplateColumns:C?"1fr":T?"repeat(auto-fit, minmax(300px, 1fr))":"repeat(auto-fit, minmax(360px, 1fr))"},children:M.map(n=>{const i=xc[n.id]??_l,o=n.title??Ac[n.id]??"Sección";return e("section",{className:"student-summary-module",style:{display:"flex",flexDirection:"column",gap:16,borderRadius:26,border:`1px solid ${Cc}`,backgroundColor:wc,padding:C?18:T?22:24,boxShadow:"0 24px 45px rgba(15, 23, 42, 0.08)"},children:[e("header",{style:{display:"flex",gap:14,alignItems:"flex-start"},children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:C?40:46,height:C?40:46,borderRadius:16,backgroundColor:Sc,color:Tc},children:t(i,{size:C?18:20})}),e("div",{children:[t("h3",{style:{margin:0,fontSize:C?15:17,fontWeight:600,color:kc},children:o}),n.meta?.maxItems&&e("p",{style:{margin:"6px 0 0",fontSize:12,color:Tc},children:["Mostrando hasta ",n.meta.maxItems," registros recientes."]})]})]}),t("div",{className:"flex-1",children:P(n)})]},n.id)})}):!p&&!m&&t("div",{className:"flex h-48 items-center justify-center",children:t("span",{className:"text-sm text-gray-500",children:"Sin información adicional disponible."})})]})]}),t(ic,{children:t(k,{variant:"secondary",onClick:i,children:"Cerrar"})})]})};function Vc(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"},child:[]}]})(t)}function Dc(){return t("div",{className:"flex min-h-screen flex-col items-center justify-center bg-gray-50",children:e("div",{className:"container flex max-w-md flex-col items-center justify-center gap-8 px-4 py-16 text-center",children:[t("div",{className:"flex items-center justify-center",children:e("div",{className:"relative flex flex-col items-center",children:[t("div",{className:"h-80 w-4 bg-gray-700"}),e("div",{className:"top-4 flex h-auto w-auto min-w-[12rem] flex-col items-center justify-center rounded-lg bg-primary-botech text-white shadow-lg p-4",children:[t("div",{className:"flex-1 mb-2",children:e("h1",{className:"text-xl/4 text-white font-seguimiento-h",children:["BO-TECH ",t("span",{className:"text-sm block",children:"SEGUIMIENTO"})]})}),t("span",{className:"text-4xl font-bold",children:"404"}),t("span",{className:"text-xs mt-1",children:"RUTA NO ENCONTRADA"})]})]})}),e("div",{className:"space-y-3",children:[t("h2",{className:"text-2xl font-bold tracking-tight text-gray-900",children:"¡Esta parada no existe!"}),t("p",{className:"text-gray-600",children:"Parece que estás esperando en una parada de autobús que no está en nuestra ruta. La página que buscas no se encuentra disponible."})]}),e("button",{className:"flex items-center gap-2 bg-primary-botech hover:bg-primary-botech/90 text-white px-4 py-2 rounded",onClick:()=>{window.location.href="/"},children:[t(Vc,{className:"h-4 w-4"}),t("span",{children:"Volver a la ruta principal"})]})]})})}const Rc="#1e40af",zc="#93c5fd",Bc="#60a5fa",jc="#1e3a8a",Ic=`\n .ba-left {\n display: none;\n flex-direction: column;\n }\n .ba-right {\n width: 100%;\n }\n .ba-sysname {\n position: absolute;\n top: 2rem;\n left: 0;\n right: 0;\n display: flex;\n justify-content: center;\n pointer-events: none;\n }\n @media (min-width: 768px) {\n .ba-left { display: flex; width: 50%; padding: 1.5rem; }\n .ba-right { width: 50%; padding: 4rem; }\n .ba-sysname { top: 3rem; }\n }\n\n /* Inputs */\n .ba-input {\n width: 100%;\n padding: 14px 16px;\n background: #f5f7f9;\n border: 1px solid transparent;\n border-radius: 8px;\n font-size: 14px;\n color: #111827;\n outline: none;\n transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;\n box-sizing: border-box;\n font-family: inherit;\n }\n .ba-input:focus {\n background: white;\n border-color: ${Rc};\n box-shadow: 0 0 0 1px ${Rc};\n }\n .ba-input::placeholder { color: #9ca3af; }\n .ba-input:disabled { opacity: 0.6; cursor: not-allowed; }\n\n /* Monospace input (product key) */\n .ba-input-mono {\n font-family: monospace;\n letter-spacing: 1.2px;\n }\n\n /* Primary black button */\n .ba-btn-primary {\n width: 100%;\n padding: 16px;\n background: #111827;\n color: white;\n font-size: 15px;\n font-weight: 600;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n letter-spacing: 0.025em;\n transition: background 0.2s, box-shadow 0.2s;\n font-family: inherit;\n }\n .ba-btn-primary:hover:not(:disabled) {\n background: #1f2937;\n box-shadow: 0 4px 12px rgba(0,0,0,0.15);\n }\n .ba-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }\n\n /* Blue primary button (modal) */\n .ba-btn-blue {\n width: 100%;\n padding: 10px 16px;\n background: ${Rc};\n color: white;\n font-size: 14px;\n font-weight: 600;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n transition: opacity 0.15s;\n font-family: inherit;\n }\n .ba-btn-blue:hover:not(:disabled) { opacity: 0.9; }\n .ba-btn-blue:disabled { background: #9ca3af; cursor: not-allowed; }\n\n /* Secondary text button */\n .ba-btn-secondary {\n width: 100%;\n padding: 12px;\n background: none;\n color: #4b5563;\n font-size: 14px;\n font-weight: 600;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n transition: color 0.15s;\n font-family: inherit;\n }\n .ba-btn-secondary:hover:not(:disabled) { color: #111827; }\n .ba-btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }\n\n /* Google overlay button (visual only, invisible Google iframe sits on top) */\n .ba-btn-google {\n width: 100%;\n padding: 16px;\n background: white;\n color: #111827;\n font-size: 15px;\n font-weight: 600;\n border: 1px solid #d1d5db;\n border-radius: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n pointer-events: none;\n transition: background 0.15s;\n letter-spacing: 0.025em;\n }\n\n /* Link-style buttons */\n .ba-link {\n background: none;\n border: none;\n cursor: pointer;\n font-weight: 700;\n color: #111827;\n transition: color 0.15s;\n font-size: inherit;\n font-family: inherit;\n padding: 0;\n }\n .ba-link:hover { color: ${"#1d4ed8"}; }\n\n .ba-link-blue {\n background: none;\n border: none;\n cursor: pointer;\n font-weight: 600;\n color: ${"#2563eb"};\n transition: color 0.15s;\n font-size: 13px;\n font-family: inherit;\n padding: 0;\n }\n .ba-link-blue:hover { color: ${jc}; }\n\n .ba-link-gray {\n background: none;\n border: none;\n cursor: pointer;\n font-weight: 600;\n color: #6b7280;\n transition: color 0.15s;\n font-size: 13px;\n font-family: inherit;\n padding: 0;\n }\n .ba-link-gray:hover { color: ${Rc}; }\n\n /* Password eye toggle */\n .ba-eye {\n position: absolute;\n right: 16px;\n top: 50%;\n transform: translateY(-50%);\n background: none;\n border: none;\n cursor: pointer;\n color: #6b7280;\n display: flex;\n align-items: center;\n transition: color 0.15s;\n padding: 0;\n }\n .ba-eye:hover { color: ${Rc}; }\n\n /* Step indicator circles */\n .ba-step-active {\n width: 32px; height: 32px;\n border-radius: 50%;\n background: ${Rc};\n color: white;\n display: flex; align-items: center; justify-content: center;\n font-size: 14px; font-weight: 500;\n }\n .ba-step-done {\n width: 32px; height: 32px;\n border-radius: 50%;\n background: #22c55e;\n color: white;\n display: flex; align-items: center; justify-content: center;\n font-size: 14px; font-weight: 500;\n }\n .ba-step-inactive {\n width: 32px; height: 32px;\n border-radius: 50%;\n background: #d1d5db;\n color: #4b5563;\n display: flex; align-items: center; justify-content: center;\n font-size: 14px; font-weight: 500;\n }\n\n /* Modal */\n .ba-modal-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0,0,0,0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n padding: 16px;\n }\n .ba-modal-close {\n background: none; border: none; cursor: pointer;\n color: #9ca3af; display: flex;\n transition: color 0.15s; padding: 0;\n }\n .ba-modal-close:hover { color: #4b5563; }\n\n /* Divider */\n .ba-divider {\n position: relative;\n margin: 20px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .ba-divider::before {\n content: '';\n position: absolute;\n left: 0; right: 0; top: 50%;\n border-top: 1px solid #d1d5db;\n }\n .ba-divider span {\n position: relative;\n background: white;\n padding: 0 8px;\n font-size: 14px;\n color: #6b7280;\n }\n\n /* Status boxes */\n .ba-status-success { background: #e7f7ee; color: #1e7e34; border-radius: 6px; padding: 12px; margin-top: 16px; font-size: 14px; }\n .ba-status-error { background: #fdecea; color: #b00020; border-radius: 6px; padding: 12px; margin-top: 16px; font-size: 14px; }\n .ba-status-loading { background: transparent; color: #374151; border-radius: 6px; padding: 12px; margin-top: 16px; font-size: 14px; }\n`;function Fc({systemName:n,leftPanelTitle:i,quote:o='"Todas las cosas buenas en este mundo empezaron con un sueño."',quoteAuthor:r="— Willy Wonka",children:s}){return e("div",{style:{display:"flex",minHeight:"100vh",backgroundColor:"white"},children:[t("style",{children:Ic}),e("div",{style:{display:"flex",width:"100%",minHeight:"100vh"},children:[t("div",{className:"ba-left",style:{backgroundColor:"white"},children:e("div",{style:{position:"relative",width:"100%",height:"100%",borderRadius:"2.5rem",backgroundColor:"black",display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"3.5rem",overflow:"hidden",boxShadow:"0 10px 25px -5px rgba(0,0,0,0.1), 0 4px 10px -5px rgba(0,0,0,0.04)",border:"1px solid #f3f4f6"},children:[t("div",{style:{position:"absolute",inset:0,background:`linear-gradient(135deg, ${jc}, black 60%, black)`,opacity:.85,pointerEvents:"none"}}),t("div",{style:{position:"absolute",top:"-10%",left:"-20%",width:"150%",height:"60%",background:"linear-gradient(45deg, rgba(37,99,235,0.3), rgba(96,165,250,0.1))",filter:"blur(80px)",borderRadius:"50%",transform:"rotate(-15deg)",pointerEvents:"none"}}),t("div",{style:{position:"absolute",top:"20%",left:"-10%",width:"120%",height:"40%",background:"linear-gradient(90deg, transparent, rgba(96,165,250,0.8), transparent)",filter:"blur(40px)",mixBlendMode:"screen",transform:"rotate(10deg)",opacity:.6,pointerEvents:"none"}}),t("div",{style:{position:"absolute",top:"35%",left:"-10%",width:"120%",height:"30%",background:"linear-gradient(90deg, transparent, rgba(147,197,253,0.8), transparent)",filter:"blur(30px)",mixBlendMode:"screen",transform:"rotate(-5deg)",opacity:.7,pointerEvents:"none"}}),t("div",{style:{position:"absolute",bottom:"-10%",right:"-20%",width:"120%",height:"60%",background:"linear-gradient(225deg, rgba(29,78,216,0.4), transparent)",filter:"blur(100px)",borderRadius:"50%",transform:"rotate(25deg)",pointerEvents:"none"}}),t("div",{style:{position:"relative",zIndex:10,width:"100%",marginBottom:"2.5rem"},children:e("p",{style:{fontSize:"2.25rem",letterSpacing:"-0.025em",fontWeight:700,textTransform:"uppercase",opacity:.9,display:"flex",alignItems:"center",gap:"1rem",color:"white",fontFamily:"Afacad, sans-serif",margin:0},children:["BOTECH",t("span",{style:{height:"1px",width:"4rem",backgroundColor:"rgba(255,255,255,0.4)",display:"block"}})]})}),e("div",{style:{position:"relative",zIndex:10,marginTop:"auto",paddingBottom:"1rem"},children:[t("h2",{style:{fontSize:"3rem",fontFamily:'Georgia, "Times New Roman", serif',lineHeight:1,color:"white",letterSpacing:"-0.025em",margin:"0 0 1.5rem 0"},children:i}),e("div",{style:{borderLeft:`2px solid ${Bc}`,paddingLeft:"1rem",paddingTop:"0.25rem",paddingBottom:"0.25rem"},children:[t("p",{style:{fontSize:"14px",fontWeight:300,color:"#d1d5db",maxWidth:"320px",lineHeight:1.625,opacity:.9,fontStyle:"italic",margin:"0 0 0.5rem 0"},children:o}),t("p",{style:{fontSize:"11px",fontWeight:700,color:zc,textTransform:"uppercase",letterSpacing:"0.1em",margin:0},children:r})]})]})]})}),e("div",{className:"ba-right",style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:"white",padding:"2rem",position:"relative"},children:[t("div",{className:"ba-sysname",children:t("span",{style:{fontSize:"2.5rem",fontWeight:700,letterSpacing:"-0.025em",color:Rc,fontFamily:"Afacad, sans-serif"},children:n})}),s]})]})]})}function Oc(t){return R({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"},child:[]}]})(t)}function $c(t){return R({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 0 0 0-51.5zm-63.57-320.64L836 122.88a8 8 0 0 0-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 0 0 0 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 0 0 0 11.31L155.17 889a8 8 0 0 0 11.31 0l712.15-712.12a8 8 0 0 0 0-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 0 0-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 0 1 146.2-106.69L401.31 546.2A112 112 0 0 1 396 512z"},child:[]},{tag:"path",attr:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 0 0 227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 0 1-112 112z"},child:[]}]})(t)}function Wc(t){return R({tag:"svg",attr:{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 48 48",enableBackground:"new 0 0 48 48"},child:[{tag:"path",attr:{fill:"#FFC107",d:"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12\r\n\tc0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24\r\n\tc0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z"},child:[]},{tag:"path",attr:{fill:"#FF3D00",d:"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657\r\n\tC34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z"},child:[]},{tag:"path",attr:{fill:"#4CAF50",d:"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36\r\n\tc-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z"},child:[]},{tag:"path",attr:{fill:"#1976D2",d:"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571\r\n\tc0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z"},child:[]}]})(t)}function Uc({isOpen:n,onClose:i,onSendReset:o}){const[r,s]=g(""),[a,l]=g("idle"),[c,d]=g("");if(!n)return null;const h=()=>{s(""),l("idle"),d(""),i()};return t("div",{className:"ba-modal-overlay",children:e("div",{style:{backgroundColor:"white",borderRadius:"8px",boxShadow:"0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04)",maxWidth:"448px",width:"100%",padding:"24px"},children:[e("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16px"},children:[t("h2",{style:{fontSize:"20px",fontWeight:600,color:"#111827",margin:0},children:"Restablecer Contraseña"}),t("button",{className:"ba-modal-close",onClick:h,disabled:"loading"===a,children:t("svg",{width:"24",height:"24",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("p",{style:{fontSize:"14px",color:"#4b5563",marginBottom:"24px",margin:"0 0 24px 0"},children:"Ingresa tu correo electrónico y te enviaremos un enlace para restablecer tu contraseña."}),e("form",{onSubmit:async t=>{if(t.preventDefault(),!r.trim())return l("error"),void d("Por favor ingresa tu correo electrónico.");l("loading"),d("");const e=await o(r);e.ok?(l("success"),d(e.message??"Correo enviado exitosamente."),setTimeout(h,3e3)):(l("error"),d(e.error??"Ocurrió un error al enviar el correo."))},noValidate:!0,children:[e("div",{style:{marginBottom:"16px"},children:[t("label",{htmlFor:"reset-email",style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:500,color:"#374151"},children:"Correo Electrónico"}),t("input",{id:"reset-email",className:"ba-input",type:"email",autoComplete:"email",placeholder:"ejemplo@correo.com",value:r,onChange:t=>s(t.target.value),disabled:"loading"===a||"success"===a})]}),t("button",{type:"submit",className:"ba-btn-blue",disabled:"loading"===a||"success"===a,children:"loading"===a?"Enviando...":"Enviar Enlace de Restablecimiento"}),"idle"!==a&&t("div",{role:"status",className:`ba-status-${a}`,children:c})]})]})})}function Xc({systemName:n,leftPanelTitle:i,quote:o,quoteAuthor:r,googleClientId:a,onLogin:c,onGoogleCredential:d,onForgotPassword:h,onNavigateToRegister:u}){const[p,m]=g(""),[f,y]=g(""),[v,x]=g(!1),[b,w]=g(!1),S=s(!1);return l(()=>{if(S.current)return;const t=()=>{if(S.current)return!0;const t=document.getElementById("google-btn-login");if(!window.google?.accounts?.id||!t)return!1;try{return S.current=!0,t.innerHTML="",window.google.accounts.id.initialize({client_id:a,callback:async t=>{await d(t.credential)}}),window.google.accounts.id.renderButton(t,{theme:"outline",size:"large",text:"continue_with",width:320}),!0}catch{return S.current=!1,!1}};if(t())return;const e=setInterval(()=>{t()&&clearInterval(e)},150);return()=>clearInterval(e)},[a]),e(Fc,{systemName:n,leftPanelTitle:i,quote:o,quoteAuthor:r,children:[e("div",{style:{textAlign:"center",width:"100%",marginTop:"1.5rem",marginBottom:"2rem",maxWidth:"480px"},children:[t("h2",{style:{fontSize:"2.5rem",fontFamily:'Georgia, "Times New Roman", serif',color:"#111827",marginBottom:"0.75rem",letterSpacing:"-0.025em",margin:"0 0 0.75rem 0"},children:"Bienvenido de nuevo"}),t("p",{style:{fontSize:"14px",color:"#6b7280",fontWeight:500,letterSpacing:"0.025em",margin:0},children:"Ingresa tu correo y contraseña para acceder al sistema."})]}),e("form",{onSubmit:async t=>{t.preventDefault(),p&&f&&await c(p,f)},style:{width:"100%",maxWidth:"480px",display:"flex",flexDirection:"column"},children:[e("div",{style:{width:"100%",marginBottom:"20px"},children:[t("label",{style:{display:"block",fontSize:"13px",fontWeight:600,color:"#111827",marginBottom:"8px"},children:"Correo electrónico"}),t("input",{className:"ba-input",placeholder:"ejemplo@correo.com",name:"email",type:"email",value:p,onChange:t=>m(t.target.value)})]}),e("div",{style:{width:"100%",marginBottom:"24px"},children:[t("label",{style:{display:"block",fontSize:"13px",fontWeight:600,color:"#111827",marginBottom:"8px"},children:"Contraseña"}),e("div",{style:{position:"relative"},children:[t("input",{className:"ba-input",style:{paddingRight:"48px"},placeholder:"Tu contraseña secreta",type:v?"text":"password",name:"password",value:f,onChange:t=>y(t.target.value)}),t("button",{type:"button",className:"ba-eye",onClick:()=>x(t=>!t),children:t(v?$c:Oc,{size:20})})]})]}),t("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end",marginBottom:"32px"},children:t("button",{type:"button",className:"ba-link-blue",onClick:()=>w(!0),children:"¿Olvidaste tu contraseña?"})}),t("button",{className:"ba-btn-primary",type:"submit",style:{marginBottom:"16px"},children:"Ingresar al sistema"}),e("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center"},children:[e("button",{type:"button",className:"ba-btn-google",children:[t(Wc,{size:22}),"Continuar con Google"]}),t("div",{id:"google-btn-login",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:.01,zIndex:10,overflow:"hidden"}})]})]}),t("div",{style:{textAlign:"center",width:"100%",marginTop:"32px"},children:e("p",{style:{fontSize:"14px",color:"#4b5563",fontWeight:500,letterSpacing:"0.025em",margin:0},children:["¿Aún no tienes cuenta?"," ",t("button",{className:"ba-link",onClick:u,children:"Regístrate aquí"})]})}),t(Uc,{isOpen:b,onClose:()=>w(!1),onSendReset:h})]})}const Hc=/^[A-Z0-9]{3}-[A-Z0-9]{2}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{7}-[A-Z0-9]{7}$/;function Yc(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,40)}function _c({systemName:i,leftPanelTitle:o,quote:r,quoteAuthor:a,googleClientId:c,systemCode:d,onValidateKey:h,onRegisterWithForm:p,onRegisterWithSSO:m,onFirebaseGoogleSignIn:f,onGoogleAuthLogin:y,onNavigateToLogin:v,onSuccess:x}){const[b,w]=g(""),[S,C]=g("idle"),[k,T]=g(""),[E,N]=g(""),[P,M]=g(1),[A,L]=g(""),[V,D]=g(""),[R,z]=g(""),[B,j]=g(""),[I,F]=g("idle"),[O,$]=g(""),W=s(null),U=s(!1),X=u(()=>function(t){const e=t.toUpperCase().replace(/[^A-Z0-9]/g,"");return[e.slice(0,3),e.slice(3,5),e.slice(5,10),e.slice(10,15),e.slice(15,22),e.slice(22,29)].filter(Boolean).join("-")}(b),[b]),H=u(()=>Hc.test(X),[X]);l(()=>{W.current?.focus()},[]),l(()=>{if(2!==P)return;if(U.current)return;const t=()=>{if(U.current)return!0;const t=document.getElementById("google-rpk-container");if(!window.google?.accounts?.id||!t)return!1;try{return U.current=!0,t.innerHTML="",window.google.accounts.id.initialize({client_id:c,callback:async t=>{await Y(t.credential)}}),window.google.accounts.id.renderButton(t,{theme:"outline",size:"large",text:"continue_with",width:320}),!0}catch{return U.current=!1,!1}};if(t())return;const e=setInterval(()=>{t()&&clearInterval(e)},150);return()=>clearInterval(e)},[P]);const Y=async t=>{F("loading"),$("Validando con Google...");const e=await f(t);if(!e.ok)return F("error"),void $(e.error??"No se pudo autenticar con Google.");const n=await m({productKey:X,idToken:e.idToken,firebaseUid:e.localId,email:e.email,systemCode:d,fullName:A||e.displayName||"Usuario Google",phoneNumber:V,tokenFcm:""});if(n.ok){F("success"),$("Registro correcto con Google.");try{await y({idToken:e.idToken,firebaseUid:e.localId,systemCode:d})}catch{}x()}else F("error"),$(n.error??"No se pudo completar el registro.")},_=(e,n)=>"idle"===e?null:t("div",{role:"status",className:`ba-status-${e}`,children:n});return e(Fc,{systemName:i,leftPanelTitle:o,quote:r,quoteAuthor:a,children:[t("div",{style:{position:"absolute",top:"2rem",left:"2rem"},children:t("button",{className:"ba-link-gray",onClick:v,children:"← Volver al inicio"})}),e("div",{style:{width:"100%",maxWidth:"480px",display:"flex",flexDirection:"column",justifyContent:"center",flex:1,marginTop:"2.5rem"},children:[t("div",{style:{textAlign:"center",width:"100%",marginBottom:"32px"},children:t("h2",{style:{fontSize:"2.5rem",fontFamily:'Georgia, "Times New Roman", serif',color:"#111827",letterSpacing:"-0.025em",margin:0},children:"Registro de Llave"})}),t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"24px"},children:e("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[t("div",{className:1===P?"ba-step-active":"ba-step-done",children:1===P?"1":"✓"}),t("span",{style:{fontSize:"14px",fontWeight:500,color:"#374151"},children:"Validar Llave"}),t("div",{style:{width:"48px",height:"2px",backgroundColor:"#d1d5db",margin:"0 8px"}}),t("div",{className:2===P?"ba-step-active":"ba-step-inactive",children:"2"}),t("span",{style:{fontSize:"14px",fontWeight:500,color:"#374151"},children:"Registro de Usuario"})]})}),1===P&&e(n,{children:[t("h1",{style:{fontSize:"20px",fontWeight:600,color:"#111827",margin:"0 0 8px 0"},children:"Registro de llave de producto"}),e("p",{style:{fontSize:"14px",color:"#6b7280",fontWeight:500,letterSpacing:"0.025em",margin:"0 0 24px 0"},children:["Ingresa tu llave de producto en el formato",t("br",{}),"XXX-XX-XXXXX-XXXXX-XXXXXXX-XXXXXXX."]}),e("form",{onSubmit:async t=>{if(t.preventDefault(),!H||"loading"===S)return;C("loading"),N(X);const e=await h(X);e.ok?(C("success"),T(e.message??"Llave validada correctamente."),setTimeout(()=>M(2),800)):(C("error"),T(e.error??"Llave inválida o ya utilizada."))},noValidate:!0,style:{display:"flex",flexDirection:"column"},children:[t("label",{htmlFor:"productKey",style:{display:"block",fontSize:"13px",fontWeight:600,color:"#111827",marginBottom:"8px"},children:"Llave de producto"}),t("input",{id:"productKey",ref:W,className:"ba-input ba-input-mono",type:"text",inputMode:"text",autoComplete:"off",placeholder:"AB1-C0-0DE06-FGHIJ-00K1L2M-1234567",value:X,onChange:t=>{C("idle"),T(""),w(Yc(t.target.value))},onPaste:t=>{t.preventDefault(),w(Yc(t.clipboardData.getData("text")))},maxLength:40,"aria-invalid":!H&&b.length>0,style:{borderColor:0===b.length?"transparent":H?"#22c55e":"#f87171"},disabled:"loading"===S||"success"===S}),t("div",{style:{fontSize:"12px",color:H||0===b.length?"#6b7280":"#dc2626",marginTop:"6px"},children:0===b.length?"Solo letras y números. Se formatea automáticamente.":H?"Formato válido.":"Formato inválido. Debe ser XXX-XX-XXXXX-XXXXX-XXXXXXX-XXXXXXX."}),e("div",{style:{display:"flex",flexDirection:"column",gap:"12px",marginTop:"24px"},children:[t("button",{type:"submit",className:"ba-btn-primary",disabled:!H||"loading"===S||"success"===S,children:"loading"===S?"Validando...":"Validar Llave"}),t("button",{type:"button",className:"ba-btn-secondary",onClick:()=>{w(""),C("idle"),T(""),M(1),L(""),D(""),z(""),j(""),F("idle"),$(""),U.current=!1,W.current?.focus()},disabled:"loading"===S,children:"Limpiar"})]}),_(S,k)]})]}),2===P&&e(n,{children:[t("h1",{style:{fontSize:"20px",fontWeight:600,color:"#111827",margin:"0 0 8px 0"},children:"Completa tu registro"}),t("p",{style:{fontSize:"14px",color:"#6b7280",margin:"0 0 16px 0"},children:"Ingresa tus datos para completar el registro."}),e("div",{style:{marginBottom:"16px"},children:[e("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center"},children:[e("button",{type:"button",className:"ba-btn-google",children:[t(Wc,{size:22}),"Continuar con Google"]}),t("div",{id:"google-rpk-container",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:.01,zIndex:10,overflow:"hidden"}})]}),t("div",{className:"ba-divider",children:t("span",{children:"o registrarse con email"})})]}),e("form",{onSubmit:async t=>{if(t.preventDefault(),"loading"===I)return;if(!(A.trim()&&V.trim()&&R.trim()&&B.trim()))return F("error"),void $("Por favor completa todos los campos.");if(B.length<6)return F("error"),void $("La contraseña debe tener al menos 6 caracteres.");F("loading");const e=await p(R,B,A,V,E);e.ok?(F("success"),$("Usuario registrado correctamente."),x()):(F("error"),$(e.error??"Error al registrar el usuario."))},noValidate:!0,style:{display:"flex",flexDirection:"column",gap:"16px"},children:[[{id:"fullName",label:"Nombre Completo",type:"text",value:A,setter:L,placeholder:"Juan Pérez",autoComplete:"name"},{id:"phoneNumber",label:"Número de Teléfono",type:"tel",value:V,setter:D,placeholder:"+57 300 000 0000",autoComplete:"tel"},{id:"email",label:"Correo Electrónico",type:"email",value:R,setter:z,placeholder:"ejemplo@correo.com",autoComplete:"email"},{id:"password",label:"Contraseña",type:"password",value:B,setter:j,placeholder:"Mínimo 6 caracteres",autoComplete:"new-password"}].map(({id:n,label:i,type:o,value:r,setter:s,placeholder:a,autoComplete:l})=>e("div",{children:[t("label",{htmlFor:n,style:{display:"block",fontSize:"13px",fontWeight:600,color:"#111827",marginBottom:"8px"},children:i}),t("input",{id:n,className:"ba-input",type:o,autoComplete:l,placeholder:a,value:r,onChange:t=>s(t.target.value),disabled:"loading"===I||"success"===I})]},n)),e("div",{style:{display:"flex",flexDirection:"column",gap:"12px",paddingTop:"8px"},children:[t("button",{type:"submit",className:"ba-btn-primary",disabled:"loading"===I||"success"===I,children:"loading"===I?"Registrando...":"Registrar Usuario"}),t("button",{type:"button",className:"ba-btn-secondary",onClick:()=>{M(1),F("idle"),$(""),U.current=!1},disabled:"loading"===I,children:"Volver"})]}),_(I,O)]})]})]})]})}const Gc=({profiles:i,currentProfileId:o,onSwitch:r})=>{const[s,a]=g(!1),[l,c]=g(!1);if(i.length<=1)return null;const d=i.find(t=>t.profileId===o);return t("div",{className:"fixed bottom-3 right-4 z-50",children:e("div",{className:"relative",children:[e("button",{onClick:()=>a(!s),disabled:l,className:"flex items-center gap-2 bg-white text-primary-botech border border-primary-botech/30 shadow-md hover:shadow-lg hover:bg-primary-botech/5 text-sm font-semibold px-3 py-2 rounded-full transition-all disabled:opacity-60",children:[t(Ul,{className:"size-4 shrink-0"}),t("span",{className:"hidden sm:inline max-w-[160px] truncate",children:d?.kindSlug??"Perfil"}),t(Zl,{className:"size-3 shrink-0 transition-transform hidden sm:block "+(s?"rotate-180":"")})]}),s&&e(n,{children:[t("div",{className:"fixed inset-0 z-40",onClick:()=>a(!1)}),e("div",{className:"absolute right-0 bottom-full mb-2 w-64 sm:w-72 rounded-xl shadow-xl border border-white/30 z-50 overflow-hidden backdrop-blur-md bg-white/80",children:[t("div",{className:"px-3 py-2 border-b border-white/40 bg-white/40",children:t("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Cambiar perfil"})}),i.map(n=>{const i=n.profileId===o;return e("button",{onClick:()=>(async t=>{if(t!==o&&!l){c(!0),a(!1);try{await r(t)}finally{c(!1)}}})(n.profileId),className:"w-full flex items-center justify-between px-3 py-3 text-left border-b border-white/30 last:border-0 transition-colors\n "+(i?"bg-primary-botech/10":"hover:bg-primary-botech/5 active:bg-primary-botech/10"),children:[e("div",{className:"flex items-center gap-2.5 min-w-0",children:[t(Ul,{className:"size-5 shrink-0 "+(i?"text-primary-botech":"text-gray-300")}),e("div",{className:"min-w-0",children:[t("div",{className:"text-sm font-semibold text-gray-900",children:n.kindSlug}),t("div",{className:"text-xs text-gray-500 truncate",children:n.schoolName})]})]}),i&&t(Jl,{className:"size-3.5 text-primary-botech shrink-0 ml-2"})]},n.profileId)})]})]})]})})};function Kc(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=>e[t]??"-"}))}export{Fc as AuthLayout,k as Button,Il as DownloadStudentsExcelButton,fc as GenericTable,U as Header,T as IconButton,Xc as LoginPage,rc as Modal,nc as ModalBody,ic as ModalFooter,ec as ModalHeader,$l as MultiSelector,Dc as NotFound,Uc as PasswordResetModal,Gc as ProfileSwitcher,_c as RegisterProductKeyPage,Rl as Sidebar,Ol as SingleSelector,Lc as StudentSummaryModal,Fl as UploadStudentsExcelButton,Bl as downloadStudentsExcel,Kc as generateTableColumns,zl as getBackendPrefix,jl as uploadStudentsExcel,sc as useModal};
1
+ import{jsx as t,jsxs as e,Fragment as n}from"react/jsx-runtime";import*as i from"react";import o,{createContext as s,useRef as r,useLayoutEffect as a,useEffect as l,useId as c,useContext as d,useInsertionEffect as u,useMemo as h,useCallback as m,Children as p,isValidElement as f,useState as g,Fragment as y,createElement as v,forwardRef as x,Component as b}from"react";import w from"sweetalert2";import S from"axios";import{createPortal as k}from"react-dom";const C=({variant:e="primary",size:n="md",onClick:i,children:o,className:s="",disabled:r=!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:r?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-primary-botech hover:bg-primary-botech-400 text-white cursor-pointer",secondary:r?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-800 cursor-pointer",danger:r?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-red-500 hover:bg-red-600 text-white cursor-pointer"}[e]} ${s}`,onClick:r?void 0:i,disabled:r,children:o}),N=({leftIcon:n,rightIcon:i,children:o,onClick:s,className:r="",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]} ${r}`,onClick:c?void 0:s,disabled:c,children:[n&&t("span",{className:"flex items-center",children:n}),o,i&&t("span",{className:"flex items-center",children:i})]});var T={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},P=o.createContext&&o.createContext(T),E=["attr","size","title"];function A(){return A=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},A.apply(null,arguments)}function M(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?M(Object(n),!0).forEach(function(e){L(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function L(t,e,n){return(e=function(t){var e=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)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function V(t){return t&&t.map((t,e)=>o.createElement(t.tag,D({key:e},t.attr),V(t.child)))}function R(t){return e=>o.createElement(B,A({attr:D({},t.attr)},e),V(t.child))}function B(t){var e=e=>{var n,{attr:i,size:s,title:r}=t,a=function(t,e){if(null==t)return{};var n,i,o=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,E),l=s||e.size||"1em";return e.className&&(n=e.className),t.className&&(n=(n?n+" ":"")+t.className),o.createElement("svg",A({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"}),r&&o.createElement("title",null,r),t.children)};return void 0!==P?o.createElement(P.Consumer,null,t=>e(t)):e(T)}function j(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)}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:"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 O(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 F(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 z(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:"polyline",attr:{points:"9 18 15 12 9 6"},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:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(t)}const U=({title:n,description:i,logoUrl:o,defaultLogoUrl:s,logoAlt:r="Logo",systemName:a="PASS",systemSubtitle:l="Sistema Escolar",onMenuToggle:c,showPageInfo:d=!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:m="text-lg sm:text-xl font-bold",descriptionClassName:p="text-xs sm:text-sm opacity-80"})=>{const f="string"==typeof s&&""!==s.trim()?s:void 0,g="string"==typeof o&&""!==o.trim()?o:f;return e("div",{className:u,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(O,{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: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:a.charAt(0)})})}),e("div",{className:"min-w-0 flex-1",children:[t("h1",{className:m,children:a}),t("p",{className:p,children:l})]})]})]}),d&&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=s({});function H(t){const e=r(null);return null===e.current&&(e.current=t()),e.current}const Y="undefined"!=typeof window?a:l,_=s(null);function K(t,e){-1===t.indexOf(e)&&t.push(e)}function G(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const q=(t,e,n)=>n>e?e:n<t?t:n;function Z(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let J=()=>{},Q=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(J=(t,e,n)=>{t||"undefined"==typeof console||console.warn(Z(e,n))},Q=(t,e,n)=>{if(!t)throw new Error(Z(e,n))});const tt={},et=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),nt=t=>"object"==typeof t&&null!==t,it=t=>/^0[^.\s]+$/u.test(t);function ot(t){let e;return()=>(void 0===e&&(e=t()),e)}const st=t=>t,rt=(...t)=>t.reduce((t,e)=>n=>e(t(n))),at=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class lt{constructor(){this.subscriptions=[]}add(t){return K(this.subscriptions,t),()=>G(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 o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ct=t=>1e3*t,dt=t=>t/1e3,ut=(t,e)=>e?t*(1e3/e):0,ht=new Set;function mt(t,e,n){t||ht.has(e)||(console.warn(Z(e,n)),ht.add(e))}const pt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ft(t,e,n,i){if(t===e&&n===i)return st;const o=e=>function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=pt(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:pt(o(t),e,i)}const gt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,yt=t=>e=>1-t(1-e),vt=ft(.33,1.53,.69,.99),xt=yt(vt),bt=gt(xt),wt=t=>t>=1?1:(t*=2)<1?.5*xt(t):.5*(2-Math.pow(2,-10*(t-1))),St=t=>1-Math.sin(Math.acos(t)),kt=yt(St),Ct=gt(St),Nt=ft(.42,0,1,1),Tt=ft(0,0,.58,1),Pt=ft(.42,0,.58,1),Et=t=>Array.isArray(t)&&"number"==typeof t[0],At={linear:st,easeIn:Nt,easeInOut:Pt,easeOut:Tt,circIn:St,circInOut:Ct,circOut:kt,backIn:xt,backInOut:bt,backOut:vt,anticipate:wt},Mt=t=>{if(Et(t)){Q(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,o]=t;return ft(e,n,i,o)}return"string"==typeof t?(Q(void 0!==At[t],`Invalid easing type '${t}'`,"invalid-easing-type"),At[t]):t},Dt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Lt={value:null,addProjectionMetrics:null};function Vt(t,e){let n=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,r=Dt.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,o=!1,s=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){r.has(e)&&(d.schedule(e),t()),l++,e(a)}const d={schedule:(t,e=!1,s=!1)=>{const a=s&&o?n:i;return e&&r.add(t),a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{if(a=t,o)return void(s=!0);o=!0;const r=n;n=i,i=r,n.forEach(c),e&&Lt.value&&Lt.value.frameloop[e].push(l),l=0,n.clear(),o=!1,s&&(s=!1,d.process(t))}};return d}(s,e?n:void 0),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:d,update:u,preRender:h,render:m,postRender:p}=r,f=()=>{const s=tt.useManualTiming,r=s?o.timestamp:performance.now();n=!1,s||(o.delta=i?1e3/60:Math.max(Math.min(r-o.timestamp,40),1)),o.timestamp=r,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),d.process(o),u.process(o),h.process(o),m.process(o),p.process(o),o.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:Dt.reduce((e,s)=>{const a=r[s];return e[s]=(e,s=!1,r=!1)=>(n||(n=!0,i=!0,o.isProcessing||t(f)),a.schedule(e,s,r)),e},{}),cancel:t=>{for(let e=0;e<Dt.length;e++)r[Dt[e]].cancel(t)},state:o,steps:r}}const{schedule:Rt,cancel:Bt,state:jt,steps:It}=Vt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:st,!0);let Ot;function Ft(){Ot=void 0}const zt={now:()=>(void 0===Ot&&zt.set(jt.isProcessing||tt.useManualTiming?jt.timestamp:performance.now()),Ot),set:t=>{Ot=t,queueMicrotask(Ft)}},$t=t=>e=>"string"==typeof e&&e.startsWith(t),Wt=$t("--"),Ut=$t("var(--"),Xt=t=>!!Ut(t)&&Ht.test(t.split("/*")[0].trim()),Ht=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Yt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const _t={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Kt={..._t,transform:t=>q(0,1,t)},Gt={..._t,default:1},qt=t=>Math.round(1e5*t)/1e5,Zt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Jt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Qt=(t,e)=>n=>Boolean("string"==typeof n&&Jt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),te=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[o,s,r,a]=i.match(Zt);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},ee={..._t,transform:t=>Math.round((t=>q(0,255,t))(t))},ne={test:Qt("rgb","red"),parse:te("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+ee.transform(t)+", "+ee.transform(e)+", "+ee.transform(n)+", "+qt(Kt.transform(i))+")"};const ie={test:Qt("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:ne.transform},oe=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),se=oe("deg"),re=oe("%"),ae=oe("px"),le=oe("vh"),ce=oe("vw"),de=(()=>({...re,parse:t=>re.parse(t)/100,transform:t=>re.transform(100*t)}))(),ue={test:Qt("hsl","hue"),parse:te("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+re.transform(qt(e))+", "+re.transform(qt(n))+", "+qt(Kt.transform(i))+")"},he={test:t=>ne.test(t)||ie.test(t)||ue.test(t),parse:t=>ne.test(t)?ne.parse(t):ue.test(t)?ue.parse(t):ie.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ne.transform(t):ue.transform(t),getAnimatableNone:t=>{const e=he.parse(t);return e.alpha=0,he.transform(e)}},me=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const pe="number",fe="color",ge=/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 ye(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},o=[];let s=0;const r=e.replace(ge,t=>(he.test(t)?(i.color.push(s),o.push(fe),n.push(he.parse(t))):t.startsWith("var(")?(i.var.push(s),o.push("var"),n.push(t)):(i.number.push(s),o.push(pe),n.push(parseFloat(t))),++s,"${}")).split("${}");return{values:n,split:r,indexes:i,types:o}}function ve({split:t,types:e}){const n=t.length;return i=>{let o="";for(let s=0;s<n;s++)if(o+=t[s],void 0!==i[s]){const t=e[s];o+=t===pe?qt(i[s]):t===fe?he.transform(i[s]):i[s]}return o}}const xe=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:he.test(n)?he.getAnimatableNone(n):n;var n};const be={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Zt)?.length||0)+(t.match(me)?.length||0)>0},parse:function(t){return ye(t).values},createTransformer:function(t){return ve(ye(t))},getAnimatableNone:function(t){const e=ye(t);return ve(e)(e.values.map((t,n)=>xe(t,e.split[n])))}};function we(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 ke=(t,e,n)=>t+(e-t)*n,Ce=(t,e,n)=>{const i=t*t,o=n*(e*e-i)+i;return o<0?0:Math.sqrt(o)},Ne=[ie,ne,ue];function Te(t){const e=(n=t,Ne.find(t=>t.test(n)));var n;if(J(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===ue&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=we(a,i,t+1/3),s=we(a,i,t),r=we(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}(i)),i}const Pe=(t,e)=>{const n=Te(t),i=Te(e);if(!n||!i)return Se(t,e);const o={...n};return t=>(o.red=Ce(n.red,i.red,t),o.green=Ce(n.green,i.green,t),o.blue=Ce(n.blue,i.blue,t),o.alpha=ke(n.alpha,i.alpha,t),ne.transform(o))},Ee=new Set(["none","hidden"]);function Ae(t,e){return n=>ke(t,e,n)}function Me(t){return"number"==typeof t?Ae:"string"==typeof t?Xt(t)?Se:he.test(t)?Pe:Ve:Array.isArray(t)?De:"object"==typeof t?he.test(t)?Pe:Le:Se}function De(t,e){const n=[...t],i=n.length,o=t.map((t,n)=>Me(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}}function Le(t,e){const n={...t,...e},i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=Me(t[o])(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Ve=(t,e)=>{const n=be.createTransformer(e),i=ye(t),o=ye(e);return i.indexes.var.length===o.indexes.var.length&&i.indexes.color.length===o.indexes.color.length&&i.indexes.number.length>=o.indexes.number.length?Ee.has(t)&&!o.values.length||Ee.has(e)&&!i.values.length?function(t,e){return Ee.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):rt(De(function(t,e){const n=[],i={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const s=e.types[o],r=t.indexes[s][i[s]],a=t.values[r]??0;n[o]=a,i[s]++}return n}(i,o),o.values),n):(J(!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.`,"complex-values-different"),Se(t,e))};function Re(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return ke(t,e,n);return Me(t)(t,e)}const Be=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Rt.update(e,t),stop:()=>Bt(e),now:()=>jt.isProcessing?jt.timestamp:zt.now()}},je=(t,e,n=10)=>{let i="";const o=Math.max(Math.round(e/n),2);for(let e=0;e<o;e++)i+=Math.round(1e4*t(e/(o-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Ie=2e4;function Oe(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}const Fe=100,ze=10,$e=1,We=0,Ue=800,Xe=.3,He=.3,Ye={granular:.01,default:2},_e={granular:.005,default:.5},Ke=.01,Ge=10,qe=.05,Ze=1;function Je(t,e){return t*Math.sqrt(1-e*e)}const Qe=.001;const tn=["duration","bounce"],en=["stiffness","damping","mass"];function nn(t,e){return e.some(e=>void 0!==t[e])}function on(t){let e={velocity:We,stiffness:Fe,damping:ze,mass:$e,isResolvedFromDuration:!1,...t};if(!nn(t,en)&&nn(t,tn))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),o=i*i,s=2*q(.05,1,1-(t.bounce||0))*Math.sqrt(o);e={...e,mass:$e,stiffness:o,damping:s}}else{const n=function({duration:t=Ue,bounce:e=Xe,velocity:n=We,mass:i=$e}){let o,s;J(t<=ct(Ge),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=q(qe,Ze,r),t=q(Ke,Ge,dt(t)),r<1?(o=e=>{const i=e*r,o=i*t,s=i-n,a=Je(e,r),l=Math.exp(-o);return Qe-s/a*l},s=e=>{const i=e*r*t,s=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),c=Je(Math.pow(e,2),r);return(-o(e)+Qe>0?-1:1)*((s-a)*l)/c}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(o,s,5/t);if(t=ct(t),isNaN(a))return{stiffness:Fe,damping:ze,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:$e},e.isResolvedFromDuration=!0}return e}function sn(t=He,e=Xe){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:o}=n;const s=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:d,duration:u,velocity:h,isResolvedFromDuration:m}=on({...n,velocity:-dt(n.velocity||0)}),p=h||0,f=c/(2*Math.sqrt(l*d)),g=r-s,y=dt(Math.sqrt(l/d)),v=Math.abs(g)<5;let x,b,w,S,k,C;if(i||(i=v?Ye.granular:Ye.default),o||(o=v?_e.granular:_e.default),f<1)w=Je(y,f),S=(p+f*y*g)/w,x=t=>{const e=Math.exp(-f*y*t);return r-e*(S*Math.sin(w*t)+g*Math.cos(w*t))},k=f*y*S+g*w,C=f*y*g-S*w,b=t=>Math.exp(-f*y*t)*(k*Math.sin(w*t)+C*Math.cos(w*t));else if(1===f){x=t=>r-Math.exp(-y*t)*(g+(p+y*g)*t);const t=p+y*g;b=e=>Math.exp(-y*e)*(y*t*e-p)}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 r-n*((p+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(p+f*y*g)/t,n=f*y*e-g*t,i=f*y*g-e*t;b=e=>{const o=Math.exp(-f*y*e),s=Math.min(t*e,300);return o*(n*Math.sinh(s)+i*Math.cosh(s))}}const N={calculatedDuration:m&&u||null,velocity:t=>ct(b(t)),next:t=>{if(!m&&f<1){const e=Math.exp(-f*y*t),n=Math.sin(w*t),s=Math.cos(w*t),l=r-e*(S*n+g*s),c=ct(e*(k*n+C*s));return a.done=Math.abs(c)<=i&&Math.abs(r-l)<=o,a.value=a.done?r:l,a}const e=x(t);if(m)a.done=t>=u;else{const n=ct(b(t));a.done=Math.abs(n)<=i&&Math.abs(r-e)<=o}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(Oe(N),Ie),e=je(e=>N.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return N}sn.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),o=Math.min(Oe(i),Ie);return{type:"keyframes",ease:t=>i.next(o*t).value/e,duration:dt(o)}}(t,100,sn);return t.ease=e.ease,t.duration=ct(e.duration),t.type="keyframes",t};function rn(t,e,n){const i=Math.max(e-5,0);return ut(n-t(i),e-i)}function an({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:d}){const u=t[0],h={done:!1,value:u},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=u+p,g=void 0===r?f:r(f);g!==f&&(p=g-u);const y=t=>-p*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);h.done=Math.abs(e)<=c,h.value=h.done?g:n};let b,w;const S=t=>{var e;(e=h.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,w=sn({keyframes:[h.value,m(h.value)],velocity:rn(v,t,h.value),damping:o,stiffness:s,restDelta:c,restSpeed:d}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==b||(e=!0,x(t),S(t)),void 0!==b&&t>=b?w.next(t-b):(!e&&x(t),h)}}}function ln(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const s=t.length;if(Q(s===e.length,"Both input and output ranges must be the same length","range-length"),1===s)return()=>e[0];if(2===s&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],o=n||tt.mix||Re,s=t.length-1;for(let n=0;n<s;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||st:e;s=rt(t,s)}i.push(s)}return i}(e,i,o),l=a.length,c=n=>{if(r&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const o=at(t[i],t[i+1],n);return a[i](o)};return n?e=>c(q(t[0],t[s-1],e)):c}function cn(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const o=at(0,e,i);t.push(ke(n,1,o))}}(e,t.length-1),e}function dn({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const o=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Mt):Mt(i),s={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:cn(e),t),a=ln(r,e,{ease:Array.isArray(o)?o:(l=e,c=o,l.map(()=>c||Pt).splice(0,l.length-1))});var l,c;return{calculatedDuration:t,next:e=>(s.value=a(e),s.done=e>=t,s)}}const un=t=>null!==t;function hn(t,{repeat:e,repeatType:n="loop"},i,o=1){const s=t.filter(un),r=o<0||e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}const mn={decay:an,inertia:an,tween:dn,keyframes:dn,spring:sn};function pn(t){"string"==typeof t.type&&(t.type=mn[t.type])}class fn{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 gn=t=>t/100;class yn extends fn{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==zt.now()&&this.tick(zt.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;pn(t);const{type:e=dn,repeat:n=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=t;let{keyframes:r}=t;const a=e||dn;"production"!==process.env.NODE_ENV&&a!==dn&&Q(r.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${r}`,"spring-two-frames"),a!==dn&&"number"!=typeof r[0]&&(this.mixKeyframes=rt(gn,Re(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===o&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-s})),null===l.calculatedDuration&&(l.calculatedDuration=Oe(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:o,mirroredGenerator:s,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:d,repeatType:u,repeatDelay:h,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,x=this.currentTime,b=n;if(d){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===u?(n=1-n,h&&(n-=h/r)):"mirror"===u&&(b=s)),x=q(0,1,n)*r}y?(this.delayState.value=c[0],v=this.delayState):v=b.next(x),o&&!y&&(v.value=o(v.value));let{done:w}=v;y||null===a||(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return S&&m!==an&&(v.value=hn(c,this.options,f,this.speed)),p&&p(v.value),S&&this.finish(),v}then(t,e){return this.finished.then(t,e)}get duration(){return dt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+dt(t)}get time(){return dt(this.currentTime)}set time(t){t=ct(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?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return rn(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(zt.now()),this.playbackSpeed=t,e&&this.driver&&(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(zt.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 vn=t=>180*t/Math.PI,xn=t=>{const e=vn(Math.atan2(t[1],t[0]));return wn(e)},bn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:xn,rotateZ:xn,skewX:t=>vn(Math.atan(t[1])),skewY:t=>vn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},wn=t=>((t%=360)<0&&(t+=360),t),Sn=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:Sn,scaleY:kn,scale:t=>(Sn(t)+kn(t))/2,rotateX:t=>wn(vn(Math.atan2(t[6],t[5]))),rotateY:t=>wn(vn(Math.atan2(-t[2],t[0]))),rotateZ:xn,rotate:xn,skewX:t=>vn(Math.atan(t[4])),skewY:t=>vn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Nn(t){return t.includes("scale")?1:0}function Tn(t,e){if(!t||"none"===t)return Nn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,o;if(n)i=Cn,o=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=bn,o=e}if(!o)return Nn(e);const s=i[e],r=o[1].split(",").map(Pn);return"function"==typeof s?s(r):r[s]}function Pn(t){return parseFloat(t.trim())}const En=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],An=(()=>new Set(En))(),Mn=t=>t===_t||t===ae,Dn=new Set(["x","y","z"]),Ln=En.filter(t=>!Dn.has(t));const Vn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-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})=>Tn(e,"x"),y:(t,{transform:e})=>Tn(e,"y")};Vn.translateX=Vn.x,Vn.translateY=Vn.y;const Rn=new Set;let Bn=!1,jn=!1,In=!1;function On(){if(jn){const t=Array.from(Rn).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 Ln.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)})}jn=!1,Bn=!1,Rn.forEach(t=>t.complete(In)),Rn.clear()}function Fn(){Rn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(jn=!0)})}class zn{constructor(t,e,n,i,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(Rn.add(this),Bn||(Bn=!0,Rt.read(Fn),Rt.resolveKeyframes(On))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const o=i?.get(),s=t[t.length-1];if(void 0!==o)t[0]=o;else if(n&&e){const i=n.readValue(e,s);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=s),i&&void 0===o&&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),Rn.delete(this)}cancel(){"scheduled"===this.state&&(Rn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function $n(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const Wn={};function Un(t,e){const n=ot(t);return()=>Wn[e]??n()}const Xn=Un(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Hn=Un(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Yn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,_n={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yn([0,.65,.55,1]),circOut:Yn([.55,0,1,.45]),backIn:Yn([.31,.01,.66,-.59]),backOut:Yn([.33,1.53,.69,.99])};function Kn(t,e){return t?"function"==typeof t?Hn()?je(t,e):"ease-out":Et(t)?Yn(t):Array.isArray(t)?t.map(t=>Kn(t,e)||_n.easeOut):_n[t]:void 0}function Gn(t,e,n,{delay:i=0,duration:o=300,repeat:s=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const d={[e]:n};l&&(d.offset=l);const u=Kn(a,o);Array.isArray(u)&&(d.easing=u);const h={delay:i,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:"reverse"===r?"alternate":"normal"};c&&(h.pseudoElement=c);return t.animate(d,h)}function qn(t){return"function"==typeof t&&"applyToOptions"in t}class Zn extends fn{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=s,this.options=t,Q("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return qn(t)&&Hn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Gn(e,n,i,l,o),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=hn(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(t),$n(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,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(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return dt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+dt(t)}get time(){return dt(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ct(t),e&&this.animation.pause()}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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Xn()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),st):i(this)}}const Jn={anticipate:wt,backInOut:bt,circInOut:Ct};function Qn(t){"string"==typeof t.ease&&t.ease in Jn&&(t.ease=Jn[t.ease])}class ti extends Zn{constructor(t){Qn(t),pn(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:o,...s}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new yn({...s,autoplay:!1}),a=Math.max(10,zt.now()-this.startTime),l=q(0,10,a-10),c=r.sample(a).value,{name:d}=this.options;o&&d&&$n(o,d,c),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,c,l),r.stop()}}const ei=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!be.test(t)&&"0"!==t||t.startsWith("url(")));function ni(t){t.duration=0,t.type="keyframes"}const ii=new Set(["opacity","clipPath","filter","transform"]),oi=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const si=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),ri=ot(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ai(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:o,damping:s,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=e.owner.getProps();return ri()&&n&&(ii.has(n)||si.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&oi.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!d)&&!c&&!i&&"mirror"!==o&&0!==s&&"inertia"!==r}class li extends fn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",keyframes:r,name:a,motionValue:l,element:c,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=zt.now();const u={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:o,repeatType:s,name:a,motionValue:l,element:c,...d},h=c?.KeyframeResolver||zn;this.keyframeResolver=new h(r,(t,e,n)=>this.onKeyframesResolved(t,e,u,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:o,type:s,velocity:r,delay:a,isHandoff:l,onUpdate:c}=n;this.resolvedAt=zt.now();let d=!0;(function(t,e,n,i){const o=t[0];if(null===o)return!1;if("display"===e||"visibility"===e)return!0;const s=t[t.length-1],r=ei(o,e),a=ei(s,e);return J(r===a,`You are trying to animate ${e} from "${o}" to "${s}". "${r?s:o}" is not an animatable value.`,"value-not-animatable"),!(!r||!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||qn(n))&&i)})(t,o,s,r)||(d=!1,!tt.instantAnimations&&a||c?.(hn(t,n,e)),t[0]=t[t.length-1],ni(n),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=d&&!l&&ai(u),m=u.motionValue?.owner?.current;let p;if(h)try{p=new ti({...u,element:m})}catch{p=new yn(u)}else p=new yn(u);p.finished.then(()=>{this.notifyFinished()}).catch(st),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}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(),In=!0,Fn(),On(),In=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}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()}}function ci(t,e,n,i=0,o=1){const s=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(s,r):1===o?s*i:a-s*i}const di=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ui(t,e,n=1){Q(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,o]=function(t){const e=di.exec(t);if(!e)return[,];const[,n,i,o]=e;return[`--${n??i}`,o]}(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);if(s){const t=s.trim();return et(t)?parseFloat(t):t}return Xt(o)?ui(o,e,n+1):o}const hi={type:"spring",stiffness:500,damping:25,restSpeed:10},mi={type:"keyframes",duration:.8},pi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fi=(t,{keyframes:e})=>e.length>2?mi:An.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:hi:pi;function gi(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function yi(t,e){const n=t?.[e]??t?.default??t;return n!==t?gi(n,t):n}const vi=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const xi=(t,e,n,i={},o,s)=>r=>{const a=yi(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=ct(l);const d={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:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:o};(function(t){for(const e in t)if(!vi.has(e))return!0;return!1})(a)||Object.assign(d,fi(t,d)),d.duration&&(d.duration=ct(d.duration)),d.repeatDelay&&(d.repeatDelay=ct(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let u=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(ni(d),0===d.delay&&(u=!0)),(tt.instantAnimations||tt.skipAnimations||o?.shouldSkipAnimations||a.skipAnimations)&&(u=!0,ni(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,u&&!s&&void 0!==e.get()){const t=hn(d.keyframes,a);if(void 0!==t)return void Rt.update(()=>{d.onUpdate(t),d.onComplete()})}return a.isSync?new yn(d):new li(d)};function bi(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function wi(t,e,n,i){if("function"==typeof e){const[o,s]=bi(i);e=e(void 0!==n?n:t.custom,o,s)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[o,s]=bi(i);e=e(void 0!==n?n:t.custom,o,s)}return e}function Si(t,e,n){const i=t.getProps();return wi(i,e,void 0!==n?n:i.custom,t)}const ki=new Set(["width","height","top","left","right","bottom",...En]);class Ci{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=zt.now();if(this.updatedAt!==e&&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()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=zt.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&&mt(!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 lt);const n=this.events[t].add(e);return"change"===t?()=>{n(),Rt.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){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}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=zt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return ut(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 Ni(t,e){return new Ci(t,e)}const Ti=t=>Array.isArray(t);function Pi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ni(n))}function Ei(t){return Ti(t)?t[t.length-1]||0:t}const Ai=t=>Boolean(t&&t.getVelocity);function Mi(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Ai(i)&&i.add))return n.add(e);if(!n&&tt.WillChange){const n=new tt.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Di(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Li="data-"+Di("framerAppearId");function Vi(t){return t.props[Li]}function Ri({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Bi(t,e,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:s,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();s=s?gi(s,l):l;const c=s?.reduceMotion,d=s?.skipAnimations;i&&(s=i);const u=[],h=o&&t.animationState&&t.animationState.getState()[o];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),o=a[e];if(void 0===o||h&&Ri(h,e))continue;const r={delay:n,...yi(s||{},e)};d&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(o)&&o===l&&!r.velocity){Rt.update(()=>i.set(o));continue}let m=!1;if(window.MotionHandoffAnimation){const n=Vi(t);if(n){const t=window.MotionHandoffAnimation(n,e,Rt);null!==t&&(r.startTime=t,m=!0)}}Mi(t,e);const p=c??t.shouldReduceMotion;i.start(xi(e,i,o,p&&ki.has(e)?{type:!1}:r,t,m));const f=i.animation;f&&u.push(f)}if(r){const e=()=>Rt.update(()=>{r&&function(t,e){const n=Si(t,e);let{transitionEnd:i={},transition:o={},...s}=n||{};s={...s,...i};for(const e in s)Pi(t,e,Ei(s[e]))}(t,r)});u.length?Promise.all(u).then(e):e()}return u}function ji(t,e,n={}){const i=Si(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(Bi(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,o=0,s=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(ji(l,e,{...r,delay:n+("function"==typeof i?0:i)+ci(t.variantChildren,l,i,o,s)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,s,r,a,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[t,e]="beforeChildren"===a?[s,r]:[r,s];return t().then(()=>e())}return Promise.all([s(),r(n.delay)])}const Ii=t=>e=>e.test(t),Oi=[_t,ae,re,se,ce,le,{test:t=>"auto"===t,parse:t=>t}],Fi=t=>Oi.find(Ii(t));function zi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||it(t))}const $i=new Set(["brightness","contrast","saturate","opacity"]);function Wi(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Zt)||[];if(!i)return t;const o=n.replace(i,"");let s=$i.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const Ui=/\b([a-z-]*)\(.*?\)/gu,Xi={...be,getAnimatableNone:t=>{const e=t.match(Ui);return e?e.map(Wi).join(" "):t}},Hi={...be,getAnimatableNone:t=>{const e=be.parse(t);return be.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Yi={..._t,transform:Math.round},_i={borderWidth:ae,borderTopWidth:ae,borderRightWidth:ae,borderBottomWidth:ae,borderLeftWidth:ae,borderRadius:ae,borderTopLeftRadius:ae,borderTopRightRadius:ae,borderBottomRightRadius:ae,borderBottomLeftRadius:ae,width:ae,maxWidth:ae,height:ae,maxHeight:ae,top:ae,right:ae,bottom:ae,left:ae,inset:ae,insetBlock:ae,insetBlockStart:ae,insetBlockEnd:ae,insetInline:ae,insetInlineStart:ae,insetInlineEnd:ae,padding:ae,paddingTop:ae,paddingRight:ae,paddingBottom:ae,paddingLeft:ae,paddingBlock:ae,paddingBlockStart:ae,paddingBlockEnd:ae,paddingInline:ae,paddingInlineStart:ae,paddingInlineEnd:ae,margin:ae,marginTop:ae,marginRight:ae,marginBottom:ae,marginLeft:ae,marginBlock:ae,marginBlockStart:ae,marginBlockEnd:ae,marginInline:ae,marginInlineStart:ae,marginInlineEnd:ae,fontSize:ae,backgroundPositionX:ae,backgroundPositionY:ae,...{rotate:se,rotateX:se,rotateY:se,rotateZ:se,scale:Gt,scaleX:Gt,scaleY:Gt,scaleZ:Gt,skew:se,skewX:se,skewY:se,distance:ae,translateX:ae,translateY:ae,translateZ:ae,x:ae,y:ae,z:ae,perspective:ae,transformPerspective:ae,opacity:Kt,originX:de,originY:de,originZ:ae},zIndex:Yi,fillOpacity:Kt,strokeOpacity:Kt,numOctaves:Yi},Ki={..._i,color:he,backgroundColor:he,outlineColor:he,fill:he,stroke:he,borderColor:he,borderTopColor:he,borderRightColor:he,borderBottomColor:he,borderLeftColor:he,filter:Xi,WebkitFilter:Xi,mask:Hi,WebkitMask:Hi},Gi=t=>Ki[t],qi=new Set([Xi,Hi]);function Zi(t,e){let n=Gi(t);return qi.has(n)||(n=be),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ji=new Set(["auto","none","0"]);class Qi extends zn{constructor(t,e,n,i,o){super(t,e,n,i,o,!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(),Xt(i))){const o=ui(i,e.current);void 0!==o&&(t[n]=o),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!ki.has(n)||2!==t.length)return;const[i,o]=t,s=Fi(i),r=Fi(o);if(Yt(i)!==Yt(o)&&Vn[n])this.needsMeasurement=!0;else if(s!==r)if(Mn(s)&&Mn(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else Vn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||zi(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,o=0;for(;o<t.length&&!i;){const e=t[o];"string"==typeof e&&!Ji.has(e)&&ye(e).values.length&&(i=t[o]),o++}if(i&&n)for(const o of e)t[o]=Zi(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=Vn[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 o=n.length-1,s=n[o];n[o]=Vn[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}function to(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const o=n?.[t]??i.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t).filter(t=>null!=t)}const eo=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function no(t){return nt(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:io,cancel:oo}=Vt(queueMicrotask,!1),so={x:!1,y:!1};function ro(){return so.x||so.y}function ao(t,e){const n=to(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function lo(t,e,n={}){const[i,o,s]=ao(t,n);return i.forEach(t=>{let n,i=!1,s=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),s&&(s=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?s=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||ro())return;s=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,o))},o),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",a,o)},o)}),s}const co=(t,e)=>!!e&&(t===e||co(t,e.parentElement)),uo=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,ho=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const mo=new Set(["INPUT","SELECT","TEXTAREA"]);const po=new WeakSet;function fo(t){return e=>{"Enter"===e.key&&t(e)}}function go(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function yo(t){return uo(t)&&!ro()}const vo=new WeakSet;function xo(t,e,n={}){const[i,o,s]=ao(t,n),r=t=>{const i=t.currentTarget;if(!yo(t))return;if(vo.has(t))return;po.add(i),n.stopPropagation&&vo.add(t);const s=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),po.has(i)&&po.delete(i),yo(t)&&"function"==typeof s&&s(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||co(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",l,o)};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,o),no(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=fo(()=>{if(po.has(n))return;go(n,"down");const t=fo(()=>{go(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>go(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,o)),e=t,ho.has(e.tagName)||!0===e.isContentEditable||t.hasAttribute("tabindex")||(t.tabIndex=0))}),s}function bo(t){return nt(t)&&"ownerSVGElement"in t}const wo=new WeakMap;let So;const ko=(t,e,n)=>(i,o)=>o&&o[0]?o[0][t+"Size"]:bo(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Co=ko("inline","width","offsetWidth"),No=ko("block","height","offsetHeight");function To({target:t,borderBoxSize:e}){wo.get(t)?.forEach(n=>{n(t,{get width(){return Co(t,e)},get height(){return No(t,e)}})})}function Po(t){t.forEach(To)}function Eo(t,e){So||"undefined"!=typeof ResizeObserver&&(So=new ResizeObserver(Po));const n=to(t);return n.forEach(t=>{let n=wo.get(t);n||(n=new Set,wo.set(t,n)),n.add(e),So?.observe(t)}),()=>{n.forEach(t=>{const n=wo.get(t);n?.delete(e),n?.size||So?.unobserve(t)})}}const Ao=new Set;let Mo;function Do(t){return Ao.add(t),Mo||(Mo=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ao.forEach(e=>e(t))},window.addEventListener("resize",Mo)),()=>{Ao.delete(t),Ao.size||"function"!=typeof Mo||(window.removeEventListener("resize",Mo),Mo=void 0)}}function Lo(t,e){return"function"==typeof t?Do(t):Eo(t,e)}const Vo=[...Oi,he,be],Ro=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Bo=new WeakMap;function jo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Io(t){return"string"==typeof t||Array.isArray(t)}const Oo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Fo=["initial",...Oo];function zo(t){return jo(t.animate)||Fo.some(e=>Io(t[e]))}function $o(t){return Boolean(zo(t)||t.variants)}const Wo={current:null},Uo={current:!1},Xo="undefined"!=typeof window;function Ho(){if(Uo.current=!0,Xo)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Wo.current=t.matches;t.addEventListener("change",e),e()}else Wo.current=!1}const Yo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let _o={};function Ko(t){_o=t}class Go{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:s,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=zn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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=zt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Rt.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=o,this.options=a,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=zo(e),this.isVariantNode=$o(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:d,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in u){const e=u[t];void 0!==l[t]&&Ai(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Bo.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)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Uo.current||Ho(),this.shouldReduceMotion=Wo.current),"production"!==process.env.NODE_ENV&&mt(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}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?.removeChild(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}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&ii.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:o,ease:s,duration:r}=e.accelerate,a=new Zn({element:this.current,name:t,keyframes:i,times:o,ease:s,duration:ct(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=An.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Rt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),o&&o()})}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 _o){const e=_o[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<Yo.length;e++){const n=Yo[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 o=e[i],s=n[i];if(Ai(o))t.addValue(i,o);else if(Ai(s))t.addValue(i,Ni(o,{owner:t}));else if(s!==o)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(o):e.hasAnimated||e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,Ni(void 0!==e?e:o,{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=Ni(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&&(et(n)||it(n))?n=parseFloat(n):(i=n,!Vo.find(Ii(i))&&be.test(e)&&(n=Zi(t,e))),this.setBaseTarget(t,Ai(n)?n.get():n)),Ai(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=wi(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||Ai(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 lt),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){io.render(this.render)}}class qo extends Go{constructor(){super(...arguments),this.KeyframeResolver=Qi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[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;Ai(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class Zo{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Jo({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Qo(t){return void 0===t||1===t}function ts({scale:t,scaleX:e,scaleY:n}){return!Qo(t)||!Qo(e)||!Qo(n)}function es(t){return ts(t)||ns(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ns(t){return is(t.x)||is(t.y)}function is(t){return t&&"0%"!==t}function os(t,e,n){return n+e*(t-n)}function ss(t,e,n,i,o){return void 0!==o&&(t=os(t,o,i)),os(t,n,i)+e}function rs(t,e=0,n=1,i,o){t.min=ss(t.min,e,n,i,o),t.max=ss(t.max,e,n,i,o)}function as(t,{x:e,y:n}){rs(t.x,e.translate,e.scale,e.originPoint),rs(t.y,n.translate,n.scale,n.originPoint)}const ls=.999999999999,cs=1.0000000000001;function ds(t,e){t.min+=e,t.max+=e}function us(t,e,n,i,o=.5){rs(t,e,n,ke(t.min,t.max,o),i)}function hs(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function ms(t,e,n){const i=n??t;us(t.x,hs(e.x,i.x),e.scaleX,e.scale,e.originX),us(t.y,hs(e.y,i.y),e.scaleY,e.scale,e.originY)}function ps(t,e){return Jo(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 fs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},gs=En.length;function ys(t,e,n){const{style:i,vars:o,transformOrigin:s}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(An.has(t))r=!0;else if(Wt(t))o[t]=n;else{const e=eo(n,_i[t]);t.startsWith("origin")?(a=!0,s[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="",o=!0;for(let s=0;s<gs;s++){const r=En[s],a=t[r];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);l=r.startsWith("scale")?1===t:0===t}if(!l||n){const t=eo(a,_i[r]);l||(o=!1,i+=`${fs[r]||r}(${t}) `),n&&(e[r]=t)}}return i=i.trim(),n?i=n(e,o?"":i):o&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=s;i.transformOrigin=`${t} ${e} ${n}`}}function vs(t,{style:e,vars:n},i,o){const s=t.style;let r;for(r in e)s[r]=e[r];for(r in o?.applyProjectionStyles(s,i),n)s.setProperty(r,n[r])}function xs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const bs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!ae.test(t))return t;t=parseFloat(t)}return`${xs(t,e.target.x)}% ${xs(t,e.target.y)}%`}},ws={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=be.parse(t);if(o.length>5)return i;const s=be.createTransformer(t),r="number"!=typeof o[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;o[0+r]/=a,o[1+r]/=l;const c=ke(a,l,.5);return"number"==typeof o[2+r]&&(o[2+r]/=c),"number"==typeof o[3+r]&&(o[3+r]/=c),s(o)}},Ss={borderRadius:{...bs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:bs,borderTopRightRadius:bs,borderBottomLeftRadius:bs,borderBottomRightRadius:bs,boxShadow:ws};function ks(t,{layout:e,layoutId:n}){return An.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ss[t]||"opacity"===t)}function Cs(t,e,n){const i=t.style,o=e?.style,s={};if(!i)return s;for(const e in i)(Ai(i[e])||o&&Ai(o[e])||ks(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(s[e]=i[e]);return s}class Ns extends qo{constructor(){super(...arguments),this.type="html",this.renderInstance=vs}readValueFromInstance(t,e){if(An.has(e))return this.projection?.isProjecting?Nn(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Tn(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),o=(Wt(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return ps(t,e)}build(t,e,n){ys(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Cs(t,e,n)}}const Ts={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ps={offset:"strokeDashoffset",array:"strokeDasharray"};const Es=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function As(t,{attrX:e,attrY:n,attrScale:i,pathLength:o,pathSpacing:s=1,pathOffset:r=0,...a},l,c,d){if(ys(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:u,style:h}=t;u.transform&&(h.transform=u.transform,delete u.transform),(h.transform||u.transformOrigin)&&(h.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),h.transform&&(h.transformBox=d?.transformBox??"fill-box",delete u.transformBox);for(const t of Es)void 0!==u[t]&&(h[t]=u[t],delete u[t]);void 0!==e&&(u.x=e),void 0!==n&&(u.y=n),void 0!==i&&(u.scale=i),void 0!==o&&function(t,e,n=1,i=0,o=!0){t.pathLength=1;const s=o?Ts:Ps;t[s.offset]=""+-i,t[s.array]=`${e} ${n}`}(u,o,s,r,!1)}const Ms=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"]),Ds=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ls(t,e,n){const i=Cs(t,e,n);for(const n in t)if(Ai(t[n])||Ai(e[n])){i[-1!==En.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Vs extends qo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ro}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(An.has(e)){const t=Gi(e);return t&&t.default||0}return e=Ms.has(e)?e:Di(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Ls(t,e,n)}build(t,e,n){As(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){vs(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Ms.has(n)?n:Di(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Ds(t.tagName),super.mount(t)}}const Rs=Fo.length;function Bs(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Bs(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<Rs;n++){const i=Fo[n],o=t.props[i];(Io(o)||!1===o)&&(e[i]=o)}return e}function js(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 Is=[...Oo].reverse(),Os=Oo.length;function Fs(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 o=e.map(e=>ji(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=ji(t,e,n);else{const o="function"==typeof e?Si(t,e,n.custom):e;i=Promise.all(Bi(t,o,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function zs(t){let e=Fs(t),n=Us(),i=!0,o=!1;const s=e=>(n,i)=>{const o=Si(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=Bs(t.parent)||{},c=[],d=new Set;let u={},h=1/0;for(let e=0;e<Os;e++){const m=Is[e],p=n[m],f=void 0!==a[m]?a[m]:l[m],g=Io(f),y=m===r?p.isActive:null;!1===y&&(h=e);let v=f===l[m]&&f!==a[m]&&g;if(v&&(i||o)&&t.manuallyAnimateOnMount&&(v=!1),p.protectedKeys={...u},!p.isActive&&null===y||!f&&!p.prevProp||jo(f)||"boolean"==typeof f)continue;if("exit"===m&&p.isActive&&!0!==y){p.prevResolvedValues&&(u={...u,...p.prevResolvedValues});continue}const x=$s(p.prevProp,f);let b=x||m===r&&p.isActive&&!v&&g||e>h&&g,w=!1;const S=Array.isArray(f)?f:[f];let k=S.reduce(s(m),{});!1===y&&(k={});const{prevResolvedValues:C={}}=p,N={...C,...k},T=e=>{b=!0,d.has(e)&&(w=!0,d.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in N){const e=k[t],n=C[t];if(u.hasOwnProperty(t))continue;let i=!1;i=Ti(e)&&Ti(n)?!js(e,n)||x:e!==n,i?null!=e?T(t):d.add(t):void 0!==e&&d.has(t)?T(t):p.protectedKeys[t]=!0}p.prevProp=f,p.prevResolvedValues=k,p.isActive&&(u={...u,...k}),(i||o)&&t.blockInitialAnimation&&(b=!1);const P=v&&x;b&&(!P||w)&&c.push(...S.map(e=>{const n={type:m};if("string"==typeof e&&(i||o)&&!P&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,o=Si(i,e);if(i.enteringChildren&&o){const{delayChildren:e}=o.transition||{};n.delay=ci(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(d.size){const e={};if("boolean"!=typeof a.initial){const n=Si(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}d.forEach(n=>{const i=t.getBaseTarget(n),o=t.getValue(n);o&&(o.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let m=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(m=!1),i=!1,o=!1,m?e(c):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 o=r(e);for(const t in n)n[t].protectedKeys={};return o},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Us(),o=!0}}}function $s(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!js(e,t)}function Ws(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Us(){return{animate:Ws(!0),whileInView:Ws(),whileHover:Ws(),whileTap:Ws(),whileDrag:Ws(),whileFocus:Ws(),exit:Ws()}}function Xs(t,e){t.min=e.min,t.max=e.max}function Hs(t,e){Xs(t.x,e.x),Xs(t.y,e.y)}function Ys(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function _s(t){return t.max-t.min}function Ks(t,e,n,i=.5){t.origin=i,t.originPoint=ke(e.min,e.max,t.origin),t.scale=_s(n)/_s(e),t.translate=ke(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 Gs(t,e,n,i){Ks(t.x,e.x,n.x,i?i.originX:void 0),Ks(t.y,e.y,n.y,i?i.originY:void 0)}function qs(t,e,n,i=0){const o=i?ke(n.min,n.max,i):n.min;t.min=o+e.min,t.max=t.min+_s(e)}function Zs(t,e,n,i=0){const o=i?ke(n.min,n.max,i):n.min;t.min=e.min-o,t.max=t.min+_s(e)}function Js(t,e,n,i){Zs(t.x,e.x,n.x,i?.x),Zs(t.y,e.y,n.y,i?.y)}function Qs(t,e,n,i,o){return t=os(t-=e,1/n,i),void 0!==o&&(t=os(t,1/o,i)),t}function tr(t,e,[n,i,o],s,r){!function(t,e=0,n=1,i=.5,o,s=t,r=t){re.test(e)&&(e=parseFloat(e),e=ke(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=ke(s.min,s.max,i);t===s&&(a-=e),t.min=Qs(t.min,e,n,a,o),t.max=Qs(t.max,e,n,a,o)}(t,e[n],e[i],e[o],e.scale,s,r)}const er=["x","scaleX","originX"],nr=["y","scaleY","originY"];function ir(t,e,n,i){tr(t.x,e,er,n?n.x:void 0,i?i.x:void 0),tr(t.y,e,nr,n?n.y:void 0,i?i.y:void 0)}function or(t){return 0===t.translate&&1===t.scale}function sr(t){return or(t.x)&&or(t.y)}function rr(t,e){return t.min===e.min&&t.max===e.max}function ar(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function lr(t,e){return ar(t.x,e.x)&&ar(t.y,e.y)}function cr(t){return _s(t.x)/_s(t.y)}function dr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function ur(t){return[t("x"),t("y")]}const hr=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],mr=hr.length,pr=t=>"string"==typeof t?parseFloat(t):t,fr=t=>"number"==typeof t||ae.test(t);function gr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const yr=xr(0,.5,kt),vr=xr(.5,.95,st);function xr(t,e,n){return i=>i<t?0:i>e?1:n(at(t,e,i))}function br(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const wr=(t,e)=>t.depth-e.depth;class Sr{constructor(){this.children=[],this.isDirty=!1}add(t){K(this.children,t),this.isDirty=!0}remove(t){G(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(wr),this.isDirty=!1,this.children.forEach(t)}}function kr(t){return Ai(t)?t.get():t}class Cr{constructor(){this.members=[]}add(t){K(this.members,t);for(let e=this.members.length-1;e>=0;e--){const n=this.members[e];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1!==i.isConnected||n.snapshot||(G(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(G(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){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:o}=t.options;void 0!==i&&i===o||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Nr={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Tr=["","X","Y","Z"];let Pr=0;function Er(t,e,n,i){const{latestValues:o}=e;o[t]&&(n[t]=o[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Ar(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Vi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Rt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Ar(i)}function Mr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t={},n=e?.()){this.id=Pr++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Vr),this.nodes.forEach(Wr),this.nodes.forEach(Ur),this.nodes.forEach(Rr)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=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 Sr)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new lt),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=bo(e)&&!(bo(n=e)&&"svg"===n.tagName),this.instance=e;const{layoutId:i,layout:o,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(o||i)&&(this.isLayoutDirty=!0),t){let n,i=0;const o=()=>this.root.updateBlockedByResize=!1;Rt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=zt.now(),i=({timestamp:o})=>{const s=o-n;s>=e&&(Bt(i),t(s-e))};return Rt.setup(i,!0),()=>Bt(i)}(o,250),Nr.hasAnimatedSinceResize&&(Nr.hasAnimatedSinceResize=!1,this.nodes.forEach($r)))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||o)&&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 o=this.options.transition||s.getDefaultTransition()||Gr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!lr(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={...yi(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c)}else e||$r(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(Xr),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&&Ar(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,"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!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()){const t=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),t&&this.nodes.forEach(Ir),void this.nodes.forEach(jr)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Or);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Fr),this.nodes.forEach(zr),this.nodes.forEach(Dr),this.nodes.forEach(Lr)):this.nodes.forEach(Or),this.clearAllSnapshots();const t=zt.now();jt.delta=q(0,1e3/60,t-jt.timestamp),jt.timestamp=t,jt.isProcessing=!0,It.update.process(jt),It.preRender.process(jt),It.render.process(jt),jt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,io.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Br),this.sharedNodes.forEach(Hr)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Rt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||_s(this.snapshot.measuredBox.x)||_s(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.layoutVersion++,this.layoutCorrected||(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(!o)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!sr(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,s=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||es(this.latestValues)||s)&&(o(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)),Jr((i=n).x),Jr(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(ta))){const{scroll:t}=this.root;t&&(ds(e.x,t.offset.x),ds(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(Hs(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s}=i;i!==this.root&&o&&s.layoutScroll&&(o.wasRoot&&Hs(e,t),ds(e.x,o.offset.x),ds(e.y,o.offset.y))}return e}applyTransform(t,e=!1,n){const i=n||{x:{min:0,max:0},y:{min:0,max:0}};Hs(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(ds(i.x,-n.scroll.offset.x),ds(i.y,-n.scroll.offset.y)),es(n.latestValues)&&ms(i,n.latestValues,n.layout?.layoutBox)}return es(this.latestValues)&&ms(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Hs(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!es(n.latestValues))continue;let i;n.instance&&(ts(n.latestValues)&&n.updateSnapshot(),i=Ro(),Hs(i,n.measurePageBox())),ir(e,n.latestValues,n.snapshot?.layoutBox,i)}return es(this.latestValues)&&ir(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!==jt.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:o}=this.options;if(!this.layout||!i&&!o)return;this.resolvedRelativeTargetAt=jt.timestamp;const s=this.getClosestProjectingParent();var r,a,l,c;(s&&this.linkedParentVersion!==s.layoutVersion&&!s.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&s&&s.layout?this.createRelativeTarget(s,this.layout.layoutBox,s.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta)&&(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,a=this.relativeTarget,l=this.relativeParent.target,c=this.options.layoutAnchor||void 0,qs(r.x,a.x,l.x,c?.x),qs(r.y,a.y,l.y,c?.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):Hs(this.target,this.layout.layoutBox),as(this.target,this.targetDelta)):Hs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&s&&Boolean(s.resumingFrom)===Boolean(this.resumingFrom)&&!s.options.layoutScroll&&s.target&&1!==this.animationProgress?this.createRelativeTarget(s,this.target,s.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(this.parent&&!ts(this.parent.latestValues)&&!ns(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,n){this.relativeParent=t,this.linkedParentVersion=t.layoutVersion,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}},Js(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),Hs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}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===jt.timestamp&&(n=!1),n)return;const{layout:i,layoutId:o}=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&&!o)return;Hs(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,r=this.treeScale.y;!function(t,e,n,i=!1){const o=n.length;if(!o)return;let s,r;e.x=e.y=1;for(let a=0;a<o;a++){s=n[a],r=s.projectionDelta;const{visualElement:o}=s.options;o&&o.props.style&&"contents"===o.props.style.display||(i&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(ds(t.x,-s.scroll.offset.x),ds(t.y,-s.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,as(t,r)),i&&es(s.latestValues)&&ms(t,s.latestValues,s.layout?.layoutBox))}e.x<cs&&e.x>ls&&(e.x=1),e.y<cs&&e.y>ls&&(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?(Ys(this.prevProjectionDelta.x,this.projectionDelta.x),Ys(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Gs(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===s&&this.treeScale.y===r&&dr(this.projectionDelta.x,this.prevProjectionDelta.x)&&dr(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:{},o={...this.latestValues},s={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 r={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,d=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(Kr));let u;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,h,m,p,f,g;Yr(s.x,t.x,n),Yr(s.y,t.y,n),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Js(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),m=this.relativeTarget,p=this.relativeTargetOrigin,f=r,g=n,_r(m.x,p.x,f.x,g),_r(m.y,p.y,f.y,g),u&&(l=this.relativeTarget,h=u,rr(l.x,h.x)&&rr(l.y,h.y))&&(this.isProjectionDirty=!1),u||(u={x:{min:0,max:0},y:{min:0,max:0}}),Hs(u,this.relativeTarget)),a&&(this.animationValues=o,function(t,e,n,i,o,s){o?(t.opacity=ke(0,n.opacity??1,yr(i)),t.opacityExit=ke(e.opacity??1,0,vr(i))):s&&(t.opacity=ke(e.opacity??1,n.opacity??1,i));for(let o=0;o<mr;o++){const s=hr[o];let r=gr(e,s),a=gr(n,s);void 0===r&&void 0===a||(r||(r=0),a||(a=0),0===r||0===a||fr(r)===fr(a)?(t[s]=Math.max(ke(pr(r),pr(a),i),0),(re.test(a)||re.test(r))&&(t[s]+="%")):t[s]=a)}(e.rotate||n.rotate)&&(t.rotate=ke(e.rotate||0,n.rotate||0,i))}(o,i,this.latestValues,n,d,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=Rt.update(()=>{Nr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ni(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(t,e,n){const i=Ai(t)?t:Ni(t);return i.start(xi("",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:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Qr(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=_s(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=_s(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Hs(e,n),ms(e,o),Gs(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Cr);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&&Er("z",t,i,this.animationValues);for(let e=0;e<Tr.length;e++)Er(`rotate${Tr[e]}`,t,i,this.animationValues),Er(`skew${Tr[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()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=kr(e?.pointerEvents)||"",void(t.transform=n?n(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=kr(e?.pointerEvents)||""),void(this.hasProjected&&!es(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1));t.visibility="";const o=i.animationValues||i.latestValues;this.applyTransformsToTarget();let s=function(t,e,n){let i="";const o=t.x.translate/e.x,s=t.y.translate/e.y,r=n?.z||0;if((o||s||r)&&(i=`translate3d(${o}px, ${s}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:o,rotateY:s,skewX:r,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),o&&(i+=`rotateX(${o}deg) `),s&&(i+=`rotateY(${s}deg) `),r&&(i+=`skewX(${r}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,o);n&&(s=n(o,s)),t.transform=s;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?o.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:o.opacityExit:t.opacity=i===this?void 0!==o.opacity?o.opacity:"":void 0!==o.opacityExit?o.opacityExit:0;for(const e in Ss){if(void 0===o[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=Ss[e],l="none"===s?o[e]:n(o[e],i);if(r){const e=r.length;for(let n=0;n<e;n++)t[r[n]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=i===this?kr(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(jr),this.root.sharedNodes.clear()}}}function Dr(t){t.updateLayout()}function Lr(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:o}=t.options,s=e.source!==t.layout.source;if("size"===o)ur(t=>{const i=s?e.measuredBox[t]:e.layoutBox[t],o=_s(i);i.min=n[t].min,i.max=i.min+o});else if("x"===o||"y"===o){const t="x"===o?"y":"x";Xs(s?e.measuredBox[t]:e.layoutBox[t],n[t])}else Qr(o,e.layoutBox,n)&&ur(i=>{const o=s?e.measuredBox[i]:e.layoutBox[i],r=_s(n[i]);o.max=o.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Gs(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?Gs(a,t.applyTransform(i,!0),e.measuredBox):Gs(a,n,e.layoutBox);const l=!sr(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:o,layout:s}=i;if(o&&s){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};Js(a,e.layoutBox,o.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};Js(l,n,s.layoutBox,r),lr(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Vr(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 Rr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Br(t){t.clearSnapshot()}function jr(t){t.clearMeasurements()}function Ir(t){t.isLayoutDirty=!0,t.updateLayout()}function Or(t){t.isLayoutDirty=!1}function Fr(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function zr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function $r(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Wr(t){t.resolveTargetDelta()}function Ur(t){t.calcProjection()}function Xr(t){t.resetSkewAndRotation()}function Hr(t){t.removeLeadSnapshot()}function Yr(t,e,n){t.translate=ke(e.translate,0,n),t.scale=ke(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function _r(t,e,n,i){t.min=ke(e.min,n.min,i),t.max=ke(e.max,n.max,i)}function Kr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Gr={duration:.45,ease:[.4,0,.1,1]},qr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Zr=qr("applewebkit/")&&!qr("chrome/")?Math.round:st;function Jr(t){t.min=Zr(t.min),t.max=Zr(t.max)}function Qr(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=cr(e),o=cr(n),s=.2,!(Math.abs(i-o)<=s));var i,o,s}function ta(t){return t!==t.root&&t.scroll?.wasRoot}const ea=Mr({attachResizeListener:(t,e)=>br(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),na={current:void 0},ia=Mr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!na.current){const t=new ea({});t.mount(window),t.setOptions({layoutScroll:!0}),na.current=t}return na.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),oa=s({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function sa(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}function ra(...t){return i.useCallback(function(...t){return e=>{let n=!1;const i=t.map(t=>{const i=sa(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;e<i.length;e++){const n=i[e];"function"==typeof n?n():sa(t[e],null)}}}}(...t),t)}class aa extends i.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(no(e)&&t.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const t=e.offsetParent,n=no(t)&&t.offsetWidth||0,i=no(t)&&t.offsetHeight||0,o=getComputedStyle(e),s=this.props.sizeRef.current;s.height=parseFloat(o.height),s.width=parseFloat(o.width),s.top=e.offsetTop,s.left=e.offsetLeft,s.right=n-s.width-s.left,s.bottom=i-s.height-s.top,s.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function la({children:e,isPresent:n,anchorX:o,anchorY:s,root:a,pop:l}){const h=c(),m=r(null),p=r({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:f}=d(oa),g=e.props?.ref??e?.ref,y=ra(m,g);return u(()=>{const{width:t,height:e,top:i,left:r,right:c,bottom:d,direction:u}=p.current;if(n||!1===l||!m.current||!t||!e)return;const g="rtl"===u,y="left"===o?g?`right: ${c}`:`left: ${r}`:g?`left: ${r}`:`right: ${c}`,v="bottom"===s?`bottom: ${d}`:`top: ${i}`;m.current.dataset.motionPopId=h;const x=document.createElement("style");f&&(x.nonce=f);const b=a??document.head;return b.appendChild(x),x.sheet&&x.sheet.insertRule(`\n [data-motion-pop-id="${h}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${y}px !important;\n ${v}px !important;\n }\n `),()=>{m.current?.removeAttribute("data-motion-pop-id"),b.contains(x)&&b.removeChild(x)}},[n]),t(aa,{isPresent:n,childRef:m,sizeRef:p,pop:l,children:!1===l?e:i.cloneElement(e,{ref:y})})}const ca=({children:e,initial:n,isPresent:o,onExitComplete:s,custom:r,presenceAffectsLayout:a,mode:l,anchorX:d,anchorY:u,root:m})=>{const p=H(da),f=c();let g=!0,y=h(()=>(g=!1,{id:f,initial:n,isPresent:o,custom:r,onExitComplete:t=>{p.set(t,!0);for(const t of p.values())if(!t)return;s&&s()},register:t=>(p.set(t,!1),()=>p.delete(t))}),[o,p,s]);return a&&g&&(y={...y}),h(()=>{p.forEach((t,e)=>p.set(e,!1))},[o]),i.useEffect(()=>{!o&&!p.size&&s&&s()},[o]),e=t(la,{pop:"popLayout"===l,isPresent:o,anchorX:d,anchorY:u,root:m,children:e}),t(_.Provider,{value:y,children:e})};function da(){return new Map}function ua(t=!0){const e=d(_);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:i,register:o}=e,s=c();l(()=>{if(t)return o(s)},[t]);const r=m(()=>t&&i&&i(s),[s,i,t]);return!n&&i?[!1,r]:[!0]}const ha=t=>t.key||"";function ma(t){const e=[];return p.forEach(t,t=>{f(t)&&e.push(t)}),e}const pa=({children:e,custom:i,initial:o=!0,onExitComplete:s,presenceAffectsLayout:a=!0,mode:l="sync",propagate:c=!1,anchorX:u="left",anchorY:m="top",root:p})=>{const[f,y]=ua(c),v=h(()=>ma(e),[e]),x=c&&!f?[]:v.map(ha),b=r(!0),w=r(v),S=H(()=>new Map),k=r(new Set),[C,N]=g(v),[T,P]=g(v);Y(()=>{b.current=!1,w.current=v;for(let t=0;t<T.length;t++){const e=ha(T[t]);x.includes(e)?(S.delete(e),k.current.delete(e)):!0!==S.get(e)&&S.set(e,!1)}},[T,x.length,x.join("-")]);const E=[];if(v!==C){let t=[...v];for(let e=0;e<T.length;e++){const n=T[e],i=ha(n);x.includes(i)||(t.splice(e,0,n),E.push(n))}return"wait"===l&&E.length&&(t=E),P(ma(t)),N(v),null}"production"!==process.env.NODE_ENV&&"wait"===l&&T.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:A}=d(X);return t(n,{children:T.map(e=>{const n=ha(e),r=!(c&&!f)&&(v===T||x.includes(n));return t(ca,{isPresent:r,initial:!(b.current&&!o)&&void 0,custom:i,presenceAffectsLayout:a,mode:l,root:p,onExitComplete:r?void 0:()=>{if(k.current.has(n))return;if(!S.has(n))return;k.current.add(n),S.set(n,!0);let t=!0;S.forEach(e=>{e||(t=!1)}),t&&(A?.(),P(w.current),c&&y?.(),s&&s())},anchorX:u,anchorY:m,children:e},n)})})},fa=s({strict:!1}),ga={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"]};let ya=!1;function va(){return function(){if(ya)return;const t={};for(const e in ga)t[e]={isEnabled:t=>ga[e].some(e=>!!t[e])};Ko(t),ya=!0}(),_o}const xa=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","propagate","ignoreStrict","viewport"]);function ba(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||xa.has(t)}let wa=t=>!ba(t);try{"function"==typeof(Sa=require("@emotion/is-prop-valid").default)&&(wa=t=>t.startsWith("on")?!ba(t):Sa(t))}catch{}var Sa;const ka=s({});function Ca(t){const{initial:e,animate:n}=function(t,e){if(zo(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Io(e)?e:void 0,animate:Io(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,d(ka));return h(()=>({initial:e,animate:n}),[Na(e),Na(n)])}function Na(t){return Array.isArray(t)?t.join(" "):t}const Ta=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Pa(t,e,n){for(const i in e)Ai(e[i])||ks(i,n)||(t[i]=e[i])}function Ea(t,e){const n={};return Pa(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return h(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return ys(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Aa(t,e){const n={},i=Ea(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 Ma=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Da(t,e,n,i){const o=h(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return As(n,e,Ds(i),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Pa(e,t.style,t),o.style={...e,...o.style}}return o}const La=["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 Va(t){return"string"==typeof t&&!t.includes("-")&&!!(La.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ra(t,e,n,{latestValues:i},o,s=!1,r){const a=(r??Va(t)?Da:Aa)(e,i,o,t),l=function(t,e,n){const i={};for(const o in t)"values"===o&&"object"==typeof t.values||Ai(t[o])||(wa(o)||!0===n&&ba(o)||!e&&!ba(o)||t.draggable&&o.startsWith("onDrag"))&&(i[o]=t[o]);return i}(e,"string"==typeof t,s),c=t!==y?{...l,...a,ref:n}:{},{children:d}=e,u=h(()=>Ai(d)?d.get():d,[d]);return v(t,{...c,children:u})}function Ba(t,e,n,i){const o={},s=i(t,{});for(const t in s)o[t]=kr(s[t]);let{initial:r,animate:a}=t;const l=zo(t),c=$o(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let d=!!n&&!1===n.initial;d=d||!1===r;const u=d?a:r;if(u&&"boolean"!=typeof u&&!jo(u)){const e=Array.isArray(u)?u:[u];for(let n=0;n<e.length;n++){const i=wi(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[d?e.length-1:0]}null!==e&&(o[t]=e)}for(const e in t)o[e]=t[e]}}}return o}const ja=t=>(e,n)=>{const i=d(ka),o=d(_),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,o){return{latestValues:Ba(n,i,o,t),renderState:e()}}(t,e,i,o);return n?s():H(s)},Ia=ja({scrapeMotionValuesFromProps:Cs,createRenderState:Ta}),Oa=ja({scrapeMotionValuesFromProps:Ls,createRenderState:Ma}),Fa=Symbol.for("motionComponentSymbol");function za(t,e,n){const i=r(n);u(()=>{i.current=n});const o=r(null);return m(n=>{n&&t.onMount?.(n),e&&(n?e.mount(n):e.unmount());const s=i.current;if("function"==typeof s)if(n){const t=s(n);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):s(n);else s&&(s.current=n)},[e])}const $a=s({});function Wa(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ua(t,e,n,i,o,s){const{visualElement:a}=d(ka),c=d(fa),h=d(_),m=d(oa),p=m.reducedMotion,f=m.skipAnimations,g=r(null),y=r(!1);i=i||c.renderer,!g.current&&i&&(g.current=i(t,{visualState:e,parent:a,props:n,presenceContext:h,blockInitialAnimation:!!h&&!1===h.initial,reducedMotionConfig:p,skipAnimations:f,isSVG:s}),y.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const v=g.current,x=d($a);!v||v.projection||!o||"html"!==v.type&&"svg"!==v.type||function(t,e,n,i){const{layoutId:o,layout:s,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:d,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Xa(t.parent)),t.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:Boolean(r)||a&&Wa(a),visualElement:t,animationType:"string"==typeof s?s:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:c,layoutAnchor:d})}(g.current,n,o,x);const b=r(!1);u(()=>{v&&b.current&&v.update(n,h)});const w=n[Li],S=r(Boolean(w)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return Y(()=>{y.current=!0,v&&(b.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),S.current&&v.animationState&&v.animationState.animateChanges())}),l(()=>{v&&(!S.current&&v.animationState&&v.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),S.current=!1),v.enteringChildren=void 0)}),v}function Xa(t){if(t)return!1!==t.options.allowProjection?t.projection:Xa(t.parent)}function Ha(n,{forwardMotionProps:i=!1,type:o}={},s,r){s&&function(t){const e=va();for(const n in t)e[n]={...e[n],...t[n]};Ko(e)}(s);const a=o?"svg"===o:Va(n),l=a?Oa:Ia;function c(o,c){let u;const h={...d(oa),...o,layoutId:Ya(o)},{isStatic:m}=h,p=Ca(o),f=l(o,m);if(!m&&"undefined"!=typeof window){!function(t,e){const n=d(fa).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?J(!1,e,"lazy-strict-mode"):Q(!1,e,"lazy-strict-mode")}}(h,s);const t=function(t){const e=va(),{drag:n,layout:i}=e;if(!n&&!i)return{};const o={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(h);u=t.MeasureLayout,p.visualElement=Ua(n,f,h,r,t.ProjectionNode,a)}return e(ka.Provider,{value:p,children:[u&&p.visualElement?t(u,{visualElement:p.visualElement,...h}):null,Ra(n,o,za(f,p.visualElement,c),f,m,i,a)]})}c.displayName=`motion.${"string"==typeof n?n:`create(${n.displayName??n.name??""})`}`;const u=x(c);return u[Fa]=n,u}function Ya({layoutId:t}){const e=d(X).id;return e&&void 0!==t?e+"-"+t:t}function _a(t,e){if("undefined"==typeof Proxy)return Ha;const n=new Map,i=(n,i)=>Ha(n,i,t,e);return new Proxy((t,e)=>("production"!==process.env.NODE_ENV&&mt(!1,"motion() is deprecated. Use motion.create() instead."),i(t,e)),{get:(o,s)=>"create"===s?i:(n.has(s)||n.set(s,Ha(s,void 0,t,e)),n.get(s))})}const Ka=(t,e)=>e.isSVG??Va(t)?new Vs(e):new Ns(e,{allowProjection:t!==y});let Ga=0;const qa={animation:{Feature:class extends Zo{constructor(t){super(t),t.animationState||(t.animationState=zs(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();jo(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 Zo{constructor(){super(...arguments),this.id=Ga++,this.isExitComplete=!1}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;if(t&&!1===n){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const n=Si(this.node,t,e);if(n){const{transition:t,transitionEnd:e,...i}=n;for(const t in i)this.node.getValue(t)?.jump(i[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Za(t){return{point:{x:t.pageX,y:t.pageY}}}function Ja(t,e,n,i){return br(t,e,(t=>e=>uo(e)&&t(e,Za(e)))(n),i)}const Qa=({current:t})=>t?t.ownerDocument.defaultView:null,tl=(t,e)=>Math.abs(t-e);const el=new Set(["auto","scroll"]);class nl{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:s=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=il(this.lastRawMoveEventInfo,this.transformPagePoint));const t=sl(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=tl(t.x,e.x),i=tl(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=jt;this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=il(e,this.transformPagePoint),Rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:o}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const s=sl("pointercancel"===t.type?this.lastMoveEventInfo:il(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,s),i&&i(t,s)},!uo(t))return;this.dragSnapToOrigin=o,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=s,this.contextWindow=i||window;const a=il(Za(t),this.transformPagePoint),{point:l}=a,{timestamp:c}=jt;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=e;d&&d(t,sl(a,this.history)),this.removeListeners=rt(Ja(this.contextWindow,"pointermove",this.handlePointerMove),Ja(this.contextWindow,"pointerup",this.handlePointerUp),Ja(this.contextWindow,"pointercancel",this.handlePointerUp)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(el.has(t.overflowX)||el.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o=i.x-e.x,s=i.y-e.y;0===o&&0===s||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o,this.lastMoveEventInfo.point.y+=s):this.history.length>0&&(this.history[0].x-=o,this.history[0].y-=s),this.scrollPositions.set(t,i),Rt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Bt(this.updatePoint)}}function il(t,e){return e?{point:e(t.point)}:t}function ol(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sl({point:t},e){return{point:t,delta:ol(t,al(e)),offset:ol(t,rl(e)),velocity:ll(e,.1)}}function rl(t){return t[0]}function al(t){return t[t.length-1]}function ll(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=al(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>ct(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&o.timestamp-i.timestamp>2*ct(e)&&(i=t[1]);const s=dt(o.timestamp-i.timestamp);if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function cl(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 dl(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 ul=.35;function hl(t,e,n){return{min:ml(t,e),max:ml(t,n)}}function ml(t,e){return"number"==typeof t?t:t[e]||0}const pl=new WeakMap;class fl{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.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:o}=this.getProps();this.panSession=new nl(t,{onSessionStart:t=>{e&&this.snapToCursor(Za(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:o}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(s=n)||"y"===s?so[s]?null:(so[s]=!0,()=>{so[s]=!1}):so.x||so.y?null:(so.x=so.y=!0,()=>{so.x=so.y=!1}),!this.openDragLock))return;var s;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ur(t=>{let e=this.getAxisMotionValue(t).get()||0;if(re.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=_s(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),o&&Rt.update(()=>o(t,e),!1,!0),Mi(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=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}(r),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),s&&Rt.update(()=>s(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:o,distanceThreshold:n,contextWindow:Qa(this.visualElement),element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!n)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&Rt.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!yl(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?ke(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?ke(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}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&&Wa(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:cl(t.x,n,o),y:cl(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=ul){return!1===t?t=0:!0===t&&(t=ul),{x:hl(t,"left","right"),y:hl(t,"top","bottom")}}(e),i!==this.constraints&&!Wa(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&ur(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||!Wa(t))return!1;const n=t.current;Q(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const o=function(t,e,n){const i=ps(t,n),{scroll:o}=e;return o&&(ds(i.x,o.offset.x),ds(i.y,o.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let s=function(t,e){return{x:dl(t.x,e.x),y:dl(t.y,e.y)}}(i.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=Jo(t))}return s}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=ur(r=>{if(!yl(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==s&&s!==r||(l={min:0,max:0});const c=i?200:1e6,d=i?40:1e7,u={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(r,u)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Mi(this.visualElement,t),n.start(xi(t,n,0,e,this.visualElement,!1))}stopAnimation(){ur(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps()[e];return n||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){ur(e=>{const{drag:n}=this.getProps();if(!yl(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.layoutBox[e],r=o.get()||0;o.set(t[e]-ke(n,s,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Wa(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};ur(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=_s(t),o=_s(e);return o>i?n=at(e.min,e.max-i,t.min):i>o&&(n=at(t.min,t.max-o,e.min)),q(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),ur(e=>{if(!yl(e,t,null))return;const n=this.getAxisMotionValue(e),{min:o,max:s}=this.constraints[e];n.set(ke(o,s,i[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;pl.set(this.visualElement,this);const t=this.visualElement.current,e=Ja(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),o=e.target,s=o!==t&&function(t){return mo.has(t.tagName)||!0===t.isContentEditable}(o);n&&i&&!s&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps();Wa(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Lo(t,gl(n)),o=Lo(e,gl(n));return()=>{i(),o()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,s=o.addEventListener("measure",i);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Rt.read(i);const r=br(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(ur(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),s(),a&&a(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=ul,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function gl(t){let e=!0;return()=>{e?e=!1:t()}}function yl(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const vl=t=>(e,n)=>{t&&Rt.update(()=>t(e,n),!1,!0)};let xl=!1;class bl extends b{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),xl&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Nr.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,{projection:s}=n;return s?(s.isPresent=o,t.layoutDependency!==e&&s.setOptions({...s.options,layoutDependency:e}),xl=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Rt.postRender(()=>{const t=s.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=e,n.root.didUpdate(),io.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;xl=!0,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 wl(e){const[n,i]=ua(),o=d(X);return t(bl,{...e,layoutGroup:o,switchLayoutGroup:d($a),isPresent:n,safeToRemove:i})}const Sl={pan:{Feature:class extends Zo{constructor(){super(...arguments),this.removePointerDownListener=st}onPointerDown(t){this.session=new nl(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Qa(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:vl(t),onStart:vl(e),onMove:vl(n),onEnd:(t,e)=>{delete this.session,i&&Rt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Ja(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 Zo{constructor(t){super(t),this.removeGroupControls=st,this.removeListeners=st,this.controls=new fl(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||st}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:ia,MeasureLayout:wl}};function kl(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const o=i["onHover"+n];o&&Rt.postRender(()=>o(e,Za(e)))}function Cl(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 o=i["onTap"+("End"===n?"":n)];o&&Rt.postRender(()=>o(e,Za(e)))}const Nl=new WeakMap,Tl=new WeakMap,Pl=t=>{const e=Nl.get(t.target);e&&e(t)},El=t=>{t.forEach(Pl)};function Al(t,e,n){const i=function({root:t,...e}){const n=t||document;Tl.has(n)||Tl.set(n,{});const i=Tl.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(El,{root:t,...e})),i[o]}(e);return Nl.set(t,n),i.observe(t),()=>{Nl.delete(t),i.unobserve(t)}}const Ml={some:0,all:1};const Dl=_a({...qa,...{inView:{Feature:class extends Zo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:o}=t,s={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Ml[i]};this.stopObserver=Al(this.node.current,s,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,o&&!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(),s=e?n:i;s&&s(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(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends Zo{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=xo(t,(t,e)=>(Cl(this.node,e,"Start"),(t,{success:e})=>Cl(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends Zo{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=rt(br(this.node.current,"focus",()=>this.onFocus()),br(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Zo{mount(){const{current:t}=this.node;t&&(this.unmount=lo(t,(t,e)=>(kl(this.node,e,"Start"),t=>kl(this.node,t,"End"))))}unmount(){}}}},...Sl,...{layout:{ProjectionNode:ia,MeasureLayout:wl}}},Ka);function Ll(){!Uo.current&&Ho();const[t]=g(Wo.current);return"production"!==process.env.NODE_ENV&&mt(!0!==t,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),t}const Vl=({isOpen:i,onClose:o,onToggle:s,menuItems:a,logoUrl:c,logoAlt:d="Logo",systemName:u="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/25 z-40",desktopMenuClassName:v="h-full flex flex-col",showBottomMenu:x=!0,bottomMenuItems:b=[{id:"settings",label:"Configuración",icon:I,action:()=>{}},{id:"help",label:"Ayuda",icon:z,action:()=>{}},{id:"logout",label:"Cerrar Sesión",icon:F,action:()=>{}}],activePath:w="",onNavigate:S,children:k,performanceMode:C="auto",fpsThreshold:N,fpsSampleSize:T,compatibilityMode:P=!1,onPerformanceModeChange:E})=>{const[A,M]=g(new Set),{effectiveMode:D}=function({mode:t="auto",fpsThreshold:e=45,fpsSampleSize:n=90,compatibilityFlag:i=!1,onModeChange:o}={}){const[s,a]=g(!1),[c,d]=g(!1),u=r("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||s||i)return;let o=0,r=0,a=performance.now(),l=null;const c=Math.min(Math.max(30,n),240),u=t=>{const n=t-a;a=t,o>0&&(r+=1e3/n),o+=1,o>=c?r/(o-1||1)<e&&d(!0):l=window.requestAnimationFrame(u)};return l=window.requestAnimationFrame(u),()=>{null!==l&&window.cancelAnimationFrame(l)}},[t,s,i,n,e]);const m=h(()=>"full"===t||"lite"===t?t:i||s||c?"lite":"full",[t,i,s,c]);return l(()=>{o?u.current!==m&&(o(m),u.current=m):u.current=m},[m,o]),{effectiveMode:m,prefersReducedMotion:s,detectedLowPerformance:c,compatibilityFlag:i}}({mode:C,fpsThreshold:N,fpsSampleSize:T,compatibilityFlag:P,onModeChange:E}),L="lite"===D,V=h(()=>L?{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"},[L,i]),R=h(()=>L?{backgroundColor:"rgba(15, 23, 42, 0.28)"}:{willChange:"opacity"},[L]),B="string"==typeof m&&""!==m.trim()?m:void 0,O="string"==typeof c&&""!==c.trim()?c:B,U=t=>w.includes(t),X=t=>{S&&S(t),o()},H=(n,i=!1)=>e(Dl.button,{whileHover:L?void 0:{scale:1.01},whileTap:L?void 0:{scale:.99},transition:L?{duration:.1}:{duration:.16,ease:[.4,0,.2,1]},style:L?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:()=>X(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($,{className:"w-4 h-4 transition-transform "+(U(n.path)?"rotate-90":"group-hover:translate-x-1")})]},n.id),Y=n=>{const i=A.has(n.id);return e("div",{className:"mb-2",children:[e(Dl.button,{whileHover:L?void 0:{scale:1.01},whileTap:L?void 0:{scale:.99},transition:L?{duration:.1}:{duration:.16,ease:[.4,0,.2,1]},style:L?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 M(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(W,{className:"w-4 h-4 transition-transform "+(i?"rotate-180":"")})]}),L?i&&t("div",{className:"pt-2 space-y-1",children:n.children.map(t=>H(t,!0))}):t(pa,{initial:!1,children:i&&t(Dl.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=>H(t,!0))},`${n.id}-content`)})]},n.id)},_=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&&X(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:d,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:u.charAt(0)})})}),t("h1",{className:"text-lg font-bold text-gray-800",children:u})]}),t("button",{onClick:o,className:"p-1 rounded-lg text-gray-500 hover:bg-gray-100 transition-colors",children:t(j,{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):H(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))})}),k&&t("div",{className:"p-4 border-t border-gray-200",children:k})]});return e(n,{children:[L?i&&t("div",{className:y,style:R,onClick:o,"data-motion-mode":D}):t(pa,{initial:!1,children:i&&t(Dl.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2,ease:[.25,1,.5,1]},className:y,style:R,onClick:o})}),L?t("div",{className:f,style:V,"data-motion-mode":D,children:_}):t(Dl.div,{initial:!1,animate:{x:i?0:"-100%",opacity:1},transition:{type:"spring",stiffness:280,damping:32,mass:.9},className:f,style:V,"data-motion-mode":D,children:_})]})},Rl=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"},Bl=async(t,e)=>{const n=`${Rl(t)}/student/downloadExcel/${e||"PASS"}`;return(await S.get(n,{responseType:"blob"})).data},jl=async(t,e,n)=>{const i=`${Rl(e)}/student/uploadExcel`,o=new FormData;o.append("receivedExcelFile",t),"85"===e&&n&&o.append("clientName",n);return(await S.post(i,o,{transformRequest:[t=>t]})).data},Il=({backend:e,label:n="Descargar Lista de Estudiantes en Excel",fileName:i="students.xlsx",className:o,variant:s="primary",clientName:r,onSuccess:a,onError:l})=>{const[c,d]=g(!1);return t(C,{variant:s,onClick:async()=>{try{d(!0);let t=r;if("85"===e&&!t){const{value:e}=await 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 d(!1);t=e}const n=await Bl(e,t),o=URL.createObjectURL(n),s=document.createElement("a");s.href=o,s.download=i,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(o),await w.fire({title:"¡Descarga exitosa!",text:"El archivo se ha descargado correctamente",icon:"success",confirmButtonText:"OK"}),a?.()}catch(t){console.error("Download students excel failed",t);let e="No se pudo descargar el archivo. Por favor, inténtelo nuevamente.";const n=t;e=n?.response?.data?.message??("string"==typeof n?.response?.data?n.response.data:void 0)??(n?.response?.statusText?`Error ${n.response.status}: ${n.response.statusText}`:void 0)??e,await w.fire({title:"Error en la descarga",text:e,icon:"error",confirmButtonText:"OK"}),l?.(t)}finally{d(!1)}},className:o,children:c?"Descargando...":n})},Ol=({backend:i,label:o="Cargar Lista de Estudiantes en Excel",className:s,variant:a="primary",clientName:l,onSuccess:c,onError:d})=>{const u=r(null),[h,m]=g(!1);return e(n,{children:[t(C,{variant:a,onClick:()=>{u.current?.click()},className:s,children:h?"Subiendo...":o}),t("input",{type:"file",accept:".xlsx,.xls",ref:u,className:"hidden",onChange:async t=>{const e=t.target.files?.[0];if(!e)return;if([/\.xlsx$/i,/\.xls$/i].some(t=>t.test(e.name)))if(0!==e.size)try{m(!0);let t=l;if("85"===i&&!t){const{value:e}=await 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 n=await jl(e,i,t);let o="El archivo se ha cargado correctamente";n?.message?o=n.message:"string"==typeof n&&(o=n),await w.fire({title:"¡Carga exitosa!",text:o,icon:"success",confirmButtonText:"OK"}),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 n=t;e=n?.response?.data?.message??("string"==typeof n?.response?.data?n.response.data:void 0)??(n?.response?.statusText?`Error ${n.response.status}: ${n.response.statusText}`:void 0)??e,await w.fire({title:"Error en la carga",text:e,icon:"error",confirmButtonText:"OK"}),d?.(t)}finally{u.current&&(u.current.value=""),m(!1)}else await w.fire({title:"Archivo vacío",text:"El archivo seleccionado está vacío",icon:"warning",confirmButtonText:"OK"});else await w.fire({title:"Archivo inválido",text:"El archivo debe ser un Excel (.xlsx o .xls)",icon:"warning",confirmButtonText:"OK"})}})]})},Fl=({items:n,selectedItem:i=null,onSelectionChange:o,placeholder:s="Seleccionar elemento",searchPlaceholder:a="Buscar...",className:d="",disabled:u=!1,searchBy:p="both",caseSensitive:f=!1,exactMatch:y=!0,renderItem:v,renderSelectedItem:x})=>{const[b,w]=g(!1),[S,k]=g(""),C=r(null),N=r(null),T=r(null),P=r([]),E=c();l(()=>{const t=t=>{C.current&&!C.current.contains(t.target)&&w(!1)};if(b)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[b]),l(()=>{b&&T.current&&T.current.focus()},[b]),l(()=>{b||k("")},[b]);const A=h(()=>((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,S),[n,S,f,y,p]),[M,D]=g(-1),L=m(()=>{w(!1)},[]),V=t=>{o(t),L(),N.current?.focus()},R=()=>{u||w(!b)},B=m(t=>{A.length&&D(e=>((-1===e?1===t?-1:0:e)+t+A.length)%A.length)},[A.length]);l(()=>{if(b){const t=i?A.findIndex(t=>t.id===i.id):-1;-1!==t?D(t):A.length?D(t=>t>=0&&t<A.length?t:0):D(-1)}else D(-1)},[b,A,i]),l(()=>{if(M<0)return;const t=P.current[M];t?.scrollIntoView({block:"nearest"})},[M]);return P.current=[],e("div",{ref:C,className:`relative w-full ${d}`,onKeyDown:t=>{if(u)return;const e=t.target,n=e===N.current;if(!b)return void(!n||"Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),R()));if("Escape"===t.key)return t.preventDefault(),L(),void N.current?.focus();if(e instanceof HTMLButtonElement)return;const i=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement;switch(t.key){case"ArrowDown":t.preventDefault(),B(1);break;case"ArrowUp":t.preventDefault(),B(-1);break;case"Enter":M>=0&&M<A.length&&(t.preventDefault(),V(A[M]));break;case" ":case"Spacebar":if(i)break;M>=0&&M<A.length&&(t.preventDefault(),V(A[M]))}},children:[e("div",{ref:N,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 ${u?"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:R,role:"button",tabIndex:u?-1:0,"aria-haspopup":"listbox","aria-expanded":b,"aria-disabled":u,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:s})}),e("div",{className:"flex items-center space-x-1 ml-2",children:[i&&!u&&t("button",{type:"button",onClick:t=>{t.stopPropagation(),o(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:T,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:S,onChange:t=>k(t.target.value),onClick:t=>t.stopPropagation(),"aria-autocomplete":"list","aria-controls":E})]})}),t("div",{id:E,className:"max-h-60 overflow-auto",role:"listbox","aria-activedescendant":M>=0?`${E}-option-${M}`:void 0,children:0===A.length?t("div",{className:"px-3 py-2 text-sm text-gray-500",children:S?"No se encontraron coincidencias exactas":"No hay elementos disponibles"}):A.map((e,n)=>t("div",{id:`${E}-option-${n}`,ref:t=>{P.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 "+(M===n?"bg-primary-botech-100":"hover:bg-primary-botech-50"),onClick:()=>V(e),role:"option","aria-selected":i?.id===e.id,onMouseEnter:()=>D(n),children:v?v(e):t("span",{className:"text-gray-900",children:e.name})},e.id))})]})]})},zl=({items:i,selectedItems:o=[],onSelectionChange:s,placeholder:a="Seleccionar elementos",searchPlaceholder:c="Buscar...",className:d="",disabled:u=!1,searchBy:h="both",caseSensitive:m=!1,exactMatch:p=!0,maxSelectedDisplay:f=3,renderItem:y,renderSelectedItem:v,renderSelectedBadge:x})=>{const[b,w]=g(!1),[S,k]=g(""),C=r(null),N=r(null);l(()=>{const t=t=>{C.current&&!C.current.contains(t.target)&&w(!1)};if(b)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[b]),l(()=>{b&&N.current&&N.current.focus()},[b]),l(()=>{b||k("")},[b]);const T=((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(h){case"name":return e===i;case"id":return n===i;case"both":return e===i||n===i;default:return!1}else switch(h){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,S),P=t=>o.some(e=>e.id===t.id),E=t=>{s(o.filter(e=>e.id!==t.id))},A=()=>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"})}),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:"M5 13l4 4L19 7"})}),D=({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(A,{})})]}),L=o.slice(0,f),V=o.length-f;return e("div",{ref:C,className:`relative w-full ${d}`,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 ${u?"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:()=>{u||w(!b)},children:[t("div",{className:"flex-1 flex flex-wrap gap-1 items-center",children:0===o.length?t("span",{className:"text-gray-500",children:a}):e(n,{children:[L.map(e=>t("div",{onClick:t=>t.stopPropagation(),children:x?x(e,()=>E(e)):t(D,{item:e,onRemove:()=>E(e)})},e.id)),V>0&&e("span",{className:"text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded-md",children:["+",V," más"]})]})}),e("div",{className:"flex items-center space-x-1 ml-2",children:[o.length>0&&!u&&t("button",{type:"button",onClick:t=>{t.stopPropagation(),s([])},className:"text-gray-400 hover:text-gray-600 transition-colors duration-200",children:t(A,{})}),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:N,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:S,onChange:t=>k(t.target.value),onClick:t=>t.stopPropagation()})]})}),o.length>0&&e("div",{className:"px-3 py-2 text-xs text-gray-600 bg-gray-50 border-b border-gray-100",children:[o.length," elemento(s) seleccionado(s)"]}),t("div",{className:"max-h-60 overflow-auto",children:0===T.length?t("div",{className:"px-3 py-2 text-sm text-gray-500",children:S?"No se encontraron coincidencias exactas":"No hay elementos disponibles"}):T.map(n=>{const i=P(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=>{P(t)?s(o.filter(e=>e.id!==t.id)):s([...o,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(M,{})})]},n.id)})})]})]})};function $l(t){return R({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 96c48.6 0 88 39.4 88 88s-39.4 88-88 88-88-39.4-88-88 39.4-88 88-88zm0 344c-58.7 0-111.3-26.6-146.5-68.2 18.8-35.4 55.6-59.8 98.5-59.8 2.4 0 4.8.4 7.1 1.1 13 4.2 26.6 6.9 40.9 6.9 14.3 0 28-2.7 40.9-6.9 2.3-.7 4.7-1.1 7.1-1.1 42.9 0 79.7 24.4 98.5 59.8C359.3 421.4 306.7 448 248 448z"},child:[]}]})(t)}function Wl(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)}function Ul(t){return R({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"},child:[]}]})(t)}function Xl(t){return R({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"},child:[]}]})(t)}const Hl=({title:n,description:i,onClose:o,showCloseIcon:s=!0,icon:r,actions:a,className:l="",...c})=>e("div",{className:`flex items-center justify-between gap-4 p-4 sm:p-6 bg-primary-botech text-white sm:rounded-t-xl ${l}`,...c,children:[e("div",{className:"flex items-start gap-3 min-w-0",children:[r&&t("span",{className:"mt-0.5 text-white text-xl",children:r}),e("div",{className:"flex-1 min-w-0",children:[n&&t("h2",{className:"text-xl font-semibold text-white",id:"bo-modal-title",children:n}),i&&t("p",{className:"mt-1 text-sm text-white/80",id:"bo-modal-description",children:i})]})]}),e("div",{className:"flex items-center gap-2",children:[a,s&&t("button",{type:"button","aria-label":"Cerrar",onClick:o,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(Wl,{className:"text-xl"})})]})]}),Yl=({className:e="",...n})=>t("div",{className:`p-4 sm:p-6 ${e}`,...n}),_l=({className:e="",...n})=>t("div",{className:`flex justify-end gap-3 p-3 sm:p-4 border-t border-gray-200 bg-gray-50 ${e}`,...n}),Kl={sm:"sm:max-w-sm",md:"sm:max-w-2xl",lg:"sm:max-w-4xl",xl:"sm:max-w-6xl"};const Gl=({open:n,onClose:i,title:o,description:s,size:a="md",footer:c,showCloseIcon:d=!0,hideHeader:u=!1,closeOnEsc:h=!0,closeOnClickOutside:p=!0,className:f="",children:g,initialFocusRef:y,headerClassName:v,overlayClassName:x,headerIcon:b,headerActions:w,zIndex:S,animate:C=!1})=>{const N=r(null),T=r(null),P=Ll(),E=C&&!P;var A;l(()=>{if(!A)return;const{overflow:t}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[A=n]),function(t,e,n){l(()=>{if(!t)return;const i=e.current;if(!i)return;const o=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],s=()=>Array.from(i.querySelectorAll(o.join(","))).filter(t=>!t.hasAttribute("disabled")&&!t.getAttribute("aria-hidden")),r=document.activeElement;(n?.current||s()[0]||i).focus();const a=t=>{if("Tab"!==t.key)return;const e=s();if(0===e.length)return;const n=e[0],o=e[e.length-1];t.shiftKey?document.activeElement!==n&&document.activeElement!==i||(o.focus(),t.preventDefault()):document.activeElement===o&&(n.focus(),t.preventDefault())};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),r?.focus?.()}},[t,e,n])}(n,N,y);const M=m(t=>{n&&"Escape"===t.key&&h&&(t.stopPropagation(),i())},[n,h,i]);l(()=>{if(n)return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[n,M]);const D=e("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center",style:S?{zIndex:S}:void 0,"aria-hidden":!n,ref:T,children:[t("button",{type:"button","aria-label":"Cerrar modal",onClick:()=>{p&&i()},className:`fixed inset-0 bg-black/50 ${x??""}`}),e("div",{role:"dialog","aria-modal":"true","aria-labelledby":o?"bo-modal-title":void 0,"aria-describedby":s?"bo-modal-description":void 0,className:`relative w-screen h-[100dvh] sm:w-full sm:h-auto ${Kl[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:N,children:[!u&&t(Hl,{title:o,description:s,onClose:i,showCloseIcon:d,className:v,icon:b,actions:w}),t("div",{className:"flex-1 overflow-y-auto",children:g}),c&&t(_l,{children:c})]})]}),L=t(pa,{children:n&&e("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center",style:S?{zIndex:S}:void 0,"aria-hidden":!n,ref:T,children:[t(Dl.button,{type:"button","aria-label":"Cerrar modal",initial:"hidden",animate:"visible",exit:"exit",variants:{hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},transition:{duration:.12,ease:"linear"},onClick:()=>{p&&i()},className:`fixed inset-0 bg-black/50 ${x??""}`}),e(Dl.div,{role:"dialog","aria-modal":"true","aria-labelledby":o?"bo-modal-title":void 0,"aria-describedby":s?"bo-modal-description":void 0,initial:"hidden",animate:"visible",exit:"exit",variants:{hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},transition:{duration:.12,ease:"linear"},className:`relative w-screen h-[100dvh] sm:w-full sm:h-auto ${Kl[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:N,children:[!u&&t(Hl,{title:o,description:s,onClose:i,showCloseIcon:d,className:v,icon:b,actions:w}),t("div",{className:"flex-1 overflow-y-auto",children:g}),c&&t(_l,{children:c})]})]})}),V=E?L:n?D:null;return"undefined"!=typeof document?k(V,document.body):V};function ql(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 Zl,Jl,Ql;Gl.Header=Hl,Gl.Body=Yl,Gl.Footer=_l,function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}(Zl||(Zl={})),function(t){t.EVEN="even",t.ODD="odd",t.HOVER="hover"}(Jl||(Jl={})),function(t){t.SM="sm",t.MD="md",t.LG="lg"}(Ql||(Ql={}));const tc=t=>{switch(t){case Zl.CENTER:return"text-center";case Zl.RIGHT:return"text-right";default:return"text-left"}},ec=t=>{switch(t){case Ql.SM:return{header:"px-2 py-2 text-xs",cell:"px-2 py-2 text-xs",table:"text-xs"};case Ql.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"}}},nc=t=>t%2==0?"bg-white":"bg-gray-50",ic=({columns:n,size:i,hasActions:o})=>{const s=ec(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:`${s.header} ${tc(e.alignment)} ${e.className||""}`,style:e.width?{width:e.width}:void 0,children:e.header},e.key)),o&&t("th",{className:`${s.header} text-center sticky right-0 bg-gray-50`,children:"ACCIONES"})]})})},oc=({columns:n,data:i,renderActions:o,size:s,onRowClick:r})=>{const a=ec(s);return t("tbody",{children:i.map((i,s)=>e("tr",{className:`${nc(s)} hover:bg-gray-100 transition-colors duration-150 ${r?"cursor-pointer":""}`,onClick:()=>r?.(i),children:[n.map(e=>t("td",{className:`${a.cell} ${tc(e.alignment)} ${e.className||""}`,children:e.accessor(i)},e.key)),o&&t("td",{className:`${a.cell} text-center sticky right-0 ${nc(s)} shadow-[-2px_0_4px_rgba(0,0,0,0.1)]`,children:o(i)})]},s))})},sc=({columns:n,data:i,renderActions:o,size:s=Ql.MD,className:a="",onRowClick:c,isLoading:d=!1,emptyMessage:u="No hay datos disponibles"})=>{const h=r(null),{visibleData:m}=((t,e)=>{const[n,i]=g(t);return l(()=>{const n=()=>{if(!e.current)return;const n=e.current.getBoundingClientRect(),o=window.innerHeight-n.top-100,s=Math.max(1,Math.floor(o/60));i(t.slice(0,s))};n();const o=()=>{n()};window.addEventListener("resize",o);const s=new ResizeObserver(n);return e.current&&s.observe(e.current),()=>{window.removeEventListener("resize",o),s.disconnect()}},[t,e]),{visibleData:n}})(i,h);return d?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:u})})}):t("div",{ref:h,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(ic,{columns:n,size:s,hasActions:!!o}),t(oc,{columns:n,data:m,renderActions:o,size:s,onRowClick:c})]})})})},rc=t=>{if(!t)return"-";const e=new Date(t);if(Number.isNaN(e.getTime()))return t;const n={year:"numeric",month:"short",day:"numeric",...t.includes("T")?{hour:"2-digit",minute:"2-digit"}:{}};return new Intl.DateTimeFormat("es-CO",n).format(e)},ac=t=>null==t?"—":"string"==typeof t?t.trim()?t:"—":String(t),lc={informacion_general:"Información general",ultimas_novedades:"Últimas novedades",personas_autorizadas:"Personas autorizadas",ultimos_movimientos:"Últimos movimientos",paradas:"Paradas",recorridos:"Recorridos"},cc={ultimas_novedades:"Novedades recientes asociadas al estudiante.",personas_autorizadas:"Vista compacta de autorizaciones vigentes.",ultimos_movimientos:"Registros recientes de acceso del estudiante.",paradas:"Paradas programadas en el recorrido.",recorridos:"Recorridos y rutas asignadas al estudiante."},dc=({groups:n})=>t("div",{className:"grid gap-3 md:grid-cols-3",children:n.map(n=>e("section",{className:"rounded-xl border border-slate-200 bg-slate-50 p-4",children:[t("h3",{className:"text-sm font-semibold text-slate-900",children:n.title}),t("dl",{className:"mt-3 space-y-2",children:n.rows.filter(t=>"—"!==String(ac(t.value)??"").trim()).map(n=>e("div",{className:"flex items-start justify-between gap-3 text-sm",children:[t("dt",{className:"text-slate-500",children:n.label}),t("dd",{className:"text-right font-medium text-slate-800",children:ac(n.value)})]},n.id))})]},n.id))}),uc=({items:n})=>e("div",{className:"overflow-hidden rounded-xl border border-slate-200 bg-white",children:[e("div",{className:"hidden grid-cols-[minmax(0,2fr)_minmax(0,1.2fr)_minmax(0,1.2fr)_minmax(0,1.3fr)] gap-4 border-b border-slate-200 bg-slate-50 px-4 py-3 text-xs font-semibold uppercase tracking-wide text-slate-500 md:grid",children:[t("span",{children:"Persona"}),t("span",{children:"Documento"}),t("span",{children:"Vigencia"}),t("span",{children:"Autorizado por"})]}),t("div",{className:"divide-y divide-slate-100",children:0===n.length?t("p",{className:"px-4 py-6 text-sm text-slate-500",children:"No hay personas autorizadas registradas."}):n.map((n,i)=>e("div",{className:"grid grid-cols-1 gap-2 px-4 py-3 text-sm text-slate-700 md:grid-cols-[minmax(0,2fr)_minmax(0,1.2fr)_minmax(0,1.2fr)_minmax(0,1.3fr)] md:gap-4",children:[e("div",{className:"min-w-0",children:[t("p",{className:"truncate font-semibold text-slate-900",children:n.nombreCompleto||"-"}),n.codigoFamilia?e("p",{className:"text-xs text-slate-500",children:["Cod. familia: ",n.codigoFamilia]}):null]}),e("div",{className:"min-w-0",children:[t("p",{className:"truncate",children:n.numeroDocumento||"-"}),n.tipoDocumento?t("p",{className:"text-xs text-slate-500",children:n.tipoDocumento}):null]}),e("div",{className:"min-w-0",children:[t("p",{children:rc(n.vigencia.desde)}),e("p",{className:"text-xs text-slate-500",children:["hasta ",rc(n.vigencia.hasta)]})]}),e("div",{className:"min-w-0",children:[t("p",{className:"truncate",children:n.autorizadoPor||"-"}),n.estado?t("p",{className:"text-xs text-slate-500",children:n.estado}):null]})]},`${n.numeroDocumento}-${i}`))})]}),hc=({items:n})=>t("div",{className:"rounded-xl border border-slate-200 bg-white",children:t("div",{className:"divide-y divide-slate-100",children:0===n.length?t("p",{className:"px-4 py-6 text-sm text-slate-500",children:"No hay movimientos recientes."}):n.map((n,i)=>t("article",{className:"px-4 py-3",children:e("div",{className:"flex flex-col gap-2 md:flex-row md:items-start md:justify-between",children:[e("div",{className:"min-w-0",children:[t("p",{className:"font-medium text-slate-900",children:n.lector.descripcion||"Sin lector"}),e("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-slate-500",children:[n.tipo?t("span",{className:"rounded-full bg-slate-100 px-2 py-0.5 text-slate-600",children:n.tipo}):null,n.lector.id?e("span",{children:["RFID ",n.lector.id]}):null,n.observaciones?t("span",{children:n.observaciones}):null]})]}),t("time",{className:"text-sm text-slate-500",dateTime:n.fecha,children:rc(n.fecha)})]})},`${n.fecha}-${i}`))})}),mc=({items:n})=>t("div",{className:"rounded-xl border border-slate-200 bg-white",children:t("div",{className:"divide-y divide-slate-100",children:0===n.length?t("p",{className:"px-4 py-6 text-sm text-slate-500",children:"Sin novedades recientes."}):n.map(n=>{return t("article",{className:"px-4 py-3",children:e("div",{className:"flex flex-col gap-2 md:flex-row md:items-start md:justify-between",children:[e("div",{className:"min-w-0 space-y-1",children:[e("div",{className:"flex flex-wrap items-center gap-2",children:[t("span",{className:"rounded-full bg-blue-50 px-2 py-0.5 text-xs font-semibold text-blue-700",children:n.tipo}),t("span",{className:"text-xs text-slate-500",children:n.estado})]}),t("p",{className:"text-sm text-slate-700",children:n.descripcion}),e("p",{className:"text-xs text-slate-500",children:["Responsable: ",n.responsable]}),n.respuesta?t("p",{className:"rounded-lg bg-slate-50 px-3 py-2 text-sm text-slate-700",children:n.respuesta}):null]}),t("time",{className:"shrink-0 text-sm text-slate-500",dateTime:n.fecha,children:(i=n.fecha,new Intl.DateTimeFormat("es-CO",{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(i)))})]})},n.id);var i})})}),pc=({items:n})=>t("div",{className:"rounded-xl border border-slate-200 bg-white",children:t("div",{className:"divide-y divide-slate-100",children:0===n.length?t("p",{className:"px-4 py-6 text-sm text-slate-500",children:"Sin paradas registradas."}):n.map((n,i)=>{const o=`Parada ${n.orden??i+1}`,s=n.time??n.horaProgramada;return t("article",{className:"px-4 py-3",children:e("div",{className:"flex flex-col gap-2 md:flex-row md:items-start md:justify-between",children:[e("div",{className:"min-w-0",children:[t("p",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:o}),t("p",{className:"font-medium text-slate-900",children:n.address??"Dirección no disponible"}),e("div",{className:"mt-1 flex flex-wrap gap-2 text-xs text-slate-500",children:[n.estado?t("span",{className:"rounded-full bg-slate-100 px-2 py-0.5",children:n.estado}):null,n.horaReal?e("span",{children:["Hora real: ",n.horaReal]}):null,n.observaciones?t("span",{children:n.observaciones}):null]})]}),s?t("span",{className:"text-sm text-slate-500",children:s}):null]})},n.id??`${i}`)})})}),fc=({items:n})=>t("div",{className:"rounded-xl border border-slate-200 bg-white",children:t("div",{className:"divide-y divide-slate-100",children:0===n.length?t("p",{className:"px-4 py-6 text-sm text-slate-500",children:"Sin recorridos asociados."}):n.map(n=>t("article",{className:"w-full px-4 py-3",children:e("div",{className:"w-full space-y-3",children:[e("div",{className:"flex w-full flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[e("div",{className:"min-w-0 flex-1",children:[t("p",{className:"font-medium text-slate-900",children:n.nombreRecorrido}),n.tipoRecorrido?t("p",{className:"mt-0.5 text-xs text-slate-500",children:n.tipoRecorrido}):null]}),n.estadoActual?t("span",{className:"inline-flex shrink-0 rounded-full bg-indigo-50 px-2.5 py-0.5 text-xs font-semibold text-indigo-700",children:n.estadoActual}):null]}),e("div",{className:"flex flex-wrap gap-2 text-xs text-slate-500",children:[n.numeroFlota?e("span",{children:["Flota ",n.numeroFlota]}):null,n.placaBus?t("span",{children:n.placaBus}):null]}),e("dl",{className:"grid w-full gap-3 text-sm text-slate-600 sm:grid-cols-2",children:[(n.horaInicio||n.horaFin)&&e("div",{children:[t("dt",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:"Horario"}),e("dd",{className:"mt-1 font-medium text-slate-800",children:[n.horaInicio??"—"," – ",n.horaFin??"—"]})]}),(n.nombreAuxiliar||n.nombreOperario)&&e("div",{children:[t("dt",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:"Equipo"}),e("dd",{className:"mt-1 font-medium text-slate-800",children:["Auxiliar: ",n.nombreAuxiliar??"—",t("br",{}),"Operario: ",n.nombreOperario??"—"]})]}),n.diasRecorrido?e("div",{className:"sm:col-span-2",children:[t("dt",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:"Días programados"}),t("dd",{className:"mt-1 font-medium text-slate-800",children:n.diasRecorrido})]}):null]}),n.ultimoEvento?t("p",{className:"w-full rounded-lg bg-indigo-50 px-3 py-2 text-sm font-medium text-indigo-900",children:n.ultimoEvento}):null]})},n.idRecorrido))})}),gc={pass:["personas_autorizadas","ultimos_movimientos"],seguimiento:["paradas","recorridos","ultimas_novedades"]},yc=(t="pass")=>{const e=String(t).trim().toLowerCase();return"seguimiento"===e||e.includes("seguimiento")?"seguimiento":"pass"},vc=(t,e)=>new Set(gc[yc(e)]).has(t),xc=(t,e)=>{const n=yc(e),i=gc[n],o=new Set(i);return[...t.filter(t=>o.has(t.id))].sort((t,e)=>i.indexOf(t.id)-i.indexOf(e.id))},bc={pass:{title:"Resumen del estudiante",description:"Autorizaciones y movimientos recientes del estudiante.",emptyMessage:"No hay autorizaciones ni movimientos recientes para mostrar."},seguimiento:{title:"Resumen del estudiante",description:"Paradas, recorridos y novedades del transporte escolar.",emptyMessage:"No hay paradas ni recorridos registrados para este estudiante."}},wc=e=>{switch(e.id){case"ultimas_novedades":return t(mc,{items:e.items});case"personas_autorizadas":return t(uc,{items:e.items});case"ultimos_movimientos":return t(hc,{items:e.items});case"paradas":return t(pc,{items:e.items});case"recorridos":return t(fc,{items:e.items});default:return null}},Sc=({open:n,onClose:i,context:o="pass",student:s,generalGroups:r,sections:a=[],photoUrl:l,title:c,description:d,loading:u=!1,error:m,onReload:p})=>{const f=yc(o),g=bc[f],y=c??g.title,v=d??g.description,x=h(()=>r??[{id:"datos_basicos",title:"Datos básicos",rows:[{id:"nombres",label:"Nombres",value:s.nombres??""},{id:"apellidos",label:"Apellidos",value:s.apellidos??""},{id:"curso",label:"Curso",value:s.curso??""},{id:"codigoFamilia",label:"Código familia",value:s.codigoFamilia??""}]},{id:"transporte",title:"Transporte",rows:[{id:"transporte",label:"Transporte",value:s.transporte??""},{id:"saleSolo",label:"Sale solo",value:s.saleSolo??""},{id:"bajaSolo",label:"Baja solo",value:s.bajaSolo??""}]},{id:"contacto",title:"Contacto y registro",rows:[{id:"direccionCasa",label:"Dirección",value:s.direccionCasa??""},{id:"rfid",label:"RFID",value:s.rfid??""},{id:"idSchoolRegistration",label:"Registro escolar",value:s.idSchoolRegistration??""}]}],[r,s]),b=h(()=>[s.nombres,s.apellidos].filter(Boolean).join(" ")||"Sin nombre",[s.nombres,s.apellidos]),w=h(()=>xc(a??[],o),[a,o]);return e(Gl,{open:n,onClose:i,size:"xl",overlayClassName:"z-[1000]",className:"z-[1001] [&_.modal-content]:!max-h-[85vh] [&_.modal-body]:!max-h-none [&_.modal-body]:!overflow-y-auto",title:y,description:v,children:[t(Yl,{className:"px-4 pb-6",children:e("div",{className:"space-y-5",children:[t("section",{className:"rounded-2xl border border-slate-200 bg-white p-5",children:e("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e("div",{className:"min-w-0",children:[t("p",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:"Estudiante"}),t("h2",{className:"truncate text-xl font-semibold text-slate-900",children:b}),e("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-slate-500",children:[s.id?e("span",{children:["ID ",s.id]}):null,s.curso?e("span",{children:["Curso ",s.curso]}):null,s.codigoFamilia?e("span",{children:["Familia ",s.codigoFamilia]}):null,t("span",{className:"seguimiento"===f?"rounded-full bg-emerald-50 px-2 py-0.5 font-medium text-emerald-800":"rounded-full bg-indigo-50 px-2 py-0.5 font-medium text-indigo-700",children:"seguimiento"===f?"Seguimiento":"PASS"})]})]}),n&&l?t("img",{src:l,alt:`Foto de ${b}`,className:"h-28 w-28 rounded-2xl object-cover ring-1 ring-slate-200 md:h-32 md:w-32",loading:"lazy"}):null]})}),t(dc,{groups:x}),u?t("section",{className:"rounded-xl border border-slate-200 bg-white p-6 text-sm text-slate-500",children:"Cargando resumen..."}):m?e("section",{className:"rounded-xl border border-red-200 bg-red-50 p-6 text-sm text-red-700",children:[t("p",{className:"font-semibold",children:"No se pudo cargar el resumen."}),t("p",{className:"mt-1",children:m})]}):w.length>0?w.map(n=>{const i=n.title??lc[n.id]??"Sección",o=cc[n.id];return e("section",{className:"w-full space-y-3",children:[e("div",{children:[t("h3",{className:"text-base font-semibold text-slate-900",children:i}),o?t("p",{className:"text-sm text-slate-500",children:o}):null,n.meta?.maxItems?e("p",{className:"mt-1 text-xs text-slate-400",children:["Mostrando hasta ",n.meta.maxItems," registros recientes."]}):null]}),wc(n)]},n.id)}):t("section",{className:"rounded-xl border border-dashed border-slate-200 bg-slate-50 p-6 text-center text-sm text-slate-500",children:g.emptyMessage})]})}),t(_l,{children:e("div",{className:"flex w-full justify-end gap-2",children:[m&&p?t(C,{variant:"secondary",onClick:p,children:"Reintentar"}):null,t(C,{variant:"secondary",onClick:i,children:"Cerrar"})]})})]})};function kc(t){return R({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"},child:[]}]})(t)}function Cc(){return t("div",{className:"flex min-h-screen flex-col items-center justify-center bg-gray-50",children:e("div",{className:"container flex max-w-md flex-col items-center justify-center gap-8 px-4 py-16 text-center",children:[t("div",{className:"flex items-center justify-center",children:e("div",{className:"relative flex flex-col items-center",children:[t("div",{className:"h-80 w-4 bg-gray-700"}),e("div",{className:"top-4 flex h-auto w-auto min-w-[12rem] flex-col items-center justify-center rounded-lg bg-primary-botech text-white shadow-lg p-4",children:[t("div",{className:"flex-1 mb-2",children:e("h1",{className:"text-xl/4 text-white font-seguimiento-h",children:["BO-TECH ",t("span",{className:"text-sm block",children:"SEGUIMIENTO"})]})}),t("span",{className:"text-4xl font-bold",children:"404"}),t("span",{className:"text-xs mt-1",children:"RUTA NO ENCONTRADA"})]})]})}),e("div",{className:"space-y-3",children:[t("h2",{className:"text-2xl font-bold tracking-tight text-gray-900",children:"¡Esta parada no existe!"}),t("p",{className:"text-gray-600",children:"Parece que estás esperando en una parada de autobús que no está en nuestra ruta. La página que buscas no se encuentra disponible."})]}),e("button",{className:"flex items-center gap-2 bg-primary-botech hover:bg-primary-botech/90 text-white px-4 py-2 rounded",onClick:()=>{window.location.href="/"},children:[t(kc,{className:"h-4 w-4"}),t("span",{children:"Volver a la ruta principal"})]})]})})}const Nc="#1e40af",Tc="#93c5fd",Pc="#60a5fa",Ec="#1e3a8a",Ac=`\n .ba-left {\n display: none;\n flex-direction: column;\n }\n .ba-right {\n width: 100%;\n }\n .ba-sysname {\n position: absolute;\n top: 2rem;\n left: 0;\n right: 0;\n display: flex;\n justify-content: center;\n pointer-events: none;\n }\n @media (min-width: 768px) {\n .ba-left { display: flex; width: 50%; padding: 1.5rem; }\n .ba-right { width: 50%; padding: 4rem; }\n .ba-sysname { top: 3rem; }\n }\n\n /* Inputs */\n .ba-input {\n width: 100%;\n padding: 14px 16px;\n background: #f5f7f9;\n border: 1px solid transparent;\n border-radius: 8px;\n font-size: 14px;\n color: #111827;\n outline: none;\n transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;\n box-sizing: border-box;\n font-family: inherit;\n }\n .ba-input:focus {\n background: white;\n border-color: ${Nc};\n box-shadow: 0 0 0 1px ${Nc};\n }\n .ba-input::placeholder { color: #9ca3af; }\n .ba-input:disabled { opacity: 0.6; cursor: not-allowed; }\n\n /* Monospace input (product key) */\n .ba-input-mono {\n font-family: monospace;\n letter-spacing: 1.2px;\n }\n\n /* Primary black button */\n .ba-btn-primary {\n width: 100%;\n padding: 16px;\n background: #111827;\n color: white;\n font-size: 15px;\n font-weight: 600;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n letter-spacing: 0.025em;\n transition: background 0.2s, box-shadow 0.2s;\n font-family: inherit;\n }\n .ba-btn-primary:hover:not(:disabled) {\n background: #1f2937;\n box-shadow: 0 4px 12px rgba(0,0,0,0.15);\n }\n .ba-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }\n\n /* Blue primary button (modal) */\n .ba-btn-blue {\n width: 100%;\n padding: 10px 16px;\n background: ${Nc};\n color: white;\n font-size: 14px;\n font-weight: 600;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n transition: opacity 0.15s;\n font-family: inherit;\n }\n .ba-btn-blue:hover:not(:disabled) { opacity: 0.9; }\n .ba-btn-blue:disabled { background: #9ca3af; cursor: not-allowed; }\n\n /* Secondary text button */\n .ba-btn-secondary {\n width: 100%;\n padding: 12px;\n background: none;\n color: #4b5563;\n font-size: 14px;\n font-weight: 600;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n transition: color 0.15s;\n font-family: inherit;\n }\n .ba-btn-secondary:hover:not(:disabled) { color: #111827; }\n .ba-btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }\n\n /* Google overlay button (visual only, invisible Google iframe sits on top) */\n .ba-btn-google {\n width: 100%;\n padding: 16px;\n background: white;\n color: #111827;\n font-size: 15px;\n font-weight: 600;\n border: 1px solid #d1d5db;\n border-radius: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n pointer-events: none;\n transition: background 0.15s;\n letter-spacing: 0.025em;\n }\n\n /* Link-style buttons */\n .ba-link {\n background: none;\n border: none;\n cursor: pointer;\n font-weight: 700;\n color: #111827;\n transition: color 0.15s;\n font-size: inherit;\n font-family: inherit;\n padding: 0;\n }\n .ba-link:hover { color: ${"#1d4ed8"}; }\n\n .ba-link-blue {\n background: none;\n border: none;\n cursor: pointer;\n font-weight: 600;\n color: ${"#2563eb"};\n transition: color 0.15s;\n font-size: 13px;\n font-family: inherit;\n padding: 0;\n }\n .ba-link-blue:hover { color: ${Ec}; }\n\n .ba-link-gray {\n background: none;\n border: none;\n cursor: pointer;\n font-weight: 600;\n color: #6b7280;\n transition: color 0.15s;\n font-size: 13px;\n font-family: inherit;\n padding: 0;\n }\n .ba-link-gray:hover { color: ${Nc}; }\n\n /* Password eye toggle */\n .ba-eye {\n position: absolute;\n right: 16px;\n top: 50%;\n transform: translateY(-50%);\n background: none;\n border: none;\n cursor: pointer;\n color: #6b7280;\n display: flex;\n align-items: center;\n transition: color 0.15s;\n padding: 0;\n }\n .ba-eye:hover { color: ${Nc}; }\n\n /* Step indicator circles */\n .ba-step-active {\n width: 32px; height: 32px;\n border-radius: 50%;\n background: ${Nc};\n color: white;\n display: flex; align-items: center; justify-content: center;\n font-size: 14px; font-weight: 500;\n }\n .ba-step-done {\n width: 32px; height: 32px;\n border-radius: 50%;\n background: #22c55e;\n color: white;\n display: flex; align-items: center; justify-content: center;\n font-size: 14px; font-weight: 500;\n }\n .ba-step-inactive {\n width: 32px; height: 32px;\n border-radius: 50%;\n background: #d1d5db;\n color: #4b5563;\n display: flex; align-items: center; justify-content: center;\n font-size: 14px; font-weight: 500;\n }\n\n /* Modal */\n .ba-modal-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0,0,0,0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n padding: 16px;\n }\n .ba-modal-close {\n background: none; border: none; cursor: pointer;\n color: #9ca3af; display: flex;\n transition: color 0.15s; padding: 0;\n }\n .ba-modal-close:hover { color: #4b5563; }\n\n /* Divider */\n .ba-divider {\n position: relative;\n margin: 20px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .ba-divider::before {\n content: '';\n position: absolute;\n left: 0; right: 0; top: 50%;\n border-top: 1px solid #d1d5db;\n }\n .ba-divider span {\n position: relative;\n background: white;\n padding: 0 8px;\n font-size: 14px;\n color: #6b7280;\n }\n\n /* Status boxes */\n .ba-status-success { background: #e7f7ee; color: #1e7e34; border-radius: 6px; padding: 12px; margin-top: 16px; font-size: 14px; }\n .ba-status-error { background: #fdecea; color: #b00020; border-radius: 6px; padding: 12px; margin-top: 16px; font-size: 14px; }\n .ba-status-loading { background: transparent; color: #374151; border-radius: 6px; padding: 12px; margin-top: 16px; font-size: 14px; }\n`;function Mc({systemName:n,leftPanelTitle:i,quote:o='"Todas las cosas buenas en este mundo empezaron con un sueño."',quoteAuthor:s="— Willy Wonka",children:r}){return e("div",{style:{display:"flex",minHeight:"100vh",backgroundColor:"white"},children:[t("style",{children:Ac}),e("div",{style:{display:"flex",width:"100%",minHeight:"100vh"},children:[t("div",{className:"ba-left",style:{backgroundColor:"white"},children:e("div",{style:{position:"relative",width:"100%",height:"100%",borderRadius:"2.5rem",backgroundColor:"black",display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"3.5rem",overflow:"hidden",boxShadow:"0 10px 25px -5px rgba(0,0,0,0.1), 0 4px 10px -5px rgba(0,0,0,0.04)",border:"1px solid #f3f4f6"},children:[t("div",{style:{position:"absolute",inset:0,background:`linear-gradient(135deg, ${Ec}, black 60%, black)`,opacity:.85,pointerEvents:"none"}}),t("div",{style:{position:"absolute",top:"-10%",left:"-20%",width:"150%",height:"60%",background:"linear-gradient(45deg, rgba(37,99,235,0.3), rgba(96,165,250,0.1))",filter:"blur(80px)",borderRadius:"50%",transform:"rotate(-15deg)",pointerEvents:"none"}}),t("div",{style:{position:"absolute",top:"20%",left:"-10%",width:"120%",height:"40%",background:"linear-gradient(90deg, transparent, rgba(96,165,250,0.8), transparent)",filter:"blur(40px)",mixBlendMode:"screen",transform:"rotate(10deg)",opacity:.6,pointerEvents:"none"}}),t("div",{style:{position:"absolute",top:"35%",left:"-10%",width:"120%",height:"30%",background:"linear-gradient(90deg, transparent, rgba(147,197,253,0.8), transparent)",filter:"blur(30px)",mixBlendMode:"screen",transform:"rotate(-5deg)",opacity:.7,pointerEvents:"none"}}),t("div",{style:{position:"absolute",bottom:"-10%",right:"-20%",width:"120%",height:"60%",background:"linear-gradient(225deg, rgba(29,78,216,0.4), transparent)",filter:"blur(100px)",borderRadius:"50%",transform:"rotate(25deg)",pointerEvents:"none"}}),t("div",{style:{position:"relative",zIndex:10,width:"100%",marginBottom:"2.5rem"},children:e("p",{style:{fontSize:"2.25rem",letterSpacing:"-0.025em",fontWeight:700,textTransform:"uppercase",opacity:.9,display:"flex",alignItems:"center",gap:"1rem",color:"white",fontFamily:"Afacad, sans-serif",margin:0},children:["BOTECH",t("span",{style:{height:"1px",width:"4rem",backgroundColor:"rgba(255,255,255,0.4)",display:"block"}})]})}),e("div",{style:{position:"relative",zIndex:10,marginTop:"auto",paddingBottom:"1rem"},children:[t("h2",{style:{fontSize:"3rem",fontFamily:'Georgia, "Times New Roman", serif',lineHeight:1,color:"white",letterSpacing:"-0.025em",margin:"0 0 1.5rem 0"},children:i}),e("div",{style:{borderLeft:`2px solid ${Pc}`,paddingLeft:"1rem",paddingTop:"0.25rem",paddingBottom:"0.25rem"},children:[t("p",{style:{fontSize:"14px",fontWeight:300,color:"#d1d5db",maxWidth:"320px",lineHeight:1.625,opacity:.9,fontStyle:"italic",margin:"0 0 0.5rem 0"},children:o}),t("p",{style:{fontSize:"11px",fontWeight:700,color:Tc,textTransform:"uppercase",letterSpacing:"0.1em",margin:0},children:s})]})]})]})}),e("div",{className:"ba-right",style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:"white",padding:"2rem",position:"relative"},children:[t("div",{className:"ba-sysname",children:t("span",{style:{fontSize:"2.5rem",fontWeight:700,letterSpacing:"-0.025em",color:Nc,fontFamily:"Afacad, sans-serif"},children:n})}),r]})]})]})}function Dc(t){return R({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"},child:[]}]})(t)}function Lc(t){return R({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 0 0 0-51.5zm-63.57-320.64L836 122.88a8 8 0 0 0-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 0 0 0 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 0 0 0 11.31L155.17 889a8 8 0 0 0 11.31 0l712.15-712.12a8 8 0 0 0 0-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 0 0-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 0 1 146.2-106.69L401.31 546.2A112 112 0 0 1 396 512z"},child:[]},{tag:"path",attr:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 0 0 227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 0 1-112 112z"},child:[]}]})(t)}function Vc(t){return R({tag:"svg",attr:{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 48 48",enableBackground:"new 0 0 48 48"},child:[{tag:"path",attr:{fill:"#FFC107",d:"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12\r\n\tc0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24\r\n\tc0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z"},child:[]},{tag:"path",attr:{fill:"#FF3D00",d:"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657\r\n\tC34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z"},child:[]},{tag:"path",attr:{fill:"#4CAF50",d:"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36\r\n\tc-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z"},child:[]},{tag:"path",attr:{fill:"#1976D2",d:"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571\r\n\tc0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z"},child:[]}]})(t)}function Rc({isOpen:n,onClose:i,onSendReset:o}){const[s,r]=g(""),[a,l]=g("idle"),[c,d]=g("");if(!n)return null;const u=()=>{r(""),l("idle"),d(""),i()};return t("div",{className:"ba-modal-overlay",children:e("div",{style:{backgroundColor:"white",borderRadius:"8px",boxShadow:"0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04)",maxWidth:"448px",width:"100%",padding:"24px"},children:[e("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16px"},children:[t("h2",{style:{fontSize:"20px",fontWeight:600,color:"#111827",margin:0},children:"Restablecer Contraseña"}),t("button",{className:"ba-modal-close",onClick:u,disabled:"loading"===a,children:t("svg",{width:"24",height:"24",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("p",{style:{fontSize:"14px",color:"#4b5563",marginBottom:"24px",margin:"0 0 24px 0"},children:"Ingresa tu correo electrónico y te enviaremos un enlace para restablecer tu contraseña."}),e("form",{onSubmit:async t=>{if(t.preventDefault(),!s.trim())return l("error"),void d("Por favor ingresa tu correo electrónico.");l("loading"),d("");const e=await o(s);e.ok?(l("success"),d(e.message??"Correo enviado exitosamente."),setTimeout(u,3e3)):(l("error"),d(e.error??"Ocurrió un error al enviar el correo."))},noValidate:!0,children:[e("div",{style:{marginBottom:"16px"},children:[t("label",{htmlFor:"reset-email",style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:500,color:"#374151"},children:"Correo Electrónico"}),t("input",{id:"reset-email",className:"ba-input",type:"email",autoComplete:"email",placeholder:"ejemplo@correo.com",value:s,onChange:t=>r(t.target.value),disabled:"loading"===a||"success"===a})]}),t("button",{type:"submit",className:"ba-btn-blue",disabled:"loading"===a||"success"===a,children:"loading"===a?"Enviando...":"Enviar Enlace de Restablecimiento"}),"idle"!==a&&t("div",{role:"status",className:`ba-status-${a}`,children:c})]})]})})}function Bc({systemName:n,leftPanelTitle:i,quote:o,quoteAuthor:s,googleClientId:a,onLogin:c,onGoogleCredential:d,onForgotPassword:u,onNavigateToRegister:h}){const[m,p]=g(""),[f,y]=g(""),[v,x]=g(!1),[b,w]=g(!1),S=r(!1);return l(()=>{if(S.current)return;const t=()=>{if(S.current)return!0;const t=document.getElementById("google-btn-login");if(!window.google?.accounts?.id||!t)return!1;try{return S.current=!0,t.innerHTML="",window.google.accounts.id.initialize({client_id:a,callback:async t=>{await d(t.credential)}}),window.google.accounts.id.renderButton(t,{theme:"outline",size:"large",text:"continue_with",width:320}),!0}catch{return S.current=!1,!1}};if(t())return;const e=setInterval(()=>{t()&&clearInterval(e)},150);return()=>clearInterval(e)},[a]),e(Mc,{systemName:n,leftPanelTitle:i,quote:o,quoteAuthor:s,children:[e("div",{style:{textAlign:"center",width:"100%",marginTop:"1.5rem",marginBottom:"2rem",maxWidth:"480px"},children:[t("h2",{style:{fontSize:"2.5rem",fontFamily:'Georgia, "Times New Roman", serif',color:"#111827",marginBottom:"0.75rem",letterSpacing:"-0.025em",margin:"0 0 0.75rem 0"},children:"Bienvenido de nuevo"}),t("p",{style:{fontSize:"14px",color:"#6b7280",fontWeight:500,letterSpacing:"0.025em",margin:0},children:"Ingresa tu correo y contraseña para acceder al sistema."})]}),e("form",{onSubmit:async t=>{t.preventDefault(),m&&f&&await c(m,f)},style:{width:"100%",maxWidth:"480px",display:"flex",flexDirection:"column"},children:[e("div",{style:{width:"100%",marginBottom:"20px"},children:[t("label",{style:{display:"block",fontSize:"13px",fontWeight:600,color:"#111827",marginBottom:"8px"},children:"Correo electrónico"}),t("input",{className:"ba-input",placeholder:"ejemplo@correo.com",name:"email",type:"email",value:m,onChange:t=>p(t.target.value)})]}),e("div",{style:{width:"100%",marginBottom:"24px"},children:[t("label",{style:{display:"block",fontSize:"13px",fontWeight:600,color:"#111827",marginBottom:"8px"},children:"Contraseña"}),e("div",{style:{position:"relative"},children:[t("input",{className:"ba-input",style:{paddingRight:"48px"},placeholder:"Tu contraseña secreta",type:v?"text":"password",name:"password",value:f,onChange:t=>y(t.target.value)}),t("button",{type:"button",className:"ba-eye",onClick:()=>x(t=>!t),children:t(v?Lc:Dc,{size:20})})]})]}),t("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end",marginBottom:"32px"},children:t("button",{type:"button",className:"ba-link-blue",onClick:()=>w(!0),children:"¿Olvidaste tu contraseña?"})}),t("button",{className:"ba-btn-primary",type:"submit",style:{marginBottom:"16px"},children:"Ingresar al sistema"}),e("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center"},children:[e("button",{type:"button",className:"ba-btn-google",children:[t(Vc,{size:22}),"Continuar con Google"]}),t("div",{id:"google-btn-login",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:.01,zIndex:10,overflow:"hidden"}})]})]}),t("div",{style:{textAlign:"center",width:"100%",marginTop:"32px"},children:e("p",{style:{fontSize:"14px",color:"#4b5563",fontWeight:500,letterSpacing:"0.025em",margin:0},children:["¿Aún no tienes cuenta?"," ",t("button",{className:"ba-link",onClick:h,children:"Regístrate aquí"})]})}),t(Rc,{isOpen:b,onClose:()=>w(!1),onSendReset:u})]})}const jc=/^[A-Z0-9]{3}-[A-Z0-9]{2}-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{7}-[A-Z0-9]{1,100}$/;function Ic(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,122)}function Oc({systemName:i,leftPanelTitle:o,quote:s,quoteAuthor:a,googleClientId:c,systemCode:d,onValidateKey:u,onRegisterWithForm:m,onRegisterWithSSO:p,onFirebaseGoogleSignIn:f,onGoogleAuthLogin:y,onNavigateToLogin:v,onSuccess:x}){const[b,w]=g(""),[S,k]=g("idle"),[C,N]=g(""),[T,P]=g(""),[E,A]=g(1),[M,D]=g(""),[L,V]=g(""),[R,B]=g(""),[j,I]=g(""),[O,F]=g("idle"),[z,$]=g(""),W=r(null),U=r(!1),X=h(()=>function(t){const e=t.toUpperCase().replace(/[^A-Z0-9]/g,"");return[e.slice(0,3),e.slice(3,5),e.slice(5,10),e.slice(10,15),e.slice(15,22),e.slice(22)].filter(Boolean).join("-")}(b),[b]),H=h(()=>jc.test(X),[X]);l(()=>{W.current?.focus()},[]),l(()=>{if(2!==E)return;if(U.current)return;const t=()=>{if(U.current)return!0;const t=document.getElementById("google-rpk-container");if(!window.google?.accounts?.id||!t)return!1;try{return U.current=!0,t.innerHTML="",window.google.accounts.id.initialize({client_id:c,callback:async t=>{await Y(t.credential)}}),window.google.accounts.id.renderButton(t,{theme:"outline",size:"large",text:"continue_with",width:320}),!0}catch{return U.current=!1,!1}};if(t())return;const e=setInterval(()=>{t()&&clearInterval(e)},150);return()=>clearInterval(e)},[E]);const Y=async t=>{F("loading"),$("Validando con Google...");const e=await f(t);if(!e.ok)return F("error"),void $(e.error??"No se pudo autenticar con Google.");const n=await p({productKey:X,idToken:e.idToken,firebaseUid:e.localId,email:e.email,systemCode:d,fullName:M||e.displayName||"Usuario Google",phoneNumber:L,tokenFcm:""});if(n.ok){F("success"),$("Registro correcto con Google.");try{await y({idToken:e.idToken,firebaseUid:e.localId,systemCode:d})}catch{}x()}else F("error"),$(n.error??"No se pudo completar el registro.")},_=(e,n)=>"idle"===e?null:t("div",{role:"status",className:`ba-status-${e}`,children:n});return e(Mc,{systemName:i,leftPanelTitle:o,quote:s,quoteAuthor:a,children:[t("div",{style:{position:"absolute",top:"2rem",left:"2rem"},children:t("button",{className:"ba-link-gray",onClick:v,children:"← Volver al inicio"})}),e("div",{style:{width:"100%",maxWidth:"480px",display:"flex",flexDirection:"column",justifyContent:"center",flex:1,marginTop:"2.5rem"},children:[t("div",{style:{textAlign:"center",width:"100%",marginBottom:"32px"},children:t("h2",{style:{fontSize:"2.5rem",fontFamily:'Georgia, "Times New Roman", serif',color:"#111827",letterSpacing:"-0.025em",margin:0},children:"Registro de Llave"})}),t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"24px"},children:e("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[t("div",{className:1===E?"ba-step-active":"ba-step-done",children:1===E?"1":"✓"}),t("span",{style:{fontSize:"14px",fontWeight:500,color:"#374151"},children:"Validar Llave"}),t("div",{style:{width:"48px",height:"2px",backgroundColor:"#d1d5db",margin:"0 8px"}}),t("div",{className:2===E?"ba-step-active":"ba-step-inactive",children:"2"}),t("span",{style:{fontSize:"14px",fontWeight:500,color:"#374151"},children:"Registro de Usuario"})]})}),1===E&&e(n,{children:[t("h1",{style:{fontSize:"20px",fontWeight:600,color:"#111827",margin:"0 0 8px 0"},children:"Registro de llave de producto"}),e("p",{style:{fontSize:"14px",color:"#6b7280",fontWeight:500,letterSpacing:"0.025em",margin:"0 0 24px 0"},children:["Ingresa tu llave de producto en el formato",t("br",{}),"XXX-XX-XXXXX-XXXXX-XXXXXXX-[clave]."]}),e("form",{onSubmit:async t=>{if(t.preventDefault(),!H||"loading"===S)return;k("loading"),P(X);const e=await u(X);e.ok?(k("success"),N(e.message??"Llave validada correctamente."),setTimeout(()=>A(2),800)):(k("error"),N(e.error??"Llave inválida o ya utilizada."))},noValidate:!0,style:{display:"flex",flexDirection:"column"},children:[t("label",{htmlFor:"productKey",style:{display:"block",fontSize:"13px",fontWeight:600,color:"#111827",marginBottom:"8px"},children:"Llave de producto"}),t("input",{id:"productKey",ref:W,className:"ba-input ba-input-mono",type:"text",inputMode:"text",autoComplete:"off",placeholder:"AB1-C0-0DE06-FGHIJ-00K1L2M-1234567",value:X,onChange:t=>{k("idle"),N(""),w(Ic(t.target.value))},onPaste:t=>{t.preventDefault(),w(Ic(t.clipboardData.getData("text")))},maxLength:122,"aria-invalid":!H&&b.length>0,style:{borderColor:0===b.length?"transparent":H?"#22c55e":"#f87171"},disabled:"loading"===S||"success"===S}),t("div",{style:{fontSize:"12px",color:H||0===b.length?"#6b7280":"#dc2626",marginTop:"6px"},children:0===b.length?"Solo letras y números. Se formatea automáticamente.":H?"Formato válido.":"Formato inválido. Debe ser XXX-XX-XXXXX-XXXXX-XXXXXXX-[clave]."}),e("div",{style:{display:"flex",flexDirection:"column",gap:"12px",marginTop:"24px"},children:[t("button",{type:"submit",className:"ba-btn-primary",disabled:!H||"loading"===S||"success"===S,children:"loading"===S?"Validando...":"Validar Llave"}),t("button",{type:"button",className:"ba-btn-secondary",onClick:()=>{w(""),k("idle"),N(""),A(1),D(""),V(""),B(""),I(""),F("idle"),$(""),U.current=!1,W.current?.focus()},disabled:"loading"===S,children:"Limpiar"})]}),_(S,C)]})]}),2===E&&e(n,{children:[t("h1",{style:{fontSize:"20px",fontWeight:600,color:"#111827",margin:"0 0 8px 0"},children:"Completa tu registro"}),t("p",{style:{fontSize:"14px",color:"#6b7280",margin:"0 0 16px 0"},children:"Ingresa tus datos para completar el registro."}),e("div",{style:{marginBottom:"16px"},children:[e("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center"},children:[e("button",{type:"button",className:"ba-btn-google",children:[t(Vc,{size:22}),"Continuar con Google"]}),t("div",{id:"google-rpk-container",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:.01,zIndex:10,overflow:"hidden"}})]}),t("div",{className:"ba-divider",children:t("span",{children:"o registrarse con email"})})]}),e("form",{onSubmit:async t=>{if(t.preventDefault(),"loading"===O)return;if(!(M.trim()&&L.trim()&&R.trim()&&j.trim()))return F("error"),void $("Por favor completa todos los campos.");if(j.length<6)return F("error"),void $("La contraseña debe tener al menos 6 caracteres.");F("loading");const e=await m(R,j,M,L,T);e.ok?(F("success"),$("Usuario registrado correctamente."),x()):(F("error"),$(e.error??"Error al registrar el usuario."))},noValidate:!0,style:{display:"flex",flexDirection:"column",gap:"16px"},children:[[{id:"fullName",label:"Nombre Completo",type:"text",value:M,setter:D,placeholder:"Juan Pérez",autoComplete:"name"},{id:"phoneNumber",label:"Número de Teléfono",type:"tel",value:L,setter:V,placeholder:"+57 300 000 0000",autoComplete:"tel"},{id:"email",label:"Correo Electrónico",type:"email",value:R,setter:B,placeholder:"ejemplo@correo.com",autoComplete:"email"},{id:"password",label:"Contraseña",type:"password",value:j,setter:I,placeholder:"Mínimo 6 caracteres",autoComplete:"new-password"}].map(({id:n,label:i,type:o,value:s,setter:r,placeholder:a,autoComplete:l})=>e("div",{children:[t("label",{htmlFor:n,style:{display:"block",fontSize:"13px",fontWeight:600,color:"#111827",marginBottom:"8px"},children:i}),t("input",{id:n,className:"ba-input",type:o,autoComplete:l,placeholder:a,value:s,onChange:t=>r(t.target.value),disabled:"loading"===O||"success"===O})]},n)),e("div",{style:{display:"flex",flexDirection:"column",gap:"12px",paddingTop:"8px"},children:[t("button",{type:"submit",className:"ba-btn-primary",disabled:"loading"===O||"success"===O,children:"loading"===O?"Registrando...":"Registrar Usuario"}),t("button",{type:"button",className:"ba-btn-secondary",onClick:()=>{A(1),F("idle"),$(""),U.current=!1},disabled:"loading"===O,children:"Volver"})]}),_(O,z)]})]})]})]})}const Fc=({profiles:i,currentProfileId:o,onSwitch:s})=>{const[r,a]=g(!1),[l,c]=g(!1);if(i.length<=1)return null;const d=i.find(t=>t.profileId===o);return t("div",{className:"fixed bottom-3 right-4 z-50",children:e("div",{className:"relative",children:[e("button",{onClick:()=>a(!r),disabled:l,className:"flex items-center gap-2 bg-white text-primary-botech border border-primary-botech/30 shadow-md hover:shadow-lg hover:bg-primary-botech/5 text-sm font-semibold px-3 py-2 rounded-full transition-all disabled:opacity-60",children:[t($l,{className:"size-4 shrink-0"}),t("span",{className:"hidden sm:inline max-w-[160px] truncate",children:d?.kindSlug??"Perfil"}),t(Ul,{className:"size-3 shrink-0 transition-transform hidden sm:block "+(r?"rotate-180":"")})]}),r&&e(n,{children:[t("div",{className:"fixed inset-0 z-40",onClick:()=>a(!1)}),e("div",{className:"absolute right-0 bottom-full mb-2 w-64 sm:w-72 rounded-xl shadow-xl border border-white/30 z-50 overflow-hidden backdrop-blur-md bg-white/80",children:[t("div",{className:"px-3 py-2 border-b border-white/40 bg-white/40",children:t("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Cambiar perfil"})}),i.map(n=>{const i=n.profileId===o;return e("button",{onClick:()=>(async t=>{if(t!==o&&!l){c(!0),a(!1);try{await s(t)}finally{c(!1)}}})(n.profileId),className:"w-full flex items-center justify-between px-3 py-3 text-left border-b border-white/30 last:border-0 transition-colors\n "+(i?"bg-primary-botech/10":"hover:bg-primary-botech/5 active:bg-primary-botech/10"),children:[e("div",{className:"flex items-center gap-2.5 min-w-0",children:[t($l,{className:"size-5 shrink-0 "+(i?"text-primary-botech":"text-gray-300")}),e("div",{className:"min-w-0",children:[t("div",{className:"text-sm font-semibold text-gray-900",children:n.kindSlug}),t("div",{className:"text-xs text-gray-500 truncate",children:n.schoolName})]})]}),i&&t(Xl,{className:"size-3.5 text-primary-botech shrink-0 ml-2"})]},n.profileId)})]})]})]})})};function zc(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=>e[t]??"-"}))}export{Mc as AuthLayout,C as Button,Il as DownloadStudentsExcelButton,sc as GenericTable,U as Header,N as IconButton,Bc as LoginPage,Gl as Modal,Yl as ModalBody,_l as ModalFooter,Hl as ModalHeader,zl as MultiSelector,Cc as NotFound,Rc as PasswordResetModal,Fc as ProfileSwitcher,Oc as RegisterProductKeyPage,gc as SECTION_IDS_BY_CONTEXT,Vl as Sidebar,Fl as SingleSelector,Sc as StudentSummaryModal,Ol as UploadStudentsExcelButton,Bl as downloadStudentsExcel,zc as generateTableColumns,Rl as getBackendPrefix,xc as getSectionsForContext,vc as isSectionAllowedForContext,yc as normalizeStudentSummaryContext,jl as uploadStudentsExcel,ql as useModal};
2
2
  //# sourceMappingURL=index.js.map