spotify/dist/assets/index-DMWoNld2.js
2025-10-21 15:43:52 +02:00

517 lines
488 KiB
JavaScript

function vy(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();function wu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zh={exports:{}},Fo={},Jh={exports:{}},K={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var si=Symbol.for("react.element"),xy=Symbol.for("react.portal"),wy=Symbol.for("react.fragment"),by=Symbol.for("react.strict_mode"),Sy=Symbol.for("react.profiler"),ky=Symbol.for("react.provider"),jy=Symbol.for("react.context"),Cy=Symbol.for("react.forward_ref"),Ny=Symbol.for("react.suspense"),Py=Symbol.for("react.memo"),Ey=Symbol.for("react.lazy"),Jc=Symbol.iterator;function Ty(e){return e===null||typeof e!="object"?null:(e=Jc&&e[Jc]||e["@@iterator"],typeof e=="function"?e:null)}var ep={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},tp=Object.assign,rp={};function Wn(e,t,r){this.props=e,this.context=t,this.refs=rp,this.updater=r||ep}Wn.prototype.isReactComponent={};Wn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Wn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function np(){}np.prototype=Wn.prototype;function bu(e,t,r){this.props=e,this.context=t,this.refs=rp,this.updater=r||ep}var Su=bu.prototype=new np;Su.constructor=bu;tp(Su,Wn.prototype);Su.isPureReactComponent=!0;var ed=Array.isArray,sp=Object.prototype.hasOwnProperty,ku={current:null},ip={key:!0,ref:!0,__self:!0,__source:!0};function op(e,t,r){var n,s={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)sp.call(t,n)&&!ip.hasOwnProperty(n)&&(s[n]=t[n]);var a=arguments.length-2;if(a===1)s.children=r;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];s.children=l}if(e&&e.defaultProps)for(n in a=e.defaultProps,a)s[n]===void 0&&(s[n]=a[n]);return{$$typeof:si,type:e,key:i,ref:o,props:s,_owner:ku.current}}function My(e,t){return{$$typeof:si,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ju(e){return typeof e=="object"&&e!==null&&e.$$typeof===si}function Ay(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var td=/\/+/g;function fa(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ay(""+e.key):t.toString(36)}function Ii(e,t,r,n,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case si:case xy:o=!0}}if(o)return o=e,s=s(o),e=n===""?"."+fa(o,0):n,ed(s)?(r="",e!=null&&(r=e.replace(td,"$&/")+"/"),Ii(s,t,r,"",function(c){return c})):s!=null&&(ju(s)&&(s=My(s,r+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(td,"$&/")+"/")+e)),t.push(s)),1;if(o=0,n=n===""?".":n+":",ed(e))for(var a=0;a<e.length;a++){i=e[a];var l=n+fa(i,a);o+=Ii(i,t,r,l,s)}else if(l=Ty(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=n+fa(i,a++),o+=Ii(i,t,r,l,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function mi(e,t,r){if(e==null)return e;var n=[],s=0;return Ii(e,n,"","",function(i){return t.call(r,i,s++)}),n}function _y(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Be={current:null},zi={transition:null},Ly={ReactCurrentDispatcher:Be,ReactCurrentBatchConfig:zi,ReactCurrentOwner:ku};function ap(){throw Error("act(...) is not supported in production builds of React.")}K.Children={map:mi,forEach:function(e,t,r){mi(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return mi(e,function(){t++}),t},toArray:function(e){return mi(e,function(t){return t})||[]},only:function(e){if(!ju(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};K.Component=Wn;K.Fragment=wy;K.Profiler=Sy;K.PureComponent=bu;K.StrictMode=by;K.Suspense=Ny;K.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ly;K.act=ap;K.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=tp({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=ku.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)sp.call(t,l)&&!ip.hasOwnProperty(l)&&(n[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];n.children=a}return{$$typeof:si,type:e.type,key:s,ref:i,props:n,_owner:o}};K.createContext=function(e){return e={$$typeof:jy,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:ky,_context:e},e.Consumer=e};K.createElement=op;K.createFactory=function(e){var t=op.bind(null,e);return t.type=e,t};K.createRef=function(){return{current:null}};K.forwardRef=function(e){return{$$typeof:Cy,render:e}};K.isValidElement=ju;K.lazy=function(e){return{$$typeof:Ey,_payload:{_status:-1,_result:e},_init:_y}};K.memo=function(e,t){return{$$typeof:Py,type:e,compare:t===void 0?null:t}};K.startTransition=function(e){var t=zi.transition;zi.transition={};try{e()}finally{zi.transition=t}};K.unstable_act=ap;K.useCallback=function(e,t){return Be.current.useCallback(e,t)};K.useContext=function(e){return Be.current.useContext(e)};K.useDebugValue=function(){};K.useDeferredValue=function(e){return Be.current.useDeferredValue(e)};K.useEffect=function(e,t){return Be.current.useEffect(e,t)};K.useId=function(){return Be.current.useId()};K.useImperativeHandle=function(e,t,r){return Be.current.useImperativeHandle(e,t,r)};K.useInsertionEffect=function(e,t){return Be.current.useInsertionEffect(e,t)};K.useLayoutEffect=function(e,t){return Be.current.useLayoutEffect(e,t)};K.useMemo=function(e,t){return Be.current.useMemo(e,t)};K.useReducer=function(e,t,r){return Be.current.useReducer(e,t,r)};K.useRef=function(e){return Be.current.useRef(e)};K.useState=function(e){return Be.current.useState(e)};K.useSyncExternalStore=function(e,t,r){return Be.current.useSyncExternalStore(e,t,r)};K.useTransition=function(){return Be.current.useTransition()};K.version="18.3.1";Jh.exports=K;var S=Jh.exports;const ii=wu(S),Dy=vy({__proto__:null,default:ii},[S]);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ry=S,Vy=Symbol.for("react.element"),Fy=Symbol.for("react.fragment"),Iy=Object.prototype.hasOwnProperty,zy=Ry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Oy={key:!0,ref:!0,__self:!0,__source:!0};function lp(e,t,r){var n,s={},i=null,o=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)Iy.call(t,n)&&!Oy.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:Vy,type:e,key:i,ref:o,props:s,_owner:zy.current}}Fo.Fragment=Fy;Fo.jsx=lp;Fo.jsxs=lp;Zh.exports=Fo;var h=Zh.exports,il={},up={exports:{}},st={},cp={exports:{}},dp={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(e){function t(_,A){var I=_.length;_.push(A);e:for(;0<I;){var R=I-1>>>1,E=_[R];if(0<s(E,A))_[R]=A,_[I]=E,I=R;else break e}}function r(_){return _.length===0?null:_[0]}function n(_){if(_.length===0)return null;var A=_[0],I=_.pop();if(I!==A){_[0]=I;e:for(var R=0,E=_.length,H=E>>>1;R<H;){var X=2*(R+1)-1,ee=_[X],q=X+1,me=_[q];if(0>s(ee,I))q<E&&0>s(me,ee)?(_[R]=me,_[q]=I,R=q):(_[R]=ee,_[X]=I,R=X);else if(q<E&&0>s(me,I))_[R]=me,_[q]=I,R=q;else break e}}return A}function s(_,A){var I=_.sortIndex-A.sortIndex;return I!==0?I:_.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,f=null,u=3,p=!1,m=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(_){for(var A=r(c);A!==null;){if(A.callback===null)n(c);else if(A.startTime<=_)n(c),A.sortIndex=A.expirationTime,t(l,A);else break;A=r(c)}}function b(_){if(g=!1,x(_),!m)if(r(l)!==null)m=!0,M(k);else{var A=r(c);A!==null&&W(b,A.startTime-_)}}function k(_,A){m=!1,g&&(g=!1,v(P),P=-1),p=!0;var I=u;try{for(x(A),f=r(l);f!==null&&(!(f.expirationTime>A)||_&&!O());){var R=f.callback;if(typeof R=="function"){f.callback=null,u=f.priorityLevel;var E=R(f.expirationTime<=A);A=e.unstable_now(),typeof E=="function"?f.callback=E:f===r(l)&&n(l),x(A)}else n(l);f=r(l)}if(f!==null)var H=!0;else{var X=r(c);X!==null&&W(b,X.startTime-A),H=!1}return H}finally{f=null,u=I,p=!1}}var C=!1,N=null,P=-1,V=5,T=-1;function O(){return!(e.unstable_now()-T<V)}function j(){if(N!==null){var _=e.unstable_now();T=_;var A=!0;try{A=N(!0,_)}finally{A?F():(C=!1,N=null)}}else C=!1}var F;if(typeof y=="function")F=function(){y(j)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,G=D.port2;D.port1.onmessage=j,F=function(){G.postMessage(null)}}else F=function(){w(j,0)};function M(_){N=_,C||(C=!0,F())}function W(_,A){P=w(function(){_(e.unstable_now())},A)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(_){_.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,M(k))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return u},e.unstable_getFirstCallbackNode=function(){return r(l)},e.unstable_next=function(_){switch(u){case 1:case 2:case 3:var A=3;break;default:A=u}var I=u;u=A;try{return _()}finally{u=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,A){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var I=u;u=_;try{return A()}finally{u=I}},e.unstable_scheduleCallback=function(_,A,I){var R=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?R+I:R):I=R,_){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=I+E,_={id:d++,callback:A,priorityLevel:_,startTime:I,expirationTime:E,sortIndex:-1},I>R?(_.sortIndex=I,t(c,_),r(l)===null&&_===r(c)&&(g?(v(P),P=-1):g=!0,W(b,I-R))):(_.sortIndex=E,t(l,_),m||p||(m=!0,M(k))),_},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(_){var A=u;return function(){var I=u;u=A;try{return _.apply(this,arguments)}finally{u=I}}}})(dp);cp.exports=dp;var $y=cp.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var By=S,rt=$y;function L(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var fp=new Set,Rs={};function tn(e,t){Ln(e,t),Ln(e+"Capture",t)}function Ln(e,t){for(Rs[e]=t,e=0;e<t.length;e++)fp.add(t[e])}var Wt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ol=Object.prototype.hasOwnProperty,Uy=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,rd={},nd={};function Wy(e){return ol.call(nd,e)?!0:ol.call(rd,e)?!1:Uy.test(e)?nd[e]=!0:(rd[e]=!0,!1)}function Hy(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function qy(e,t,r,n){if(t===null||typeof t>"u"||Hy(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ue(e,t,r,n,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ae[e]=new Ue(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ae[t]=new Ue(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ae[e]=new Ue(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ae[e]=new Ue(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ae[e]=new Ue(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ae[e]=new Ue(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ae[e]=new Ue(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ae[e]=new Ue(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ae[e]=new Ue(e,5,!1,e.toLowerCase(),null,!1,!1)});var Cu=/[\-:]([a-z])/g;function Nu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Cu,Nu);Ae[t]=new Ue(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Cu,Nu);Ae[t]=new Ue(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Cu,Nu);Ae[t]=new Ue(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ae[e]=new Ue(e,1,!1,e.toLowerCase(),null,!1,!1)});Ae.xlinkHref=new Ue("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ae[e]=new Ue(e,1,!1,e.toLowerCase(),null,!0,!0)});function Pu(e,t,r,n){var s=Ae.hasOwnProperty(t)?Ae[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(qy(t,r,s,n)&&(r=null),n||s===null?Wy(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Qt=By.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,gi=Symbol.for("react.element"),un=Symbol.for("react.portal"),cn=Symbol.for("react.fragment"),Eu=Symbol.for("react.strict_mode"),al=Symbol.for("react.profiler"),hp=Symbol.for("react.provider"),pp=Symbol.for("react.context"),Tu=Symbol.for("react.forward_ref"),ll=Symbol.for("react.suspense"),ul=Symbol.for("react.suspense_list"),Mu=Symbol.for("react.memo"),nr=Symbol.for("react.lazy"),mp=Symbol.for("react.offscreen"),sd=Symbol.iterator;function es(e){return e===null||typeof e!="object"?null:(e=sd&&e[sd]||e["@@iterator"],typeof e=="function"?e:null)}var pe=Object.assign,ha;function fs(e){if(ha===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);ha=t&&t[1]||""}return`
`+ha+e}var pa=!1;function ma(e,t){if(!e||pa)return"";pa=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&typeof c.stack=="string"){for(var s=c.stack.split(`
`),i=n.stack.split(`
`),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=`
`+s[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{pa=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?fs(e):""}function Gy(e){switch(e.tag){case 5:return fs(e.type);case 16:return fs("Lazy");case 13:return fs("Suspense");case 19:return fs("SuspenseList");case 0:case 2:case 15:return e=ma(e.type,!1),e;case 11:return e=ma(e.type.render,!1),e;case 1:return e=ma(e.type,!0),e;default:return""}}function cl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case cn:return"Fragment";case un:return"Portal";case al:return"Profiler";case Eu:return"StrictMode";case ll:return"Suspense";case ul:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case pp:return(e.displayName||"Context")+".Consumer";case hp:return(e._context.displayName||"Context")+".Provider";case Tu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Mu:return t=e.displayName||null,t!==null?t:cl(e.type)||"Memo";case nr:t=e._payload,e=e._init;try{return cl(e(t))}catch{}}return null}function Yy(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return cl(t);case 8:return t===Eu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Sr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ky(e){var t=gp(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yi(e){e._valueTracker||(e._valueTracker=Ky(e))}function yp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=gp(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function eo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function dl(e,t){var r=t.checked;return pe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function id(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Sr(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function vp(e,t){t=t.checked,t!=null&&Pu(e,"checked",t,!1)}function fl(e,t){vp(e,t);var r=Sr(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?hl(e,t.type,r):t.hasOwnProperty("defaultValue")&&hl(e,t.type,Sr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function od(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function hl(e,t,r){(t!=="number"||eo(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var hs=Array.isArray;function Cn(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Sr(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function pl(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(L(91));return pe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ad(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(L(92));if(hs(r)){if(1<r.length)throw Error(L(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Sr(r)}}function xp(e,t){var r=Sr(t.value),n=Sr(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function ld(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function wp(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ml(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?wp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var vi,bp=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(vi=vi||document.createElement("div"),vi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=vi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Vs(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ys={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Xy=["Webkit","ms","Moz","O"];Object.keys(ys).forEach(function(e){Xy.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ys[t]=ys[e]})});function Sp(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ys.hasOwnProperty(e)&&ys[e]?(""+t).trim():t+"px"}function kp(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Sp(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var Qy=pe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function gl(e,t){if(t){if(Qy[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function yl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vl=null;function Au(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xl=null,Nn=null,Pn=null;function ud(e){if(e=li(e)){if(typeof xl!="function")throw Error(L(280));var t=e.stateNode;t&&(t=Bo(t),xl(e.stateNode,e.type,t))}}function jp(e){Nn?Pn?Pn.push(e):Pn=[e]:Nn=e}function Cp(){if(Nn){var e=Nn,t=Pn;if(Pn=Nn=null,ud(e),t)for(e=0;e<t.length;e++)ud(t[e])}}function Np(e,t){return e(t)}function Pp(){}var ga=!1;function Ep(e,t,r){if(ga)return e(t,r);ga=!0;try{return Np(e,t,r)}finally{ga=!1,(Nn!==null||Pn!==null)&&(Pp(),Cp())}}function Fs(e,t){var r=e.stateNode;if(r===null)return null;var n=Bo(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(L(231,t,typeof r));return r}var wl=!1;if(Wt)try{var ts={};Object.defineProperty(ts,"passive",{get:function(){wl=!0}}),window.addEventListener("test",ts,ts),window.removeEventListener("test",ts,ts)}catch{wl=!1}function Zy(e,t,r,n,s,i,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(d){this.onError(d)}}var vs=!1,to=null,ro=!1,bl=null,Jy={onError:function(e){vs=!0,to=e}};function e1(e,t,r,n,s,i,o,a,l){vs=!1,to=null,Zy.apply(Jy,arguments)}function t1(e,t,r,n,s,i,o,a,l){if(e1.apply(this,arguments),vs){if(vs){var c=to;vs=!1,to=null}else throw Error(L(198));ro||(ro=!0,bl=c)}}function rn(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Tp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function cd(e){if(rn(e)!==e)throw Error(L(188))}function r1(e){var t=e.alternate;if(!t){if(t=rn(e),t===null)throw Error(L(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===r)return cd(s),e;if(i===n)return cd(s),t;i=i.sibling}throw Error(L(188))}if(r.return!==n.return)r=s,n=i;else{for(var o=!1,a=s.child;a;){if(a===r){o=!0,r=s,n=i;break}if(a===n){o=!0,n=s,r=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===r){o=!0,r=i,n=s;break}if(a===n){o=!0,n=i,r=s;break}a=a.sibling}if(!o)throw Error(L(189))}}if(r.alternate!==n)throw Error(L(190))}if(r.tag!==3)throw Error(L(188));return r.stateNode.current===r?e:t}function Mp(e){return e=r1(e),e!==null?Ap(e):null}function Ap(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ap(e);if(t!==null)return t;e=e.sibling}return null}var _p=rt.unstable_scheduleCallback,dd=rt.unstable_cancelCallback,n1=rt.unstable_shouldYield,s1=rt.unstable_requestPaint,ve=rt.unstable_now,i1=rt.unstable_getCurrentPriorityLevel,_u=rt.unstable_ImmediatePriority,Lp=rt.unstable_UserBlockingPriority,no=rt.unstable_NormalPriority,o1=rt.unstable_LowPriority,Dp=rt.unstable_IdlePriority,Io=null,Tt=null;function a1(e){if(Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(Io,e,void 0,(e.current.flags&128)===128)}catch{}}var xt=Math.clz32?Math.clz32:c1,l1=Math.log,u1=Math.LN2;function c1(e){return e>>>=0,e===0?32:31-(l1(e)/u1|0)|0}var xi=64,wi=4194304;function ps(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function so(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var a=o&~s;a!==0?n=ps(a):(i&=o,i!==0&&(n=ps(i)))}else o=r&~s,o!==0?n=ps(o):i!==0&&(n=ps(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-xt(t),s=1<<r,n|=e[r],t&=~s;return n}function d1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function f1(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-xt(i),a=1<<o,l=s[o];l===-1?(!(a&r)||a&n)&&(s[o]=d1(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Sl(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Rp(){var e=xi;return xi<<=1,!(xi&4194240)&&(xi=64),e}function ya(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function oi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-xt(t),e[t]=r}function h1(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-xt(r),i=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~i}}function Lu(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-xt(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var J=0;function Vp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Fp,Du,Ip,zp,Op,kl=!1,bi=[],fr=null,hr=null,pr=null,Is=new Map,zs=new Map,or=[],p1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function fd(e,t){switch(e){case"focusin":case"focusout":fr=null;break;case"dragenter":case"dragleave":hr=null;break;case"mouseover":case"mouseout":pr=null;break;case"pointerover":case"pointerout":Is.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":zs.delete(t.pointerId)}}function rs(e,t,r,n,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},t!==null&&(t=li(t),t!==null&&Du(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function m1(e,t,r,n,s){switch(t){case"focusin":return fr=rs(fr,e,t,r,n,s),!0;case"dragenter":return hr=rs(hr,e,t,r,n,s),!0;case"mouseover":return pr=rs(pr,e,t,r,n,s),!0;case"pointerover":var i=s.pointerId;return Is.set(i,rs(Is.get(i)||null,e,t,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,zs.set(i,rs(zs.get(i)||null,e,t,r,n,s)),!0}return!1}function $p(e){var t=Br(e.target);if(t!==null){var r=rn(t);if(r!==null){if(t=r.tag,t===13){if(t=Tp(r),t!==null){e.blockedOn=t,Op(e.priority,function(){Ip(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Oi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=jl(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);vl=n,r.target.dispatchEvent(n),vl=null}else return t=li(r),t!==null&&Du(t),e.blockedOn=r,!1;t.shift()}return!0}function hd(e,t,r){Oi(e)&&r.delete(t)}function g1(){kl=!1,fr!==null&&Oi(fr)&&(fr=null),hr!==null&&Oi(hr)&&(hr=null),pr!==null&&Oi(pr)&&(pr=null),Is.forEach(hd),zs.forEach(hd)}function ns(e,t){e.blockedOn===t&&(e.blockedOn=null,kl||(kl=!0,rt.unstable_scheduleCallback(rt.unstable_NormalPriority,g1)))}function Os(e){function t(s){return ns(s,e)}if(0<bi.length){ns(bi[0],e);for(var r=1;r<bi.length;r++){var n=bi[r];n.blockedOn===e&&(n.blockedOn=null)}}for(fr!==null&&ns(fr,e),hr!==null&&ns(hr,e),pr!==null&&ns(pr,e),Is.forEach(t),zs.forEach(t),r=0;r<or.length;r++)n=or[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<or.length&&(r=or[0],r.blockedOn===null);)$p(r),r.blockedOn===null&&or.shift()}var En=Qt.ReactCurrentBatchConfig,io=!0;function y1(e,t,r,n){var s=J,i=En.transition;En.transition=null;try{J=1,Ru(e,t,r,n)}finally{J=s,En.transition=i}}function v1(e,t,r,n){var s=J,i=En.transition;En.transition=null;try{J=4,Ru(e,t,r,n)}finally{J=s,En.transition=i}}function Ru(e,t,r,n){if(io){var s=jl(e,t,r,n);if(s===null)Pa(e,t,n,oo,r),fd(e,n);else if(m1(s,e,t,r,n))n.stopPropagation();else if(fd(e,n),t&4&&-1<p1.indexOf(e)){for(;s!==null;){var i=li(s);if(i!==null&&Fp(i),i=jl(e,t,r,n),i===null&&Pa(e,t,n,oo,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else Pa(e,t,n,null,r)}}var oo=null;function jl(e,t,r,n){if(oo=null,e=Au(n),e=Br(e),e!==null)if(t=rn(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Tp(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return oo=e,null}function Bp(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(i1()){case _u:return 1;case Lp:return 4;case no:case o1:return 16;case Dp:return 536870912;default:return 16}default:return 16}}var ur=null,Vu=null,$i=null;function Up(){if($i)return $i;var e,t=Vu,r=t.length,n,s="value"in ur?ur.value:ur.textContent,i=s.length;for(e=0;e<r&&t[e]===s[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===s[i-n];n++);return $i=s.slice(e,1<n?1-n:void 0)}function Bi(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Si(){return!0}function pd(){return!1}function it(e){function t(r,n,s,i,o){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(r=e[a],this[a]=r?r(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Si:pd,this.isPropagationStopped=pd,this}return pe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Si)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Si)},persist:function(){},isPersistent:Si}),t}var Hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fu=it(Hn),ai=pe({},Hn,{view:0,detail:0}),x1=it(ai),va,xa,ss,zo=pe({},ai,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Iu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ss&&(ss&&e.type==="mousemove"?(va=e.screenX-ss.screenX,xa=e.screenY-ss.screenY):xa=va=0,ss=e),va)},movementY:function(e){return"movementY"in e?e.movementY:xa}}),md=it(zo),w1=pe({},zo,{dataTransfer:0}),b1=it(w1),S1=pe({},ai,{relatedTarget:0}),wa=it(S1),k1=pe({},Hn,{animationName:0,elapsedTime:0,pseudoElement:0}),j1=it(k1),C1=pe({},Hn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),N1=it(C1),P1=pe({},Hn,{data:0}),gd=it(P1),E1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},T1={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},M1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function A1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=M1[e])?!!t[e]:!1}function Iu(){return A1}var _1=pe({},ai,{key:function(e){if(e.key){var t=E1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?T1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Iu,charCode:function(e){return e.type==="keypress"?Bi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),L1=it(_1),D1=pe({},zo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yd=it(D1),R1=pe({},ai,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Iu}),V1=it(R1),F1=pe({},Hn,{propertyName:0,elapsedTime:0,pseudoElement:0}),I1=it(F1),z1=pe({},zo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),O1=it(z1),$1=[9,13,27,32],zu=Wt&&"CompositionEvent"in window,xs=null;Wt&&"documentMode"in document&&(xs=document.documentMode);var B1=Wt&&"TextEvent"in window&&!xs,Wp=Wt&&(!zu||xs&&8<xs&&11>=xs),vd=" ",xd=!1;function Hp(e,t){switch(e){case"keyup":return $1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var dn=!1;function U1(e,t){switch(e){case"compositionend":return qp(t);case"keypress":return t.which!==32?null:(xd=!0,vd);case"textInput":return e=t.data,e===vd&&xd?null:e;default:return null}}function W1(e,t){if(dn)return e==="compositionend"||!zu&&Hp(e,t)?(e=Up(),$i=Vu=ur=null,dn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Wp&&t.locale!=="ko"?null:t.data;default:return null}}var H1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!H1[e.type]:t==="textarea"}function Gp(e,t,r,n){jp(n),t=ao(t,"onChange"),0<t.length&&(r=new Fu("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var ws=null,$s=null;function q1(e){sm(e,0)}function Oo(e){var t=pn(e);if(yp(t))return e}function G1(e,t){if(e==="change")return t}var Yp=!1;if(Wt){var ba;if(Wt){var Sa="oninput"in document;if(!Sa){var bd=document.createElement("div");bd.setAttribute("oninput","return;"),Sa=typeof bd.oninput=="function"}ba=Sa}else ba=!1;Yp=ba&&(!document.documentMode||9<document.documentMode)}function Sd(){ws&&(ws.detachEvent("onpropertychange",Kp),$s=ws=null)}function Kp(e){if(e.propertyName==="value"&&Oo($s)){var t=[];Gp(t,$s,e,Au(e)),Ep(q1,t)}}function Y1(e,t,r){e==="focusin"?(Sd(),ws=t,$s=r,ws.attachEvent("onpropertychange",Kp)):e==="focusout"&&Sd()}function K1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Oo($s)}function X1(e,t){if(e==="click")return Oo(t)}function Q1(e,t){if(e==="input"||e==="change")return Oo(t)}function Z1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bt=typeof Object.is=="function"?Object.is:Z1;function Bs(e,t){if(bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!ol.call(t,s)||!bt(e[s],t[s]))return!1}return!0}function kd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jd(e,t){var r=kd(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=kd(r)}}function Xp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qp(){for(var e=window,t=eo();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=eo(e.document)}return t}function Ou(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function J1(e){var t=Qp(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Xp(r.ownerDocument.documentElement,r)){if(n!==null&&Ou(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!e.extend&&i>n&&(s=n,n=i,i=s),s=jd(r,i);var o=jd(r,n);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ev=Wt&&"documentMode"in document&&11>=document.documentMode,fn=null,Cl=null,bs=null,Nl=!1;function Cd(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Nl||fn==null||fn!==eo(n)||(n=fn,"selectionStart"in n&&Ou(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),bs&&Bs(bs,n)||(bs=n,n=ao(Cl,"onSelect"),0<n.length&&(t=new Fu("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=fn)))}function ki(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var hn={animationend:ki("Animation","AnimationEnd"),animationiteration:ki("Animation","AnimationIteration"),animationstart:ki("Animation","AnimationStart"),transitionend:ki("Transition","TransitionEnd")},ka={},Zp={};Wt&&(Zp=document.createElement("div").style,"AnimationEvent"in window||(delete hn.animationend.animation,delete hn.animationiteration.animation,delete hn.animationstart.animation),"TransitionEvent"in window||delete hn.transitionend.transition);function $o(e){if(ka[e])return ka[e];if(!hn[e])return e;var t=hn[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Zp)return ka[e]=t[r];return e}var Jp=$o("animationend"),em=$o("animationiteration"),tm=$o("animationstart"),rm=$o("transitionend"),nm=new Map,Nd="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Pr(e,t){nm.set(e,t),tn(t,[e])}for(var ja=0;ja<Nd.length;ja++){var Ca=Nd[ja],tv=Ca.toLowerCase(),rv=Ca[0].toUpperCase()+Ca.slice(1);Pr(tv,"on"+rv)}Pr(Jp,"onAnimationEnd");Pr(em,"onAnimationIteration");Pr(tm,"onAnimationStart");Pr("dblclick","onDoubleClick");Pr("focusin","onFocus");Pr("focusout","onBlur");Pr(rm,"onTransitionEnd");Ln("onMouseEnter",["mouseout","mouseover"]);Ln("onMouseLeave",["mouseout","mouseover"]);Ln("onPointerEnter",["pointerout","pointerover"]);Ln("onPointerLeave",["pointerout","pointerover"]);tn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));tn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));tn("onBeforeInput",["compositionend","keypress","textInput","paste"]);tn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));tn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));tn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ms="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),nv=new Set("cancel close invalid load scroll toggle".split(" ").concat(ms));function Pd(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,t1(n,t,void 0,e),e.currentTarget=null}function sm(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var o=n.length-1;0<=o;o--){var a=n[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;Pd(s,a,c),i=l}else for(o=0;o<n.length;o++){if(a=n[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;Pd(s,a,c),i=l}}}if(ro)throw e=bl,ro=!1,bl=null,e}function ie(e,t){var r=t[Al];r===void 0&&(r=t[Al]=new Set);var n=e+"__bubble";r.has(n)||(im(t,e,2,!1),r.add(n))}function Na(e,t,r){var n=0;t&&(n|=4),im(r,e,n,t)}var ji="_reactListening"+Math.random().toString(36).slice(2);function Us(e){if(!e[ji]){e[ji]=!0,fp.forEach(function(r){r!=="selectionchange"&&(nv.has(r)||Na(r,!1,e),Na(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ji]||(t[ji]=!0,Na("selectionchange",!1,t))}}function im(e,t,r,n){switch(Bp(t)){case 1:var s=y1;break;case 4:s=v1;break;default:s=Ru}r=s.bind(null,t,r,e),s=void 0,!wl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function Pa(e,t,r,n,s){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var a=n.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=n.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=Br(a),o===null)return;if(l=o.tag,l===5||l===6){n=i=o;continue e}a=a.parentNode}}n=n.return}Ep(function(){var c=i,d=Au(r),f=[];e:{var u=nm.get(e);if(u!==void 0){var p=Fu,m=e;switch(e){case"keypress":if(Bi(r)===0)break e;case"keydown":case"keyup":p=L1;break;case"focusin":m="focus",p=wa;break;case"focusout":m="blur",p=wa;break;case"beforeblur":case"afterblur":p=wa;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=md;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=b1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=V1;break;case Jp:case em:case tm:p=j1;break;case rm:p=I1;break;case"scroll":p=x1;break;case"wheel":p=O1;break;case"copy":case"cut":case"paste":p=N1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=yd}var g=(t&4)!==0,w=!g&&e==="scroll",v=g?u!==null?u+"Capture":null:u;g=[];for(var y=c,x;y!==null;){x=y;var b=x.stateNode;if(x.tag===5&&b!==null&&(x=b,v!==null&&(b=Fs(y,v),b!=null&&g.push(Ws(y,b,x)))),w)break;y=y.return}0<g.length&&(u=new p(u,m,null,r,d),f.push({event:u,listeners:g}))}}if(!(t&7)){e:{if(u=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",u&&r!==vl&&(m=r.relatedTarget||r.fromElement)&&(Br(m)||m[Ht]))break e;if((p||u)&&(u=d.window===d?d:(u=d.ownerDocument)?u.defaultView||u.parentWindow:window,p?(m=r.relatedTarget||r.toElement,p=c,m=m?Br(m):null,m!==null&&(w=rn(m),m!==w||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(g=md,b="onMouseLeave",v="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=yd,b="onPointerLeave",v="onPointerEnter",y="pointer"),w=p==null?u:pn(p),x=m==null?u:pn(m),u=new g(b,y+"leave",p,r,d),u.target=w,u.relatedTarget=x,b=null,Br(d)===c&&(g=new g(v,y+"enter",m,r,d),g.target=x,g.relatedTarget=w,b=g),w=b,p&&m)t:{for(g=p,v=m,y=0,x=g;x;x=ln(x))y++;for(x=0,b=v;b;b=ln(b))x++;for(;0<y-x;)g=ln(g),y--;for(;0<x-y;)v=ln(v),x--;for(;y--;){if(g===v||v!==null&&g===v.alternate)break t;g=ln(g),v=ln(v)}g=null}else g=null;p!==null&&Ed(f,u,p,g,!1),m!==null&&w!==null&&Ed(f,w,m,g,!0)}}e:{if(u=c?pn(c):window,p=u.nodeName&&u.nodeName.toLowerCase(),p==="select"||p==="input"&&u.type==="file")var k=G1;else if(wd(u))if(Yp)k=Q1;else{k=K1;var C=Y1}else(p=u.nodeName)&&p.toLowerCase()==="input"&&(u.type==="checkbox"||u.type==="radio")&&(k=X1);if(k&&(k=k(e,c))){Gp(f,k,r,d);break e}C&&C(e,u,c),e==="focusout"&&(C=u._wrapperState)&&C.controlled&&u.type==="number"&&hl(u,"number",u.value)}switch(C=c?pn(c):window,e){case"focusin":(wd(C)||C.contentEditable==="true")&&(fn=C,Cl=c,bs=null);break;case"focusout":bs=Cl=fn=null;break;case"mousedown":Nl=!0;break;case"contextmenu":case"mouseup":case"dragend":Nl=!1,Cd(f,r,d);break;case"selectionchange":if(ev)break;case"keydown":case"keyup":Cd(f,r,d)}var N;if(zu)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else dn?Hp(e,r)&&(P="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(P="onCompositionStart");P&&(Wp&&r.locale!=="ko"&&(dn||P!=="onCompositionStart"?P==="onCompositionEnd"&&dn&&(N=Up()):(ur=d,Vu="value"in ur?ur.value:ur.textContent,dn=!0)),C=ao(c,P),0<C.length&&(P=new gd(P,e,null,r,d),f.push({event:P,listeners:C}),N?P.data=N:(N=qp(r),N!==null&&(P.data=N)))),(N=B1?U1(e,r):W1(e,r))&&(c=ao(c,"onBeforeInput"),0<c.length&&(d=new gd("onBeforeInput","beforeinput",null,r,d),f.push({event:d,listeners:c}),d.data=N))}sm(f,t)})}function Ws(e,t,r){return{instance:e,listener:t,currentTarget:r}}function ao(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Fs(e,r),i!=null&&n.unshift(Ws(e,i,s)),i=Fs(e,t),i!=null&&n.push(Ws(e,i,s))),e=e.return}return n}function ln(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ed(e,t,r,n,s){for(var i=t._reactName,o=[];r!==null&&r!==n;){var a=r,l=a.alternate,c=a.stateNode;if(l!==null&&l===n)break;a.tag===5&&c!==null&&(a=c,s?(l=Fs(r,i),l!=null&&o.unshift(Ws(r,l,a))):s||(l=Fs(r,i),l!=null&&o.push(Ws(r,l,a)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var sv=/\r\n?/g,iv=/\u0000|\uFFFD/g;function Td(e){return(typeof e=="string"?e:""+e).replace(sv,`
`).replace(iv,"")}function Ci(e,t,r){if(t=Td(t),Td(e)!==t&&r)throw Error(L(425))}function lo(){}var Pl=null,El=null;function Tl(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ml=typeof setTimeout=="function"?setTimeout:void 0,ov=typeof clearTimeout=="function"?clearTimeout:void 0,Md=typeof Promise=="function"?Promise:void 0,av=typeof queueMicrotask=="function"?queueMicrotask:typeof Md<"u"?function(e){return Md.resolve(null).then(e).catch(lv)}:Ml;function lv(e){setTimeout(function(){throw e})}function Ea(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),Os(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);Os(t)}function mr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Ad(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var qn=Math.random().toString(36).slice(2),Nt="__reactFiber$"+qn,Hs="__reactProps$"+qn,Ht="__reactContainer$"+qn,Al="__reactEvents$"+qn,uv="__reactListeners$"+qn,cv="__reactHandles$"+qn;function Br(e){var t=e[Nt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ht]||r[Nt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Ad(e);e!==null;){if(r=e[Nt])return r;e=Ad(e)}return t}e=r,r=e.parentNode}return null}function li(e){return e=e[Nt]||e[Ht],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function pn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(L(33))}function Bo(e){return e[Hs]||null}var _l=[],mn=-1;function Er(e){return{current:e}}function ae(e){0>mn||(e.current=_l[mn],_l[mn]=null,mn--)}function re(e,t){mn++,_l[mn]=e.current,e.current=t}var kr={},Ve=Er(kr),qe=Er(!1),Kr=kr;function Dn(e,t){var r=e.type.contextTypes;if(!r)return kr;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in r)s[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ge(e){return e=e.childContextTypes,e!=null}function uo(){ae(qe),ae(Ve)}function _d(e,t,r){if(Ve.current!==kr)throw Error(L(168));re(Ve,t),re(qe,r)}function om(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(L(108,Yy(e)||"Unknown",s));return pe({},r,n)}function co(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||kr,Kr=Ve.current,re(Ve,e),re(qe,qe.current),!0}function Ld(e,t,r){var n=e.stateNode;if(!n)throw Error(L(169));r?(e=om(e,t,Kr),n.__reactInternalMemoizedMergedChildContext=e,ae(qe),ae(Ve),re(Ve,e)):ae(qe),re(qe,r)}var Ft=null,Uo=!1,Ta=!1;function am(e){Ft===null?Ft=[e]:Ft.push(e)}function dv(e){Uo=!0,am(e)}function Tr(){if(!Ta&&Ft!==null){Ta=!0;var e=0,t=J;try{var r=Ft;for(J=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Ft=null,Uo=!1}catch(s){throw Ft!==null&&(Ft=Ft.slice(e+1)),_p(_u,Tr),s}finally{J=t,Ta=!1}}return null}var gn=[],yn=0,fo=null,ho=0,lt=[],ut=0,Xr=null,It=1,zt="";function Fr(e,t){gn[yn++]=ho,gn[yn++]=fo,fo=e,ho=t}function lm(e,t,r){lt[ut++]=It,lt[ut++]=zt,lt[ut++]=Xr,Xr=e;var n=It;e=zt;var s=32-xt(n)-1;n&=~(1<<s),r+=1;var i=32-xt(t)+s;if(30<i){var o=s-s%5;i=(n&(1<<o)-1).toString(32),n>>=o,s-=o,It=1<<32-xt(t)+s|r<<s|n,zt=i+e}else It=1<<i|r<<s|n,zt=e}function $u(e){e.return!==null&&(Fr(e,1),lm(e,1,0))}function Bu(e){for(;e===fo;)fo=gn[--yn],gn[yn]=null,ho=gn[--yn],gn[yn]=null;for(;e===Xr;)Xr=lt[--ut],lt[ut]=null,zt=lt[--ut],lt[ut]=null,It=lt[--ut],lt[ut]=null}var tt=null,Je=null,ue=!1,yt=null;function um(e,t){var r=ct(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Dd(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,tt=e,Je=mr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,tt=e,Je=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Xr!==null?{id:It,overflow:zt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=ct(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,tt=e,Je=null,!0):!1;default:return!1}}function Ll(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Dl(e){if(ue){var t=Je;if(t){var r=t;if(!Dd(e,t)){if(Ll(e))throw Error(L(418));t=mr(r.nextSibling);var n=tt;t&&Dd(e,t)?um(n,r):(e.flags=e.flags&-4097|2,ue=!1,tt=e)}}else{if(Ll(e))throw Error(L(418));e.flags=e.flags&-4097|2,ue=!1,tt=e}}}function Rd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;tt=e}function Ni(e){if(e!==tt)return!1;if(!ue)return Rd(e),ue=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Tl(e.type,e.memoizedProps)),t&&(t=Je)){if(Ll(e))throw cm(),Error(L(418));for(;t;)um(e,t),t=mr(t.nextSibling)}if(Rd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(L(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Je=mr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Je=null}}else Je=tt?mr(e.stateNode.nextSibling):null;return!0}function cm(){for(var e=Je;e;)e=mr(e.nextSibling)}function Rn(){Je=tt=null,ue=!1}function Uu(e){yt===null?yt=[e]:yt.push(e)}var fv=Qt.ReactCurrentBatchConfig;function is(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(L(309));var n=r.stateNode}if(!n)throw Error(L(147,e));var s=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(L(284));if(!r._owner)throw Error(L(290,e))}return e}function Pi(e,t){throw e=Object.prototype.toString.call(t),Error(L(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vd(e){var t=e._init;return t(e._payload)}function dm(e){function t(v,y){if(e){var x=v.deletions;x===null?(v.deletions=[y],v.flags|=16):x.push(y)}}function r(v,y){if(!e)return null;for(;y!==null;)t(v,y),y=y.sibling;return null}function n(v,y){for(v=new Map;y!==null;)y.key!==null?v.set(y.key,y):v.set(y.index,y),y=y.sibling;return v}function s(v,y){return v=xr(v,y),v.index=0,v.sibling=null,v}function i(v,y,x){return v.index=x,e?(x=v.alternate,x!==null?(x=x.index,x<y?(v.flags|=2,y):x):(v.flags|=2,y)):(v.flags|=1048576,y)}function o(v){return e&&v.alternate===null&&(v.flags|=2),v}function a(v,y,x,b){return y===null||y.tag!==6?(y=Va(x,v.mode,b),y.return=v,y):(y=s(y,x),y.return=v,y)}function l(v,y,x,b){var k=x.type;return k===cn?d(v,y,x.props.children,b,x.key):y!==null&&(y.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===nr&&Vd(k)===y.type)?(b=s(y,x.props),b.ref=is(v,y,x),b.return=v,b):(b=Ki(x.type,x.key,x.props,null,v.mode,b),b.ref=is(v,y,x),b.return=v,b)}function c(v,y,x,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=Fa(x,v.mode,b),y.return=v,y):(y=s(y,x.children||[]),y.return=v,y)}function d(v,y,x,b,k){return y===null||y.tag!==7?(y=Gr(x,v.mode,b,k),y.return=v,y):(y=s(y,x),y.return=v,y)}function f(v,y,x){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Va(""+y,v.mode,x),y.return=v,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case gi:return x=Ki(y.type,y.key,y.props,null,v.mode,x),x.ref=is(v,null,y),x.return=v,x;case un:return y=Fa(y,v.mode,x),y.return=v,y;case nr:var b=y._init;return f(v,b(y._payload),x)}if(hs(y)||es(y))return y=Gr(y,v.mode,x,null),y.return=v,y;Pi(v,y)}return null}function u(v,y,x,b){var k=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return k!==null?null:a(v,y,""+x,b);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case gi:return x.key===k?l(v,y,x,b):null;case un:return x.key===k?c(v,y,x,b):null;case nr:return k=x._init,u(v,y,k(x._payload),b)}if(hs(x)||es(x))return k!==null?null:d(v,y,x,b,null);Pi(v,x)}return null}function p(v,y,x,b,k){if(typeof b=="string"&&b!==""||typeof b=="number")return v=v.get(x)||null,a(y,v,""+b,k);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case gi:return v=v.get(b.key===null?x:b.key)||null,l(y,v,b,k);case un:return v=v.get(b.key===null?x:b.key)||null,c(y,v,b,k);case nr:var C=b._init;return p(v,y,x,C(b._payload),k)}if(hs(b)||es(b))return v=v.get(x)||null,d(y,v,b,k,null);Pi(y,b)}return null}function m(v,y,x,b){for(var k=null,C=null,N=y,P=y=0,V=null;N!==null&&P<x.length;P++){N.index>P?(V=N,N=null):V=N.sibling;var T=u(v,N,x[P],b);if(T===null){N===null&&(N=V);break}e&&N&&T.alternate===null&&t(v,N),y=i(T,y,P),C===null?k=T:C.sibling=T,C=T,N=V}if(P===x.length)return r(v,N),ue&&Fr(v,P),k;if(N===null){for(;P<x.length;P++)N=f(v,x[P],b),N!==null&&(y=i(N,y,P),C===null?k=N:C.sibling=N,C=N);return ue&&Fr(v,P),k}for(N=n(v,N);P<x.length;P++)V=p(N,v,P,x[P],b),V!==null&&(e&&V.alternate!==null&&N.delete(V.key===null?P:V.key),y=i(V,y,P),C===null?k=V:C.sibling=V,C=V);return e&&N.forEach(function(O){return t(v,O)}),ue&&Fr(v,P),k}function g(v,y,x,b){var k=es(x);if(typeof k!="function")throw Error(L(150));if(x=k.call(x),x==null)throw Error(L(151));for(var C=k=null,N=y,P=y=0,V=null,T=x.next();N!==null&&!T.done;P++,T=x.next()){N.index>P?(V=N,N=null):V=N.sibling;var O=u(v,N,T.value,b);if(O===null){N===null&&(N=V);break}e&&N&&O.alternate===null&&t(v,N),y=i(O,y,P),C===null?k=O:C.sibling=O,C=O,N=V}if(T.done)return r(v,N),ue&&Fr(v,P),k;if(N===null){for(;!T.done;P++,T=x.next())T=f(v,T.value,b),T!==null&&(y=i(T,y,P),C===null?k=T:C.sibling=T,C=T);return ue&&Fr(v,P),k}for(N=n(v,N);!T.done;P++,T=x.next())T=p(N,v,P,T.value,b),T!==null&&(e&&T.alternate!==null&&N.delete(T.key===null?P:T.key),y=i(T,y,P),C===null?k=T:C.sibling=T,C=T);return e&&N.forEach(function(j){return t(v,j)}),ue&&Fr(v,P),k}function w(v,y,x,b){if(typeof x=="object"&&x!==null&&x.type===cn&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case gi:e:{for(var k=x.key,C=y;C!==null;){if(C.key===k){if(k=x.type,k===cn){if(C.tag===7){r(v,C.sibling),y=s(C,x.props.children),y.return=v,v=y;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===nr&&Vd(k)===C.type){r(v,C.sibling),y=s(C,x.props),y.ref=is(v,C,x),y.return=v,v=y;break e}r(v,C);break}else t(v,C);C=C.sibling}x.type===cn?(y=Gr(x.props.children,v.mode,b,x.key),y.return=v,v=y):(b=Ki(x.type,x.key,x.props,null,v.mode,b),b.ref=is(v,y,x),b.return=v,v=b)}return o(v);case un:e:{for(C=x.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){r(v,y.sibling),y=s(y,x.children||[]),y.return=v,v=y;break e}else{r(v,y);break}else t(v,y);y=y.sibling}y=Fa(x,v.mode,b),y.return=v,v=y}return o(v);case nr:return C=x._init,w(v,y,C(x._payload),b)}if(hs(x))return m(v,y,x,b);if(es(x))return g(v,y,x,b);Pi(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(r(v,y.sibling),y=s(y,x),y.return=v,v=y):(r(v,y),y=Va(x,v.mode,b),y.return=v,v=y),o(v)):r(v,y)}return w}var Vn=dm(!0),fm=dm(!1),po=Er(null),mo=null,vn=null,Wu=null;function Hu(){Wu=vn=mo=null}function qu(e){var t=po.current;ae(po),e._currentValue=t}function Rl(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Tn(e,t){mo=e,Wu=vn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(He=!0),e.firstContext=null)}function ft(e){var t=e._currentValue;if(Wu!==e)if(e={context:e,memoizedValue:t,next:null},vn===null){if(mo===null)throw Error(L(308));vn=e,mo.dependencies={lanes:0,firstContext:e}}else vn=vn.next=e;return t}var Ur=null;function Gu(e){Ur===null?Ur=[e]:Ur.push(e)}function hm(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Gu(t)):(r.next=s.next,s.next=r),t.interleaved=r,qt(e,n)}function qt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var sr=!1;function Yu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pm(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function $t(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function gr(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Q&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,qt(e,r)}return s=n.interleaved,s===null?(t.next=t,Gu(n)):(t.next=s.next,s.next=t),n.interleaved=t,qt(e,r)}function Ui(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Lu(e,r)}}function Fd(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?s=i=t:i=i.next=t}else s=i=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function go(e,t,r,n){var s=e.updateQueue;sr=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;o=0,d=c=l=null,a=i;do{var u=a.lane,p=a.eventTime;if((n&u)===u){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,g=a;switch(u=t,p=r,g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(p,f,u);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,u=typeof m=="function"?m.call(p,f,u):m,u==null)break e;f=pe({},f,u);break e;case 2:sr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,u=s.effects,u===null?s.effects=[a]:u.push(a))}else p={eventTime:p,lane:u,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=p,l=f):d=d.next=p,o|=u;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;u=a,a=u.next,u.next=null,s.lastBaseUpdate=u,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Zr|=o,e.lanes=o,e.memoizedState=f}}function Id(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(L(191,s));s.call(n)}}}var ui={},Mt=Er(ui),qs=Er(ui),Gs=Er(ui);function Wr(e){if(e===ui)throw Error(L(174));return e}function Ku(e,t){switch(re(Gs,t),re(qs,e),re(Mt,ui),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ml(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ml(t,e)}ae(Mt),re(Mt,t)}function Fn(){ae(Mt),ae(qs),ae(Gs)}function mm(e){Wr(Gs.current);var t=Wr(Mt.current),r=ml(t,e.type);t!==r&&(re(qs,e),re(Mt,r))}function Xu(e){qs.current===e&&(ae(Mt),ae(qs))}var de=Er(0);function yo(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ma=[];function Qu(){for(var e=0;e<Ma.length;e++)Ma[e]._workInProgressVersionPrimary=null;Ma.length=0}var Wi=Qt.ReactCurrentDispatcher,Aa=Qt.ReactCurrentBatchConfig,Qr=0,he=null,je=null,Pe=null,vo=!1,Ss=!1,Ys=0,hv=0;function _e(){throw Error(L(321))}function Zu(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!bt(e[r],t[r]))return!1;return!0}function Ju(e,t,r,n,s,i){if(Qr=i,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Wi.current=e===null||e.memoizedState===null?yv:vv,e=r(n,s),Ss){i=0;do{if(Ss=!1,Ys=0,25<=i)throw Error(L(301));i+=1,Pe=je=null,t.updateQueue=null,Wi.current=xv,e=r(n,s)}while(Ss)}if(Wi.current=xo,t=je!==null&&je.next!==null,Qr=0,Pe=je=he=null,vo=!1,t)throw Error(L(300));return e}function ec(){var e=Ys!==0;return Ys=0,e}function Ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pe===null?he.memoizedState=Pe=e:Pe=Pe.next=e,Pe}function ht(){if(je===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=je.next;var t=Pe===null?he.memoizedState:Pe.next;if(t!==null)Pe=t,je=e;else{if(e===null)throw Error(L(310));je=e,e={memoizedState:je.memoizedState,baseState:je.baseState,baseQueue:je.baseQueue,queue:je.queue,next:null},Pe===null?he.memoizedState=Pe=e:Pe=Pe.next=e}return Pe}function Ks(e,t){return typeof t=="function"?t(e):t}function _a(e){var t=ht(),r=t.queue;if(r===null)throw Error(L(311));r.lastRenderedReducer=e;var n=je,s=n.baseQueue,i=r.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}n.baseQueue=s=i,r.pending=null}if(s!==null){i=s.next,n=n.baseState;var a=o=null,l=null,c=i;do{var d=c.lane;if((Qr&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,o=n):l=l.next=f,he.lanes|=d,Zr|=d}c=c.next}while(c!==null&&c!==i);l===null?o=n:l.next=a,bt(n,t.memoizedState)||(He=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=l,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do i=s.lane,he.lanes|=i,Zr|=i,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function La(e){var t=ht(),r=t.queue;if(r===null)throw Error(L(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,i=t.memoizedState;if(s!==null){r.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);bt(i,t.memoizedState)||(He=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function gm(){}function ym(e,t){var r=he,n=ht(),s=t(),i=!bt(n.memoizedState,s);if(i&&(n.memoizedState=s,He=!0),n=n.queue,tc(wm.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||Pe!==null&&Pe.memoizedState.tag&1){if(r.flags|=2048,Xs(9,xm.bind(null,r,n,s,t),void 0,null),Ee===null)throw Error(L(349));Qr&30||vm(r,t,s)}return s}function vm(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function xm(e,t,r,n){t.value=r,t.getSnapshot=n,bm(t)&&Sm(e)}function wm(e,t,r){return r(function(){bm(t)&&Sm(e)})}function bm(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!bt(e,r)}catch{return!0}}function Sm(e){var t=qt(e,1);t!==null&&wt(t,e,1,-1)}function zd(e){var t=Ct();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ks,lastRenderedState:e},t.queue=e,e=e.dispatch=gv.bind(null,he,e),[t.memoizedState,e]}function Xs(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function km(){return ht().memoizedState}function Hi(e,t,r,n){var s=Ct();he.flags|=e,s.memoizedState=Xs(1|t,r,void 0,n===void 0?null:n)}function Wo(e,t,r,n){var s=ht();n=n===void 0?null:n;var i=void 0;if(je!==null){var o=je.memoizedState;if(i=o.destroy,n!==null&&Zu(n,o.deps)){s.memoizedState=Xs(t,r,i,n);return}}he.flags|=e,s.memoizedState=Xs(1|t,r,i,n)}function Od(e,t){return Hi(8390656,8,e,t)}function tc(e,t){return Wo(2048,8,e,t)}function jm(e,t){return Wo(4,2,e,t)}function Cm(e,t){return Wo(4,4,e,t)}function Nm(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Pm(e,t,r){return r=r!=null?r.concat([e]):null,Wo(4,4,Nm.bind(null,t,e),r)}function rc(){}function Em(e,t){var r=ht();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Zu(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Tm(e,t){var r=ht();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Zu(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Mm(e,t,r){return Qr&21?(bt(r,t)||(r=Rp(),he.lanes|=r,Zr|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,He=!0),e.memoizedState=r)}function pv(e,t){var r=J;J=r!==0&&4>r?r:4,e(!0);var n=Aa.transition;Aa.transition={};try{e(!1),t()}finally{J=r,Aa.transition=n}}function Am(){return ht().memoizedState}function mv(e,t,r){var n=vr(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},_m(e))Lm(t,r);else if(r=hm(e,t,r,n),r!==null){var s=$e();wt(r,e,n,s),Dm(r,t,n)}}function gv(e,t,r){var n=vr(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(_m(e))Lm(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,r);if(s.hasEagerState=!0,s.eagerState=a,bt(a,o)){var l=t.interleaved;l===null?(s.next=s,Gu(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}r=hm(e,t,s,n),r!==null&&(s=$e(),wt(r,e,n,s),Dm(r,t,n))}}function _m(e){var t=e.alternate;return e===he||t!==null&&t===he}function Lm(e,t){Ss=vo=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Dm(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Lu(e,r)}}var xo={readContext:ft,useCallback:_e,useContext:_e,useEffect:_e,useImperativeHandle:_e,useInsertionEffect:_e,useLayoutEffect:_e,useMemo:_e,useReducer:_e,useRef:_e,useState:_e,useDebugValue:_e,useDeferredValue:_e,useTransition:_e,useMutableSource:_e,useSyncExternalStore:_e,useId:_e,unstable_isNewReconciler:!1},yv={readContext:ft,useCallback:function(e,t){return Ct().memoizedState=[e,t===void 0?null:t],e},useContext:ft,useEffect:Od,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Hi(4194308,4,Nm.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Hi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Hi(4,2,e,t)},useMemo:function(e,t){var r=Ct();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ct();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=mv.bind(null,he,e),[n.memoizedState,e]},useRef:function(e){var t=Ct();return e={current:e},t.memoizedState=e},useState:zd,useDebugValue:rc,useDeferredValue:function(e){return Ct().memoizedState=e},useTransition:function(){var e=zd(!1),t=e[0];return e=pv.bind(null,e[1]),Ct().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=he,s=Ct();if(ue){if(r===void 0)throw Error(L(407));r=r()}else{if(r=t(),Ee===null)throw Error(L(349));Qr&30||vm(n,t,r)}s.memoizedState=r;var i={value:r,getSnapshot:t};return s.queue=i,Od(wm.bind(null,n,i,e),[e]),n.flags|=2048,Xs(9,xm.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Ct(),t=Ee.identifierPrefix;if(ue){var r=zt,n=It;r=(n&~(1<<32-xt(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ys++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=hv++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},vv={readContext:ft,useCallback:Em,useContext:ft,useEffect:tc,useImperativeHandle:Pm,useInsertionEffect:jm,useLayoutEffect:Cm,useMemo:Tm,useReducer:_a,useRef:km,useState:function(){return _a(Ks)},useDebugValue:rc,useDeferredValue:function(e){var t=ht();return Mm(t,je.memoizedState,e)},useTransition:function(){var e=_a(Ks)[0],t=ht().memoizedState;return[e,t]},useMutableSource:gm,useSyncExternalStore:ym,useId:Am,unstable_isNewReconciler:!1},xv={readContext:ft,useCallback:Em,useContext:ft,useEffect:tc,useImperativeHandle:Pm,useInsertionEffect:jm,useLayoutEffect:Cm,useMemo:Tm,useReducer:La,useRef:km,useState:function(){return La(Ks)},useDebugValue:rc,useDeferredValue:function(e){var t=ht();return je===null?t.memoizedState=e:Mm(t,je.memoizedState,e)},useTransition:function(){var e=La(Ks)[0],t=ht().memoizedState;return[e,t]},useMutableSource:gm,useSyncExternalStore:ym,useId:Am,unstable_isNewReconciler:!1};function mt(e,t){if(e&&e.defaultProps){t=pe({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Vl(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:pe({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Ho={isMounted:function(e){return(e=e._reactInternals)?rn(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=$e(),s=vr(e),i=$t(n,s);i.payload=t,r!=null&&(i.callback=r),t=gr(e,i,s),t!==null&&(wt(t,e,s,n),Ui(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=$e(),s=vr(e),i=$t(n,s);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=gr(e,i,s),t!==null&&(wt(t,e,s,n),Ui(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=$e(),n=vr(e),s=$t(r,n);s.tag=2,t!=null&&(s.callback=t),t=gr(e,s,n),t!==null&&(wt(t,e,n,r),Ui(t,e,n))}};function $d(e,t,r,n,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,o):t.prototype&&t.prototype.isPureReactComponent?!Bs(r,n)||!Bs(s,i):!0}function Rm(e,t,r){var n=!1,s=kr,i=t.contextType;return typeof i=="object"&&i!==null?i=ft(i):(s=Ge(t)?Kr:Ve.current,n=t.contextTypes,i=(n=n!=null)?Dn(e,s):kr),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ho,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Bd(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Ho.enqueueReplaceState(t,t.state,null)}function Fl(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},Yu(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=ft(i):(i=Ge(t)?Kr:Ve.current,s.context=Dn(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Vl(e,t,i,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Ho.enqueueReplaceState(s,s.state,null),go(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function In(e,t){try{var r="",n=t;do r+=Gy(n),n=n.return;while(n);var s=r}catch(i){s=`
Error generating stack: `+i.message+`
`+i.stack}return{value:e,source:t,stack:s,digest:null}}function Da(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Il(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var wv=typeof WeakMap=="function"?WeakMap:Map;function Vm(e,t,r){r=$t(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){bo||(bo=!0,Yl=n),Il(e,t)},r}function Fm(e,t,r){r=$t(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){Il(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Il(e,t),typeof n!="function"&&(yr===null?yr=new Set([this]):yr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function Ud(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new wv;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=Dv.bind(null,e,t,r),t.then(e,e))}function Wd(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Hd(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=$t(-1,1),t.tag=2,gr(r,t,1))),r.lanes|=1),e)}var bv=Qt.ReactCurrentOwner,He=!1;function Oe(e,t,r,n){t.child=e===null?fm(t,null,r,n):Vn(t,e.child,r,n)}function qd(e,t,r,n,s){r=r.render;var i=t.ref;return Tn(t,s),n=Ju(e,t,r,n,i,s),r=ec(),e!==null&&!He?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Gt(e,t,s)):(ue&&r&&$u(t),t.flags|=1,Oe(e,t,n,s),t.child)}function Gd(e,t,r,n,s){if(e===null){var i=r.type;return typeof i=="function"&&!cc(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,Im(e,t,i,n,s)):(e=Ki(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(r=r.compare,r=r!==null?r:Bs,r(o,n)&&e.ref===t.ref)return Gt(e,t,s)}return t.flags|=1,e=xr(i,n),e.ref=t.ref,e.return=t,t.child=e}function Im(e,t,r,n,s){if(e!==null){var i=e.memoizedProps;if(Bs(i,n)&&e.ref===t.ref)if(He=!1,t.pendingProps=n=i,(e.lanes&s)!==0)e.flags&131072&&(He=!0);else return t.lanes=e.lanes,Gt(e,t,s)}return zl(e,t,r,n,s)}function zm(e,t,r){var n=t.pendingProps,s=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},re(wn,Ze),Ze|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,re(wn,Ze),Ze|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,re(wn,Ze),Ze|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,re(wn,Ze),Ze|=n;return Oe(e,t,s,r),t.child}function Om(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function zl(e,t,r,n,s){var i=Ge(r)?Kr:Ve.current;return i=Dn(t,i),Tn(t,s),r=Ju(e,t,r,n,i,s),n=ec(),e!==null&&!He?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Gt(e,t,s)):(ue&&n&&$u(t),t.flags|=1,Oe(e,t,r,s),t.child)}function Yd(e,t,r,n,s){if(Ge(r)){var i=!0;co(t)}else i=!1;if(Tn(t,s),t.stateNode===null)qi(e,t),Rm(t,r,n),Fl(t,r,n,s),n=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=r.contextType;typeof c=="object"&&c!==null?c=ft(c):(c=Ge(r)?Kr:Ve.current,c=Dn(t,c));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==c)&&Bd(t,o,n,c),sr=!1;var u=t.memoizedState;o.state=u,go(t,n,o,s),l=t.memoizedState,a!==n||u!==l||qe.current||sr?(typeof d=="function"&&(Vl(t,r,d,n),l=t.memoizedState),(a=sr||$d(t,r,a,n,u,l,c))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),o.props=n,o.state=l,o.context=c,n=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,pm(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:mt(t.type,a),o.props=c,f=t.pendingProps,u=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=ft(l):(l=Ge(r)?Kr:Ve.current,l=Dn(t,l));var p=r.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||u!==l)&&Bd(t,o,n,l),sr=!1,u=t.memoizedState,o.state=u,go(t,n,o,s);var m=t.memoizedState;a!==f||u!==m||qe.current||sr?(typeof p=="function"&&(Vl(t,r,p,n),m=t.memoizedState),(c=sr||$d(t,r,c,n,u,m,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&u===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&u===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=m),o.props=n,o.state=m,o.context=l,n=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&u===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&u===e.memoizedState||(t.flags|=1024),n=!1)}return Ol(e,t,r,n,i,s)}function Ol(e,t,r,n,s,i){Om(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return s&&Ld(t,r,!1),Gt(e,t,i);n=t.stateNode,bv.current=t;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Vn(t,e.child,null,i),t.child=Vn(t,null,a,i)):Oe(e,t,a,i),t.memoizedState=n.state,s&&Ld(t,r,!0),t.child}function $m(e){var t=e.stateNode;t.pendingContext?_d(e,t.pendingContext,t.pendingContext!==t.context):t.context&&_d(e,t.context,!1),Ku(e,t.containerInfo)}function Kd(e,t,r,n,s){return Rn(),Uu(s),t.flags|=256,Oe(e,t,r,n),t.child}var $l={dehydrated:null,treeContext:null,retryLane:0};function Bl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Bm(e,t,r){var n=t.pendingProps,s=de.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),re(de,s&1),e===null)return Dl(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,i?(n=t.mode,i=t.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Yo(o,n,0,null),e=Gr(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Bl(r),t.memoizedState=$l,e):nc(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return Sv(e,t,o,n,a,s,r);if(i){i=n.fallback,o=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:n.children};return!(o&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=l,t.deletions=null):(n=xr(s,l),n.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=xr(a,i):(i=Gr(i,o,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,o=e.child.memoizedState,o=o===null?Bl(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~r,t.memoizedState=$l,n}return i=e.child,e=i.sibling,n=xr(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function nc(e,t){return t=Yo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ei(e,t,r,n){return n!==null&&Uu(n),Vn(t,e.child,null,r),e=nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sv(e,t,r,n,s,i,o){if(r)return t.flags&256?(t.flags&=-257,n=Da(Error(L(422))),Ei(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,s=t.mode,n=Yo({mode:"visible",children:n.children},s,0,null),i=Gr(i,s,o,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&Vn(t,e.child,null,o),t.child.memoizedState=Bl(o),t.memoizedState=$l,i);if(!(t.mode&1))return Ei(e,t,o,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var a=n.dgst;return n=a,i=Error(L(419)),n=Da(i,n,void 0),Ei(e,t,o,n)}if(a=(o&e.childLanes)!==0,He||a){if(n=Ee,n!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,qt(e,s),wt(n,e,s,-1))}return uc(),n=Da(Error(L(421))),Ei(e,t,o,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Rv.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Je=mr(s.nextSibling),tt=t,ue=!0,yt=null,e!==null&&(lt[ut++]=It,lt[ut++]=zt,lt[ut++]=Xr,It=e.id,zt=e.overflow,Xr=t),t=nc(t,n.children),t.flags|=4096,t)}function Xd(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Rl(e.return,t,r)}function Ra(e,t,r,n,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=s)}function Um(e,t,r){var n=t.pendingProps,s=n.revealOrder,i=n.tail;if(Oe(e,t,n.children,r),n=de.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xd(e,r,t);else if(e.tag===19)Xd(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(re(de,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&yo(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),Ra(t,!1,s,r,i);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&yo(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}Ra(t,!0,r,null,i);break;case"together":Ra(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function qi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Gt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Zr|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(L(153));if(t.child!==null){for(e=t.child,r=xr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=xr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function kv(e,t,r){switch(t.tag){case 3:$m(t),Rn();break;case 5:mm(t);break;case 1:Ge(t.type)&&co(t);break;case 4:Ku(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;re(po,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(re(de,de.current&1),t.flags|=128,null):r&t.child.childLanes?Bm(e,t,r):(re(de,de.current&1),e=Gt(e,t,r),e!==null?e.sibling:null);re(de,de.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Um(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),re(de,de.current),n)break;return null;case 22:case 23:return t.lanes=0,zm(e,t,r)}return Gt(e,t,r)}var Wm,Ul,Hm,qm;Wm=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Ul=function(){};Hm=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,Wr(Mt.current);var i=null;switch(r){case"input":s=dl(e,s),n=dl(e,n),i=[];break;case"select":s=pe({},s,{value:void 0}),n=pe({},n,{value:void 0}),i=[];break;case"textarea":s=pl(e,s),n=pl(e,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=lo)}gl(r,n);var o;r=null;for(c in s)if(!n.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Rs.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in n){var l=n[c];if(a=s!=null?s[c]:void 0,n.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(i||(i=[]),i.push(c,r)),r=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Rs.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ie("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}r&&(i=i||[]).push("style",r);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};qm=function(e,t,r,n){r!==n&&(t.flags|=4)};function os(e,t){if(!ue)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Le(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function jv(e,t,r){var n=t.pendingProps;switch(Bu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(t),null;case 1:return Ge(t.type)&&uo(),Le(t),null;case 3:return n=t.stateNode,Fn(),ae(qe),ae(Ve),Qu(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ni(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,yt!==null&&(Ql(yt),yt=null))),Ul(e,t),Le(t),null;case 5:Xu(t);var s=Wr(Gs.current);if(r=t.type,e!==null&&t.stateNode!=null)Hm(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(L(166));return Le(t),null}if(e=Wr(Mt.current),Ni(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[Nt]=t,n[Hs]=i,e=(t.mode&1)!==0,r){case"dialog":ie("cancel",n),ie("close",n);break;case"iframe":case"object":case"embed":ie("load",n);break;case"video":case"audio":for(s=0;s<ms.length;s++)ie(ms[s],n);break;case"source":ie("error",n);break;case"img":case"image":case"link":ie("error",n),ie("load",n);break;case"details":ie("toggle",n);break;case"input":id(n,i),ie("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},ie("invalid",n);break;case"textarea":ad(n,i),ie("invalid",n)}gl(r,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?n.textContent!==a&&(i.suppressHydrationWarning!==!0&&Ci(n.textContent,a,e),s=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ci(n.textContent,a,e),s=["children",""+a]):Rs.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ie("scroll",n)}switch(r){case"input":yi(n),od(n,i,!0);break;case"textarea":yi(n),ld(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=lo)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=wp(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Nt]=t,e[Hs]=n,Wm(e,t,!1,!1),t.stateNode=e;e:{switch(o=yl(r,n),r){case"dialog":ie("cancel",e),ie("close",e),s=n;break;case"iframe":case"object":case"embed":ie("load",e),s=n;break;case"video":case"audio":for(s=0;s<ms.length;s++)ie(ms[s],e);s=n;break;case"source":ie("error",e),s=n;break;case"img":case"image":case"link":ie("error",e),ie("load",e),s=n;break;case"details":ie("toggle",e),s=n;break;case"input":id(e,n),s=dl(e,n),ie("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=pe({},n,{value:void 0}),ie("invalid",e);break;case"textarea":ad(e,n),s=pl(e,n),ie("invalid",e);break;default:s=n}gl(r,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?kp(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&bp(e,l)):i==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&Vs(e,l):typeof l=="number"&&Vs(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Rs.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ie("scroll",e):l!=null&&Pu(e,i,l,o))}switch(r){case"input":yi(e),od(e,n,!1);break;case"textarea":yi(e),ld(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Sr(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?Cn(e,!!n.multiple,i,!1):n.defaultValue!=null&&Cn(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=lo)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Le(t),null;case 6:if(e&&t.stateNode!=null)qm(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(L(166));if(r=Wr(Gs.current),Wr(Mt.current),Ni(t)){if(n=t.stateNode,r=t.memoizedProps,n[Nt]=t,(i=n.nodeValue!==r)&&(e=tt,e!==null))switch(e.tag){case 3:Ci(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ci(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Nt]=t,t.stateNode=n}return Le(t),null;case 13:if(ae(de),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ue&&Je!==null&&t.mode&1&&!(t.flags&128))cm(),Rn(),t.flags|=98560,i=!1;else if(i=Ni(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(L(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(L(317));i[Nt]=t}else Rn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Le(t),i=!1}else yt!==null&&(Ql(yt),yt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||de.current&1?Ne===0&&(Ne=3):uc())),t.updateQueue!==null&&(t.flags|=4),Le(t),null);case 4:return Fn(),Ul(e,t),e===null&&Us(t.stateNode.containerInfo),Le(t),null;case 10:return qu(t.type._context),Le(t),null;case 17:return Ge(t.type)&&uo(),Le(t),null;case 19:if(ae(de),i=t.memoizedState,i===null)return Le(t),null;if(n=(t.flags&128)!==0,o=i.rendering,o===null)if(n)os(i,!1);else{if(Ne!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=yo(e),o!==null){for(t.flags|=128,os(i,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return re(de,de.current&1|2),t.child}e=e.sibling}i.tail!==null&&ve()>zn&&(t.flags|=128,n=!0,os(i,!1),t.lanes=4194304)}else{if(!n)if(e=yo(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),os(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!ue)return Le(t),null}else 2*ve()-i.renderingStartTime>zn&&r!==1073741824&&(t.flags|=128,n=!0,os(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ve(),t.sibling=null,r=de.current,re(de,n?r&1|2:r&1),t):(Le(t),null);case 22:case 23:return lc(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Ze&1073741824&&(Le(t),t.subtreeFlags&6&&(t.flags|=8192)):Le(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function Cv(e,t){switch(Bu(t),t.tag){case 1:return Ge(t.type)&&uo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fn(),ae(qe),ae(Ve),Qu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xu(t),null;case 13:if(ae(de),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));Rn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(de),null;case 4:return Fn(),null;case 10:return qu(t.type._context),null;case 22:case 23:return lc(),null;case 24:return null;default:return null}}var Ti=!1,Re=!1,Nv=typeof WeakSet=="function"?WeakSet:Set,$=null;function xn(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ge(e,t,n)}else r.current=null}function Wl(e,t,r){try{r()}catch(n){ge(e,t,n)}}var Qd=!1;function Pv(e,t){if(Pl=io,e=Qp(),Ou(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,c=0,d=0,f=e,u=null;t:for(;;){for(var p;f!==r||s!==0&&f.nodeType!==3||(a=o+s),f!==i||n!==0&&f.nodeType!==3||(l=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)u=f,f=p;for(;;){if(f===e)break t;if(u===r&&++c===s&&(a=o),u===i&&++d===n&&(l=o),(p=f.nextSibling)!==null)break;f=u,u=f.parentNode}f=p}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(El={focusedElem:e,selectionRange:r},io=!1,$=t;$!==null;)if(t=$,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$=e;else for(;$!==null;){t=$;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,w=m.memoizedState,v=t.stateNode,y=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:mt(t.type,g),w);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(b){ge(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,$=e;break}$=t.return}return m=Qd,Qd=!1,m}function ks(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Wl(t,r,i)}s=s.next}while(s!==n)}}function qo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Hl(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Gm(e){var t=e.alternate;t!==null&&(e.alternate=null,Gm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nt],delete t[Hs],delete t[Al],delete t[uv],delete t[cv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ym(e){return e.tag===5||e.tag===3||e.tag===4}function Zd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ym(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ql(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=lo));else if(n!==4&&(e=e.child,e!==null))for(ql(e,t,r),e=e.sibling;e!==null;)ql(e,t,r),e=e.sibling}function Gl(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Gl(e,t,r),e=e.sibling;e!==null;)Gl(e,t,r),e=e.sibling}var Te=null,gt=!1;function Jt(e,t,r){for(r=r.child;r!==null;)Km(e,t,r),r=r.sibling}function Km(e,t,r){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(Io,r)}catch{}switch(r.tag){case 5:Re||xn(r,t);case 6:var n=Te,s=gt;Te=null,Jt(e,t,r),Te=n,gt=s,Te!==null&&(gt?(e=Te,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Te.removeChild(r.stateNode));break;case 18:Te!==null&&(gt?(e=Te,r=r.stateNode,e.nodeType===8?Ea(e.parentNode,r):e.nodeType===1&&Ea(e,r),Os(e)):Ea(Te,r.stateNode));break;case 4:n=Te,s=gt,Te=r.stateNode.containerInfo,gt=!0,Jt(e,t,r),Te=n,gt=s;break;case 0:case 11:case 14:case 15:if(!Re&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Wl(r,t,o),s=s.next}while(s!==n)}Jt(e,t,r);break;case 1:if(!Re&&(xn(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){ge(r,t,a)}Jt(e,t,r);break;case 21:Jt(e,t,r);break;case 22:r.mode&1?(Re=(n=Re)||r.memoizedState!==null,Jt(e,t,r),Re=n):Jt(e,t,r);break;default:Jt(e,t,r)}}function Jd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Nv),t.forEach(function(n){var s=Vv.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function pt(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Te=a.stateNode,gt=!1;break e;case 3:Te=a.stateNode.containerInfo,gt=!0;break e;case 4:Te=a.stateNode.containerInfo,gt=!0;break e}a=a.return}if(Te===null)throw Error(L(160));Km(i,o,s),Te=null,gt=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){ge(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Xm(t,e),t=t.sibling}function Xm(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(pt(t,e),kt(e),n&4){try{ks(3,e,e.return),qo(3,e)}catch(g){ge(e,e.return,g)}try{ks(5,e,e.return)}catch(g){ge(e,e.return,g)}}break;case 1:pt(t,e),kt(e),n&512&&r!==null&&xn(r,r.return);break;case 5:if(pt(t,e),kt(e),n&512&&r!==null&&xn(r,r.return),e.flags&32){var s=e.stateNode;try{Vs(s,"")}catch(g){ge(e,e.return,g)}}if(n&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=r!==null?r.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&vp(s,i),yl(a,o);var c=yl(a,i);for(o=0;o<l.length;o+=2){var d=l[o],f=l[o+1];d==="style"?kp(s,f):d==="dangerouslySetInnerHTML"?bp(s,f):d==="children"?Vs(s,f):Pu(s,d,f,c)}switch(a){case"input":fl(s,i);break;case"textarea":xp(s,i);break;case"select":var u=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?Cn(s,!!i.multiple,p,!1):u!==!!i.multiple&&(i.defaultValue!=null?Cn(s,!!i.multiple,i.defaultValue,!0):Cn(s,!!i.multiple,i.multiple?[]:"",!1))}s[Hs]=i}catch(g){ge(e,e.return,g)}}break;case 6:if(pt(t,e),kt(e),n&4){if(e.stateNode===null)throw Error(L(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(g){ge(e,e.return,g)}}break;case 3:if(pt(t,e),kt(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Os(t.containerInfo)}catch(g){ge(e,e.return,g)}break;case 4:pt(t,e),kt(e);break;case 13:pt(t,e),kt(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(oc=ve())),n&4&&Jd(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(Re=(c=Re)||d,pt(t,e),Re=c):pt(t,e),kt(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for($=e,d=e.child;d!==null;){for(f=$=d;$!==null;){switch(u=$,p=u.child,u.tag){case 0:case 11:case 14:case 15:ks(4,u,u.return);break;case 1:xn(u,u.return);var m=u.stateNode;if(typeof m.componentWillUnmount=="function"){n=u,r=u.return;try{t=n,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){ge(n,r,g)}}break;case 5:xn(u,u.return);break;case 22:if(u.memoizedState!==null){tf(f);continue}}p!==null?(p.return=u,$=p):tf(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{s=f.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Sp("display",o))}catch(g){ge(e,e.return,g)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(g){ge(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:pt(t,e),kt(e),n&4&&Jd(e);break;case 21:break;default:pt(t,e),kt(e)}}function kt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Ym(r)){var n=r;break e}r=r.return}throw Error(L(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(Vs(s,""),n.flags&=-33);var i=Zd(e);Gl(e,i,s);break;case 3:case 4:var o=n.stateNode.containerInfo,a=Zd(e);ql(e,a,o);break;default:throw Error(L(161))}}catch(l){ge(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ev(e,t,r){$=e,Qm(e)}function Qm(e,t,r){for(var n=(e.mode&1)!==0;$!==null;){var s=$,i=s.child;if(s.tag===22&&n){var o=s.memoizedState!==null||Ti;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||Re;a=Ti;var c=Re;if(Ti=o,(Re=l)&&!c)for($=s;$!==null;)o=$,l=o.child,o.tag===22&&o.memoizedState!==null?rf(s):l!==null?(l.return=o,$=l):rf(s);for(;i!==null;)$=i,Qm(i),i=i.sibling;$=s,Ti=a,Re=c}ef(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,$=i):ef(e)}}function ef(e){for(;$!==null;){var t=$;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Re||qo(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Re)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:mt(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Id(t,i,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Id(t,o,r)}break;case 5:var a=t.stateNode;if(r===null&&t.flags&4){r=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Os(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(L(163))}Re||t.flags&512&&Hl(t)}catch(u){ge(t,t.return,u)}}if(t===e){$=null;break}if(r=t.sibling,r!==null){r.return=t.return,$=r;break}$=t.return}}function tf(e){for(;$!==null;){var t=$;if(t===e){$=null;break}var r=t.sibling;if(r!==null){r.return=t.return,$=r;break}$=t.return}}function rf(e){for(;$!==null;){var t=$;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{qo(4,t)}catch(l){ge(t,r,l)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(l){ge(t,s,l)}}var i=t.return;try{Hl(t)}catch(l){ge(t,i,l)}break;case 5:var o=t.return;try{Hl(t)}catch(l){ge(t,o,l)}}}catch(l){ge(t,t.return,l)}if(t===e){$=null;break}var a=t.sibling;if(a!==null){a.return=t.return,$=a;break}$=t.return}}var Tv=Math.ceil,wo=Qt.ReactCurrentDispatcher,sc=Qt.ReactCurrentOwner,dt=Qt.ReactCurrentBatchConfig,Q=0,Ee=null,ke=null,Me=0,Ze=0,wn=Er(0),Ne=0,Qs=null,Zr=0,Go=0,ic=0,js=null,We=null,oc=0,zn=1/0,Vt=null,bo=!1,Yl=null,yr=null,Mi=!1,cr=null,So=0,Cs=0,Kl=null,Gi=-1,Yi=0;function $e(){return Q&6?ve():Gi!==-1?Gi:Gi=ve()}function vr(e){return e.mode&1?Q&2&&Me!==0?Me&-Me:fv.transition!==null?(Yi===0&&(Yi=Rp()),Yi):(e=J,e!==0||(e=window.event,e=e===void 0?16:Bp(e.type)),e):1}function wt(e,t,r,n){if(50<Cs)throw Cs=0,Kl=null,Error(L(185));oi(e,r,n),(!(Q&2)||e!==Ee)&&(e===Ee&&(!(Q&2)&&(Go|=r),Ne===4&&ar(e,Me)),Ye(e,n),r===1&&Q===0&&!(t.mode&1)&&(zn=ve()+500,Uo&&Tr()))}function Ye(e,t){var r=e.callbackNode;f1(e,t);var n=so(e,e===Ee?Me:0);if(n===0)r!==null&&dd(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&dd(r),t===1)e.tag===0?dv(nf.bind(null,e)):am(nf.bind(null,e)),av(function(){!(Q&6)&&Tr()}),r=null;else{switch(Vp(n)){case 1:r=_u;break;case 4:r=Lp;break;case 16:r=no;break;case 536870912:r=Dp;break;default:r=no}r=i0(r,Zm.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Zm(e,t){if(Gi=-1,Yi=0,Q&6)throw Error(L(327));var r=e.callbackNode;if(Mn()&&e.callbackNode!==r)return null;var n=so(e,e===Ee?Me:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=ko(e,n);else{t=n;var s=Q;Q|=2;var i=e0();(Ee!==e||Me!==t)&&(Vt=null,zn=ve()+500,qr(e,t));do try{_v();break}catch(a){Jm(e,a)}while(!0);Hu(),wo.current=i,Q=s,ke!==null?t=0:(Ee=null,Me=0,t=Ne)}if(t!==0){if(t===2&&(s=Sl(e),s!==0&&(n=s,t=Xl(e,s))),t===1)throw r=Qs,qr(e,0),ar(e,n),Ye(e,ve()),r;if(t===6)ar(e,n);else{if(s=e.current.alternate,!(n&30)&&!Mv(s)&&(t=ko(e,n),t===2&&(i=Sl(e),i!==0&&(n=i,t=Xl(e,i))),t===1))throw r=Qs,qr(e,0),ar(e,n),Ye(e,ve()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(L(345));case 2:Ir(e,We,Vt);break;case 3:if(ar(e,n),(n&130023424)===n&&(t=oc+500-ve(),10<t)){if(so(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){$e(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Ml(Ir.bind(null,e,We,Vt),t);break}Ir(e,We,Vt);break;case 4:if(ar(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var o=31-xt(n);i=1<<o,o=t[o],o>s&&(s=o),n&=~i}if(n=s,n=ve()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Tv(n/1960))-n,10<n){e.timeoutHandle=Ml(Ir.bind(null,e,We,Vt),n);break}Ir(e,We,Vt);break;case 5:Ir(e,We,Vt);break;default:throw Error(L(329))}}}return Ye(e,ve()),e.callbackNode===r?Zm.bind(null,e):null}function Xl(e,t){var r=js;return e.current.memoizedState.isDehydrated&&(qr(e,t).flags|=256),e=ko(e,t),e!==2&&(t=We,We=r,t!==null&&Ql(t)),e}function Ql(e){We===null?We=e:We.push.apply(We,e)}function Mv(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],i=s.getSnapshot;s=s.value;try{if(!bt(i(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ar(e,t){for(t&=~ic,t&=~Go,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-xt(t),n=1<<r;e[r]=-1,t&=~n}}function nf(e){if(Q&6)throw Error(L(327));Mn();var t=so(e,0);if(!(t&1))return Ye(e,ve()),null;var r=ko(e,t);if(e.tag!==0&&r===2){var n=Sl(e);n!==0&&(t=n,r=Xl(e,n))}if(r===1)throw r=Qs,qr(e,0),ar(e,t),Ye(e,ve()),r;if(r===6)throw Error(L(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ir(e,We,Vt),Ye(e,ve()),null}function ac(e,t){var r=Q;Q|=1;try{return e(t)}finally{Q=r,Q===0&&(zn=ve()+500,Uo&&Tr())}}function Jr(e){cr!==null&&cr.tag===0&&!(Q&6)&&Mn();var t=Q;Q|=1;var r=dt.transition,n=J;try{if(dt.transition=null,J=1,e)return e()}finally{J=n,dt.transition=r,Q=t,!(Q&6)&&Tr()}}function lc(){Ze=wn.current,ae(wn)}function qr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,ov(r)),ke!==null)for(r=ke.return;r!==null;){var n=r;switch(Bu(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&uo();break;case 3:Fn(),ae(qe),ae(Ve),Qu();break;case 5:Xu(n);break;case 4:Fn();break;case 13:ae(de);break;case 19:ae(de);break;case 10:qu(n.type._context);break;case 22:case 23:lc()}r=r.return}if(Ee=e,ke=e=xr(e.current,null),Me=Ze=t,Ne=0,Qs=null,ic=Go=Zr=0,We=js=null,Ur!==null){for(t=0;t<Ur.length;t++)if(r=Ur[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,i=r.pending;if(i!==null){var o=i.next;i.next=s,n.next=o}r.pending=n}Ur=null}return e}function Jm(e,t){do{var r=ke;try{if(Hu(),Wi.current=xo,vo){for(var n=he.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}vo=!1}if(Qr=0,Pe=je=he=null,Ss=!1,Ys=0,sc.current=null,r===null||r.return===null){Ne=1,Qs=t,ke=null;break}e:{var i=e,o=r.return,a=r,l=t;if(t=Me,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var u=d.alternate;u?(d.updateQueue=u.updateQueue,d.memoizedState=u.memoizedState,d.lanes=u.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Wd(o);if(p!==null){p.flags&=-257,Hd(p,o,a,i,t),p.mode&1&&Ud(i,c,t),t=p,l=c;var m=t.updateQueue;if(m===null){var g=new Set;g.add(l),t.updateQueue=g}else m.add(l);break e}else{if(!(t&1)){Ud(i,c,t),uc();break e}l=Error(L(426))}}else if(ue&&a.mode&1){var w=Wd(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Hd(w,o,a,i,t),Uu(In(l,a));break e}}i=l=In(l,a),Ne!==4&&(Ne=2),js===null?js=[i]:js.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var v=Vm(i,l,t);Fd(i,v);break e;case 1:a=l;var y=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(yr===null||!yr.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=Fm(i,a,t);Fd(i,b);break e}}i=i.return}while(i!==null)}r0(r)}catch(k){t=k,ke===r&&r!==null&&(ke=r=r.return);continue}break}while(!0)}function e0(){var e=wo.current;return wo.current=xo,e===null?xo:e}function uc(){(Ne===0||Ne===3||Ne===2)&&(Ne=4),Ee===null||!(Zr&268435455)&&!(Go&268435455)||ar(Ee,Me)}function ko(e,t){var r=Q;Q|=2;var n=e0();(Ee!==e||Me!==t)&&(Vt=null,qr(e,t));do try{Av();break}catch(s){Jm(e,s)}while(!0);if(Hu(),Q=r,wo.current=n,ke!==null)throw Error(L(261));return Ee=null,Me=0,Ne}function Av(){for(;ke!==null;)t0(ke)}function _v(){for(;ke!==null&&!n1();)t0(ke)}function t0(e){var t=s0(e.alternate,e,Ze);e.memoizedProps=e.pendingProps,t===null?r0(e):ke=t,sc.current=null}function r0(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Cv(r,t),r!==null){r.flags&=32767,ke=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ne=6,ke=null;return}}else if(r=jv(r,t,Ze),r!==null){ke=r;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);Ne===0&&(Ne=5)}function Ir(e,t,r){var n=J,s=dt.transition;try{dt.transition=null,J=1,Lv(e,t,r,n)}finally{dt.transition=s,J=n}return null}function Lv(e,t,r,n){do Mn();while(cr!==null);if(Q&6)throw Error(L(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(L(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(h1(e,i),e===Ee&&(ke=Ee=null,Me=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Mi||(Mi=!0,i0(no,function(){return Mn(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=dt.transition,dt.transition=null;var o=J;J=1;var a=Q;Q|=4,sc.current=null,Pv(e,r),Xm(r,e),J1(El),io=!!Pl,El=Pl=null,e.current=r,Ev(r),s1(),Q=a,J=o,dt.transition=i}else e.current=r;if(Mi&&(Mi=!1,cr=e,So=s),i=e.pendingLanes,i===0&&(yr=null),a1(r.stateNode),Ye(e,ve()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(bo)throw bo=!1,e=Yl,Yl=null,e;return So&1&&e.tag!==0&&Mn(),i=e.pendingLanes,i&1?e===Kl?Cs++:(Cs=0,Kl=e):Cs=0,Tr(),null}function Mn(){if(cr!==null){var e=Vp(So),t=dt.transition,r=J;try{if(dt.transition=null,J=16>e?16:e,cr===null)var n=!1;else{if(e=cr,cr=null,So=0,Q&6)throw Error(L(331));var s=Q;for(Q|=4,$=e.current;$!==null;){var i=$,o=i.child;if($.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for($=c;$!==null;){var d=$;switch(d.tag){case 0:case 11:case 15:ks(8,d,i)}var f=d.child;if(f!==null)f.return=d,$=f;else for(;$!==null;){d=$;var u=d.sibling,p=d.return;if(Gm(d),d===c){$=null;break}if(u!==null){u.return=p,$=u;break}$=p}}}var m=i.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var w=g.sibling;g.sibling=null,g=w}while(g!==null)}}$=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,$=o;else e:for(;$!==null;){if(i=$,i.flags&2048)switch(i.tag){case 0:case 11:case 15:ks(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,$=v;break e}$=i.return}}var y=e.current;for($=y;$!==null;){o=$;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,$=x;else e:for(o=y;$!==null;){if(a=$,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:qo(9,a)}}catch(k){ge(a,a.return,k)}if(a===o){$=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,$=b;break e}$=a.return}}if(Q=s,Tr(),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(Io,e)}catch{}n=!0}return n}finally{J=r,dt.transition=t}}return!1}function sf(e,t,r){t=In(r,t),t=Vm(e,t,1),e=gr(e,t,1),t=$e(),e!==null&&(oi(e,1,t),Ye(e,t))}function ge(e,t,r){if(e.tag===3)sf(e,e,r);else for(;t!==null;){if(t.tag===3){sf(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(yr===null||!yr.has(n))){e=In(r,e),e=Fm(t,e,1),t=gr(t,e,1),e=$e(),t!==null&&(oi(t,1,e),Ye(t,e));break}}t=t.return}}function Dv(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=$e(),e.pingedLanes|=e.suspendedLanes&r,Ee===e&&(Me&r)===r&&(Ne===4||Ne===3&&(Me&130023424)===Me&&500>ve()-oc?qr(e,0):ic|=r),Ye(e,t)}function n0(e,t){t===0&&(e.mode&1?(t=wi,wi<<=1,!(wi&130023424)&&(wi=4194304)):t=1);var r=$e();e=qt(e,t),e!==null&&(oi(e,t,r),Ye(e,r))}function Rv(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),n0(e,r)}function Vv(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(L(314))}n!==null&&n.delete(t),n0(e,r)}var s0;s0=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||qe.current)He=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return He=!1,kv(e,t,r);He=!!(e.flags&131072)}else He=!1,ue&&t.flags&1048576&&lm(t,ho,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;qi(e,t),e=t.pendingProps;var s=Dn(t,Ve.current);Tn(t,r),s=Ju(null,t,n,e,s,r);var i=ec();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ge(n)?(i=!0,co(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Yu(t),s.updater=Ho,t.stateNode=s,s._reactInternals=t,Fl(t,n,e,r),t=Ol(null,t,n,!0,i,r)):(t.tag=0,ue&&i&&$u(t),Oe(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(qi(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=Iv(n),e=mt(n,e),s){case 0:t=zl(null,t,n,e,r);break e;case 1:t=Yd(null,t,n,e,r);break e;case 11:t=qd(null,t,n,e,r);break e;case 14:t=Gd(null,t,n,mt(n.type,e),r);break e}throw Error(L(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:mt(n,s),zl(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:mt(n,s),Yd(e,t,n,s,r);case 3:e:{if($m(t),e===null)throw Error(L(387));n=t.pendingProps,i=t.memoizedState,s=i.element,pm(e,t),go(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=In(Error(L(423)),t),t=Kd(e,t,n,r,s);break e}else if(n!==s){s=In(Error(L(424)),t),t=Kd(e,t,n,r,s);break e}else for(Je=mr(t.stateNode.containerInfo.firstChild),tt=t,ue=!0,yt=null,r=fm(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Rn(),n===s){t=Gt(e,t,r);break e}Oe(e,t,n,r)}t=t.child}return t;case 5:return mm(t),e===null&&Dl(t),n=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Tl(n,s)?o=null:i!==null&&Tl(n,i)&&(t.flags|=32),Om(e,t),Oe(e,t,o,r),t.child;case 6:return e===null&&Dl(t),null;case 13:return Bm(e,t,r);case 4:return Ku(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Vn(t,null,n,r):Oe(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:mt(n,s),qd(e,t,n,s,r);case 7:return Oe(e,t,t.pendingProps,r),t.child;case 8:return Oe(e,t,t.pendingProps.children,r),t.child;case 12:return Oe(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,re(po,n._currentValue),n._currentValue=o,i!==null)if(bt(i.value,o)){if(i.children===s.children&&!qe.current){t=Gt(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=$t(-1,r&-r),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),Rl(i.return,r,t),a.lanes|=r;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(L(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Rl(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Oe(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Tn(t,r),s=ft(s),n=n(s),t.flags|=1,Oe(e,t,n,r),t.child;case 14:return n=t.type,s=mt(n,t.pendingProps),s=mt(n.type,s),Gd(e,t,n,s,r);case 15:return Im(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:mt(n,s),qi(e,t),t.tag=1,Ge(n)?(e=!0,co(t)):e=!1,Tn(t,r),Rm(t,n,s),Fl(t,n,s,r),Ol(null,t,n,!0,e,r);case 19:return Um(e,t,r);case 22:return zm(e,t,r)}throw Error(L(156,t.tag))};function i0(e,t){return _p(e,t)}function Fv(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ct(e,t,r,n){return new Fv(e,t,r,n)}function cc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Iv(e){if(typeof e=="function")return cc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Tu)return 11;if(e===Mu)return 14}return 2}function xr(e,t){var r=e.alternate;return r===null?(r=ct(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Ki(e,t,r,n,s,i){var o=2;if(n=e,typeof e=="function")cc(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case cn:return Gr(r.children,s,i,t);case Eu:o=8,s|=8;break;case al:return e=ct(12,r,t,s|2),e.elementType=al,e.lanes=i,e;case ll:return e=ct(13,r,t,s),e.elementType=ll,e.lanes=i,e;case ul:return e=ct(19,r,t,s),e.elementType=ul,e.lanes=i,e;case mp:return Yo(r,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case hp:o=10;break e;case pp:o=9;break e;case Tu:o=11;break e;case Mu:o=14;break e;case nr:o=16,n=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=ct(o,r,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function Gr(e,t,r,n){return e=ct(7,e,n,t),e.lanes=r,e}function Yo(e,t,r,n){return e=ct(22,e,n,t),e.elementType=mp,e.lanes=r,e.stateNode={isHidden:!1},e}function Va(e,t,r){return e=ct(6,e,null,t),e.lanes=r,e}function Fa(e,t,r){return t=ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function zv(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ya(0),this.expirationTimes=ya(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ya(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function dc(e,t,r,n,s,i,o,a,l){return e=new zv(e,t,r,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ct(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yu(i),e}function Ov(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:un,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function o0(e){if(!e)return kr;e=e._reactInternals;e:{if(rn(e)!==e||e.tag!==1)throw Error(L(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ge(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(L(171))}if(e.tag===1){var r=e.type;if(Ge(r))return om(e,r,t)}return t}function a0(e,t,r,n,s,i,o,a,l){return e=dc(r,n,!0,e,s,i,o,a,l),e.context=o0(null),r=e.current,n=$e(),s=vr(r),i=$t(n,s),i.callback=t??null,gr(r,i,s),e.current.lanes=s,oi(e,s,n),Ye(e,n),e}function Ko(e,t,r,n){var s=t.current,i=$e(),o=vr(s);return r=o0(r),t.context===null?t.context=r:t.pendingContext=r,t=$t(i,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=gr(s,t,o),e!==null&&(wt(e,s,o,i),Ui(e,s,o)),o}function jo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function of(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function fc(e,t){of(e,t),(e=e.alternate)&&of(e,t)}function $v(){return null}var l0=typeof reportError=="function"?reportError:function(e){console.error(e)};function hc(e){this._internalRoot=e}Xo.prototype.render=hc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(L(409));Ko(e,t,null,null)};Xo.prototype.unmount=hc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Jr(function(){Ko(null,e,null,null)}),t[Ht]=null}};function Xo(e){this._internalRoot=e}Xo.prototype.unstable_scheduleHydration=function(e){if(e){var t=zp();e={blockedOn:null,target:e,priority:t};for(var r=0;r<or.length&&t!==0&&t<or[r].priority;r++);or.splice(r,0,e),r===0&&$p(e)}};function pc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Qo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function af(){}function Bv(e,t,r,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var c=jo(o);i.call(c)}}var o=a0(t,n,e,0,null,!1,!1,"",af);return e._reactRootContainer=o,e[Ht]=o.current,Us(e.nodeType===8?e.parentNode:e),Jr(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var a=n;n=function(){var c=jo(l);a.call(c)}}var l=dc(e,0,!1,null,null,!1,!1,"",af);return e._reactRootContainer=l,e[Ht]=l.current,Us(e.nodeType===8?e.parentNode:e),Jr(function(){Ko(t,l,r,n)}),l}function Zo(e,t,r,n,s){var i=r._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=jo(o);a.call(l)}}Ko(t,o,e,s)}else o=Bv(r,t,e,s,n);return jo(o)}Fp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=ps(t.pendingLanes);r!==0&&(Lu(t,r|1),Ye(t,ve()),!(Q&6)&&(zn=ve()+500,Tr()))}break;case 13:Jr(function(){var n=qt(e,1);if(n!==null){var s=$e();wt(n,e,1,s)}}),fc(e,1)}};Du=function(e){if(e.tag===13){var t=qt(e,134217728);if(t!==null){var r=$e();wt(t,e,134217728,r)}fc(e,134217728)}};Ip=function(e){if(e.tag===13){var t=vr(e),r=qt(e,t);if(r!==null){var n=$e();wt(r,e,t,n)}fc(e,t)}};zp=function(){return J};Op=function(e,t){var r=J;try{return J=e,t()}finally{J=r}};xl=function(e,t,r){switch(t){case"input":if(fl(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=Bo(n);if(!s)throw Error(L(90));yp(n),fl(n,s)}}}break;case"textarea":xp(e,r);break;case"select":t=r.value,t!=null&&Cn(e,!!r.multiple,t,!1)}};Np=ac;Pp=Jr;var Uv={usingClientEntryPoint:!1,Events:[li,pn,Bo,jp,Cp,ac]},as={findFiberByHostInstance:Br,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Wv={bundleType:as.bundleType,version:as.version,rendererPackageName:as.rendererPackageName,rendererConfig:as.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Qt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Mp(e),e===null?null:e.stateNode},findFiberByHostInstance:as.findFiberByHostInstance||$v,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ai=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ai.isDisabled&&Ai.supportsFiber)try{Io=Ai.inject(Wv),Tt=Ai}catch{}}st.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Uv;st.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!pc(t))throw Error(L(200));return Ov(e,t,null,r)};st.createRoot=function(e,t){if(!pc(e))throw Error(L(299));var r=!1,n="",s=l0;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=dc(e,1,!1,null,null,r,!1,n,s),e[Ht]=t.current,Us(e.nodeType===8?e.parentNode:e),new hc(t)};st.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(L(188)):(e=Object.keys(e).join(","),Error(L(268,e)));return e=Mp(t),e=e===null?null:e.stateNode,e};st.flushSync=function(e){return Jr(e)};st.hydrate=function(e,t,r){if(!Qo(t))throw Error(L(200));return Zo(null,e,t,!0,r)};st.hydrateRoot=function(e,t,r){if(!pc(e))throw Error(L(405));var n=r!=null&&r.hydratedSources||null,s=!1,i="",o=l0;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=a0(t,null,e,1,r??null,s,!1,i,o),e[Ht]=t.current,Us(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new Xo(t)};st.render=function(e,t,r){if(!Qo(t))throw Error(L(200));return Zo(null,e,t,!1,r)};st.unmountComponentAtNode=function(e){if(!Qo(e))throw Error(L(40));return e._reactRootContainer?(Jr(function(){Zo(null,null,e,!1,function(){e._reactRootContainer=null,e[Ht]=null})}),!0):!1};st.unstable_batchedUpdates=ac;st.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Qo(r))throw Error(L(200));if(e==null||e._reactInternals===void 0)throw Error(L(38));return Zo(e,t,r,!1,n)};st.version="18.3.1-next-f1338f8080-20240426";function u0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u0)}catch(e){console.error(e)}}u0(),up.exports=st;var Hv=up.exports,lf=Hv;il.createRoot=lf.createRoot,il.hydrateRoot=lf.hydrateRoot;/**
* @remix-run/router v1.23.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zs.apply(this,arguments)}var dr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(dr||(dr={}));const uf="popstate";function qv(e){e===void 0&&(e={});function t(n,s){let{pathname:i,search:o,hash:a}=n.location;return Zl("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:Co(s)}return Yv(t,r,null,e)}function we(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function c0(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Gv(){return Math.random().toString(36).substr(2,8)}function cf(e,t){return{usr:e.state,key:e.key,idx:t}}function Zl(e,t,r,n){return r===void 0&&(r=null),Zs({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Gn(t):t,{state:r,key:t&&t.key||n||Gv()})}function Co(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Gn(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Yv(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:i=!1}=n,o=s.history,a=dr.Pop,l=null,c=d();c==null&&(c=0,o.replaceState(Zs({},o.state,{idx:c}),""));function d(){return(o.state||{idx:null}).idx}function f(){a=dr.Pop;let w=d(),v=w==null?null:w-c;c=w,l&&l({action:a,location:g.location,delta:v})}function u(w,v){a=dr.Push;let y=Zl(g.location,w,v);c=d()+1;let x=cf(y,c),b=g.createHref(y);try{o.pushState(x,"",b)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;s.location.assign(b)}i&&l&&l({action:a,location:g.location,delta:1})}function p(w,v){a=dr.Replace;let y=Zl(g.location,w,v);c=d();let x=cf(y,c),b=g.createHref(y);o.replaceState(x,"",b),i&&l&&l({action:a,location:g.location,delta:0})}function m(w){let v=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof w=="string"?w:Co(w);return y=y.replace(/ $/,"%20"),we(v,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,v)}let g={get action(){return a},get location(){return e(s,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(uf,f),l=w,()=>{s.removeEventListener(uf,f),l=null}},createHref(w){return t(s,w)},createURL:m,encodeLocation(w){let v=m(w);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:u,replace:p,go(w){return o.go(w)}};return g}var df;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(df||(df={}));function Kv(e,t,r){return r===void 0&&(r="/"),Xv(e,t,r)}function Xv(e,t,r,n){let s=typeof t=="string"?Gn(t):t,i=mc(s.pathname||"/",r);if(i==null)return null;let o=d0(e);Qv(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=ux(i);a=ox(o[l],c)}return a}function d0(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(i,o,a)=>{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(we(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=wr([n,l.relativePath]),d=r.concat(l);i.children&&i.children.length>0&&(we(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),d0(i.children,t,d,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:sx(c,i.index),routesMeta:d})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of f0(i.path))s(i,o,l)}),t}function f0(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return s?[i,""]:[i];let o=f0(n.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function Qv(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:ix(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Zv=/^:[\w-]+$/,Jv=3,ex=2,tx=1,rx=10,nx=-2,ff=e=>e==="*";function sx(e,t){let r=e.split("/"),n=r.length;return r.some(ff)&&(n+=nx),t&&(n+=ex),r.filter(s=>!ff(s)).reduce((s,i)=>s+(Zv.test(i)?Jv:i===""?tx:rx),n)}function ix(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function ox(e,t,r){let{routesMeta:n}=e,s={},i="/",o=[];for(let a=0;a<n.length;++a){let l=n[a],c=a===n.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=ax({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d),u=l.route;if(!f)return null;Object.assign(s,f.params),o.push({params:s,pathname:wr([i,f.pathname]),pathnameBase:hx(wr([i,f.pathnameBase])),route:u}),f.pathnameBase!=="/"&&(i=wr([i,f.pathnameBase]))}return o}function ax(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=lx(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:n.reduce((c,d,f)=>{let{paramName:u,isOptional:p}=d;if(u==="*"){let g=a[f]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const m=a[f];return p&&!m?c[u]=void 0:c[u]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:e}}function lx(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),c0(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function ux(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return c0(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function mc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function cx(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?Gn(e):e;return{pathname:r?r.startsWith("/")?r:dx(r,t):t,search:px(n),hash:mx(s)}}function dx(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function Ia(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function fx(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function gc(e,t){let r=fx(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function yc(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=Gn(e):(s=Zs({},e),we(!s.pathname||!s.pathname.includes("?"),Ia("?","pathname","search",s)),we(!s.pathname||!s.pathname.includes("#"),Ia("#","pathname","hash",s)),we(!s.search||!s.search.includes("#"),Ia("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let u=o.split("/");for(;u[0]==="..";)u.shift(),f-=1;s.pathname=u.join("/")}a=f>=0?t[f]:"/"}let l=cx(s,a),c=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const wr=e=>e.join("/").replace(/\/\/+/g,"/"),hx=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),px=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,mx=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function gx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const h0=["post","put","patch","delete"];new Set(h0);const yx=["get",...h0];new Set(yx);/**
* React Router v6.30.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Js(){return Js=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Js.apply(this,arguments)}const vc=S.createContext(null),vx=S.createContext(null),Mr=S.createContext(null),Jo=S.createContext(null),Ar=S.createContext({outlet:null,matches:[],isDataRoute:!1}),p0=S.createContext(null);function xx(e,t){let{relative:r}=t===void 0?{}:t;Yn()||we(!1);let{basename:n,navigator:s}=S.useContext(Mr),{hash:i,pathname:o,search:a}=g0(e,{relative:r}),l=o;return n!=="/"&&(l=o==="/"?n:wr([n,o])),s.createHref({pathname:l,search:a,hash:i})}function Yn(){return S.useContext(Jo)!=null}function _r(){return Yn()||we(!1),S.useContext(Jo).location}function m0(e){S.useContext(Mr).static||S.useLayoutEffect(e)}function ea(){let{isDataRoute:e}=S.useContext(Ar);return e?_x():wx()}function wx(){Yn()||we(!1);let e=S.useContext(vc),{basename:t,future:r,navigator:n}=S.useContext(Mr),{matches:s}=S.useContext(Ar),{pathname:i}=_r(),o=JSON.stringify(gc(s,r.v7_relativeSplatPath)),a=S.useRef(!1);return m0(()=>{a.current=!0}),S.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){n.go(c);return}let f=yc(c,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:wr([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,o,i,e])}function g0(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=S.useContext(Mr),{matches:s}=S.useContext(Ar),{pathname:i}=_r(),o=JSON.stringify(gc(s,n.v7_relativeSplatPath));return S.useMemo(()=>yc(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function bx(e,t){return Sx(e,t)}function Sx(e,t,r,n){Yn()||we(!1);let{navigator:s}=S.useContext(Mr),{matches:i}=S.useContext(Ar),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=_r(),d;if(t){var f;let w=typeof t=="string"?Gn(t):t;l==="/"||(f=w.pathname)!=null&&f.startsWith(l)||we(!1),d=w}else d=c;let u=d.pathname||"/",p=u;if(l!=="/"){let w=l.replace(/^\//,"").split("/");p="/"+u.replace(/^\//,"").split("/").slice(w.length).join("/")}let m=Kv(e,{pathname:p}),g=Px(m&&m.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:wr([l,s.encodeLocation?s.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:wr([l,s.encodeLocation?s.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,r,n);return t&&g?S.createElement(Jo.Provider,{value:{location:Js({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:dr.Pop}},g):g}function kx(){let e=Ax(),t=gx(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),r?S.createElement("pre",{style:s},r):null,null)}const jx=S.createElement(kx,null);class Cx extends S.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?S.createElement(Ar.Provider,{value:this.props.routeContext},S.createElement(p0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Nx(e){let{routeContext:t,match:r,children:n}=e,s=S.useContext(vc);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),S.createElement(Ar.Provider,{value:t},n)}function Px(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,a=(s=r)==null?void 0:s.errors;if(a!=null){let d=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||we(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=d),f.route.id){let{loaderData:u,errors:p}=r,m=f.route.loader&&u[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||m){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,f,u)=>{let p,m=!1,g=null,w=null;r&&(p=a&&f.route.id?a[f.route.id]:void 0,g=f.route.errorElement||jx,l&&(c<0&&u===0?(Lx("route-fallback"),m=!0,w=null):c===u&&(m=!0,w=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,u+1)),y=()=>{let x;return p?x=g:m?x=w:f.route.Component?x=S.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,S.createElement(Nx,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:r!=null},children:x})};return r&&(f.route.ErrorBoundary||f.route.errorElement||u===0)?S.createElement(Cx,{location:r.location,revalidation:r.revalidation,component:g,error:p,children:y(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):y()},null)}var y0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(y0||{}),v0=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(v0||{});function Ex(e){let t=S.useContext(vc);return t||we(!1),t}function Tx(e){let t=S.useContext(vx);return t||we(!1),t}function Mx(e){let t=S.useContext(Ar);return t||we(!1),t}function x0(e){let t=Mx(),r=t.matches[t.matches.length-1];return r.route.id||we(!1),r.route.id}function Ax(){var e;let t=S.useContext(p0),r=Tx(),n=x0();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function _x(){let{router:e}=Ex(y0.UseNavigateStable),t=x0(v0.UseNavigateStable),r=S.useRef(!1);return m0(()=>{r.current=!0}),S.useCallback(function(s,i){i===void 0&&(i={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Js({fromRouteId:t},i)))},[e,t])}const hf={};function Lx(e,t,r){hf[e]||(hf[e]=!0)}function Dx(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Rx(e){let{to:t,replace:r,state:n,relative:s}=e;Yn()||we(!1);let{future:i,static:o}=S.useContext(Mr),{matches:a}=S.useContext(Ar),{pathname:l}=_r(),c=ea(),d=yc(t,gc(a,i.v7_relativeSplatPath),l,s==="path"),f=JSON.stringify(d);return S.useEffect(()=>c(JSON.parse(f),{replace:r,state:n,relative:s}),[c,f,s,r,n]),null}function jt(e){we(!1)}function Vx(e){let{basename:t="/",children:r=null,location:n,navigationType:s=dr.Pop,navigator:i,static:o=!1,future:a}=e;Yn()&&we(!1);let l=t.replace(/^\/*/,"/"),c=S.useMemo(()=>({basename:l,navigator:i,static:o,future:Js({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof n=="string"&&(n=Gn(n));let{pathname:d="/",search:f="",hash:u="",state:p=null,key:m="default"}=n,g=S.useMemo(()=>{let w=mc(d,l);return w==null?null:{location:{pathname:w,search:f,hash:u,state:p,key:m},navigationType:s}},[l,d,f,u,p,m,s]);return g==null?null:S.createElement(Mr.Provider,{value:c},S.createElement(Jo.Provider,{children:r,value:g}))}function Fx(e){let{children:t,location:r}=e;return bx(Jl(t),r)}new Promise(()=>{});function Jl(e,t){t===void 0&&(t=[]);let r=[];return S.Children.forEach(e,(n,s)=>{if(!S.isValidElement(n))return;let i=[...t,s];if(n.type===S.Fragment){r.push.apply(r,Jl(n.props.children,i));return}n.type!==jt&&we(!1),!n.props.index||!n.props.children||we(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Jl(n.props.children,i)),r.push(o)}),r}/**
* React Router DOM v6.30.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function eu(){return eu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eu.apply(this,arguments)}function Ix(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,i;for(i=0;i<n.length;i++)s=n[i],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function zx(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ox(e,t){return e.button===0&&(!t||t==="_self")&&!zx(e)}function tu(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function $x(e,t){let r=tu(e);return t&&t.forEach((n,s)=>{r.has(s)||t.getAll(s).forEach(i=>{r.append(s,i)})}),r}const Bx=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Ux="6";try{window.__reactRouterVersion=Ux}catch{}const Wx="startTransition",pf=Dy[Wx];function Hx(e){let{basename:t,children:r,future:n,window:s}=e,i=S.useRef();i.current==null&&(i.current=qv({window:s,v5Compat:!0}));let o=i.current,[a,l]=S.useState({action:o.action,location:o.location}),{v7_startTransition:c}=n||{},d=S.useCallback(f=>{c&&pf?pf(()=>l(f)):l(f)},[l,c]);return S.useLayoutEffect(()=>o.listen(d),[o,d]),S.useEffect(()=>Dx(n),[n]),S.createElement(Vx,{basename:t,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}const qx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Gx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xi=S.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:c,preventScrollReset:d,viewTransition:f}=t,u=Ix(t,Bx),{basename:p}=S.useContext(Mr),m,g=!1;if(typeof c=="string"&&Gx.test(c)&&(m=c,qx))try{let x=new URL(window.location.href),b=c.startsWith("//")?new URL(x.protocol+c):new URL(c),k=mc(b.pathname,p);b.origin===x.origin&&k!=null?c=k+b.search+b.hash:g=!0}catch{}let w=xx(c,{relative:s}),v=Yx(c,{replace:o,state:a,target:l,preventScrollReset:d,relative:s,viewTransition:f});function y(x){n&&n(x),x.defaultPrevented||v(x)}return S.createElement("a",eu({},u,{href:m||w,onClick:g||i?n:y,ref:r,target:l}))});var mf;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(mf||(mf={}));var gf;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(gf||(gf={}));function Yx(e,t){let{target:r,replace:n,state:s,preventScrollReset:i,relative:o,viewTransition:a}=t===void 0?{}:t,l=ea(),c=_r(),d=g0(e,{relative:o});return S.useCallback(f=>{if(Ox(f,r)){f.preventDefault();let u=n!==void 0?n:Co(c)===Co(d);l(e,{replace:u,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[c,l,d,n,s,r,e,i,o,a])}function Kx(e){let t=S.useRef(tu(e)),r=S.useRef(!1),n=_r(),s=S.useMemo(()=>$x(n.search,r.current?null:t.current),[n.search]),i=ea(),o=S.useCallback((a,l)=>{const c=tu(typeof a=="function"?a(s):a);r.current=!0,i("?"+c,l)},[i,s]);return[s,o]}let Xx={data:""},Qx=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||Xx},Zx=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Jx=/\/\*[^]*?\*\/| +/g,yf=/\n+/g,lr=(e,t)=>{let r="",n="",s="";for(let i in e){let o=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+o+";":n+=i[1]=="f"?lr(o,i):i+"{"+lr(o,i[1]=="k"?"":t)+"}":typeof o=="object"?n+=lr(o,t?t.replace(/([^,])+/g,a=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):i):o!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=lr.p?lr.p(i,o):i+":"+o+";")}return r+(t&&s?t+"{"+s+"}":s)+n},Dt={},w0=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+w0(e[r]);return t}return e},e2=(e,t,r,n,s)=>{let i=w0(e),o=Dt[i]||(Dt[i]=(l=>{let c=0,d=11;for(;c<l.length;)d=101*d+l.charCodeAt(c++)>>>0;return"go"+d})(i));if(!Dt[o]){let l=i!==e?e:(c=>{let d,f,u=[{}];for(;d=Zx.exec(c.replace(Jx,""));)d[4]?u.shift():d[3]?(f=d[3].replace(yf," ").trim(),u.unshift(u[0][f]=u[0][f]||{})):u[0][d[1]]=d[2].replace(yf," ").trim();return u[0]})(e);Dt[o]=lr(s?{["@keyframes "+o]:l}:l,r?"":"."+o)}let a=r&&Dt.g?Dt.g:null;return r&&(Dt.g=Dt[o]),((l,c,d,f)=>{f?c.data=c.data.replace(f,l):c.data.indexOf(l)===-1&&(c.data=d?l+c.data:c.data+l)})(Dt[o],t,n,a),o},t2=(e,t,r)=>e.reduce((n,s,i)=>{let o=t[i];if(o&&o.call){let a=o(r),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":lr(a,""):a===!1?"":a}return n+s+(o??"")},"");function ta(e){let t=this||{},r=e.call?e(t.p):e;return e2(r.unshift?r.raw?t2(r,[].slice.call(arguments,1),t.p):r.reduce((n,s)=>Object.assign(n,s&&s.call?s(t.p):s),{}):r,Qx(t.target),t.g,t.o,t.k)}let b0,ru,nu;ta.bind({g:1});let Yt=ta.bind({k:1});function r2(e,t,r,n){lr.p=t,b0=e,ru=r,nu=n}function Lr(e,t){let r=this||{};return function(){let n=arguments;function s(i,o){let a=Object.assign({},i),l=a.className||s.className;r.p=Object.assign({theme:ru&&ru()},a),r.o=/ *go\d+/.test(l),a.className=ta.apply(r,n)+(l?" "+l:"");let c=e;return e[0]&&(c=a.as||e,delete a.as),nu&&c[0]&&nu(a),b0(c,a)}return s}}var n2=e=>typeof e=="function",No=(e,t)=>n2(e)?e(t):e,s2=(()=>{let e=0;return()=>(++e).toString()})(),S0=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),i2=20,xc="default",k0=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return k0(e,{type:e.toasts.find(o=>o.id===n.id)?1:0,toast:n});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(o=>o.id===s||s===void 0?{...o,dismissed:!0,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},Qi=[],j0={toasts:[],pausedAt:void 0,settings:{toastLimit:i2}},Pt={},C0=(e,t=xc)=>{Pt[t]=k0(Pt[t]||j0,e),Qi.forEach(([r,n])=>{r===t&&n(Pt[t])})},N0=e=>Object.keys(Pt).forEach(t=>C0(e,t)),o2=e=>Object.keys(Pt).find(t=>Pt[t].toasts.some(r=>r.id===e)),ra=(e=xc)=>t=>{C0(t,e)},a2={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},l2=(e={},t=xc)=>{let[r,n]=S.useState(Pt[t]||j0),s=S.useRef(Pt[t]);S.useEffect(()=>(s.current!==Pt[t]&&n(Pt[t]),Qi.push([t,n]),()=>{let o=Qi.findIndex(([a])=>a===t);o>-1&&Qi.splice(o,1)}),[t]);let i=r.toasts.map(o=>{var a,l,c;return{...e,...e[o.type],...o,removeDelay:o.removeDelay||((a=e[o.type])==null?void 0:a.removeDelay)||(e==null?void 0:e.removeDelay),duration:o.duration||((l=e[o.type])==null?void 0:l.duration)||(e==null?void 0:e.duration)||a2[o.type],style:{...e.style,...(c=e[o.type])==null?void 0:c.style,...o.style}}});return{...r,toasts:i}},u2=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||s2()}),ci=e=>(t,r)=>{let n=u2(t,e,r);return ra(n.toasterId||o2(n.id))({type:2,toast:n}),n.id},Ce=(e,t)=>ci("blank")(e,t);Ce.error=ci("error");Ce.success=ci("success");Ce.loading=ci("loading");Ce.custom=ci("custom");Ce.dismiss=(e,t)=>{let r={type:3,toastId:e};t?ra(t)(r):N0(r)};Ce.dismissAll=e=>Ce.dismiss(void 0,e);Ce.remove=(e,t)=>{let r={type:4,toastId:e};t?ra(t)(r):N0(r)};Ce.removeAll=e=>Ce.remove(void 0,e);Ce.promise=(e,t,r)=>{let n=Ce.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let i=t.success?No(t.success,s):void 0;return i?Ce.success(i,{id:n,...r,...r==null?void 0:r.success}):Ce.dismiss(n),s}).catch(s=>{let i=t.error?No(t.error,s):void 0;i?Ce.error(i,{id:n,...r,...r==null?void 0:r.error}):Ce.dismiss(n)}),e};var c2=1e3,d2=(e,t="default")=>{let{toasts:r,pausedAt:n}=l2(e,t),s=S.useRef(new Map).current,i=S.useCallback((f,u=c2)=>{if(s.has(f))return;let p=setTimeout(()=>{s.delete(f),o({type:4,toastId:f})},u);s.set(f,p)},[]);S.useEffect(()=>{if(n)return;let f=Date.now(),u=r.map(p=>{if(p.duration===1/0)return;let m=(p.duration||0)+p.pauseDuration-(f-p.createdAt);if(m<0){p.visible&&Ce.dismiss(p.id);return}return setTimeout(()=>Ce.dismiss(p.id,t),m)});return()=>{u.forEach(p=>p&&clearTimeout(p))}},[r,n,t]);let o=S.useCallback(ra(t),[t]),a=S.useCallback(()=>{o({type:5,time:Date.now()})},[o]),l=S.useCallback((f,u)=>{o({type:1,toast:{id:f,height:u}})},[o]),c=S.useCallback(()=>{n&&o({type:6,time:Date.now()})},[n,o]),d=S.useCallback((f,u)=>{let{reverseOrder:p=!1,gutter:m=8,defaultPosition:g}=u||{},w=r.filter(x=>(x.position||g)===(f.position||g)&&x.height),v=w.findIndex(x=>x.id===f.id),y=w.filter((x,b)=>b<v&&x.visible).length;return w.filter(x=>x.visible).slice(...p?[y+1]:[0,y]).reduce((x,b)=>x+(b.height||0)+m,0)},[r]);return S.useEffect(()=>{r.forEach(f=>{if(f.dismissed)i(f.id,f.removeDelay);else{let u=s.get(f.id);u&&(clearTimeout(u),s.delete(f.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:l,startPause:a,endPause:c,calculateOffset:d}}},f2=Yt`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,h2=Yt`
from {
transform: scale(0);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}`,p2=Yt`
from {
transform: scale(0) rotate(90deg);
opacity: 0;
}
to {
transform: scale(1) rotate(90deg);
opacity: 1;
}`,m2=Lr("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${e=>e.primary||"#ff4b4b"};
position: relative;
transform: rotate(45deg);
animation: ${f2} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after,
&:before {
content: '';
animation: ${h2} 0.15s ease-out forwards;
animation-delay: 150ms;
position: absolute;
border-radius: 3px;
opacity: 0;
background: ${e=>e.secondary||"#fff"};
bottom: 9px;
left: 4px;
height: 2px;
width: 12px;
}
&:before {
animation: ${p2} 0.15s ease-out forwards;
animation-delay: 180ms;
transform: rotate(90deg);
}
`,g2=Yt`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`,y2=Lr("div")`
width: 12px;
height: 12px;
box-sizing: border-box;
border: 2px solid;
border-radius: 100%;
border-color: ${e=>e.secondary||"#e0e0e0"};
border-right-color: ${e=>e.primary||"#616161"};
animation: ${g2} 1s linear infinite;
`,v2=Yt`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,x2=Yt`
0% {
height: 0;
width: 0;
opacity: 0;
}
40% {
height: 0;
width: 6px;
opacity: 1;
}
100% {
opacity: 1;
height: 10px;
}`,w2=Lr("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${e=>e.primary||"#61d345"};
position: relative;
transform: rotate(45deg);
animation: ${v2} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after {
content: '';
box-sizing: border-box;
animation: ${x2} 0.2s ease-out forwards;
opacity: 0;
animation-delay: 200ms;
position: absolute;
border-right: 2px solid;
border-bottom: 2px solid;
border-color: ${e=>e.secondary||"#fff"};
bottom: 6px;
left: 6px;
height: 10px;
width: 6px;
}
`,b2=Lr("div")`
position: absolute;
`,S2=Lr("div")`
position: relative;
display: flex;
justify-content: center;
align-items: center;
min-width: 20px;
min-height: 20px;
`,k2=Yt`
from {
transform: scale(0.6);
opacity: 0.4;
}
to {
transform: scale(1);
opacity: 1;
}`,j2=Lr("div")`
position: relative;
transform: scale(0.6);
opacity: 0.4;
min-width: 20px;
animation: ${k2} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
`,C2=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?S.createElement(j2,null,t):t:r==="blank"?null:S.createElement(S2,null,S.createElement(y2,{...n}),r!=="loading"&&S.createElement(b2,null,r==="error"?S.createElement(m2,{...n}):S.createElement(w2,{...n})))},N2=e=>`
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,P2=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
`,E2="0%{opacity:0;} 100%{opacity:1;}",T2="0%{opacity:1;} 100%{opacity:0;}",M2=Lr("div")`
display: flex;
align-items: center;
background: #fff;
color: #363636;
line-height: 1.3;
will-change: transform;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
max-width: 350px;
pointer-events: auto;
padding: 8px 10px;
border-radius: 8px;
`,A2=Lr("div")`
display: flex;
justify-content: center;
margin: 4px 10px;
color: inherit;
flex: 1 1 auto;
white-space: pre-line;
`,_2=(e,t)=>{let r=e.includes("top")?1:-1,[n,s]=S0()?[E2,T2]:[N2(r),P2(r)];return{animation:t?`${Yt(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Yt(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},L2=S.memo(({toast:e,position:t,style:r,children:n})=>{let s=e.height?_2(e.position||t||"top-center",e.visible):{opacity:0},i=S.createElement(C2,{toast:e}),o=S.createElement(A2,{...e.ariaProps},No(e.message,e));return S.createElement(M2,{className:e.className,style:{...s,...r,...e.style}},typeof n=="function"?n({icon:i,message:o}):S.createElement(S.Fragment,null,i,o))});r2(S.createElement);var D2=({id:e,className:t,style:r,onHeightUpdate:n,children:s})=>{let i=S.useCallback(o=>{if(o){let a=()=>{let l=o.getBoundingClientRect().height;n(e,l)};a(),new MutationObserver(a).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return S.createElement("div",{ref:i,className:t,style:r},s)},R2=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:S0()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...s}},V2=ta`
z-index: 9999;
> * {
pointer-events: auto;
}
`,_i=16,F2=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:s,toasterId:i,containerStyle:o,containerClassName:a})=>{let{toasts:l,handlers:c}=d2(r,i);return S.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:_i,left:_i,right:_i,bottom:_i,pointerEvents:"none",...o},className:a,onMouseEnter:c.startPause,onMouseLeave:c.endPause},l.map(d=>{let f=d.position||t,u=c.calculateOffset(d,{reverseOrder:e,gutter:n,defaultPosition:t}),p=R2(f,u);return S.createElement(D2,{id:d.id,key:d.id,onHeightUpdate:c.updateHeight,className:d.visible?V2:"",style:p},d.type==="custom"?No(d.message,d):s?s(d):S.createElement(L2,{toast:d,position:f}))}))},ce=Ce;const P0=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),na=S.createContext({}),sa=S.createContext(null),ia=typeof document<"u",wc=ia?S.useLayoutEffect:S.useEffect,E0=S.createContext({strict:!1}),bc=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),I2="framerAppearId",T0="data-"+bc(I2);function z2(e,t,r,n){const{visualElement:s}=S.useContext(na),i=S.useContext(E0),o=S.useContext(sa),a=S.useContext(P0).reducedMotion,l=S.useRef();n=n||i.renderer,!l.current&&n&&(l.current=n(e,{visualState:t,parent:s,props:r,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;S.useInsertionEffect(()=>{c&&c.update(r,o)});const d=S.useRef(!!(r[T0]&&!window.HandoffComplete));return wc(()=>{c&&(c.render(),d.current&&c.animationState&&c.animationState.animateChanges())}),S.useEffect(()=>{c&&(c.updateFeatures(),!d.current&&c.animationState&&c.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),c}function bn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function O2(e,t,r){return S.useCallback(n=>{n&&e.mount&&e.mount(n),t&&(n?t.mount(n):t.unmount()),r&&(typeof r=="function"?r(n):bn(r)&&(r.current=n))},[t])}function ei(e){return typeof e=="string"||Array.isArray(e)}function oa(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Sc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],kc=["initial",...Sc];function aa(e){return oa(e.animate)||kc.some(t=>ei(e[t]))}function M0(e){return!!(aa(e)||e.variants)}function $2(e,t){if(aa(e)){const{initial:r,animate:n}=e;return{initial:r===!1||ei(r)?r:void 0,animate:ei(n)?n:void 0}}return e.inherit!==!1?t:{}}function B2(e){const{initial:t,animate:r}=$2(e,S.useContext(na));return S.useMemo(()=>({initial:t,animate:r}),[vf(t),vf(r)])}function vf(e){return Array.isArray(e)?e.join(" "):e}const xf={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"]},ti={};for(const e in xf)ti[e]={isEnabled:t=>xf[e].some(r=>!!t[r])};function U2(e){for(const t in e)ti[t]={...ti[t],...e[t]}}const jc=S.createContext({}),A0=S.createContext({}),W2=Symbol.for("motionComponentSymbol");function H2({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:n,Component:s}){e&&U2(e);function i(a,l){let c;const d={...S.useContext(P0),...a,layoutId:q2(a)},{isStatic:f}=d,u=B2(a),p=n(a,f);if(!f&&ia){u.visualElement=z2(s,p,d,t);const m=S.useContext(A0),g=S.useContext(E0).strict;u.visualElement&&(c=u.visualElement.loadFeatures(d,g,e,m))}return S.createElement(na.Provider,{value:u},c&&u.visualElement?S.createElement(c,{visualElement:u.visualElement,...d}):null,r(s,a,O2(p,u.visualElement,l),p,f,u.visualElement))}const o=S.forwardRef(i);return o[W2]=s,o}function q2({layoutId:e}){const t=S.useContext(jc).id;return t&&e!==void 0?t+"-"+e:e}function G2(e){function t(n,s={}){return H2(e(n,s))}if(typeof Proxy>"u")return t;const r=new Map;return new Proxy(t,{get:(n,s)=>(r.has(s)||r.set(s,t(s)),r.get(s))})}const Y2=["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 Cc(e){return typeof e!="string"||e.includes("-")?!1:!!(Y2.indexOf(e)>-1||/[A-Z]/.test(e))}const Po={};function K2(e){Object.assign(Po,e)}const di=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],nn=new Set(di);function _0(e,{layout:t,layoutId:r}){return nn.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Po[e]||e==="opacity")}const Xe=e=>!!(e&&e.getVelocity),X2={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Q2=di.length;function Z2(e,{enableHardwareAcceleration:t=!0,allowTransformNone:r=!0},n,s){let i="";for(let o=0;o<Q2;o++){const a=di[o];if(e[a]!==void 0){const l=X2[a]||a;i+=`${l}(${e[a]}) `}}return t&&!e.z&&(i+="translateZ(0)"),i=i.trim(),s?i=s(e,n?"":i):r&&n&&(i="none"),i}const L0=e=>t=>typeof t=="string"&&t.startsWith(e),D0=L0("--"),su=L0("var(--"),J2=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,ew=(e,t)=>t&&typeof e=="number"?t.transform(e):e,jr=(e,t,r)=>Math.min(Math.max(r,e),t),sn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ns={...sn,transform:e=>jr(0,1,e)},Li={...sn,default:1},Ps=e=>Math.round(e*1e5)/1e5,la=/(-)?([\d]*\.?[\d])+/g,R0=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,tw=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function fi(e){return typeof e=="string"}const hi=e=>({test:t=>fi(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),rr=hi("deg"),At=hi("%"),U=hi("px"),rw=hi("vh"),nw=hi("vw"),wf={...At,parse:e=>At.parse(e)/100,transform:e=>At.transform(e*100)},bf={...sn,transform:Math.round},V0={borderWidth:U,borderTopWidth:U,borderRightWidth:U,borderBottomWidth:U,borderLeftWidth:U,borderRadius:U,radius:U,borderTopLeftRadius:U,borderTopRightRadius:U,borderBottomRightRadius:U,borderBottomLeftRadius:U,width:U,maxWidth:U,height:U,maxHeight:U,size:U,top:U,right:U,bottom:U,left:U,padding:U,paddingTop:U,paddingRight:U,paddingBottom:U,paddingLeft:U,margin:U,marginTop:U,marginRight:U,marginBottom:U,marginLeft:U,rotate:rr,rotateX:rr,rotateY:rr,rotateZ:rr,scale:Li,scaleX:Li,scaleY:Li,scaleZ:Li,skew:rr,skewX:rr,skewY:rr,distance:U,translateX:U,translateY:U,translateZ:U,x:U,y:U,z:U,perspective:U,transformPerspective:U,opacity:Ns,originX:wf,originY:wf,originZ:U,zIndex:bf,fillOpacity:Ns,strokeOpacity:Ns,numOctaves:bf};function Nc(e,t,r,n){const{style:s,vars:i,transform:o,transformOrigin:a}=e;let l=!1,c=!1,d=!0;for(const f in t){const u=t[f];if(D0(f)){i[f]=u;continue}const p=V0[f],m=ew(u,p);if(nn.has(f)){if(l=!0,o[f]=m,!d)continue;u!==(p.default||0)&&(d=!1)}else f.startsWith("origin")?(c=!0,a[f]=m):s[f]=m}if(t.transform||(l||n?s.transform=Z2(e.transform,r,d,n):s.transform&&(s.transform="none")),c){const{originX:f="50%",originY:u="50%",originZ:p=0}=a;s.transformOrigin=`${f} ${u} ${p}`}}const Pc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function F0(e,t,r){for(const n in t)!Xe(t[n])&&!_0(n,r)&&(e[n]=t[n])}function sw({transformTemplate:e},t,r){return S.useMemo(()=>{const n=Pc();return Nc(n,t,{enableHardwareAcceleration:!r},e),Object.assign({},n.vars,n.style)},[t])}function iw(e,t,r){const n=e.style||{},s={};return F0(s,n,e),Object.assign(s,sw(e,t,r)),e.transformValues?e.transformValues(s):s}function ow(e,t,r){const n={},s=iw(e,t,r);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const aw=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Eo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||aw.has(e)}let I0=e=>!Eo(e);function lw(e){e&&(I0=t=>t.startsWith("on")?!Eo(t):e(t))}try{lw(require("@emotion/is-prop-valid").default)}catch{}function uw(e,t,r){const n={};for(const s in e)s==="values"&&typeof e.values=="object"||(I0(s)||r===!0&&Eo(s)||!t&&!Eo(s)||e.draggable&&s.startsWith("onDrag"))&&(n[s]=e[s]);return n}function Sf(e,t,r){return typeof e=="string"?e:U.transform(t+r*e)}function cw(e,t,r){const n=Sf(t,e.x,e.width),s=Sf(r,e.y,e.height);return`${n} ${s}`}const dw={offset:"stroke-dashoffset",array:"stroke-dasharray"},fw={offset:"strokeDashoffset",array:"strokeDasharray"};function hw(e,t,r=1,n=0,s=!0){e.pathLength=1;const i=s?dw:fw;e[i.offset]=U.transform(-n);const o=U.transform(t),a=U.transform(r);e[i.array]=`${o} ${a}`}function Ec(e,{attrX:t,attrY:r,attrScale:n,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,f,u){if(Nc(e,c,d,u),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:m,dimensions:g}=e;p.transform&&(g&&(m.transform=p.transform),delete p.transform),g&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=cw(g,s!==void 0?s:.5,i!==void 0?i:.5)),t!==void 0&&(p.x=t),r!==void 0&&(p.y=r),n!==void 0&&(p.scale=n),o!==void 0&&hw(p,o,a,l,!1)}const z0=()=>({...Pc(),attrs:{}}),Tc=e=>typeof e=="string"&&e.toLowerCase()==="svg";function pw(e,t,r,n){const s=S.useMemo(()=>{const i=z0();return Ec(i,t,{enableHardwareAcceleration:!1},Tc(n),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};F0(i,e.style,e),s.style={...i,...s.style}}return s}function mw(e=!1){return(r,n,s,{latestValues:i},o)=>{const l=(Cc(r)?pw:ow)(n,i,o,r),d={...uw(n,typeof r=="string",e),...l,ref:s},{children:f}=n,u=S.useMemo(()=>Xe(f)?f.get():f,[f]);return S.createElement(r,{...d,children:u})}}function O0(e,{style:t,vars:r},n,s){Object.assign(e.style,t,s&&s.getProjectionStyles(n));for(const i in r)e.style.setProperty(i,r[i])}const $0=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function B0(e,t,r,n){O0(e,t,void 0,n);for(const s in t.attrs)e.setAttribute($0.has(s)?s:bc(s),t.attrs[s])}function Mc(e,t){const{style:r}=e,n={};for(const s in r)(Xe(r[s])||t.style&&Xe(t.style[s])||_0(s,e))&&(n[s]=r[s]);return n}function U0(e,t){const r=Mc(e,t);for(const n in e)if(Xe(e[n])||Xe(t[n])){const s=di.indexOf(n)!==-1?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n;r[s]=e[n]}return r}function Ac(e,t,r,n={},s={}){return typeof t=="function"&&(t=t(r!==void 0?r:e.custom,n,s)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(r!==void 0?r:e.custom,n,s)),t}function W0(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const To=e=>Array.isArray(e),gw=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),yw=e=>To(e)?e[e.length-1]||0:e;function Zi(e){const t=Xe(e)?e.get():e;return gw(t)?t.toValue():t}function vw({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:r},n,s,i){const o={latestValues:xw(n,s,i,e),renderState:t()};return r&&(o.mount=a=>r(n,a,o)),o}const H0=e=>(t,r)=>{const n=S.useContext(na),s=S.useContext(sa),i=()=>vw(e,t,n,s);return r?i():W0(i)};function xw(e,t,r,n){const s={},i=n(e,{});for(const u in i)s[u]=Zi(i[u]);let{initial:o,animate:a}=e;const l=aa(e),c=M0(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=r?r.initial===!1:!1;d=d||o===!1;const f=d?a:o;return f&&typeof f!="boolean"&&!oa(f)&&(Array.isArray(f)?f:[f]).forEach(p=>{const m=Ac(e,p);if(!m)return;const{transitionEnd:g,transition:w,...v}=m;for(const y in v){let x=v[y];if(Array.isArray(x)){const b=d?x.length-1:0;x=x[b]}x!==null&&(s[y]=x)}for(const y in g)s[y]=g[y]}),s}const xe=e=>e;class kf{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const r=this.order.indexOf(t);r!==-1&&(this.order.splice(r,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function ww(e){let t=new kf,r=new kf,n=0,s=!1,i=!1;const o=new WeakSet,a={schedule:(l,c=!1,d=!1)=>{const f=d&&s,u=f?t:r;return c&&o.add(l),u.add(l)&&f&&s&&(n=t.order.length),l},cancel:l=>{r.remove(l),o.delete(l)},process:l=>{if(s){i=!0;return}if(s=!0,[t,r]=[r,t],r.clear(),n=t.order.length,n)for(let c=0;c<n;c++){const d=t.order[c];d(l),o.has(d)&&(a.schedule(d),e())}s=!1,i&&(i=!1,a.process(l))}};return a}const Di=["prepare","read","update","preRender","render","postRender"],bw=40;function Sw(e,t){let r=!1,n=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=Di.reduce((f,u)=>(f[u]=ww(()=>r=!0),f),{}),o=f=>i[f].process(s),a=()=>{const f=performance.now();r=!1,s.delta=n?1e3/60:Math.max(Math.min(f-s.timestamp,bw),1),s.timestamp=f,s.isProcessing=!0,Di.forEach(o),s.isProcessing=!1,r&&t&&(n=!1,e(a))},l=()=>{r=!0,n=!0,s.isProcessing||e(a)};return{schedule:Di.reduce((f,u)=>{const p=i[u];return f[u]=(m,g=!1,w=!1)=>(r||l(),p.schedule(m,g,w)),f},{}),cancel:f=>Di.forEach(u=>i[u].cancel(f)),state:s,steps:i}}const{schedule:ne,cancel:Kt,state:De,steps:za}=Sw(typeof requestAnimationFrame<"u"?requestAnimationFrame:xe,!0),kw={useVisualState:H0({scrapeMotionValuesFromProps:U0,createRenderState:z0,onMount:(e,t,{renderState:r,latestValues:n})=>{ne.read(()=>{try{r.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),ne.render(()=>{Ec(r,n,{enableHardwareAcceleration:!1},Tc(t.tagName),e.transformTemplate),B0(t,r)})}})},jw={useVisualState:H0({scrapeMotionValuesFromProps:Mc,createRenderState:Pc})};function Cw(e,{forwardMotionProps:t=!1},r,n){return{...Cc(e)?kw:jw,preloadedFeatures:r,useRender:mw(t),createVisualElement:n,Component:e}}function Ot(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}const q0=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function ua(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const Nw=e=>t=>q0(t)&&e(t,ua(t));function Bt(e,t,r,n){return Ot(e,t,Nw(r),n)}const Pw=(e,t)=>r=>t(e(r)),br=(...e)=>e.reduce(Pw);function G0(e){let t=null;return()=>{const r=()=>{t=null};return t===null?(t=e,r):!1}}const jf=G0("dragHorizontal"),Cf=G0("dragVertical");function Y0(e){let t=!1;if(e==="y")t=Cf();else if(e==="x")t=jf();else{const r=jf(),n=Cf();r&&n?t=()=>{r(),n()}:(r&&r(),n&&n())}return t}function K0(){const e=Y0(!0);return e?(e(),!1):!0}class Dr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Nf(e,t){const r="pointer"+(t?"enter":"leave"),n="onHover"+(t?"Start":"End"),s=(i,o)=>{if(i.pointerType==="touch"||K0())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[n]&&ne.update(()=>a[n](i,o))};return Bt(e.current,r,s,{passive:!e.getProps()[n]})}class Ew extends Dr{mount(){this.unmount=br(Nf(this.node,!0),Nf(this.node,!1))}unmount(){}}class Tw extends Dr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=br(Ot(this.node.current,"focus",()=>this.onFocus()),Ot(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const X0=(e,t)=>t?e===t?!0:X0(e,t.parentElement):!1;function Oa(e,t){if(!t)return;const r=new PointerEvent("pointer"+e);t(r,ua(r))}class Mw extends Dr{constructor(){super(...arguments),this.removeStartListeners=xe,this.removeEndListeners=xe,this.removeAccessibleListeners=xe,this.startPointerPress=(t,r)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),i=Bt(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:d,globalTapTarget:f}=this.node.getProps();ne.update(()=>{!f&&!X0(this.node.current,a.target)?d&&d(a,l):c&&c(a,l)})},{passive:!(n.onTap||n.onPointerUp)}),o=Bt(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=br(i,o),this.startPress(t,r)},this.startAccessiblePress=()=>{const t=i=>{if(i.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Oa("up",(l,c)=>{const{onTap:d}=this.node.getProps();d&&ne.update(()=>d(l,c))})};this.removeEndListeners(),this.removeEndListeners=Ot(this.node.current,"keyup",o),Oa("down",(a,l)=>{this.startPress(a,l)})},r=Ot(this.node.current,"keydown",t),n=()=>{this.isPressing&&Oa("cancel",(i,o)=>this.cancelPress(i,o))},s=Ot(this.node.current,"blur",n);this.removeAccessibleListeners=br(r,s)}}startPress(t,r){this.isPressing=!0;const{onTapStart:n,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&ne.update(()=>n(t,r))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!K0()}cancelPress(t,r){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&ne.update(()=>n(t,r))}mount(){const t=this.node.getProps(),r=Bt(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=Ot(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=br(r,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const iu=new WeakMap,$a=new WeakMap,Aw=e=>{const t=iu.get(e.target);t&&t(e)},_w=e=>{e.forEach(Aw)};function Lw({root:e,...t}){const r=e||document;$a.has(r)||$a.set(r,{});const n=$a.get(r),s=JSON.stringify(t);return n[s]||(n[s]=new IntersectionObserver(_w,{root:e,...t})),n[s]}function Dw(e,t,r){const n=Lw(t);return iu.set(e,r),n.observe(e),()=>{iu.delete(e),n.unobserve(e)}}const Rw={some:0,all:1};class Vw extends Dr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:s="some",once:i}=t,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof s=="number"?s:Rw[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),u=c?d:f;u&&u(l)};return Dw(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(Fw(t,r))&&this.startObserver()}unmount(){}}function Fw({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const Iw={inView:{Feature:Vw},tap:{Feature:Mw},focus:{Feature:Tw},hover:{Feature:Ew}};function Q0(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function zw(e){const t={};return e.values.forEach((r,n)=>t[n]=r.get()),t}function Ow(e){const t={};return e.values.forEach((r,n)=>t[n]=r.getVelocity()),t}function ca(e,t,r){const n=e.getProps();return Ac(n,t,r!==void 0?r:n.custom,zw(e),Ow(e))}let _c=xe;const Yr=e=>e*1e3,Ut=e=>e/1e3,$w={current:!1},Z0=e=>Array.isArray(e)&&typeof e[0]=="number";function J0(e){return!!(!e||typeof e=="string"&&eg[e]||Z0(e)||Array.isArray(e)&&e.every(J0))}const gs=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,eg={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:gs([0,.65,.55,1]),circOut:gs([.55,0,1,.45]),backIn:gs([.31,.01,.66,-.59]),backOut:gs([.33,1.53,.69,.99])};function tg(e){if(e)return Z0(e)?gs(e):Array.isArray(e)?e.map(tg):eg[e]}function Bw(e,t,r,{delay:n=0,duration:s,repeat:i=0,repeatType:o="loop",ease:a,times:l}={}){const c={[t]:r};l&&(c.offset=l);const d=tg(a);return Array.isArray(d)&&(c.easing=d),e.animate(c,{delay:n,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}function Uw(e,{repeat:t,repeatType:r="loop"}){const n=t&&r!=="loop"&&t%2===1?0:e.length-1;return e[n]}const rg=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Ww=1e-7,Hw=12;function qw(e,t,r,n,s){let i,o,a=0;do o=t+(r-t)/2,i=rg(o,n,s)-e,i>0?r=o:t=o;while(Math.abs(i)>Ww&&++a<Hw);return o}function pi(e,t,r,n){if(e===t&&r===n)return xe;const s=i=>qw(i,0,1,e,r);return i=>i===0||i===1?i:rg(s(i),t,n)}const Gw=pi(.42,0,1,1),Yw=pi(0,0,.58,1),ng=pi(.42,0,.58,1),Kw=e=>Array.isArray(e)&&typeof e[0]!="number",sg=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ig=e=>t=>1-e(1-t),Lc=e=>1-Math.sin(Math.acos(e)),og=ig(Lc),Xw=sg(Lc),ag=pi(.33,1.53,.69,.99),Dc=ig(ag),Qw=sg(Dc),Zw=e=>(e*=2)<1?.5*Dc(e):.5*(2-Math.pow(2,-10*(e-1))),Jw={linear:xe,easeIn:Gw,easeInOut:ng,easeOut:Yw,circIn:Lc,circInOut:Xw,circOut:og,backIn:Dc,backInOut:Qw,backOut:ag,anticipate:Zw},Pf=e=>{if(Array.isArray(e)){_c(e.length===4);const[t,r,n,s]=e;return pi(t,r,n,s)}else if(typeof e=="string")return Jw[e];return e},Rc=(e,t)=>r=>!!(fi(r)&&tw.test(r)&&r.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(r,t)),lg=(e,t,r)=>n=>{if(!fi(n))return n;const[s,i,o,a]=n.match(la);return{[e]:parseFloat(s),[t]:parseFloat(i),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},e5=e=>jr(0,255,e),Ba={...sn,transform:e=>Math.round(e5(e))},Hr={test:Rc("rgb","red"),parse:lg("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+Ba.transform(e)+", "+Ba.transform(t)+", "+Ba.transform(r)+", "+Ps(Ns.transform(n))+")"};function t5(e){let t="",r="",n="",s="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),s=e.substring(4,5),t+=t,r+=r,n+=n,s+=s),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:s?parseInt(s,16)/255:1}}const ou={test:Rc("#"),parse:t5,transform:Hr.transform},Sn={test:Rc("hsl","hue"),parse:lg("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+At.transform(Ps(t))+", "+At.transform(Ps(r))+", "+Ps(Ns.transform(n))+")"},ze={test:e=>Hr.test(e)||ou.test(e)||Sn.test(e),parse:e=>Hr.test(e)?Hr.parse(e):Sn.test(e)?Sn.parse(e):ou.parse(e),transform:e=>fi(e)?e:e.hasOwnProperty("red")?Hr.transform(e):Sn.transform(e)},fe=(e,t,r)=>-r*e+r*t+e;function Ua(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function r5({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let s=0,i=0,o=0;if(!t)s=i=o=r;else{const a=r<.5?r*(1+t):r+t-r*t,l=2*r-a;s=Ua(l,a,e+1/3),i=Ua(l,a,e),o=Ua(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:n}}const Wa=(e,t,r)=>{const n=e*e;return Math.sqrt(Math.max(0,r*(t*t-n)+n))},n5=[ou,Hr,Sn],s5=e=>n5.find(t=>t.test(e));function Ef(e){const t=s5(e);let r=t.parse(e);return t===Sn&&(r=r5(r)),r}const ug=(e,t)=>{const r=Ef(e),n=Ef(t),s={...r};return i=>(s.red=Wa(r.red,n.red,i),s.green=Wa(r.green,n.green,i),s.blue=Wa(r.blue,n.blue,i),s.alpha=fe(r.alpha,n.alpha,i),Hr.transform(s))};function i5(e){var t,r;return isNaN(e)&&fi(e)&&(((t=e.match(la))===null||t===void 0?void 0:t.length)||0)+(((r=e.match(R0))===null||r===void 0?void 0:r.length)||0)>0}const cg={regex:J2,countKey:"Vars",token:"${v}",parse:xe},dg={regex:R0,countKey:"Colors",token:"${c}",parse:ze.parse},fg={regex:la,countKey:"Numbers",token:"${n}",parse:sn.parse};function Ha(e,{regex:t,countKey:r,token:n,parse:s}){const i=e.tokenised.match(t);i&&(e["num"+r]=i.length,e.tokenised=e.tokenised.replace(t,n),e.values.push(...i.map(s)))}function Mo(e){const t=e.toString(),r={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return r.value.includes("var(--")&&Ha(r,cg),Ha(r,dg),Ha(r,fg),r}function hg(e){return Mo(e).values}function pg(e){const{values:t,numColors:r,numVars:n,tokenised:s}=Mo(e),i=t.length;return o=>{let a=s;for(let l=0;l<i;l++)l<n?a=a.replace(cg.token,o[l]):l<n+r?a=a.replace(dg.token,ze.transform(o[l])):a=a.replace(fg.token,Ps(o[l]));return a}}const o5=e=>typeof e=="number"?0:e;function a5(e){const t=hg(e);return pg(e)(t.map(o5))}const Cr={test:i5,parse:hg,createTransformer:pg,getAnimatableNone:a5},mg=(e,t)=>r=>`${r>0?t:e}`;function gg(e,t){return typeof e=="number"?r=>fe(e,t,r):ze.test(e)?ug(e,t):e.startsWith("var(")?mg(e,t):vg(e,t)}const yg=(e,t)=>{const r=[...e],n=r.length,s=e.map((i,o)=>gg(i,t[o]));return i=>{for(let o=0;o<n;o++)r[o]=s[o](i);return r}},l5=(e,t)=>{const r={...e,...t},n={};for(const s in r)e[s]!==void 0&&t[s]!==void 0&&(n[s]=gg(e[s],t[s]));return s=>{for(const i in n)r[i]=n[i](s);return r}},vg=(e,t)=>{const r=Cr.createTransformer(t),n=Mo(e),s=Mo(t);return n.numVars===s.numVars&&n.numColors===s.numColors&&n.numNumbers>=s.numNumbers?br(yg(n.values,s.values),r):mg(e,t)},ri=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n},Tf=(e,t)=>r=>fe(e,t,r);function u5(e){return typeof e=="number"?Tf:typeof e=="string"?ze.test(e)?ug:vg:Array.isArray(e)?yg:typeof e=="object"?l5:Tf}function c5(e,t,r){const n=[],s=r||u5(e[0]),i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||xe:t;a=br(l,a)}n.push(a)}return n}function xg(e,t,{clamp:r=!0,ease:n,mixer:s}={}){const i=e.length;if(_c(i===t.length),i===1)return()=>t[0];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=c5(t,n,s),a=o.length,l=c=>{let d=0;if(a>1)for(;d<e.length-2&&!(c<e[d+1]);d++);const f=ri(e[d],e[d+1],c);return o[d](f)};return r?c=>l(jr(e[0],e[i-1],c)):l}function d5(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const s=ri(0,t,n);e.push(fe(r,1,s))}}function f5(e){const t=[0];return d5(t,e.length-1),t}function h5(e,t){return e.map(r=>r*t)}function p5(e,t){return e.map(()=>t||ng).splice(0,e.length-1)}function Ao({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const s=Kw(n)?n.map(Pf):Pf(n),i={done:!1,value:t[0]},o=h5(r&&r.length===t.length?r:f5(t),e),a=xg(o,t,{ease:Array.isArray(s)?s:p5(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}function wg(e,t){return t?e*(1e3/t):0}const m5=5;function bg(e,t,r){const n=Math.max(t-m5,0);return wg(r-e(n),t-n)}const qa=.001,g5=.01,y5=10,v5=.05,x5=1;function w5({duration:e=800,bounce:t=.25,velocity:r=0,mass:n=1}){let s,i,o=1-t;o=jr(v5,x5,o),e=jr(g5,y5,Ut(e)),o<1?(s=c=>{const d=c*o,f=d*e,u=d-r,p=au(c,o),m=Math.exp(-f);return qa-u/p*m},i=c=>{const f=c*o*e,u=f*r+r,p=Math.pow(o,2)*Math.pow(c,2)*e,m=Math.exp(-f),g=au(Math.pow(c,2),o);return(-s(c)+qa>0?-1:1)*((u-p)*m)/g}):(s=c=>{const d=Math.exp(-c*e),f=(c-r)*e+1;return-qa+d*f},i=c=>{const d=Math.exp(-c*e),f=(r-c)*(e*e);return d*f});const a=5/e,l=S5(s,i,a);if(e=Yr(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*n;return{stiffness:c,damping:o*2*Math.sqrt(n*c),duration:e}}}const b5=12;function S5(e,t,r){let n=r;for(let s=1;s<b5;s++)n=n-e(n)/t(n);return n}function au(e,t){return e*Math.sqrt(1-t*t)}const k5=["duration","bounce"],j5=["stiffness","damping","mass"];function Mf(e,t){return t.some(r=>e[r]!==void 0)}function C5(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Mf(e,j5)&&Mf(e,k5)){const r=w5(e);t={...t,...r,mass:1},t.isResolvedFromDuration=!0}return t}function Sg({keyframes:e,restDelta:t,restSpeed:r,...n}){const s=e[0],i=e[e.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:d,velocity:f,isResolvedFromDuration:u}=C5({...n,velocity:-Ut(n.velocity||0)}),p=f||0,m=l/(2*Math.sqrt(a*c)),g=i-s,w=Ut(Math.sqrt(a/c)),v=Math.abs(g)<5;r||(r=v?.01:2),t||(t=v?.005:.5);let y;if(m<1){const x=au(w,m);y=b=>{const k=Math.exp(-m*w*b);return i-k*((p+m*w*g)/x*Math.sin(x*b)+g*Math.cos(x*b))}}else if(m===1)y=x=>i-Math.exp(-w*x)*(g+(p+w*g)*x);else{const x=w*Math.sqrt(m*m-1);y=b=>{const k=Math.exp(-m*w*b),C=Math.min(x*b,300);return i-k*((p+m*w*g)*Math.sinh(C)+x*g*Math.cosh(C))/x}}return{calculatedDuration:u&&d||null,next:x=>{const b=y(x);if(u)o.done=x>=d;else{let k=p;x!==0&&(m<1?k=bg(y,x,b):k=0);const C=Math.abs(k)<=r,N=Math.abs(i-b)<=t;o.done=C&&N}return o.value=o.done?i:b,o}}}function Af({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:d}){const f=e[0],u={done:!1,value:f},p=P=>a!==void 0&&P<a||l!==void 0&&P>l,m=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let g=r*t;const w=f+g,v=o===void 0?w:o(w);v!==w&&(g=v-f);const y=P=>-g*Math.exp(-P/n),x=P=>v+y(P),b=P=>{const V=y(P),T=x(P);u.done=Math.abs(V)<=c,u.value=u.done?v:T};let k,C;const N=P=>{p(u.value)&&(k=P,C=Sg({keyframes:[u.value,m(u.value)],velocity:bg(x,P,u.value),damping:s,stiffness:i,restDelta:c,restSpeed:d}))};return N(0),{calculatedDuration:null,next:P=>{let V=!1;return!C&&k===void 0&&(V=!0,b(P),N(P)),k!==void 0&&P>k?C.next(P-k):(!V&&b(P),u)}}}const N5=e=>{const t=({timestamp:r})=>e(r);return{start:()=>ne.update(t,!0),stop:()=>Kt(t),now:()=>De.isProcessing?De.timestamp:performance.now()}},_f=2e4;function Lf(e){let t=0;const r=50;let n=e.next(t);for(;!n.done&&t<_f;)t+=r,n=e.next(t);return t>=_f?1/0:t}const P5={decay:Af,inertia:Af,tween:Ao,keyframes:Ao,spring:Sg};function _o({autoplay:e=!0,delay:t=0,driver:r=N5,keyframes:n,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:d,onUpdate:f,...u}){let p=1,m=!1,g,w;const v=()=>{w=new Promise(R=>{g=R})};v();let y;const x=P5[s]||Ao;let b;x!==Ao&&typeof n[0]!="number"&&(b=xg([0,100],n,{clamp:!1}),n=[0,100]);const k=x({...u,keyframes:n});let C;a==="mirror"&&(C=x({...u,keyframes:[...n].reverse(),velocity:-(u.velocity||0)}));let N="idle",P=null,V=null,T=null;k.calculatedDuration===null&&i&&(k.calculatedDuration=Lf(k));const{calculatedDuration:O}=k;let j=1/0,F=1/0;O!==null&&(j=O+o,F=j*(i+1)-o);let D=0;const G=R=>{if(V===null)return;p>0&&(V=Math.min(V,R)),p<0&&(V=Math.min(R-F/p,V)),P!==null?D=P:D=Math.round(R-V)*p;const E=D-t*(p>=0?1:-1),H=p>=0?E<0:E>F;D=Math.max(E,0),N==="finished"&&P===null&&(D=F);let X=D,ee=k;if(i){const _t=Math.min(D,F)/j;let St=Math.floor(_t),Qe=_t%1;!Qe&&_t>=1&&(Qe=1),Qe===1&&St--,St=Math.min(St,i+1),!!(St%2)&&(a==="reverse"?(Qe=1-Qe,o&&(Qe-=o/j)):a==="mirror"&&(ee=C)),X=jr(0,1,Qe)*j}const q=H?{done:!1,value:n[0]}:ee.next(X);b&&(q.value=b(q.value));let{done:me}=q;!H&&O!==null&&(me=p>=0?D>=F:D<=0);const Rr=P===null&&(N==="finished"||N==="running"&&me);return f&&f(q.value),Rr&&_(),q},M=()=>{y&&y.stop(),y=void 0},W=()=>{N="idle",M(),g(),v(),V=T=null},_=()=>{N="finished",d&&d(),M(),g()},A=()=>{if(m)return;y||(y=r(G));const R=y.now();l&&l(),P!==null?V=R-P:(!V||N==="finished")&&(V=R),N==="finished"&&v(),T=V,P=null,N="running",y.start()};e&&A();const I={then(R,E){return w.then(R,E)},get time(){return Ut(D)},set time(R){R=Yr(R),D=R,P!==null||!y||p===0?P=R:V=y.now()-R/p},get duration(){const R=k.calculatedDuration===null?Lf(k):k.calculatedDuration;return Ut(R)},get speed(){return p},set speed(R){R===p||!y||(p=R,I.time=Ut(D))},get state(){return N},play:A,pause:()=>{N="paused",P=D},stop:()=>{m=!0,N!=="idle"&&(N="idle",c&&c(),W())},cancel:()=>{T!==null&&G(T),W()},complete:()=>{N="finished"},sample:R=>(V=0,G(R))};return I}function E5(e){let t;return()=>(t===void 0&&(t=e()),t)}const T5=E5(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),M5=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Ri=10,A5=2e4,_5=(e,t)=>t.type==="spring"||e==="backgroundColor"||!J0(t.ease);function L5(e,t,{onUpdate:r,onComplete:n,...s}){if(!(T5()&&M5.has(t)&&!s.repeatDelay&&s.repeatType!=="mirror"&&s.damping!==0&&s.type!=="inertia"))return!1;let o=!1,a,l,c=!1;const d=()=>{l=new Promise(x=>{a=x})};d();let{keyframes:f,duration:u=300,ease:p,times:m}=s;if(_5(t,s)){const x=_o({...s,repeat:0,delay:0});let b={done:!1,value:f[0]};const k=[];let C=0;for(;!b.done&&C<A5;)b=x.sample(C),k.push(b.value),C+=Ri;m=void 0,f=k,u=C-Ri,p="linear"}const g=Bw(e.owner.current,t,f,{...s,duration:u,ease:p,times:m}),w=()=>{c=!1,g.cancel()},v=()=>{c=!0,ne.update(w),a(),d()};return g.onfinish=()=>{c||(e.set(Uw(f,s)),n&&n(),v())},{then(x,b){return l.then(x,b)},attachTimeline(x){return g.timeline=x,g.onfinish=null,xe},get time(){return Ut(g.currentTime||0)},set time(x){g.currentTime=Yr(x)},get speed(){return g.playbackRate},set speed(x){g.playbackRate=x},get duration(){return Ut(u)},play:()=>{o||(g.play(),Kt(w))},pause:()=>g.pause(),stop:()=>{if(o=!0,g.playState==="idle")return;const{currentTime:x}=g;if(x){const b=_o({...s,autoplay:!1});e.setWithVelocity(b.sample(x-Ri).value,b.sample(x).value,Ri)}v()},complete:()=>{c||g.finish()},cancel:v}}function D5({keyframes:e,delay:t,onUpdate:r,onComplete:n}){const s=()=>(r&&r(e[e.length-1]),n&&n(),{time:0,speed:1,duration:0,play:xe,pause:xe,stop:xe,then:i=>(i(),Promise.resolve()),cancel:xe,complete:xe});return t?_o({keyframes:[0,1],duration:0,delay:t,onComplete:s}):s()}const R5={type:"spring",stiffness:500,damping:25,restSpeed:10},V5=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),F5={type:"keyframes",duration:.8},I5={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},z5=(e,{keyframes:t})=>t.length>2?F5:nn.has(e)?e.startsWith("scale")?V5(t[1]):R5:I5,lu=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Cr.test(t)||t==="0")&&!t.startsWith("url(")),O5=new Set(["brightness","contrast","saturate","opacity"]);function $5(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(la)||[];if(!n)return e;const s=r.replace(n,"");let i=O5.has(t)?1:0;return n!==r&&(i*=100),t+"("+i+s+")"}const B5=/([a-z-]*)\(.*?\)/g,uu={...Cr,getAnimatableNone:e=>{const t=e.match(B5);return t?t.map($5).join(" "):e}},U5={...V0,color:ze,backgroundColor:ze,outlineColor:ze,fill:ze,stroke:ze,borderColor:ze,borderTopColor:ze,borderRightColor:ze,borderBottomColor:ze,borderLeftColor:ze,filter:uu,WebkitFilter:uu},Vc=e=>U5[e];function kg(e,t){let r=Vc(e);return r!==uu&&(r=Cr),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const jg=e=>/^0[^.\s]+$/.test(e);function W5(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||jg(e)}function H5(e,t,r,n){const s=lu(t,r);let i;Array.isArray(r)?i=[...r]:i=[null,r];const o=n.from!==void 0?n.from:e.get();let a;const l=[];for(let c=0;c<i.length;c++)i[c]===null&&(i[c]=c===0?o:i[c-1]),W5(i[c])&&l.push(c),typeof i[c]=="string"&&i[c]!=="none"&&i[c]!=="0"&&(a=i[c]);if(s&&l.length&&a)for(let c=0;c<l.length;c++){const d=l[c];i[d]=kg(t,a)}return i}function q5({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length}function Fc(e,t){return e[t]||e.default||e}const G5={skipAnimations:!1},Ic=(e,t,r,n={})=>s=>{const i=Fc(n,e)||{},o=i.delay||n.delay||0;let{elapsed:a=0}=n;a=a-Yr(o);const l=H5(t,e,r,i),c=l[0],d=l[l.length-1],f=lu(e,c),u=lu(e,d);let p={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...i,delay:-a,onUpdate:m=>{t.set(m),i.onUpdate&&i.onUpdate(m)},onComplete:()=>{s(),i.onComplete&&i.onComplete()}};if(q5(i)||(p={...p,...z5(e,p)}),p.duration&&(p.duration=Yr(p.duration)),p.repeatDelay&&(p.repeatDelay=Yr(p.repeatDelay)),!f||!u||$w.current||i.type===!1||G5.skipAnimations)return D5(p);if(!n.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const m=L5(t,e,p);if(m)return m}return _o(p)};function Lo(e){return!!(Xe(e)&&e.add)}const Cg=e=>/^\-?\d*\.?\d+$/.test(e);function zc(e,t){e.indexOf(t)===-1&&e.push(t)}function Oc(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class $c{constructor(){this.subscriptions=[]}add(t){return zc(this.subscriptions,t),()=>Oc(this.subscriptions,t)}notify(t,r,n){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,r,n);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Y5=e=>!isNaN(parseFloat(e));class K5{constructor(t,r={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(n,s=!0)=>{this.prev=this.current,this.current=n;const{delta:i,timestamp:o}=De;this.lastUpdated!==o&&(this.timeDelta=i,this.lastUpdated=o,ne.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>ne.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=Y5(this.current),this.owner=r.owner}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new $c);const n=this.events[t].add(r);return t==="change"?()=>{n(),ne.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t,r=!0){!r||!this.passiveEffect?this.updateAndNotify(t,r):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,r,n){this.set(r),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?wg(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function On(e,t){return new K5(e,t)}const Ng=e=>t=>t.test(e),X5={test:e=>e==="auto",parse:e=>e},Pg=[sn,U,At,rr,nw,rw,X5],ls=e=>Pg.find(Ng(e)),Q5=[...Pg,ze,Cr],Z5=e=>Q5.find(Ng(e));function J5(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,On(r))}function eb(e,t){const r=ca(e,t);let{transitionEnd:n={},transition:s={},...i}=r?e.makeTargetAnimatable(r,!1):{};i={...i,...n};for(const o in i){const a=yw(i[o]);J5(e,o,a)}}function tb(e,t,r){var n,s;const i=Object.keys(t).filter(a=>!e.hasValue(a)),o=i.length;if(o)for(let a=0;a<o;a++){const l=i[a],c=t[l];let d=null;Array.isArray(c)&&(d=c[0]),d===null&&(d=(s=(n=r[l])!==null&&n!==void 0?n:e.readValue(l))!==null&&s!==void 0?s:t[l]),d!=null&&(typeof d=="string"&&(Cg(d)||jg(d))?d=parseFloat(d):!Z5(d)&&Cr.test(c)&&(d=kg(l,c)),e.addValue(l,On(d,{owner:e})),r[l]===void 0&&(r[l]=d),d!==null&&e.setBaseTarget(l,d))}}function rb(e,t){return t?(t[e]||t.default||t).from:void 0}function nb(e,t,r){const n={};for(const s in e){const i=rb(s,t);if(i!==void 0)n[s]=i;else{const o=r.getValue(s);o&&(n[s]=o.get())}}return n}function sb({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function ib(e,t){const r=e.get();if(Array.isArray(t)){for(let n=0;n<t.length;n++)if(t[n]!==r)return!0}else return r!==t}function Eg(e,t,{delay:r=0,transitionOverride:n,type:s}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:o,...a}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");n&&(i=n);const c=[],d=s&&e.animationState&&e.animationState.getState()[s];for(const f in a){const u=e.getValue(f),p=a[f];if(!u||p===void 0||d&&sb(d,f))continue;const m={delay:r,elapsed:0,...Fc(i||{},f)};if(window.HandoffAppearAnimations){const v=e.getProps()[T0];if(v){const y=window.HandoffAppearAnimations(v,f,u,ne);y!==null&&(m.elapsed=y,m.isHandoff=!0)}}let g=!m.isHandoff&&!ib(u,p);if(m.type==="spring"&&(u.getVelocity()||m.velocity)&&(g=!1),u.animation&&(g=!1),g)continue;u.start(Ic(f,u,p,e.shouldReduceMotion&&nn.has(f)?{type:!1}:m));const w=u.animation;Lo(l)&&(l.add(f),w.then(()=>l.remove(f))),c.push(w)}return o&&Promise.all(c).then(()=>{o&&eb(e,o)}),c}function cu(e,t,r={}){const n=ca(e,t,r.custom);let{transition:s=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(s=r.transitionOverride);const i=n?()=>Promise.all(Eg(e,n,r)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=s;return ob(e,t,c+l,d,f,r)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,c]=a==="beforeChildren"?[i,o]:[o,i];return l().then(()=>c())}else return Promise.all([i(),o(r.delay)])}function ob(e,t,r=0,n=0,s=1,i){const o=[],a=(e.variantChildren.size-1)*n,l=s===1?(c=0)=>c*n:(c=0)=>a-c*n;return Array.from(e.variantChildren).sort(ab).forEach((c,d)=>{c.notify("AnimationStart",t),o.push(cu(c,t,{...i,delay:r+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function ab(e,t){return e.sortNodePosition(t)}function lb(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const s=t.map(i=>cu(e,i,r));n=Promise.all(s)}else if(typeof t=="string")n=cu(e,t,r);else{const s=typeof t=="function"?ca(e,t,r.custom):t;n=Promise.all(Eg(e,s,r))}return n.then(()=>e.notify("AnimationComplete",t))}const ub=[...Sc].reverse(),cb=Sc.length;function db(e){return t=>Promise.all(t.map(({animation:r,options:n})=>lb(e,r,n)))}function fb(e){let t=db(e);const r=pb();let n=!0;const s=(l,c)=>{const d=ca(e,c);if(d){const{transition:f,transitionEnd:u,...p}=d;l={...l,...p,...u}}return l};function i(l){t=l(e)}function o(l,c){const d=e.getProps(),f=e.getVariantContext(!0)||{},u=[],p=new Set;let m={},g=1/0;for(let v=0;v<cb;v++){const y=ub[v],x=r[y],b=d[y]!==void 0?d[y]:f[y],k=ei(b),C=y===c?x.isActive:null;C===!1&&(g=v);let N=b===f[y]&&b!==d[y]&&k;if(N&&n&&e.manuallyAnimateOnMount&&(N=!1),x.protectedKeys={...m},!x.isActive&&C===null||!b&&!x.prevProp||oa(b)||typeof b=="boolean")continue;let V=hb(x.prevProp,b)||y===c&&x.isActive&&!N&&k||v>g&&k,T=!1;const O=Array.isArray(b)?b:[b];let j=O.reduce(s,{});C===!1&&(j={});const{prevResolvedValues:F={}}=x,D={...F,...j},G=M=>{V=!0,p.has(M)&&(T=!0,p.delete(M)),x.needsAnimating[M]=!0};for(const M in D){const W=j[M],_=F[M];if(m.hasOwnProperty(M))continue;let A=!1;To(W)&&To(_)?A=!Q0(W,_):A=W!==_,A?W!==void 0?G(M):p.add(M):W!==void 0&&p.has(M)?G(M):x.protectedKeys[M]=!0}x.prevProp=b,x.prevResolvedValues=j,x.isActive&&(m={...m,...j}),n&&e.blockInitialAnimation&&(V=!1),V&&(!N||T)&&u.push(...O.map(M=>({animation:M,options:{type:y,...l}})))}if(p.size){const v={};p.forEach(y=>{const x=e.getBaseTarget(y);x!==void 0&&(v[y]=x)}),u.push({animation:v})}let w=!!u.length;return n&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(w=!1),n=!1,w?t(u):Promise.resolve()}function a(l,c,d){var f;if(r[l].isActive===c)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(p=>{var m;return(m=p.animationState)===null||m===void 0?void 0:m.setActive(l,c)}),r[l].isActive=c;const u=o(d,l);for(const p in r)r[p].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>r}}function hb(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Q0(t,e):!1}function Vr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function pb(){return{animate:Vr(!0),whileInView:Vr(),whileHover:Vr(),whileTap:Vr(),whileDrag:Vr(),whileFocus:Vr(),exit:Vr()}}class mb extends Dr{constructor(t){super(t),t.animationState||(t.animationState=fb(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),oa(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){}}let gb=0;class yb extends Dr{constructor(){super(...arguments),this.id=gb++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:r,custom:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t,{custom:n??this.node.getProps().custom});r&&!t&&i.then(()=>r(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const vb={animation:{Feature:mb},exit:{Feature:yb}},Df=(e,t)=>Math.abs(e-t);function xb(e,t){const r=Df(e.x,t.x),n=Df(e.y,t.y);return Math.sqrt(r**2+n**2)}class Tg{constructor(t,r,{transformPagePoint:n,contextWindow:s,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Ya(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,p=xb(f.offset,{x:0,y:0})>=3;if(!u&&!p)return;const{point:m}=f,{timestamp:g}=De;this.history.push({...m,timestamp:g});const{onStart:w,onMove:v}=this.handlers;u||(w&&w(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,f)},this.handlePointerMove=(f,u)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Ga(u,this.transformPagePoint),ne.update(this.updatePoint,!0)},this.handlePointerUp=(f,u)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Ya(f.type==="pointercancel"?this.lastMoveEventInfo:Ga(u,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,w),m&&m(f,w)},!q0(t))return;this.dragSnapToOrigin=i,this.handlers=r,this.transformPagePoint=n,this.contextWindow=s||window;const o=ua(t),a=Ga(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=De;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=r;d&&d(t,Ya(a,this.history)),this.removeListeners=br(Bt(this.contextWindow,"pointermove",this.handlePointerMove),Bt(this.contextWindow,"pointerup",this.handlePointerUp),Bt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Kt(this.updatePoint)}}function Ga(e,t){return t?{point:t(e.point)}:e}function Rf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ya({point:e},t){return{point:e,delta:Rf(e,Mg(t)),offset:Rf(e,wb(t)),velocity:bb(t,.1)}}function wb(e){return e[0]}function Mg(e){return e[e.length-1]}function bb(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const s=Mg(e);for(;r>=0&&(n=e[r],!(s.timestamp-n.timestamp>Yr(t)));)r--;if(!n)return{x:0,y:0};const i=Ut(s.timestamp-n.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-n.x)/i,y:(s.y-n.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function nt(e){return e.max-e.min}function du(e,t=0,r=.01){return Math.abs(e-t)<=r}function Vf(e,t,r,n=.5){e.origin=n,e.originPoint=fe(t.min,t.max,e.origin),e.scale=nt(r)/nt(t),(du(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=fe(r.min,r.max,e.origin)-e.originPoint,(du(e.translate)||isNaN(e.translate))&&(e.translate=0)}function Es(e,t,r,n){Vf(e.x,t.x,r.x,n?n.originX:void 0),Vf(e.y,t.y,r.y,n?n.originY:void 0)}function Ff(e,t,r){e.min=r.min+t.min,e.max=e.min+nt(t)}function Sb(e,t,r){Ff(e.x,t.x,r.x),Ff(e.y,t.y,r.y)}function If(e,t,r){e.min=t.min-r.min,e.max=e.min+nt(t)}function Ts(e,t,r){If(e.x,t.x,r.x),If(e.y,t.y,r.y)}function kb(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?fe(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?fe(r,e,n.max):Math.min(e,r)),e}function zf(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function jb(e,{top:t,left:r,bottom:n,right:s}){return{x:zf(e.x,r,s),y:zf(e.y,t,n)}}function Of(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function Cb(e,t){return{x:Of(e.x,t.x),y:Of(e.y,t.y)}}function Nb(e,t){let r=.5;const n=nt(e),s=nt(t);return s>n?r=ri(t.min,t.max-n,e.min):n>s&&(r=ri(e.min,e.max-s,t.min)),jr(0,1,r)}function Pb(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const fu=.35;function Eb(e=fu){return e===!1?e=0:e===!0&&(e=fu),{x:$f(e,"left","right"),y:$f(e,"top","bottom")}}function $f(e,t,r){return{min:Bf(e,t),max:Bf(e,r)}}function Bf(e,t){return typeof e=="number"?e:e[t]||0}const Uf=()=>({translate:0,scale:1,origin:0,originPoint:0}),kn=()=>({x:Uf(),y:Uf()}),Wf=()=>({min:0,max:0}),Se=()=>({x:Wf(),y:Wf()});function at(e){return[e("x"),e("y")]}function Ag({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function Tb({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Mb(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function Ka(e){return e===void 0||e===1}function hu({scale:e,scaleX:t,scaleY:r}){return!Ka(e)||!Ka(t)||!Ka(r)}function zr(e){return hu(e)||_g(e)||e.z||e.rotate||e.rotateX||e.rotateY}function _g(e){return Hf(e.x)||Hf(e.y)}function Hf(e){return e&&e!=="0%"}function Do(e,t,r){const n=e-r,s=t*n;return r+s}function qf(e,t,r,n,s){return s!==void 0&&(e=Do(e,s,n)),Do(e,r,n)+t}function pu(e,t=0,r=1,n,s){e.min=qf(e.min,t,r,n,s),e.max=qf(e.max,t,r,n,s)}function Lg(e,{x:t,y:r}){pu(e.x,t.translate,t.scale,t.originPoint),pu(e.y,r.translate,r.scale,r.originPoint)}function Ab(e,t,r,n=!1){const s=r.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a<s;a++){i=r[a],o=i.projectionDelta;const l=i.instance;l&&l.style&&l.style.display==="contents"||(n&&i.options.layoutScroll&&i.scroll&&i!==i.root&&jn(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Lg(e,o)),n&&zr(i.latestValues)&&jn(e,i.latestValues))}t.x=Gf(t.x),t.y=Gf(t.y)}function Gf(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function ir(e,t){e.min=e.min+t,e.max=e.max+t}function Yf(e,t,[r,n,s]){const i=t[s]!==void 0?t[s]:.5,o=fe(e.min,e.max,i);pu(e,t[r],t[n],o,t.scale)}const _b=["x","scaleX","originX"],Lb=["y","scaleY","originY"];function jn(e,t){Yf(e.x,t,_b),Yf(e.y,t,Lb)}function Dg(e,t){return Ag(Mb(e.getBoundingClientRect(),t))}function Db(e,t,r){const n=Dg(e,r),{scroll:s}=t;return s&&(ir(n.x,s.offset.x),ir(n.y,s.offset.y)),n}const Rg=({current:e})=>e?e.ownerDocument.defaultView:null,Rb=new WeakMap;class Vb{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Se(),this.visualElement=t}start(t,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const s=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(ua(d,"page").point)},i=(d,f)=>{const{drag:u,dragPropagation:p,onDragStart:m}=this.getProps();if(u&&!p&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Y0(u),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),at(w=>{let v=this.getAxisMotionValue(w).get()||0;if(At.test(v)){const{projection:y}=this.visualElement;if(y&&y.layout){const x=y.layout.layoutBox[w];x&&(v=nt(x)*(parseFloat(v)/100))}}this.originPoint[w]=v}),m&&ne.update(()=>m(d,f),!1,!0);const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(d,f)=>{const{dragPropagation:u,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:w}=f;if(p&&this.currentDirection===null){this.currentDirection=Fb(w),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),g&&g(d,f)},a=(d,f)=>this.stop(d,f),l=()=>at(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Tg(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Rg(this.visualElement)})}stop(t,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:s}=r;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&ne.update(()=>i(t,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,n){const{drag:s}=this.getProps();if(!n||!Vi(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=kb(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:r,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;r&&bn(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&s?this.constraints=jb(s.layoutBox,r):this.constraints=!1,this.elastic=Eb(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&at(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=Pb(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!bn(t))return!1;const n=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=Db(n,s.root,this.visualElement.getTransformPagePoint());let o=Cb(s.layout.layoutBox,i);if(r){const a=r(Tb(o));this.hasMutatedConstraints=!!a,a&&(o=Ag(a))}return o}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=at(d=>{if(!Vi(d,r,this.currentDirection))return;let f=l&&l[d]||{};o&&(f={min:0,max:0});const u=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:n?t[d]:0,bounceStiffness:u,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return n.start(Ic(t,n,0,r))}stopAnimation(){at(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){at(t=>{var r;return(r=this.getAxisMotionValue(t).animation)===null||r===void 0?void 0:r.pause()})}getAnimationState(t){var r;return(r=this.getAxisMotionValue(t).animation)===null||r===void 0?void 0:r.state}getAxisMotionValue(t){const r="_drag"+t.toUpperCase(),n=this.visualElement.getProps(),s=n[r];return s||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){at(r=>{const{drag:n}=this.getProps();if(!Vi(r,n,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(r);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[r];i.set(t[r]-fe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!bn(r)||!n||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};at(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();s[o]=Nb({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),at(o=>{if(!Vi(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(fe(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;Rb.set(this.visualElement,this);const t=this.visualElement.current,r=Bt(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),n=()=>{const{dragConstraints:l}=this.getProps();bn(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),n();const o=Ot(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(at(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),r(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=fu,dragMomentum:a=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Vi(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function Fb(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class Ib extends Dr{constructor(t){super(t),this.removeGroupControls=xe,this.removeListeners=xe,this.controls=new Vb(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||xe}unmount(){this.removeGroupControls(),this.removeListeners()}}const Kf=e=>(t,r)=>{e&&ne.update(()=>e(t,r))};class zb extends Dr{constructor(){super(...arguments),this.removePointerDownListener=xe}onPointerDown(t){this.session=new Tg(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Rg(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:s}=this.node.getProps();return{onSessionStart:Kf(t),onStart:Kf(r),onMove:n,onEnd:(i,o)=>{delete this.session,s&&ne.update(()=>s(i,o))}}}mount(){this.removePointerDownListener=Bt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function Ob(){const e=S.useContext(sa);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:r,register:n}=e,s=S.useId();return S.useEffect(()=>n(s),[]),!t&&r?[!1,()=>r&&r(s)]:[!0]}const Ji={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Xf(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const us={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(U.test(e))e=parseFloat(e);else return e;const r=Xf(e,t.target.x),n=Xf(e,t.target.y);return`${r}% ${n}%`}},$b={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,s=Cr.parse(e);if(s.length>5)return n;const i=Cr.createTransformer(e),o=typeof s[0]!="number"?1:0,a=r.x.scale*t.x,l=r.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=fe(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}};class Bb extends ii.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:s}=this.props,{projection:i}=t;K2(Ub),i&&(r.group&&r.group.add(i),n&&n.register&&s&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Ji.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:s,isPresent:i}=this.props,o=n.projection;return o&&(o.isPresent=i,s||t.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||ne.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(s),n&&n.deregister&&n.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Vg(e){const[t,r]=Ob(),n=S.useContext(jc);return ii.createElement(Bb,{...e,layoutGroup:n,switchLayoutGroup:S.useContext(A0),isPresent:t,safeToRemove:r})}const Ub={borderRadius:{...us,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:us,borderTopRightRadius:us,borderBottomLeftRadius:us,borderBottomRightRadius:us,boxShadow:$b},Fg=["TopLeft","TopRight","BottomLeft","BottomRight"],Wb=Fg.length,Qf=e=>typeof e=="string"?parseFloat(e):e,Zf=e=>typeof e=="number"||U.test(e);function Hb(e,t,r,n,s,i){s?(e.opacity=fe(0,r.opacity!==void 0?r.opacity:1,qb(n)),e.opacityExit=fe(t.opacity!==void 0?t.opacity:1,0,Gb(n))):i&&(e.opacity=fe(t.opacity!==void 0?t.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;o<Wb;o++){const a=`border${Fg[o]}Radius`;let l=Jf(t,a),c=Jf(r,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Zf(l)===Zf(c)?(e[a]=Math.max(fe(Qf(l),Qf(c),n),0),(At.test(c)||At.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||r.rotate)&&(e.rotate=fe(t.rotate||0,r.rotate||0,n))}function Jf(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const qb=Ig(0,.5,og),Gb=Ig(.5,.95,xe);function Ig(e,t,r){return n=>n<e?0:n>t?1:r(ri(e,t,n))}function eh(e,t){e.min=t.min,e.max=t.max}function ot(e,t){eh(e.x,t.x),eh(e.y,t.y)}function th(e,t,r,n,s){return e-=t,e=Do(e,1/r,n),s!==void 0&&(e=Do(e,1/s,n)),e}function Yb(e,t=0,r=1,n=.5,s,i=e,o=e){if(At.test(t)&&(t=parseFloat(t),t=fe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=fe(i.min,i.max,n);e===i&&(a-=t),e.min=th(e.min,t,r,a,s),e.max=th(e.max,t,r,a,s)}function rh(e,t,[r,n,s],i,o){Yb(e,t[r],t[n],t[s],t.scale,i,o)}const Kb=["x","scaleX","originX"],Xb=["y","scaleY","originY"];function nh(e,t,r,n){rh(e.x,t,Kb,r?r.x:void 0,n?n.x:void 0),rh(e.y,t,Xb,r?r.y:void 0,n?n.y:void 0)}function sh(e){return e.translate===0&&e.scale===1}function zg(e){return sh(e.x)&&sh(e.y)}function Qb(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function Og(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function ih(e){return nt(e.x)/nt(e.y)}class Zb{constructor(){this.members=[]}add(t){zc(this.members,t),t.scheduleRender()}remove(t){if(Oc(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){const r=this.members.findIndex(s=>t===s);if(r===0)return!1;let n;for(let s=r;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){n=i;break}}return n?(this.promote(n),!0):!1}promote(t,r){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,r&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:r,resumingFrom:n}=t;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function oh(e,t,r){let n="";const s=e.x.translate/t.x,i=e.y.translate/t.y;if((s||i)&&(n=`translate3d(${s}px, ${i}px, 0) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{rotate:l,rotateX:c,rotateY:d}=r;l&&(n+=`rotate(${l}deg) `),c&&(n+=`rotateX(${c}deg) `),d&&(n+=`rotateY(${d}deg) `)}const o=e.x.scale*t.x,a=e.y.scale*t.y;return(o!==1||a!==1)&&(n+=`scale(${o}, ${a})`),n||"none"}const Jb=(e,t)=>e.depth-t.depth;class e4{constructor(){this.children=[],this.isDirty=!1}add(t){zc(this.children,t),this.isDirty=!0}remove(t){Oc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Jb),this.isDirty=!1,this.children.forEach(t)}}function t4(e,t){const r=performance.now(),n=({timestamp:s})=>{const i=s-r;i>=t&&(Kt(n),e(i-t))};return ne.read(n,!0),()=>Kt(n)}function r4(e){window.MotionDebug&&window.MotionDebug.record(e)}function n4(e){return e instanceof SVGElement&&e.tagName!=="svg"}function s4(e,t,r){const n=Xe(e)?e:On(e);return n.start(Ic("",n,t,r)),n.animation}const ah=["","X","Y","Z"],i4={visibility:"hidden"},lh=1e3;let o4=0;const Or={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function $g({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=o4++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Or.totalNodes=Or.resolvedTargetDeltas=Or.recalculatedProjection=0,this.nodes.forEach(u4),this.nodes.forEach(p4),this.nodes.forEach(m4),this.nodes.forEach(c4),r4(Or)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new e4)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new $c),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=n4(o),this.instance=o;const{layoutId:l,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let f;const u=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=t4(u,250),Ji.hasAnimatedSinceResize&&(Ji.hasAnimatedSinceResize=!1,this.nodes.forEach(ch))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:u,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||d.getDefaultTransition()||w4,{onLayoutAnimationStart:w,onLayoutAnimationComplete:v}=d.getProps(),y=!this.targetLayout||!Og(this.targetLayout,m)||p,x=!u&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||u&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const b={...Fc(g,"layout"),onPlay:w,onComplete:v};(d.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else u||ch(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Kt(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(g4),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(uh);return}this.isUpdating||this.nodes.forEach(f4),this.isUpdating=!1,this.nodes.forEach(h4),this.nodes.forEach(a4),this.nodes.forEach(l4),this.clearAllSnapshots();const a=performance.now();De.delta=jr(0,1e3/60,a-De.timestamp),De.timestamp=a,De.isProcessing=!0,za.update.process(De),za.preRender.process(De),za.render.process(De),De.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(d4),this.sharedNodes.forEach(y4)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ne.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ne.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Se(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&(this.scroll={animationId:this.root.animationId,phase:o,isRoot:n(this.instance),offset:r(this.instance)})}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform,a=this.projectionDelta&&!zg(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&(a||zr(this.latestValues)||d)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),b4(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return Se();const a=o.measureViewportBox(),{scroll:l}=this.root;return l&&(ir(a.x,l.offset.x),ir(a.y,l.offset.y)),a}removeElementScroll(o){const a=Se();ot(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:d,options:f}=c;if(c!==this.root&&d&&f.layoutScroll){if(d.isRoot){ot(a,o);const{scroll:u}=this.root;u&&(ir(a.x,-u.offset.x),ir(a.y,-u.offset.y))}ir(a.x,d.offset.x),ir(a.y,d.offset.y)}}return a}applyTransform(o,a=!1){const l=Se();ot(l,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&jn(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),zr(d.latestValues)&&jn(l,d.latestValues)}return zr(this.latestValues)&&jn(l,this.latestValues),l}removeTransform(o){const a=Se();ot(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!zr(c.latestValues))continue;hu(c.latestValues)&&c.updateSnapshot();const d=Se(),f=c.measurePageBox();ot(d,f),nh(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return zr(this.latestValues)&&nh(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==De.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:f,layoutId:u}=this.options;if(!(!this.layout||!(f||u))){if(this.resolvedRelativeTargetAt=De.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),Ts(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),ot(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Se(),this.targetWithTransforms=Se()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Sb(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ot(this.target,this.layout.layoutBox),Lg(this.target,this.targetDelta)):ot(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),Ts(this.relativeTargetOrigin,this.target,p.target),ot(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Or.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||hu(this.parent.latestValues)||_g(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===De.timestamp&&(c=!1),c)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;ot(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,p=this.treeScale.y;Ab(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox);const{target:m}=a;if(!m){this.projectionTransform&&(this.projectionDelta=kn(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=kn(),this.projectionDeltaWithTransform=kn());const g=this.projectionTransform;Es(this.projectionDelta,this.layoutCorrected,m,this.latestValues),this.projectionTransform=oh(this.projectionDelta,this.treeScale),(this.projectionTransform!==g||this.treeScale.x!==u||this.treeScale.y!==p)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m)),Or.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},f=kn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const u=Se(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,w=this.getStack(),v=!w||w.members.length<=1,y=!!(g&&!v&&this.options.crossfade===!0&&!this.path.some(x4));this.animationProgress=0;let x;this.mixTargetDelta=b=>{const k=b/1e3;dh(f.x,o.x,k),dh(f.y,o.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ts(u,this.layout.layoutBox,this.relativeParent.layout.layoutBox),v4(this.relativeTarget,this.relativeTargetOrigin,u,k),x&&Qb(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Se()),ot(x,this.relativeTarget)),g&&(this.animationValues=d,Hb(d,c,this.latestValues,k,y,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Kt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ne.update(()=>{Ji.hasAnimatedSinceResize=!0,this.currentAnimation=s4(0,lh,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(lh),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Bg(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Se();const f=nt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const u=nt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+u}ot(a,l),jn(a,d),Es(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Zb),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let d=0;d<ah.length;d++){const f="rotate"+ah[d];l[f]&&(c[f]=l[f],o.setStaticValue(f,0))}o.render();for(const d in c)o.setStaticValue(d,c[d]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return i4;const c={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Zi(o==null?void 0:o.pointerEvents)||"",c.transform=d?d(this.latestValues,""):"none",c;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Zi(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!zr(this.latestValues)&&(g.transform=d?d({},""):"none",this.hasProjected=!1),g}const u=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=oh(this.projectionDeltaWithTransform,this.treeScale,u),d&&(c.transform=d(u,c.transform));const{x:p,y:m}=this.projectionDelta;c.transformOrigin=`${p.origin*100}% ${m.origin*100}% 0`,f.animationValues?c.opacity=f===this?(l=(a=u.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:c.opacity=f===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in Po){if(u[g]===void 0)continue;const{correct:w,applyTo:v}=Po[g],y=c.transform==="none"?u[g]:w(u[g],f);if(v){const x=v.length;for(let b=0;b<x;b++)c[v[b]]=y}else c[g]=y}return this.options.layoutId&&(c.pointerEvents=f===this?Zi(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(uh),this.root.sharedNodes.clear()}}}function a4(e){e.updateLayout()}function l4(e){var t;const r=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=e.layout,{animationType:i}=e.options,o=r.source!==e.layout.source;i==="size"?at(f=>{const u=o?r.measuredBox[f]:r.layoutBox[f],p=nt(u);u.min=n[f].min,u.max=u.min+p}):Bg(i,r.layoutBox,n)&&at(f=>{const u=o?r.measuredBox[f]:r.layoutBox[f],p=nt(n[f]);u.max=u.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=kn();Es(a,n,r.layoutBox);const l=kn();o?Es(l,e.applyTransform(s,!0),r.measuredBox):Es(l,n,r.layoutBox);const c=!zg(a);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:u,layout:p}=f;if(u&&p){const m=Se();Ts(m,r.layoutBox,u.layoutBox);const g=Se();Ts(g,n,p.layoutBox),Og(m,g)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function u4(e){Or.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function c4(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function d4(e){e.clearSnapshot()}function uh(e){e.clearMeasurements()}function f4(e){e.isLayoutDirty=!1}function h4(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ch(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function p4(e){e.resolveTargetDelta()}function m4(e){e.calcProjection()}function g4(e){e.resetRotation()}function y4(e){e.removeLeadSnapshot()}function dh(e,t,r){e.translate=fe(t.translate,0,r),e.scale=fe(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function fh(e,t,r,n){e.min=fe(t.min,r.min,n),e.max=fe(t.max,r.max,n)}function v4(e,t,r,n){fh(e.x,t.x,r.x,n),fh(e.y,t.y,r.y,n)}function x4(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const w4={duration:.45,ease:[.4,0,.1,1]},hh=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),ph=hh("applewebkit/")&&!hh("chrome/")?Math.round:xe;function mh(e){e.min=ph(e.min),e.max=ph(e.max)}function b4(e){mh(e.x),mh(e.y)}function Bg(e,t,r){return e==="position"||e==="preserve-aspect"&&!du(ih(t),ih(r),.2)}const S4=$g({attachResizeListener:(e,t)=>Ot(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Xa={current:void 0},Ug=$g({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xa.current){const e=new S4({});e.mount(window),e.setOptions({layoutScroll:!0}),Xa.current=e}return Xa.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),k4={pan:{Feature:zb},drag:{Feature:Ib,ProjectionNode:Ug,MeasureLayout:Vg}},j4=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function C4(e){const t=j4.exec(e);if(!t)return[,];const[,r,n]=t;return[r,n]}function mu(e,t,r=1){const[n,s]=C4(e);if(!n)return;const i=window.getComputedStyle(t).getPropertyValue(n);if(i){const o=i.trim();return Cg(o)?parseFloat(o):o}else return su(s)?mu(s,t,r+1):s}function N4(e,{...t},r){const n=e.current;if(!(n instanceof Element))return{target:t,transitionEnd:r};r&&(r={...r}),e.values.forEach(s=>{const i=s.get();if(!su(i))return;const o=mu(i,n);o&&s.set(o)});for(const s in t){const i=t[s];if(!su(i))continue;const o=mu(i,n);o&&(t[s]=o,r||(r={}),r[s]===void 0&&(r[s]=i))}return{target:t,transitionEnd:r}}const P4=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Wg=e=>P4.has(e),E4=e=>Object.keys(e).some(Wg),gh=e=>e===sn||e===U,yh=(e,t)=>parseFloat(e.split(", ")[t]),vh=(e,t)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const s=n.match(/^matrix3d\((.+)\)$/);if(s)return yh(s[1],t);{const i=n.match(/^matrix\((.+)\)$/);return i?yh(i[1],e):0}},T4=new Set(["x","y","z"]),M4=di.filter(e=>!T4.has(e));function A4(e){const t=[];return M4.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t.length&&e.render(),t}const $n={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:vh(4,13),y:vh(5,14)};$n.translateX=$n.x;$n.translateY=$n.y;const _4=(e,t,r)=>{const n=t.measureViewportBox(),s=t.current,i=getComputedStyle(s),{display:o}=i,a={};o==="none"&&t.setStaticValue("display",e.display||"block"),r.forEach(c=>{a[c]=$n[c](n,i)}),t.render();const l=t.measureViewportBox();return r.forEach(c=>{const d=t.getValue(c);d&&d.jump(a[c]),e[c]=$n[c](l,i)}),e},L4=(e,t,r={},n={})=>{t={...t},n={...n};const s=Object.keys(t).filter(Wg);let i=[],o=!1;const a=[];if(s.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let d=r[l],f=ls(d);const u=t[l];let p;if(To(u)){const m=u.length,g=u[0]===null?1:0;d=u[g],f=ls(d);for(let w=g;w<m&&u[w]!==null;w++)p?_c(ls(u[w])===p):p=ls(u[w])}else p=ls(u);if(f!==p)if(gh(f)&&gh(p)){const m=c.get();typeof m=="string"&&c.set(parseFloat(m)),typeof u=="string"?t[l]=parseFloat(u):Array.isArray(u)&&p===U&&(t[l]=u.map(parseFloat))}else f!=null&&f.transform&&(p!=null&&p.transform)&&(d===0||u===0)?d===0?c.set(p.transform(d)):t[l]=f.transform(u):(o||(i=A4(e),o=!0),a.push(l),n[l]=n[l]!==void 0?n[l]:t[l],c.jump(u))}),a.length){const l=a.indexOf("height")>=0?window.pageYOffset:null,c=_4(t,e,a);return i.length&&i.forEach(([d,f])=>{e.getValue(d).set(f)}),e.render(),ia&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:n}}else return{target:t,transitionEnd:n}};function D4(e,t,r,n){return E4(t)?L4(e,t,r,n):{target:t,transitionEnd:n}}const R4=(e,t,r,n)=>{const s=N4(e,t,n);return t=s.target,n=s.transitionEnd,D4(e,t,r,n)},gu={current:null},Hg={current:!1};function V4(){if(Hg.current=!0,!!ia)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>gu.current=e.matches;e.addListener(t),t()}else gu.current=!1}function F4(e,t,r){const{willChange:n}=t;for(const s in t){const i=t[s],o=r[s];if(Xe(i))e.addValue(s,i),Lo(n)&&n.add(s);else if(Xe(o))e.addValue(s,On(i,{owner:e})),Lo(n)&&n.remove(s);else if(o!==i)if(e.hasValue(s)){const a=e.getValue(s);!a.hasAnimated&&a.set(i)}else{const a=e.getStaticValue(s);e.addValue(s,On(a!==void 0?a:i,{owner:e}))}}for(const s in r)t[s]===void 0&&e.removeValue(s);return t}const xh=new WeakMap,qg=Object.keys(ti),I4=qg.length,wh=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],z4=kc.length;class O4{constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:s,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>ne.render(this.render,!1,!0);const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=r.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=aa(r),this.isVariantNode=M0(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(r,{});for(const f in d){const u=d[f];a[f]!==void 0&&Xe(u)&&(u.set(a[f],!1),Lo(c)&&c.add(f))}}scrapeMotionValuesFromProps(t,r){return{}}mount(t){this.current=t,xh.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((r,n)=>this.bindToMotionValue(n,r)),Hg.current||V4(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gu.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){xh.delete(this.current),this.projection&&this.projection.unmount(),Kt(this.notifyUpdate),Kt(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,r){const n=nn.has(t),s=r.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&ne.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=r.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...r},n,s,i){let o,a;for(let l=0;l<I4;l++){const c=qg[l],{isEnabled:d,Feature:f,ProjectionNode:u,MeasureLayout:p}=ti[c];u&&(o=u),d(r)&&(!this.features[c]&&f&&(this.features[c]=new f(this)),p&&(a=p))}if((this.type==="html"||this.type==="svg")&&!this.projection&&o){this.projection=new o(this.latestValues,this.parent&&this.parent.projection);const{layoutId:l,layout:c,drag:d,dragConstraints:f,layoutScroll:u,layoutRoot:p}=r;this.projection.setOptions({layoutId:l,layout:c,alwaysMeasureLayout:!!d||f&&bn(f),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:i,layoutScroll:u,layoutRoot:p})}return a}updateFeatures(){for(const t in this.features){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Se()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}makeTargetAnimatable(t,r=!0){return this.makeTargetAnimatableFromInstance(t,this.props,r)}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<wh.length;n++){const s=wh[n];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i=t["on"+s];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=F4(this,this.scrapeMotionValuesFromProps(t,this.prevProps),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}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const n=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(n.initial=this.props.initial),n}const r={};for(let n=0;n<z4;n++){const s=kc[n],i=this.props[s];(ei(i)||i===!1)&&(r[s]=i)}return r}addVariantChild(t){const r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){r!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,r)),this.values.set(t,r),this.latestValues[t]=r.get()}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=On(r,{owner:this}),this.addValue(t,n)),n}readValue(t){var r;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var r;const{initial:n}=this.props,s=typeof n=="string"||typeof n=="object"?(r=Ac(this.props,n))===null||r===void 0?void 0:r[t]:void 0;if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Xe(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new $c),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}}class Gg extends O4{sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:r,...n},{transformValues:s},i){let o=nb(n,t||{},this);if(s&&(r&&(r=s(r)),n&&(n=s(n)),o&&(o=s(o))),i){tb(this,n,o);const a=R4(this,n,o,r);r=a.transitionEnd,n=a.target}return{transition:t,transitionEnd:r,...n}}}function $4(e){return window.getComputedStyle(e)}class B4 extends Gg{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,r){if(nn.has(r)){const n=Vc(r);return n&&n.default||0}else{const n=$4(t),s=(D0(r)?n.getPropertyValue(r):n[r])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:r}){return Dg(t,r)}build(t,r,n,s){Nc(t,r,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,r){return Mc(t,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Xe(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}renderInstance(t,r,n,s){O0(t,r,n,s)}}class U4 extends Gg{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(nn.has(r)){const n=Vc(r);return n&&n.default||0}return r=$0.has(r)?r:bc(r),t.getAttribute(r)}measureInstanceViewportBox(){return Se()}scrapeMotionValuesFromProps(t,r){return U0(t,r)}build(t,r,n,s){Ec(t,r,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,r,n,s){B0(t,r,n,s)}mount(t){this.isSVGTag=Tc(t.tagName),super.mount(t)}}const W4=(e,t)=>Cc(e)?new U4(t,{enableHardwareAcceleration:!1}):new B4(t,{enableHardwareAcceleration:!0}),H4={layout:{ProjectionNode:Ug,MeasureLayout:Vg}},q4={...vb,...Iw,...k4,...H4},z=G2((e,t)=>Cw(e,t,q4,W4));function Yg(){const e=S.useRef(!1);return wc(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function G4(){const e=Yg(),[t,r]=S.useState(0),n=S.useCallback(()=>{e.current&&r(t+1)},[t]);return[S.useCallback(()=>ne.postRender(n),[n]),t]}class Y4 extends S.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function K4({children:e,isPresent:t}){const r=S.useId(),n=S.useRef(null),s=S.useRef({width:0,height:0,top:0,left:0});return S.useInsertionEffect(()=>{const{width:i,height:o,top:a,left:l}=s.current;if(t||!n.current||!i||!o)return;n.current.dataset.motionPopId=r;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
[data-motion-pop-id="${r}"] {
position: absolute !important;
width: ${i}px !important;
height: ${o}px !important;
top: ${a}px !important;
left: ${l}px !important;
}
`),()=>{document.head.removeChild(c)}},[t]),S.createElement(Y4,{isPresent:t,childRef:n,sizeRef:s},S.cloneElement(e,{ref:n}))}const Qa=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:s,presenceAffectsLayout:i,mode:o})=>{const a=W0(X4),l=S.useId(),c=S.useMemo(()=>({id:l,initial:t,isPresent:r,custom:s,onExitComplete:d=>{a.set(d,!0);for(const f of a.values())if(!f)return;n&&n()},register:d=>(a.set(d,!1),()=>a.delete(d))}),i?void 0:[r]);return S.useMemo(()=>{a.forEach((d,f)=>a.set(f,!1))},[r]),S.useEffect(()=>{!r&&!a.size&&n&&n()},[r]),o==="popLayout"&&(e=S.createElement(K4,{isPresent:r},e)),S.createElement(sa.Provider,{value:c},e)};function X4(){return new Map}function Q4(e){return S.useEffect(()=>()=>e(),[])}const $r=e=>e.key||"";function Z4(e,t){e.forEach(r=>{const n=$r(r);t.set(n,r)})}function J4(e){const t=[];return S.Children.forEach(e,r=>{S.isValidElement(r)&&t.push(r)}),t}const e3=({children:e,custom:t,initial:r=!0,onExitComplete:n,exitBeforeEnter:s,presenceAffectsLayout:i=!0,mode:o="sync"})=>{const a=S.useContext(jc).forceRender||G4()[0],l=Yg(),c=J4(e);let d=c;const f=S.useRef(new Map).current,u=S.useRef(d),p=S.useRef(new Map).current,m=S.useRef(!0);if(wc(()=>{m.current=!1,Z4(c,p),u.current=d}),Q4(()=>{m.current=!0,p.clear(),f.clear()}),m.current)return S.createElement(S.Fragment,null,d.map(y=>S.createElement(Qa,{key:$r(y),isPresent:!0,initial:r?void 0:!1,presenceAffectsLayout:i,mode:o},y)));d=[...d];const g=u.current.map($r),w=c.map($r),v=g.length;for(let y=0;y<v;y++){const x=g[y];w.indexOf(x)===-1&&!f.has(x)&&f.set(x,void 0)}return o==="wait"&&f.size&&(d=[]),f.forEach((y,x)=>{if(w.indexOf(x)!==-1)return;const b=p.get(x);if(!b)return;const k=g.indexOf(x);let C=y;if(!C){const N=()=>{f.delete(x);const P=Array.from(p.keys()).filter(V=>!w.includes(V));if(P.forEach(V=>p.delete(V)),u.current=c.filter(V=>{const T=$r(V);return T===x||P.includes(T)}),!f.size){if(l.current===!1)return;a(),n&&n()}};C=S.createElement(Qa,{key:$r(b),isPresent:!1,onExitComplete:N,custom:t,presenceAffectsLayout:i,mode:o},b),f.set(x,C)}d.splice(k,0,C)}),d=d.map(y=>{const x=y.key;return f.has(x)?y:S.createElement(Qa,{key:$r(y),isPresent:!0,presenceAffectsLayout:i,mode:o},y)}),S.createElement(S.Fragment,null,f.size?d:d.map(y=>S.cloneElement(y)))},t3={},bh=e=>{let t;const r=new Set,n=(d,f)=>{const u=typeof d=="function"?d(t):d;if(!Object.is(u,t)){const p=t;t=f??(typeof u!="object"||u===null)?u:Object.assign({},t,u),r.forEach(m=>m(t,p))}},s=()=>t,l={setState:n,getState:s,getInitialState:()=>c,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(t3?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},c=t=e(n,s,l);return l},r3=e=>e?bh(e):bh;var Kg={exports:{}},Xg={},Qg={exports:{}},Zg={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Bn=S;function n3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var s3=typeof Object.is=="function"?Object.is:n3,i3=Bn.useState,o3=Bn.useEffect,a3=Bn.useLayoutEffect,l3=Bn.useDebugValue;function u3(e,t){var r=t(),n=i3({inst:{value:r,getSnapshot:t}}),s=n[0].inst,i=n[1];return a3(function(){s.value=r,s.getSnapshot=t,Za(s)&&i({inst:s})},[e,r,t]),o3(function(){return Za(s)&&i({inst:s}),e(function(){Za(s)&&i({inst:s})})},[e]),l3(r),r}function Za(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!s3(e,r)}catch{return!0}}function c3(e,t){return t()}var d3=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c3:u3;Zg.useSyncExternalStore=Bn.useSyncExternalStore!==void 0?Bn.useSyncExternalStore:d3;Qg.exports=Zg;var f3=Qg.exports;/**
* @license React
* use-sync-external-store-shim/with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var da=S,h3=f3;function p3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var m3=typeof Object.is=="function"?Object.is:p3,g3=h3.useSyncExternalStore,y3=da.useRef,v3=da.useEffect,x3=da.useMemo,w3=da.useDebugValue;Xg.useSyncExternalStoreWithSelector=function(e,t,r,n,s){var i=y3(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=x3(function(){function l(p){if(!c){if(c=!0,d=p,p=n(p),s!==void 0&&o.hasValue){var m=o.value;if(s(m,p))return f=m}return f=p}if(m=f,m3(d,p))return m;var g=n(p);return s!==void 0&&s(m,g)?(d=p,m):(d=p,f=g)}var c=!1,d,f,u=r===void 0?null:r;return[function(){return l(t())},u===null?void 0:function(){return l(u())}]},[t,r,n,s]);var a=g3(e,i[0],i[1]);return v3(function(){o.hasValue=!0,o.value=a},[a]),w3(a),a};Kg.exports=Xg;var b3=Kg.exports;const S3=wu(b3),Jg={},{useDebugValue:k3}=ii,{useSyncExternalStoreWithSelector:j3}=S3;let Sh=!1;const C3=e=>e;function N3(e,t=C3,r){(Jg?"production":void 0)!=="production"&&r&&!Sh&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Sh=!0);const n=j3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return k3(n),n}const P3=e=>{(Jg?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?r3(e):e,r=(n,s)=>N3(t,n,s);return Object.assign(r,t),r},E3=e=>P3,T3={};function M3(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var i;const o=l=>l===null?null:JSON.parse(l,void 0),a=(i=r.getItem(s))!=null?i:null;return a instanceof Promise?a.then(o):o(a)},setItem:(s,i)=>r.setItem(s,JSON.stringify(i,void 0)),removeItem:s=>r.removeItem(s)}}const ni=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return ni(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return ni(n)(r)}}}},A3=(e,t)=>(r,n,s)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:w=>w,version:0,merge:(w,v)=>({...v,...w}),...t},o=!1;const a=new Set,l=new Set;let c;try{c=i.getStorage()}catch{}if(!c)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(...w)},n,s);const d=ni(i.serialize),f=()=>{const w=i.partialize({...n()});let v;const y=d({state:w,version:i.version}).then(x=>c.setItem(i.name,x)).catch(x=>{v=x});if(v)throw v;return y},u=s.setState;s.setState=(w,v)=>{u(w,v),f()};const p=e((...w)=>{r(...w),f()},n,s);let m;const g=()=>{var w;if(!c)return;o=!1,a.forEach(y=>y(n()));const v=((w=i.onRehydrateStorage)==null?void 0:w.call(i,n()))||void 0;return ni(c.getItem.bind(c))(i.name).then(y=>{if(y)return i.deserialize(y)}).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==i.version){if(i.migrate)return i.migrate(y.state,y.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return y.state}).then(y=>{var x;return m=i.merge(y,(x=n())!=null?x:p),r(m,!0),f()}).then(()=>{v==null||v(m,void 0),o=!0,l.forEach(y=>y(m))}).catch(y=>{v==null||v(void 0,y)})};return s.persist={setOptions:w=>{i={...i,...w},w.getStorage&&(c=w.getStorage())},clearStorage:()=>{c==null||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>o,onHydrate:w=>(a.add(w),()=>{a.delete(w)}),onFinishHydration:w=>(l.add(w),()=>{l.delete(w)})},g(),m||p},_3=(e,t)=>(r,n,s)=>{let i={storage:M3(()=>localStorage),partialize:g=>g,version:0,merge:(g,w)=>({...w,...g}),...t},o=!1;const a=new Set,l=new Set;let c=i.storage;if(!c)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(...g)},n,s);const d=()=>{const g=i.partialize({...n()});return c.setItem(i.name,{state:g,version:i.version})},f=s.setState;s.setState=(g,w)=>{f(g,w),d()};const u=e((...g)=>{r(...g),d()},n,s);s.getInitialState=()=>u;let p;const m=()=>{var g,w;if(!c)return;o=!1,a.forEach(y=>{var x;return y((x=n())!=null?x:u)});const v=((w=i.onRehydrateStorage)==null?void 0:w.call(i,(g=n())!=null?g:u))||void 0;return ni(c.getItem.bind(c))(i.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==i.version){if(i.migrate)return[!0,i.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var x;const[b,k]=y;if(p=i.merge(k,(x=n())!=null?x:u),r(p,!0),b)return d()}).then(()=>{v==null||v(p,void 0),p=n(),o=!0,l.forEach(y=>y(p))}).catch(y=>{v==null||v(void 0,y)})};return s.persist={setOptions:g=>{i={...i,...g},g.storage&&(c=g.storage)},clearStorage:()=>{c==null||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},i.skipHydration||m(),p||u},L3=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((T3?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),A3(e,t)):_3(e,t),D3=L3,kh={currentUser:null,partnerUser:null,isLoading:!1,error:null,currentTrack:null,isPlaying:!1},oe=E3()(D3(e=>({...kh,mixedPlaylists:[],memoryLane:[],theme:"green",setCurrentUser:t=>e({currentUser:t}),setPartnerUser:t=>e({partnerUser:t}),logout:()=>e({currentUser:null,partnerUser:null,currentTrack:null,isPlaying:!1,mixedPlaylists:[],memoryLane:[],error:null}),setLoading:t=>e({isLoading:t}),setError:t=>e({error:t}),setCurrentTrack:t=>e({currentTrack:t}),setIsPlaying:t=>e({isPlaying:t}),addMixedPlaylist:t=>e(r=>({mixedPlaylists:[...r.mixedPlaylists,t]})),removeMixedPlaylist:t=>e(r=>({mixedPlaylists:r.mixedPlaylists.filter(n=>n.id!==t)})),setMixedPlaylists:t=>e({mixedPlaylists:t}),addMemoryLaneItem:t=>e(r=>({memoryLane:[...r.memoryLane,t].sort((n,s)=>new Date(s.date).getTime()-new Date(n.date).getTime())})),removeMemoryLaneItem:t=>e(r=>({memoryLane:r.memoryLane.filter(n=>n.id!==t)})),setTheme:t=>e({theme:t}),clearAllData:()=>e({...kh,mixedPlaylists:[],memoryLane:[]})}),{name:"spotify-app-settings",partialize:e=>({theme:e.theme})}));function R3(){{const e="/api";try{const t=typeof window<"u"&&window.location.protocol==="https:",r=new URL(e,window.location.origin);if(t&&r.protocol==="http:"&&r.hostname==="159.195.9.107"&&(r.port==="8081"||r.port===""))return"https://159.195.9.107:3443"}catch{}return e}}const Kn=R3();function Xt(){try{const e=localStorage.getItem("spotify-user");if(!e)return null;const t=JSON.parse(e);return(t==null?void 0:t.jwt)||(t==null?void 0:t.token)||null}catch{return null}}async function Et(e,t,r){const n=await fetch(`${Kn}${e}`,{method:"POST",headers:{"Content-Type":"application/json",...r?{Authorization:`Bearer ${r}`}:Xt()?{Authorization:`Bearer ${Xt()}`}:{}},body:t?JSON.stringify(t):void 0});if(!n.ok){const s=await n.text();throw new Error(s||`Request failed: ${n.status}`)}return n.json()}async function te(e,t){const r=await fetch(`${Kn}${e}`,{headers:{...t?{Authorization:`Bearer ${t}`}:Xt()?{Authorization:`Bearer ${Xt()}`}:{}}});if(!r.ok){const n=await r.text();throw new Error(n||`Request failed: ${r.status}`)}return r.json()}function V3(e){const t=Xt(),r=new URL(`${Kn}${e}`,window.location.origin);return t&&r.searchParams.set("token",t),new EventSource(r.toString())}async function F3(e,t,r){const n=await fetch(`${Kn}${e}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",...Xt()?{Authorization:`Bearer ${Xt()}`}:{}},body:new URLSearchParams(t).toString()});if(!n.ok){const s=await n.text();throw new Error(s||`Request failed: ${n.status}`)}return n.json()}async function I3(e,t){const r=await fetch(`${Kn}${e}`,{method:"DELETE",headers:{...t?{Authorization:`Bearer ${t}`}:Xt()?{Authorization:`Bearer ${Xt()}`}:{}}});if(!r.ok){const n=await r.text();throw new Error(n||`Request failed: ${r.status}`)}return r.json()}const en=e=>{const t={green:{primary:"bg-theme-green-primary text-white",secondary:"bg-theme-green-secondary text-white",accent:"bg-theme-green-accent text-white",border:"border-theme-green-primary",text:"text-theme-green-primary",gradient:"from-theme-green-primary to-theme-green-secondary",glass:"bg-theme-green-primary/10 border-theme-green-primary/30",hover:"hover:bg-theme-green-primary/20",cssVars:{primary:"#1db954",secondary:"#1ed760",accent:"#00e676"}},pink:{primary:"bg-theme-pink-primary text-white",secondary:"bg-theme-pink-secondary text-white",accent:"bg-theme-pink-accent text-white",border:"border-theme-pink-primary",text:"text-theme-pink-primary",gradient:"from-theme-pink-primary to-theme-pink-secondary",glass:"bg-theme-pink-primary/10 border-theme-pink-primary/30",hover:"hover:bg-theme-pink-primary/20",cssVars:{primary:"#ec4899",secondary:"#f472b6",accent:"#fb7185"}},blue:{primary:"bg-theme-blue-primary text-white",secondary:"bg-theme-blue-secondary text-white",accent:"bg-theme-blue-accent text-white",border:"border-theme-blue-primary",text:"text-theme-blue-primary",gradient:"from-theme-blue-primary to-theme-blue-secondary",glass:"bg-theme-blue-primary/10 border-theme-blue-primary/30",hover:"hover:bg-theme-blue-primary/20",cssVars:{primary:"#3b82f6",secondary:"#60a5fa",accent:"#93c5fd"}},red:{primary:"bg-theme-red-primary text-white",secondary:"bg-theme-red-secondary text-white",accent:"bg-theme-red-accent text-white",border:"border-theme-red-primary",text:"text-theme-red-primary",gradient:"from-theme-red-primary to-theme-red-secondary",glass:"bg-theme-red-primary/10 border-theme-red-primary/30",hover:"hover:bg-theme-red-primary/20",cssVars:{primary:"#dc2626",secondary:"#ef4444",accent:"#f87171"}},purple:{primary:"bg-theme-purple-primary text-white",secondary:"bg-theme-purple-secondary text-white",accent:"bg-theme-purple-accent text-white",border:"border-theme-purple-primary",text:"text-theme-purple-primary",gradient:"from-theme-purple-primary to-theme-purple-secondary",glass:"bg-theme-purple-primary/10 border-theme-purple-primary/30",hover:"hover:bg-theme-purple-primary/20",cssVars:{primary:"#8b5cf6",secondary:"#a78bfa",accent:"#c4b5fd"}},yellow:{primary:"bg-theme-yellow-primary text-black",secondary:"bg-theme-yellow-secondary text-black",accent:"bg-theme-yellow-accent text-black",border:"border-theme-yellow-primary",text:"text-theme-yellow-primary",gradient:"from-theme-yellow-primary to-theme-yellow-secondary",glass:"bg-theme-yellow-primary/10 border-theme-yellow-primary/30",hover:"hover:bg-theme-yellow-primary/20",cssVars:{primary:"#eab308",secondary:"#f59e0b",accent:"#fbbf24"}},turquoise:{primary:"bg-theme-turquoise-primary text-white",secondary:"bg-theme-turquoise-secondary text-white",accent:"bg-theme-turquoise-accent text-white",border:"border-theme-turquoise-primary",text:"text-theme-turquoise-primary",gradient:"from-theme-turquoise-primary to-theme-turquoise-secondary",glass:"bg-theme-turquoise-primary/10 border-theme-turquoise-primary/30",hover:"hover:bg-theme-turquoise-primary/20",cssVars:{primary:"#06b6d4",secondary:"#22d3ee",accent:"#67e8f9"}}},r=t[e]||t.green;if(typeof document<"u"){const n=document.documentElement;n.style.setProperty("--theme-primary",r.cssVars.primary),n.style.setProperty("--theme-secondary",r.cssVars.secondary),n.style.setProperty("--theme-accent",r.cssVars.accent)}return r},Ms=e=>({green:120,pink:300,blue:360,red:245,purple:280,yellow:200,turquoise:40})[e]||120;function As(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function yu(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function z3(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function jh(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Ch(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function O3(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function $3(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function Ja(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function B3(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return Math.sqrt(r*r+n*n+s*s)}function U3(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return r*r+n*n+s*s}function Nh(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function W3(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function H3(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function vu(e,t){let r=t[0],n=t[1],s=t[2],i=r*r+n*n+s*s;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function ey(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ph(e,t,r){let n=t[0],s=t[1],i=t[2],o=r[0],a=r[1],l=r[2];return e[0]=s*l-i*a,e[1]=i*o-n*l,e[2]=n*a-s*o,e}function q3(e,t,r,n){let s=t[0],i=t[1],o=t[2];return e[0]=s+n*(r[0]-s),e[1]=i+n*(r[1]-i),e[2]=o+n*(r[2]-o),e}function G3(e,t,r,n,s){const i=Math.exp(-n*s);let o=t[0],a=t[1],l=t[2];return e[0]=r[0]+(o-r[0])*i,e[1]=r[1]+(a-r[1])*i,e[2]=r[2]+(l-r[2])*i,e}function Y3(e,t,r){let n=t[0],s=t[1],i=t[2],o=r[3]*n+r[7]*s+r[11]*i+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*s+r[8]*i+r[12])/o,e[1]=(r[1]*n+r[5]*s+r[9]*i+r[13])/o,e[2]=(r[2]*n+r[6]*s+r[10]*i+r[14])/o,e}function K3(e,t,r){let n=t[0],s=t[1],i=t[2],o=r[3]*n+r[7]*s+r[11]*i+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*s+r[8]*i)/o,e[1]=(r[1]*n+r[5]*s+r[9]*i)/o,e[2]=(r[2]*n+r[6]*s+r[10]*i)/o,e}function X3(e,t,r){let n=t[0],s=t[1],i=t[2];return e[0]=n*r[0]+s*r[3]+i*r[6],e[1]=n*r[1]+s*r[4]+i*r[7],e[2]=n*r[2]+s*r[5]+i*r[8],e}function Q3(e,t,r){let n=t[0],s=t[1],i=t[2],o=r[0],a=r[1],l=r[2],c=r[3],d=a*i-l*s,f=l*n-o*i,u=o*s-a*n,p=a*u-l*f,m=l*d-o*u,g=o*f-a*d,w=c*2;return d*=w,f*=w,u*=w,p*=2,m*=2,g*=2,e[0]=n+d+p,e[1]=s+f+m,e[2]=i+u+g,e}const Z3=function(){const e=[0,0,0],t=[0,0,0];return function(r,n){yu(e,r),yu(t,n),vu(e,e),vu(t,t);let s=ey(e,t);return s>1?0:s<-1?Math.PI:Math.acos(s)}}();function J3(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}class vt extends Array{constructor(t=0,r=t,n=t){return super(t,r,n),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this[0]=t}set y(t){this[1]=t}set z(t){this[2]=t}set(t,r=t,n=t){return t.length?this.copy(t):(z3(this,t,r,n),this)}copy(t){return yu(this,t),this}add(t,r){return r?jh(this,t,r):jh(this,this,t),this}sub(t,r){return r?Ch(this,t,r):Ch(this,this,t),this}multiply(t){return t.length?O3(this,this,t):Ja(this,this,t),this}divide(t){return t.length?$3(this,this,t):Ja(this,this,1/t),this}inverse(t=this){return H3(this,t),this}len(){return As(this)}distance(t){return t?B3(this,t):As(this)}squaredLen(){return Nh(this)}squaredDistance(t){return t?U3(this,t):Nh(this)}negate(t=this){return W3(this,t),this}cross(t,r){return r?Ph(this,t,r):Ph(this,this,t),this}scale(t){return Ja(this,this,t),this}normalize(){return vu(this,this),this}dot(t){return ey(this,t)}equals(t){return J3(this,t)}applyMatrix3(t){return X3(this,this,t),this}applyMatrix4(t){return Y3(this,this,t),this}scaleRotateMatrix4(t){return K3(this,this,t),this}applyQuaternion(t){return Q3(this,this,t),this}angle(t){return Z3(this,t)}lerp(t,r){return q3(this,this,t,r),this}smoothLerp(t,r,n){return G3(this,this,t,r,n),this}clone(){return new vt(this[0],this[1],this[2])}fromArray(t,r=0){return this[0]=t[r],this[1]=t[r+1],this[2]=t[r+2],this}toArray(t=[],r=0){return t[r]=this[0],t[r+1]=this[1],t[r+2]=this[2],t}transformDirection(t){const r=this[0],n=this[1],s=this[2];return this[0]=t[0]*r+t[4]*n+t[8]*s,this[1]=t[1]*r+t[5]*n+t[9]*s,this[2]=t[2]*r+t[6]*n+t[10]*s,this.normalize()}}const Eh=new vt;let eS=1,tS=1,Th=!1;class rS{constructor(t,r={}){t.canvas||console.error("gl not passed as first argument to Geometry"),this.gl=t,this.attributes=r,this.id=eS++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let n in r)this.addAttribute(n,r[n])}addAttribute(t,r){if(this.attributes[t]=r,r.id=tS++,r.size=r.size||1,r.type=r.type||(r.data.constructor===Float32Array?this.gl.FLOAT:r.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),r.target=t==="index"?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,r.normalized=r.normalized||!1,r.stride=r.stride||0,r.offset=r.offset||0,r.count=r.count||(r.stride?r.data.byteLength/r.stride:r.data.length/r.size),r.divisor=r.instanced||0,r.needsUpdate=!1,r.usage=r.usage||this.gl.STATIC_DRAW,r.buffer||this.updateAttribute(r),r.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==r.count*r.divisor)return console.warn("geometry has multiple instanced buffers of different length"),this.instancedCount=Math.min(this.instancedCount,r.count*r.divisor);this.instancedCount=r.count*r.divisor}else t==="index"?this.drawRange.count=r.count:this.attributes.index||(this.drawRange.count=Math.max(this.drawRange.count,r.count))}updateAttribute(t){const r=!t.buffer;r&&(t.buffer=this.gl.createBuffer()),this.glState.boundBuffer!==t.buffer&&(this.gl.bindBuffer(t.target,t.buffer),this.glState.boundBuffer=t.buffer),r?this.gl.bufferData(t.target,t.data,t.usage):this.gl.bufferSubData(t.target,0,t.data),t.needsUpdate=!1}setIndex(t){this.addAttribute("index",t)}setDrawRange(t,r){this.drawRange.start=t,this.drawRange.count=r}setInstancedCount(t){this.instancedCount=t}createVAO(t){this.VAOs[t.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.bindAttributes(t)}bindAttributes(t){t.attributeLocations.forEach((r,{name:n,type:s})=>{if(!this.attributes[n]){console.warn(`active attribute ${n} not being supplied`);return}const i=this.attributes[n];this.gl.bindBuffer(i.target,i.buffer),this.glState.boundBuffer=i.buffer;let o=1;s===35674&&(o=2),s===35675&&(o=3),s===35676&&(o=4);const a=i.size/o,l=o===1?0:o*o*4,c=o===1?0:o*4;for(let d=0;d<o;d++)this.gl.vertexAttribPointer(r+d,a,i.type,i.normalized,i.stride+l,i.offset+d*c),this.gl.enableVertexAttribArray(r+d),this.gl.renderer.vertexAttribDivisor(r+d,i.divisor)}),this.attributes.index&&this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.attributes.index.buffer)}draw({program:t,mode:r=this.gl.TRIANGLES}){var s;this.gl.renderer.currentGeometry!==`${this.id}_${t.attributeOrder}`&&(this.VAOs[t.attributeOrder]||this.createVAO(t),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.gl.renderer.currentGeometry=`${this.id}_${t.attributeOrder}`),t.attributeLocations.forEach((i,{name:o})=>{const a=this.attributes[o];a.needsUpdate&&this.updateAttribute(a)});let n=2;((s=this.attributes.index)==null?void 0:s.type)===this.gl.UNSIGNED_INT&&(n=4),this.isInstanced?this.attributes.index?this.gl.renderer.drawElementsInstanced(r,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*n,this.instancedCount):this.gl.renderer.drawArraysInstanced(r,this.drawRange.start,this.drawRange.count,this.instancedCount):this.attributes.index?this.gl.drawElements(r,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*n):this.gl.drawArrays(r,this.drawRange.start,this.drawRange.count)}getPosition(){const t=this.attributes.position;if(t.data)return t;if(!Th)return console.warn("No position buffer data found to compute bounds"),Th=!0}computeBoundingBox(t){t||(t=this.getPosition());const r=t.data,n=t.size;this.bounds||(this.bounds={min:new vt,max:new vt,center:new vt,scale:new vt,radius:1/0});const s=this.bounds.min,i=this.bounds.max,o=this.bounds.center,a=this.bounds.scale;s.set(1/0),i.set(-1/0);for(let l=0,c=r.length;l<c;l+=n){const d=r[l],f=r[l+1],u=r[l+2];s.x=Math.min(d,s.x),s.y=Math.min(f,s.y),s.z=Math.min(u,s.z),i.x=Math.max(d,i.x),i.y=Math.max(f,i.y),i.z=Math.max(u,i.z)}a.sub(i,s),o.add(s,i).divide(2)}computeBoundingSphere(t){t||(t=this.getPosition());const r=t.data,n=t.size;this.bounds||this.computeBoundingBox(t);let s=0;for(let i=0,o=r.length;i<o;i+=n)Eh.fromArray(r,i),s=Math.max(s,this.bounds.center.squaredDistance(Eh));this.bounds.radius=Math.sqrt(s)}remove(){for(let t in this.VAOs)this.gl.renderer.deleteVertexArray(this.VAOs[t]),delete this.VAOs[t];for(let t in this.attributes)this.gl.deleteBuffer(this.attributes[t].buffer),delete this.attributes[t]}}let nS=1;const Mh={};class sS{constructor(t,{vertex:r,fragment:n,uniforms:s={},transparent:i=!1,cullFace:o=t.BACK,frontFace:a=t.CCW,depthTest:l=!0,depthWrite:c=!0,depthFunc:d=t.LEQUAL}={}){t.canvas||console.error("gl not passed as first argument to Program"),this.gl=t,this.uniforms=s,this.id=nS++,r||console.warn("vertex shader not supplied"),n||console.warn("fragment shader not supplied"),this.transparent=i,this.cullFace=o,this.frontFace=a,this.depthTest=l,this.depthWrite=c,this.depthFunc=d,this.blendFunc={},this.blendEquation={},this.stencilFunc={},this.stencilOp={},this.transparent&&!this.blendFunc.src&&(this.gl.renderer.premultipliedAlpha?this.setBlendFunc(this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA):this.setBlendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA)),this.vertexShader=t.createShader(t.VERTEX_SHADER),this.fragmentShader=t.createShader(t.FRAGMENT_SHADER),this.program=t.createProgram(),t.attachShader(this.program,this.vertexShader),t.attachShader(this.program,this.fragmentShader),this.setShaders({vertex:r,fragment:n})}setShaders({vertex:t,fragment:r}){if(t&&(this.gl.shaderSource(this.vertexShader,t),this.gl.compileShader(this.vertexShader),this.gl.getShaderInfoLog(this.vertexShader)!==""&&console.warn(`${this.gl.getShaderInfoLog(this.vertexShader)}
Vertex Shader
${Ah(t)}`)),r&&(this.gl.shaderSource(this.fragmentShader,r),this.gl.compileShader(this.fragmentShader),this.gl.getShaderInfoLog(this.fragmentShader)!==""&&console.warn(`${this.gl.getShaderInfoLog(this.fragmentShader)}
Fragment Shader
${Ah(r)}`)),this.gl.linkProgram(this.program),!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))return console.warn(this.gl.getProgramInfoLog(this.program));this.uniformLocations=new Map;let n=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_UNIFORMS);for(let o=0;o<n;o++){let a=this.gl.getActiveUniform(this.program,o);this.uniformLocations.set(a,this.gl.getUniformLocation(this.program,a.name));const l=a.name.match(/(\w+)/g);a.uniformName=l[0],a.nameComponents=l.slice(1)}this.attributeLocations=new Map;const s=[],i=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES);for(let o=0;o<i;o++){const a=this.gl.getActiveAttrib(this.program,o),l=this.gl.getAttribLocation(this.program,a.name);l!==-1&&(s[l]=a.name,this.attributeLocations.set(a,l))}this.attributeOrder=s.join("")}setBlendFunc(t,r,n,s){this.blendFunc.src=t,this.blendFunc.dst=r,this.blendFunc.srcAlpha=n,this.blendFunc.dstAlpha=s,t&&(this.transparent=!0)}setBlendEquation(t,r){this.blendEquation.modeRGB=t,this.blendEquation.modeAlpha=r}setStencilFunc(t,r,n){this.stencilRef=r,this.stencilFunc.func=t,this.stencilFunc.ref=r,this.stencilFunc.mask=n}setStencilOp(t,r,n){this.stencilOp.stencilFail=t,this.stencilOp.depthFail=r,this.stencilOp.depthPass=n}applyState(){this.depthTest?this.gl.renderer.enable(this.gl.DEPTH_TEST):this.gl.renderer.disable(this.gl.DEPTH_TEST),this.cullFace?this.gl.renderer.enable(this.gl.CULL_FACE):this.gl.renderer.disable(this.gl.CULL_FACE),this.blendFunc.src?this.gl.renderer.enable(this.gl.BLEND):this.gl.renderer.disable(this.gl.BLEND),this.cullFace&&this.gl.renderer.setCullFace(this.cullFace),this.gl.renderer.setFrontFace(this.frontFace),this.gl.renderer.setDepthMask(this.depthWrite),this.gl.renderer.setDepthFunc(this.depthFunc),this.blendFunc.src&&this.gl.renderer.setBlendFunc(this.blendFunc.src,this.blendFunc.dst,this.blendFunc.srcAlpha,this.blendFunc.dstAlpha),this.gl.renderer.setBlendEquation(this.blendEquation.modeRGB,this.blendEquation.modeAlpha),this.stencilFunc.func||this.stencilOp.stencilFail?this.gl.renderer.enable(this.gl.STENCIL_TEST):this.gl.renderer.disable(this.gl.STENCIL_TEST),this.gl.renderer.setStencilFunc(this.stencilFunc.func,this.stencilFunc.ref,this.stencilFunc.mask),this.gl.renderer.setStencilOp(this.stencilOp.stencilFail,this.stencilOp.depthFail,this.stencilOp.depthPass)}use({flipFaces:t=!1}={}){let r=-1;this.gl.renderer.state.currentProgram===this.id||(this.gl.useProgram(this.program),this.gl.renderer.state.currentProgram=this.id),this.uniformLocations.forEach((s,i)=>{let o=this.uniforms[i.uniformName];for(const a of i.nameComponents){if(!o)break;if(a in o)o=o[a];else{if(Array.isArray(o.value))break;o=void 0;break}}if(!o)return _h(`Active uniform ${i.name} has not been supplied`);if(o&&o.value===void 0)return _h(`${i.name} uniform is missing a value parameter`);if(o.value.texture)return r=r+1,o.value.update(r),el(this.gl,i.type,s,r);if(o.value.length&&o.value[0].texture){const a=[];return o.value.forEach(l=>{r=r+1,l.update(r),a.push(r)}),el(this.gl,i.type,s,a)}el(this.gl,i.type,s,o.value)}),this.applyState(),t&&this.gl.renderer.setFrontFace(this.frontFace===this.gl.CCW?this.gl.CW:this.gl.CCW)}remove(){this.gl.deleteProgram(this.program)}}function el(e,t,r,n){n=n.length?iS(n):n;const s=e.renderer.state.uniformLocations.get(r);if(n.length)if(s===void 0||s.length!==n.length)e.renderer.state.uniformLocations.set(r,n.slice(0));else{if(oS(s,n))return;s.set?s.set(n):aS(s,n),e.renderer.state.uniformLocations.set(r,s)}else{if(s===n)return;e.renderer.state.uniformLocations.set(r,n)}switch(t){case 5126:return n.length?e.uniform1fv(r,n):e.uniform1f(r,n);case 35664:return e.uniform2fv(r,n);case 35665:return e.uniform3fv(r,n);case 35666:return e.uniform4fv(r,n);case 35670:case 5124:case 35678:case 36306:case 35680:case 36289:return n.length?e.uniform1iv(r,n):e.uniform1i(r,n);case 35671:case 35667:return e.uniform2iv(r,n);case 35672:case 35668:return e.uniform3iv(r,n);case 35673:case 35669:return e.uniform4iv(r,n);case 35674:return e.uniformMatrix2fv(r,!1,n);case 35675:return e.uniformMatrix3fv(r,!1,n);case 35676:return e.uniformMatrix4fv(r,!1,n)}}function Ah(e){let t=e.split(`
`);for(let r=0;r<t.length;r++)t[r]=r+1+": "+t[r];return t.join(`
`)}function iS(e){const t=e.length,r=e[0].length;if(r===void 0)return e;const n=t*r;let s=Mh[n];s||(Mh[n]=s=new Float32Array(n));for(let i=0;i<t;i++)s.set(e[i],i*r);return s}function oS(e,t){if(e.length!==t.length)return!1;for(let r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}function aS(e,t){for(let r=0,n=e.length;r<n;r++)e[r]=t[r]}let tl=0;function _h(e){tl>100||(console.warn(e),tl++,tl>100&&console.warn("More than 100 program warnings - stopping logs."))}const rl=new vt;let lS=1;class uS{constructor({canvas:t=document.createElement("canvas"),width:r=300,height:n=150,dpr:s=1,alpha:i=!1,depth:o=!0,stencil:a=!1,antialias:l=!1,premultipliedAlpha:c=!1,preserveDrawingBuffer:d=!1,powerPreference:f="default",autoClear:u=!0,webgl:p=2}={}){const m={alpha:i,depth:o,stencil:a,antialias:l,premultipliedAlpha:c,preserveDrawingBuffer:d,powerPreference:f};this.dpr=s,this.alpha=i,this.color=!0,this.depth=o,this.stencil=a,this.premultipliedAlpha=c,this.autoClear=u,this.id=lS++,p===2&&(this.gl=t.getContext("webgl2",m)),this.isWebgl2=!!this.gl,this.gl||(this.gl=t.getContext("webgl",m)),this.gl||console.error("unable to create webgl context"),this.gl.renderer=this,this.setSize(r,n),this.state={},this.state.blendFunc={src:this.gl.ONE,dst:this.gl.ZERO},this.state.blendEquation={modeRGB:this.gl.FUNC_ADD},this.state.cullFace=!1,this.state.frontFace=this.gl.CCW,this.state.depthMask=!0,this.state.depthFunc=this.gl.LEQUAL,this.state.premultiplyAlpha=!1,this.state.flipY=!1,this.state.unpackAlignment=4,this.state.framebuffer=null,this.state.viewport={x:0,y:0,width:null,height:null},this.state.textureUnits=[],this.state.activeTextureUnit=0,this.state.boundBuffer=null,this.state.uniformLocations=new Map,this.state.currentProgram=null,this.extensions={},this.isWebgl2?(this.getExtension("EXT_color_buffer_float"),this.getExtension("OES_texture_float_linear")):(this.getExtension("OES_texture_float"),this.getExtension("OES_texture_float_linear"),this.getExtension("OES_texture_half_float"),this.getExtension("OES_texture_half_float_linear"),this.getExtension("OES_element_index_uint"),this.getExtension("OES_standard_derivatives"),this.getExtension("EXT_sRGB"),this.getExtension("WEBGL_depth_texture"),this.getExtension("WEBGL_draw_buffers")),this.getExtension("WEBGL_compressed_texture_astc"),this.getExtension("EXT_texture_compression_bptc"),this.getExtension("WEBGL_compressed_texture_s3tc"),this.getExtension("WEBGL_compressed_texture_etc1"),this.getExtension("WEBGL_compressed_texture_pvrtc"),this.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this.vertexAttribDivisor=this.getExtension("ANGLE_instanced_arrays","vertexAttribDivisor","vertexAttribDivisorANGLE"),this.drawArraysInstanced=this.getExtension("ANGLE_instanced_arrays","drawArraysInstanced","drawArraysInstancedANGLE"),this.drawElementsInstanced=this.getExtension("ANGLE_instanced_arrays","drawElementsInstanced","drawElementsInstancedANGLE"),this.createVertexArray=this.getExtension("OES_vertex_array_object","createVertexArray","createVertexArrayOES"),this.bindVertexArray=this.getExtension("OES_vertex_array_object","bindVertexArray","bindVertexArrayOES"),this.deleteVertexArray=this.getExtension("OES_vertex_array_object","deleteVertexArray","deleteVertexArrayOES"),this.drawBuffers=this.getExtension("WEBGL_draw_buffers","drawBuffers","drawBuffersWEBGL"),this.parameters={},this.parameters.maxTextureUnits=this.gl.getParameter(this.gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.parameters.maxAnisotropy=this.getExtension("EXT_texture_filter_anisotropic")?this.gl.getParameter(this.getExtension("EXT_texture_filter_anisotropic").MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}setSize(t,r){this.width=t,this.height=r,this.gl.canvas.width=t*this.dpr,this.gl.canvas.height=r*this.dpr,this.gl.canvas.style&&Object.assign(this.gl.canvas.style,{width:t+"px",height:r+"px"})}setViewport(t,r,n=0,s=0){this.state.viewport.width===t&&this.state.viewport.height===r||(this.state.viewport.width=t,this.state.viewport.height=r,this.state.viewport.x=n,this.state.viewport.y=s,this.gl.viewport(n,s,t,r))}setScissor(t,r,n=0,s=0){this.gl.scissor(n,s,t,r)}enable(t){this.state[t]!==!0&&(this.gl.enable(t),this.state[t]=!0)}disable(t){this.state[t]!==!1&&(this.gl.disable(t),this.state[t]=!1)}setBlendFunc(t,r,n,s){this.state.blendFunc.src===t&&this.state.blendFunc.dst===r&&this.state.blendFunc.srcAlpha===n&&this.state.blendFunc.dstAlpha===s||(this.state.blendFunc.src=t,this.state.blendFunc.dst=r,this.state.blendFunc.srcAlpha=n,this.state.blendFunc.dstAlpha=s,n!==void 0?this.gl.blendFuncSeparate(t,r,n,s):this.gl.blendFunc(t,r))}setBlendEquation(t,r){t=t||this.gl.FUNC_ADD,!(this.state.blendEquation.modeRGB===t&&this.state.blendEquation.modeAlpha===r)&&(this.state.blendEquation.modeRGB=t,this.state.blendEquation.modeAlpha=r,r!==void 0?this.gl.blendEquationSeparate(t,r):this.gl.blendEquation(t))}setCullFace(t){this.state.cullFace!==t&&(this.state.cullFace=t,this.gl.cullFace(t))}setFrontFace(t){this.state.frontFace!==t&&(this.state.frontFace=t,this.gl.frontFace(t))}setDepthMask(t){this.state.depthMask!==t&&(this.state.depthMask=t,this.gl.depthMask(t))}setDepthFunc(t){this.state.depthFunc!==t&&(this.state.depthFunc=t,this.gl.depthFunc(t))}setStencilMask(t){this.state.stencilMask!==t&&(this.state.stencilMask=t,this.gl.stencilMask(t))}setStencilFunc(t,r,n){this.state.stencilFunc===t&&this.state.stencilRef===r&&this.state.stencilFuncMask===n||(this.state.stencilFunc=t||this.gl.ALWAYS,this.state.stencilRef=r||0,this.state.stencilFuncMask=n||0,this.gl.stencilFunc(t||this.gl.ALWAYS,r||0,n||0))}setStencilOp(t,r,n){this.state.stencilFail===t&&this.state.stencilDepthFail===r&&this.state.stencilDepthPass===n||(this.state.stencilFail=t,this.state.stencilDepthFail=r,this.state.stencilDepthPass=n,this.gl.stencilOp(t,r,n))}activeTexture(t){this.state.activeTextureUnit!==t&&(this.state.activeTextureUnit=t,this.gl.activeTexture(this.gl.TEXTURE0+t))}bindFramebuffer({target:t=this.gl.FRAMEBUFFER,buffer:r=null}={}){this.state.framebuffer!==r&&(this.state.framebuffer=r,this.gl.bindFramebuffer(t,r))}getExtension(t,r,n){return r&&this.gl[r]?this.gl[r].bind(this.gl):(this.extensions[t]||(this.extensions[t]=this.gl.getExtension(t)),r?this.extensions[t]?this.extensions[t][n].bind(this.extensions[t]):null:this.extensions[t])}sortOpaque(t,r){return t.renderOrder!==r.renderOrder?t.renderOrder-r.renderOrder:t.program.id!==r.program.id?t.program.id-r.program.id:t.zDepth!==r.zDepth?t.zDepth-r.zDepth:r.id-t.id}sortTransparent(t,r){return t.renderOrder!==r.renderOrder?t.renderOrder-r.renderOrder:t.zDepth!==r.zDepth?r.zDepth-t.zDepth:r.id-t.id}sortUI(t,r){return t.renderOrder!==r.renderOrder?t.renderOrder-r.renderOrder:t.program.id!==r.program.id?t.program.id-r.program.id:r.id-t.id}getRenderList({scene:t,camera:r,frustumCull:n,sort:s}){let i=[];if(r&&n&&r.updateFrustum(),t.traverse(o=>{if(!o.visible)return!0;o.draw&&(n&&o.frustumCulled&&r&&!r.frustumIntersectsMesh(o)||i.push(o))}),s){const o=[],a=[],l=[];i.forEach(c=>{c.program.transparent?c.program.depthTest?a.push(c):l.push(c):o.push(c),c.zDepth=0,!(c.renderOrder!==0||!c.program.depthTest||!r)&&(c.worldMatrix.getTranslation(rl),rl.applyMatrix4(r.projectionViewMatrix),c.zDepth=rl.z)}),o.sort(this.sortOpaque),a.sort(this.sortTransparent),l.sort(this.sortUI),i=o.concat(a,l)}return i}render({scene:t,camera:r,target:n=null,update:s=!0,sort:i=!0,frustumCull:o=!0,clear:a}){n===null?(this.bindFramebuffer(),this.setViewport(this.width*this.dpr,this.height*this.dpr)):(this.bindFramebuffer(n),this.setViewport(n.width,n.height)),(a||this.autoClear&&a!==!1)&&(this.depth&&(!n||n.depth)&&(this.enable(this.gl.DEPTH_TEST),this.setDepthMask(!0)),(this.stencil||!n||n.stencil)&&(this.enable(this.gl.STENCIL_TEST),this.setStencilMask(255)),this.gl.clear((this.color?this.gl.COLOR_BUFFER_BIT:0)|(this.depth?this.gl.DEPTH_BUFFER_BIT:0)|(this.stencil?this.gl.STENCIL_BUFFER_BIT:0))),s&&t.updateMatrixWorld(),r&&r.updateMatrixWorld(),this.getRenderList({scene:t,camera:r,frustumCull:o,sort:i}).forEach(c=>{c.draw({camera:r})})}}function cS(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function dS(e,t,r,n,s){return e[0]=t,e[1]=r,e[2]=n,e[3]=s,e}function fS(e,t){let r=t[0],n=t[1],s=t[2],i=t[3],o=r*r+n*n+s*s+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=s*o,e[3]=i*o,e}function hS(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function pS(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function mS(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function Lh(e,t,r){let n=t[0],s=t[1],i=t[2],o=t[3],a=r[0],l=r[1],c=r[2],d=r[3];return e[0]=n*d+o*a+s*c-i*l,e[1]=s*d+o*l+i*a-n*c,e[2]=i*d+o*c+n*l-s*a,e[3]=o*d-n*a-s*l-i*c,e}function gS(e,t,r){r*=.5;let n=t[0],s=t[1],i=t[2],o=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=n*l+o*a,e[1]=s*l+i*a,e[2]=i*l-s*a,e[3]=o*l-n*a,e}function yS(e,t,r){r*=.5;let n=t[0],s=t[1],i=t[2],o=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=n*l-i*a,e[1]=s*l+o*a,e[2]=i*l+n*a,e[3]=o*l-s*a,e}function vS(e,t,r){r*=.5;let n=t[0],s=t[1],i=t[2],o=t[3],a=Math.sin(r),l=Math.cos(r);return e[0]=n*l+s*a,e[1]=s*l-n*a,e[2]=i*l+o*a,e[3]=o*l-i*a,e}function xS(e,t,r,n){let s=t[0],i=t[1],o=t[2],a=t[3],l=r[0],c=r[1],d=r[2],f=r[3],u,p,m,g,w;return p=s*l+i*c+o*d+a*f,p<0&&(p=-p,l=-l,c=-c,d=-d,f=-f),1-p>1e-6?(u=Math.acos(p),m=Math.sin(u),g=Math.sin((1-n)*u)/m,w=Math.sin(n*u)/m):(g=1-n,w=n),e[0]=g*s+w*l,e[1]=g*i+w*c,e[2]=g*o+w*d,e[3]=g*a+w*f,e}function wS(e,t){let r=t[0],n=t[1],s=t[2],i=t[3],o=r*r+n*n+s*s+i*i,a=o?1/o:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-s*a,e[3]=i*a,e}function bS(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function SS(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[s*3+s]&&(s=2);let i=(s+1)%3,o=(s+2)%3;n=Math.sqrt(t[s*3+s]-t[i*3+i]-t[o*3+o]+1),e[s]=.5*n,n=.5/n,e[3]=(t[i*3+o]-t[o*3+i])*n,e[i]=(t[i*3+s]+t[s*3+i])*n,e[o]=(t[o*3+s]+t[s*3+o])*n}return e}function kS(e,t,r="YXZ"){let n=Math.sin(t[0]*.5),s=Math.cos(t[0]*.5),i=Math.sin(t[1]*.5),o=Math.cos(t[1]*.5),a=Math.sin(t[2]*.5),l=Math.cos(t[2]*.5);return r==="XYZ"?(e[0]=n*o*l+s*i*a,e[1]=s*i*l-n*o*a,e[2]=s*o*a+n*i*l,e[3]=s*o*l-n*i*a):r==="YXZ"?(e[0]=n*o*l+s*i*a,e[1]=s*i*l-n*o*a,e[2]=s*o*a-n*i*l,e[3]=s*o*l+n*i*a):r==="ZXY"?(e[0]=n*o*l-s*i*a,e[1]=s*i*l+n*o*a,e[2]=s*o*a+n*i*l,e[3]=s*o*l-n*i*a):r==="ZYX"?(e[0]=n*o*l-s*i*a,e[1]=s*i*l+n*o*a,e[2]=s*o*a-n*i*l,e[3]=s*o*l+n*i*a):r==="YZX"?(e[0]=n*o*l+s*i*a,e[1]=s*i*l+n*o*a,e[2]=s*o*a-n*i*l,e[3]=s*o*l-n*i*a):r==="XZY"&&(e[0]=n*o*l-s*i*a,e[1]=s*i*l-n*o*a,e[2]=s*o*a+n*i*l,e[3]=s*o*l+n*i*a),e}const jS=cS,CS=dS,NS=hS,PS=fS;class ES extends Array{constructor(t=0,r=0,n=0,s=1){super(t,r,n,s),this.onChange=()=>{},this._target=this;const i=["0","1","2","3"];return new Proxy(this,{set(o,a){const l=Reflect.set(...arguments);return l&&i.includes(a)&&o.onChange(),l}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set w(t){this._target[3]=t,this.onChange()}identity(){return pS(this._target),this.onChange(),this}set(t,r,n,s){return t.length?this.copy(t):(CS(this._target,t,r,n,s),this.onChange(),this)}rotateX(t){return gS(this._target,this._target,t),this.onChange(),this}rotateY(t){return yS(this._target,this._target,t),this.onChange(),this}rotateZ(t){return vS(this._target,this._target,t),this.onChange(),this}inverse(t=this._target){return wS(this._target,t),this.onChange(),this}conjugate(t=this._target){return bS(this._target,t),this.onChange(),this}copy(t){return jS(this._target,t),this.onChange(),this}normalize(t=this._target){return PS(this._target,t),this.onChange(),this}multiply(t,r){return r?Lh(this._target,t,r):Lh(this._target,this._target,t),this.onChange(),this}dot(t){return NS(this._target,t)}fromMatrix3(t){return SS(this._target,t),this.onChange(),this}fromEuler(t,r){return kS(this._target,t,t.order),r||this.onChange(),this}fromAxisAngle(t,r){return mS(this._target,t,r),this.onChange(),this}slerp(t,r){return xS(this._target,this._target,t,r),this.onChange(),this}fromArray(t,r=0){return this._target[0]=t[r],this._target[1]=t[r+1],this._target[2]=t[r+2],this._target[3]=t[r+3],this.onChange(),this}toArray(t=[],r=0){return t[r]=this[0],t[r+1]=this[1],t[r+2]=this[2],t[r+3]=this[3],t}}const TS=1e-6;function MS(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function AS(e,t,r,n,s,i,o,a,l,c,d,f,u,p,m,g,w){return e[0]=t,e[1]=r,e[2]=n,e[3]=s,e[4]=i,e[5]=o,e[6]=a,e[7]=l,e[8]=c,e[9]=d,e[10]=f,e[11]=u,e[12]=p,e[13]=m,e[14]=g,e[15]=w,e}function _S(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function LS(e,t){let r=t[0],n=t[1],s=t[2],i=t[3],o=t[4],a=t[5],l=t[6],c=t[7],d=t[8],f=t[9],u=t[10],p=t[11],m=t[12],g=t[13],w=t[14],v=t[15],y=r*a-n*o,x=r*l-s*o,b=r*c-i*o,k=n*l-s*a,C=n*c-i*a,N=s*c-i*l,P=d*g-f*m,V=d*w-u*m,T=d*v-p*m,O=f*w-u*g,j=f*v-p*g,F=u*v-p*w,D=y*F-x*j+b*O+k*T-C*V+N*P;return D?(D=1/D,e[0]=(a*F-l*j+c*O)*D,e[1]=(s*j-n*F-i*O)*D,e[2]=(g*N-w*C+v*k)*D,e[3]=(u*C-f*N-p*k)*D,e[4]=(l*T-o*F-c*V)*D,e[5]=(r*F-s*T+i*V)*D,e[6]=(w*b-m*N-v*x)*D,e[7]=(d*N-u*b+p*x)*D,e[8]=(o*j-a*T+c*P)*D,e[9]=(n*T-r*j-i*P)*D,e[10]=(m*C-g*b+v*y)*D,e[11]=(f*b-d*C-p*y)*D,e[12]=(a*V-o*O-l*P)*D,e[13]=(r*O-n*V+s*P)*D,e[14]=(g*x-m*k-w*y)*D,e[15]=(d*k-f*x+u*y)*D,e):null}function ty(e){let t=e[0],r=e[1],n=e[2],s=e[3],i=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],u=e[11],p=e[12],m=e[13],g=e[14],w=e[15],v=t*o-r*i,y=t*a-n*i,x=t*l-s*i,b=r*a-n*o,k=r*l-s*o,C=n*l-s*a,N=c*m-d*p,P=c*g-f*p,V=c*w-u*p,T=d*g-f*m,O=d*w-u*m,j=f*w-u*g;return v*j-y*O+x*T+b*V-k*P+C*N}function Dh(e,t,r){let n=t[0],s=t[1],i=t[2],o=t[3],a=t[4],l=t[5],c=t[6],d=t[7],f=t[8],u=t[9],p=t[10],m=t[11],g=t[12],w=t[13],v=t[14],y=t[15],x=r[0],b=r[1],k=r[2],C=r[3];return e[0]=x*n+b*a+k*f+C*g,e[1]=x*s+b*l+k*u+C*w,e[2]=x*i+b*c+k*p+C*v,e[3]=x*o+b*d+k*m+C*y,x=r[4],b=r[5],k=r[6],C=r[7],e[4]=x*n+b*a+k*f+C*g,e[5]=x*s+b*l+k*u+C*w,e[6]=x*i+b*c+k*p+C*v,e[7]=x*o+b*d+k*m+C*y,x=r[8],b=r[9],k=r[10],C=r[11],e[8]=x*n+b*a+k*f+C*g,e[9]=x*s+b*l+k*u+C*w,e[10]=x*i+b*c+k*p+C*v,e[11]=x*o+b*d+k*m+C*y,x=r[12],b=r[13],k=r[14],C=r[15],e[12]=x*n+b*a+k*f+C*g,e[13]=x*s+b*l+k*u+C*w,e[14]=x*i+b*c+k*p+C*v,e[15]=x*o+b*d+k*m+C*y,e}function DS(e,t,r){let n=r[0],s=r[1],i=r[2],o,a,l,c,d,f,u,p,m,g,w,v;return t===e?(e[12]=t[0]*n+t[4]*s+t[8]*i+t[12],e[13]=t[1]*n+t[5]*s+t[9]*i+t[13],e[14]=t[2]*n+t[6]*s+t[10]*i+t[14],e[15]=t[3]*n+t[7]*s+t[11]*i+t[15]):(o=t[0],a=t[1],l=t[2],c=t[3],d=t[4],f=t[5],u=t[6],p=t[7],m=t[8],g=t[9],w=t[10],v=t[11],e[0]=o,e[1]=a,e[2]=l,e[3]=c,e[4]=d,e[5]=f,e[6]=u,e[7]=p,e[8]=m,e[9]=g,e[10]=w,e[11]=v,e[12]=o*n+d*s+m*i+t[12],e[13]=a*n+f*s+g*i+t[13],e[14]=l*n+u*s+w*i+t[14],e[15]=c*n+p*s+v*i+t[15]),e}function RS(e,t,r){let n=r[0],s=r[1],i=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function VS(e,t,r,n){let s=n[0],i=n[1],o=n[2],a=Math.hypot(s,i,o),l,c,d,f,u,p,m,g,w,v,y,x,b,k,C,N,P,V,T,O,j,F,D,G;return Math.abs(a)<TS?null:(a=1/a,s*=a,i*=a,o*=a,l=Math.sin(r),c=Math.cos(r),d=1-c,f=t[0],u=t[1],p=t[2],m=t[3],g=t[4],w=t[5],v=t[6],y=t[7],x=t[8],b=t[9],k=t[10],C=t[11],N=s*s*d+c,P=i*s*d+o*l,V=o*s*d-i*l,T=s*i*d-o*l,O=i*i*d+c,j=o*i*d+s*l,F=s*o*d+i*l,D=i*o*d-s*l,G=o*o*d+c,e[0]=f*N+g*P+x*V,e[1]=u*N+w*P+b*V,e[2]=p*N+v*P+k*V,e[3]=m*N+y*P+C*V,e[4]=f*T+g*O+x*j,e[5]=u*T+w*O+b*j,e[6]=p*T+v*O+k*j,e[7]=m*T+y*O+C*j,e[8]=f*F+g*D+x*G,e[9]=u*F+w*D+b*G,e[10]=p*F+v*D+k*G,e[11]=m*F+y*D+C*G,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function FS(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function ry(e,t){let r=t[0],n=t[1],s=t[2],i=t[4],o=t[5],a=t[6],l=t[8],c=t[9],d=t[10];return e[0]=Math.hypot(r,n,s),e[1]=Math.hypot(i,o,a),e[2]=Math.hypot(l,c,d),e}function IS(e){let t=e[0],r=e[1],n=e[2],s=e[4],i=e[5],o=e[6],a=e[8],l=e[9],c=e[10];const d=t*t+r*r+n*n,f=s*s+i*i+o*o,u=a*a+l*l+c*c;return Math.sqrt(Math.max(d,f,u))}const ny=function(){const e=[1,1,1];return function(t,r){let n=e;ry(n,r);let s=1/n[0],i=1/n[1],o=1/n[2],a=r[0]*s,l=r[1]*i,c=r[2]*o,d=r[4]*s,f=r[5]*i,u=r[6]*o,p=r[8]*s,m=r[9]*i,g=r[10]*o,w=a+f+g,v=0;return w>0?(v=Math.sqrt(w+1)*2,t[3]=.25*v,t[0]=(u-m)/v,t[1]=(p-c)/v,t[2]=(l-d)/v):a>f&&a>g?(v=Math.sqrt(1+a-f-g)*2,t[3]=(u-m)/v,t[0]=.25*v,t[1]=(l+d)/v,t[2]=(p+c)/v):f>g?(v=Math.sqrt(1+f-a-g)*2,t[3]=(p-c)/v,t[0]=(l+d)/v,t[1]=.25*v,t[2]=(u+m)/v):(v=Math.sqrt(1+g-a-f)*2,t[3]=(l-d)/v,t[0]=(p+c)/v,t[1]=(u+m)/v,t[2]=.25*v),t}}();function zS(e,t,r,n){let s=As([e[0],e[1],e[2]]);const i=As([e[4],e[5],e[6]]),o=As([e[8],e[9],e[10]]);ty(e)<0&&(s=-s),r[0]=e[12],r[1]=e[13],r[2]=e[14];const l=e.slice(),c=1/s,d=1/i,f=1/o;l[0]*=c,l[1]*=c,l[2]*=c,l[4]*=d,l[5]*=d,l[6]*=d,l[8]*=f,l[9]*=f,l[10]*=f,ny(t,l),n[0]=s,n[1]=i,n[2]=o}function OS(e,t,r,n){const s=e,i=t[0],o=t[1],a=t[2],l=t[3],c=i+i,d=o+o,f=a+a,u=i*c,p=i*d,m=i*f,g=o*d,w=o*f,v=a*f,y=l*c,x=l*d,b=l*f,k=n[0],C=n[1],N=n[2];return s[0]=(1-(g+v))*k,s[1]=(p+b)*k,s[2]=(m-x)*k,s[3]=0,s[4]=(p-b)*C,s[5]=(1-(u+v))*C,s[6]=(w+y)*C,s[7]=0,s[8]=(m+x)*N,s[9]=(w-y)*N,s[10]=(1-(u+g))*N,s[11]=0,s[12]=r[0],s[13]=r[1],s[14]=r[2],s[15]=1,s}function $S(e,t){let r=t[0],n=t[1],s=t[2],i=t[3],o=r+r,a=n+n,l=s+s,c=r*o,d=n*o,f=n*a,u=s*o,p=s*a,m=s*l,g=i*o,w=i*a,v=i*l;return e[0]=1-f-m,e[1]=d+v,e[2]=u-w,e[3]=0,e[4]=d-v,e[5]=1-c-m,e[6]=p+g,e[7]=0,e[8]=u+w,e[9]=p-g,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function BS(e,t,r,n,s){let i=1/Math.tan(t/2),o=1/(n-s);return e[0]=i/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(s+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*s*n*o,e[15]=0,e}function US(e,t,r,n,s,i,o){let a=1/(t-r),l=1/(n-s),c=1/(i-o);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*a,e[13]=(s+n)*l,e[14]=(o+i)*c,e[15]=1,e}function WS(e,t,r,n){let s=t[0],i=t[1],o=t[2],a=n[0],l=n[1],c=n[2],d=s-r[0],f=i-r[1],u=o-r[2],p=d*d+f*f+u*u;p===0?u=1:(p=1/Math.sqrt(p),d*=p,f*=p,u*=p);let m=l*u-c*f,g=c*d-a*u,w=a*f-l*d;return p=m*m+g*g+w*w,p===0&&(c?a+=1e-6:l?c+=1e-6:l+=1e-6,m=l*u-c*f,g=c*d-a*u,w=a*f-l*d,p=m*m+g*g+w*w),p=1/Math.sqrt(p),m*=p,g*=p,w*=p,e[0]=m,e[1]=g,e[2]=w,e[3]=0,e[4]=f*w-u*g,e[5]=u*m-d*w,e[6]=d*g-f*m,e[7]=0,e[8]=d,e[9]=f,e[10]=u,e[11]=0,e[12]=s,e[13]=i,e[14]=o,e[15]=1,e}function Rh(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function Vh(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function HS(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}class Ro extends Array{constructor(t=1,r=0,n=0,s=0,i=0,o=1,a=0,l=0,c=0,d=0,f=1,u=0,p=0,m=0,g=0,w=1){return super(t,r,n,s,i,o,a,l,c,d,f,u,p,m,g,w),this}get x(){return this[12]}get y(){return this[13]}get z(){return this[14]}get w(){return this[15]}set x(t){this[12]=t}set y(t){this[13]=t}set z(t){this[14]=t}set w(t){this[15]=t}set(t,r,n,s,i,o,a,l,c,d,f,u,p,m,g,w){return t.length?this.copy(t):(AS(this,t,r,n,s,i,o,a,l,c,d,f,u,p,m,g,w),this)}translate(t,r=this){return DS(this,r,t),this}rotate(t,r,n=this){return VS(this,n,t,r),this}scale(t,r=this){return RS(this,r,typeof t=="number"?[t,t,t]:t),this}add(t,r){return r?Rh(this,t,r):Rh(this,this,t),this}sub(t,r){return r?Vh(this,t,r):Vh(this,this,t),this}multiply(t,r){return t.length?r?Dh(this,t,r):Dh(this,this,t):HS(this,this,t),this}identity(){return _S(this),this}copy(t){return MS(this,t),this}fromPerspective({fov:t,aspect:r,near:n,far:s}={}){return BS(this,t,r,n,s),this}fromOrthogonal({left:t,right:r,bottom:n,top:s,near:i,far:o}){return US(this,t,r,n,s,i,o),this}fromQuaternion(t){return $S(this,t),this}setPosition(t){return this.x=t[0],this.y=t[1],this.z=t[2],this}inverse(t=this){return LS(this,t),this}compose(t,r,n){return OS(this,t,r,n),this}decompose(t,r,n){return zS(this,t,r,n),this}getRotation(t){return ny(t,this),this}getTranslation(t){return FS(t,this),this}getScaling(t){return ry(t,this),this}getMaxScaleOnAxis(){return IS(this)}lookAt(t,r,n){return WS(this,t,r,n),this}determinant(){return ty(this)}fromArray(t,r=0){return this[0]=t[r],this[1]=t[r+1],this[2]=t[r+2],this[3]=t[r+3],this[4]=t[r+4],this[5]=t[r+5],this[6]=t[r+6],this[7]=t[r+7],this[8]=t[r+8],this[9]=t[r+9],this[10]=t[r+10],this[11]=t[r+11],this[12]=t[r+12],this[13]=t[r+13],this[14]=t[r+14],this[15]=t[r+15],this}toArray(t=[],r=0){return t[r]=this[0],t[r+1]=this[1],t[r+2]=this[2],t[r+3]=this[3],t[r+4]=this[4],t[r+5]=this[5],t[r+6]=this[6],t[r+7]=this[7],t[r+8]=this[8],t[r+9]=this[9],t[r+10]=this[10],t[r+11]=this[11],t[r+12]=this[12],t[r+13]=this[13],t[r+14]=this[14],t[r+15]=this[15],t}}function qS(e,t,r="YXZ"){return r==="XYZ"?(e[1]=Math.asin(Math.min(Math.max(t[8],-1),1)),Math.abs(t[8])<.99999?(e[0]=Math.atan2(-t[9],t[10]),e[2]=Math.atan2(-t[4],t[0])):(e[0]=Math.atan2(t[6],t[5]),e[2]=0)):r==="YXZ"?(e[0]=Math.asin(-Math.min(Math.max(t[9],-1),1)),Math.abs(t[9])<.99999?(e[1]=Math.atan2(t[8],t[10]),e[2]=Math.atan2(t[1],t[5])):(e[1]=Math.atan2(-t[2],t[0]),e[2]=0)):r==="ZXY"?(e[0]=Math.asin(Math.min(Math.max(t[6],-1),1)),Math.abs(t[6])<.99999?(e[1]=Math.atan2(-t[2],t[10]),e[2]=Math.atan2(-t[4],t[5])):(e[1]=0,e[2]=Math.atan2(t[1],t[0]))):r==="ZYX"?(e[1]=Math.asin(-Math.min(Math.max(t[2],-1),1)),Math.abs(t[2])<.99999?(e[0]=Math.atan2(t[6],t[10]),e[2]=Math.atan2(t[1],t[0])):(e[0]=0,e[2]=Math.atan2(-t[4],t[5]))):r==="YZX"?(e[2]=Math.asin(Math.min(Math.max(t[1],-1),1)),Math.abs(t[1])<.99999?(e[0]=Math.atan2(-t[9],t[5]),e[1]=Math.atan2(-t[2],t[0])):(e[0]=0,e[1]=Math.atan2(t[8],t[10]))):r==="XZY"&&(e[2]=Math.asin(-Math.min(Math.max(t[4],-1),1)),Math.abs(t[4])<.99999?(e[0]=Math.atan2(t[6],t[5]),e[1]=Math.atan2(t[8],t[0])):(e[0]=Math.atan2(-t[9],t[10]),e[1]=0)),e}const Fh=new Ro;class GS extends Array{constructor(t=0,r=t,n=t,s="YXZ"){super(t,r,n),this.order=s,this.onChange=()=>{},this._target=this;const i=["0","1","2"];return new Proxy(this,{set(o,a){const l=Reflect.set(...arguments);return l&&i.includes(a)&&o.onChange(),l}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set(t,r=t,n=t){return t.length?this.copy(t):(this._target[0]=t,this._target[1]=r,this._target[2]=n,this.onChange(),this)}copy(t){return this._target[0]=t[0],this._target[1]=t[1],this._target[2]=t[2],this.onChange(),this}reorder(t){return this._target.order=t,this.onChange(),this}fromRotationMatrix(t,r=this.order){return qS(this._target,t,r),this.onChange(),this}fromQuaternion(t,r=this.order,n){return Fh.fromQuaternion(t),this._target.fromRotationMatrix(Fh,r),n||this.onChange(),this}fromArray(t,r=0){return this._target[0]=t[r],this._target[1]=t[r+1],this._target[2]=t[r+2],this}toArray(t=[],r=0){return t[r]=this[0],t[r+1]=this[1],t[r+2]=this[2],t}}class YS{constructor(){this.parent=null,this.children=[],this.visible=!0,this.matrix=new Ro,this.worldMatrix=new Ro,this.matrixAutoUpdate=!0,this.worldMatrixNeedsUpdate=!1,this.position=new vt,this.quaternion=new ES,this.scale=new vt(1),this.rotation=new GS,this.up=new vt(0,1,0),this.rotation._target.onChange=()=>this.quaternion.fromEuler(this.rotation,!0),this.quaternion._target.onChange=()=>this.rotation.fromQuaternion(this.quaternion,void 0,!0)}setParent(t,r=!0){this.parent&&t!==this.parent&&this.parent.removeChild(this,!1),this.parent=t,r&&t&&t.addChild(this,!1)}addChild(t,r=!0){~this.children.indexOf(t)||this.children.push(t),r&&t.setParent(this,!1)}removeChild(t,r=!0){~this.children.indexOf(t)&&this.children.splice(this.children.indexOf(t),1),r&&t.setParent(null,!1)}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.worldMatrixNeedsUpdate||t)&&(this.parent===null?this.worldMatrix.copy(this.matrix):this.worldMatrix.multiply(this.parent.worldMatrix,this.matrix),this.worldMatrixNeedsUpdate=!1,t=!0);for(let r=0,n=this.children.length;r<n;r++)this.children[r].updateMatrixWorld(t)}updateMatrix(){this.matrix.compose(this.quaternion,this.position,this.scale),this.worldMatrixNeedsUpdate=!0}traverse(t){if(!t(this))for(let r=0,n=this.children.length;r<n;r++)this.children[r].traverse(t)}decompose(){this.matrix.decompose(this.quaternion._target,this.position,this.scale),this.rotation.fromQuaternion(this.quaternion)}lookAt(t,r=!1){r?this.matrix.lookAt(this.position,t,this.up):this.matrix.lookAt(t,this.position,this.up),this.matrix.getRotation(this.quaternion._target),this.rotation.fromQuaternion(this.quaternion)}}function KS(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function XS(e,t){let r=t[0],n=t[1],s=t[2],i=t[3],o=r+r,a=n+n,l=s+s,c=r*o,d=n*o,f=n*a,u=s*o,p=s*a,m=s*l,g=i*o,w=i*a,v=i*l;return e[0]=1-f-m,e[3]=d-v,e[6]=u+w,e[1]=d+v,e[4]=1-c-m,e[7]=p-g,e[2]=u-w,e[5]=p+g,e[8]=1-c-f,e}function QS(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function ZS(e,t,r,n,s,i,o,a,l,c){return e[0]=t,e[1]=r,e[2]=n,e[3]=s,e[4]=i,e[5]=o,e[6]=a,e[7]=l,e[8]=c,e}function JS(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function ek(e,t){let r=t[0],n=t[1],s=t[2],i=t[3],o=t[4],a=t[5],l=t[6],c=t[7],d=t[8],f=d*o-a*c,u=-d*i+a*l,p=c*i-o*l,m=r*f+n*u+s*p;return m?(m=1/m,e[0]=f*m,e[1]=(-d*n+s*c)*m,e[2]=(a*n-s*o)*m,e[3]=u*m,e[4]=(d*r-s*l)*m,e[5]=(-a*r+s*i)*m,e[6]=p*m,e[7]=(-c*r+n*l)*m,e[8]=(o*r-n*i)*m,e):null}function Ih(e,t,r){let n=t[0],s=t[1],i=t[2],o=t[3],a=t[4],l=t[5],c=t[6],d=t[7],f=t[8],u=r[0],p=r[1],m=r[2],g=r[3],w=r[4],v=r[5],y=r[6],x=r[7],b=r[8];return e[0]=u*n+p*o+m*c,e[1]=u*s+p*a+m*d,e[2]=u*i+p*l+m*f,e[3]=g*n+w*o+v*c,e[4]=g*s+w*a+v*d,e[5]=g*i+w*l+v*f,e[6]=y*n+x*o+b*c,e[7]=y*s+x*a+b*d,e[8]=y*i+x*l+b*f,e}function tk(e,t,r){let n=t[0],s=t[1],i=t[2],o=t[3],a=t[4],l=t[5],c=t[6],d=t[7],f=t[8],u=r[0],p=r[1];return e[0]=n,e[1]=s,e[2]=i,e[3]=o,e[4]=a,e[5]=l,e[6]=u*n+p*o+c,e[7]=u*s+p*a+d,e[8]=u*i+p*l+f,e}function rk(e,t,r){let n=t[0],s=t[1],i=t[2],o=t[3],a=t[4],l=t[5],c=t[6],d=t[7],f=t[8],u=Math.sin(r),p=Math.cos(r);return e[0]=p*n+u*o,e[1]=p*s+u*a,e[2]=p*i+u*l,e[3]=p*o-u*n,e[4]=p*a-u*s,e[5]=p*l-u*i,e[6]=c,e[7]=d,e[8]=f,e}function nk(e,t,r){let n=r[0],s=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=s*t[3],e[4]=s*t[4],e[5]=s*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function sk(e,t){let r=t[0],n=t[1],s=t[2],i=t[3],o=t[4],a=t[5],l=t[6],c=t[7],d=t[8],f=t[9],u=t[10],p=t[11],m=t[12],g=t[13],w=t[14],v=t[15],y=r*a-n*o,x=r*l-s*o,b=r*c-i*o,k=n*l-s*a,C=n*c-i*a,N=s*c-i*l,P=d*g-f*m,V=d*w-u*m,T=d*v-p*m,O=f*w-u*g,j=f*v-p*g,F=u*v-p*w,D=y*F-x*j+b*O+k*T-C*V+N*P;return D?(D=1/D,e[0]=(a*F-l*j+c*O)*D,e[1]=(l*T-o*F-c*V)*D,e[2]=(o*j-a*T+c*P)*D,e[3]=(s*j-n*F-i*O)*D,e[4]=(r*F-s*T+i*V)*D,e[5]=(n*T-r*j-i*P)*D,e[6]=(g*N-w*C+v*k)*D,e[7]=(w*b-m*N-v*x)*D,e[8]=(m*C-g*b+v*y)*D,e):null}class ik extends Array{constructor(t=1,r=0,n=0,s=0,i=1,o=0,a=0,l=0,c=1){return super(t,r,n,s,i,o,a,l,c),this}set(t,r,n,s,i,o,a,l,c){return t.length?this.copy(t):(ZS(this,t,r,n,s,i,o,a,l,c),this)}translate(t,r=this){return tk(this,r,t),this}rotate(t,r=this){return rk(this,r,t),this}scale(t,r=this){return nk(this,r,t),this}multiply(t,r){return r?Ih(this,t,r):Ih(this,this,t),this}identity(){return JS(this),this}copy(t){return QS(this,t),this}fromMatrix4(t){return KS(this,t),this}fromQuaternion(t){return XS(this,t),this}fromBasis(t,r,n){return this.set(t[0],t[1],t[2],r[0],r[1],r[2],n[0],n[1],n[2]),this}inverse(t=this){return ek(this,t),this}getNormalMatrix(t){return sk(this,t),this}}let ok=0;class ak extends YS{constructor(t,{geometry:r,program:n,mode:s=t.TRIANGLES,frustumCulled:i=!0,renderOrder:o=0}={}){super(),t.canvas||console.error("gl not passed as first argument to Mesh"),this.gl=t,this.id=ok++,this.geometry=r,this.program=n,this.mode=s,this.frustumCulled=i,this.renderOrder=o,this.modelViewMatrix=new Ro,this.normalMatrix=new ik,this.beforeRenderCallbacks=[],this.afterRenderCallbacks=[]}onBeforeRender(t){return this.beforeRenderCallbacks.push(t),this}onAfterRender(t){return this.afterRenderCallbacks.push(t),this}draw({camera:t}={}){t&&(this.program.uniforms.modelMatrix||Object.assign(this.program.uniforms,{modelMatrix:{value:null},viewMatrix:{value:null},modelViewMatrix:{value:null},normalMatrix:{value:null},projectionMatrix:{value:null},cameraPosition:{value:null}}),this.program.uniforms.projectionMatrix.value=t.projectionMatrix,this.program.uniforms.cameraPosition.value=t.worldPosition,this.program.uniforms.viewMatrix.value=t.viewMatrix,this.modelViewMatrix.multiply(t.viewMatrix,this.worldMatrix),this.normalMatrix.getNormalMatrix(this.modelViewMatrix),this.program.uniforms.modelMatrix.value=this.worldMatrix,this.program.uniforms.modelViewMatrix.value=this.modelViewMatrix,this.program.uniforms.normalMatrix.value=this.normalMatrix),this.beforeRenderCallbacks.forEach(n=>n&&n({mesh:this,camera:t}));let r=this.program.cullFace&&this.worldMatrix.determinant()<0;this.program.use({flipFaces:r}),this.geometry.draw({mode:this.mode,program:this.program}),this.afterRenderCallbacks.forEach(n=>n&&n({mesh:this,camera:t}))}}function lk(e,t){return e[0]=t[0],e[1]=t[1],e}function uk(e,t,r){return e[0]=t,e[1]=r,e}function zh(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}function Oh(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function ck(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e}function dk(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e}function nl(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function fk(e,t){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function hk(e,t){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function $h(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)}function pk(e){var t=e[0],r=e[1];return t*t+r*r}function mk(e,t){return e[0]=-t[0],e[1]=-t[1],e}function gk(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function yk(e,t){var r=t[0],n=t[1],s=r*r+n*n;return s>0&&(s=1/Math.sqrt(s)),e[0]=t[0]*s,e[1]=t[1]*s,e}function vk(e,t){return e[0]*t[0]+e[1]*t[1]}function Bh(e,t){return e[0]*t[1]-e[1]*t[0]}function xk(e,t,r,n){var s=t[0],i=t[1];return e[0]=s+n*(r[0]-s),e[1]=i+n*(r[1]-i),e}function wk(e,t,r,n,s){const i=Math.exp(-n*s);let o=t[0],a=t[1];return e[0]=r[0]+(o-r[0])*i,e[1]=r[1]+(a-r[1])*i,e}function bk(e,t,r){var n=t[0],s=t[1];return e[0]=r[0]*n+r[3]*s+r[6],e[1]=r[1]*n+r[4]*s+r[7],e}function Sk(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[4]*s+r[12],e[1]=r[1]*n+r[5]*s+r[13],e}function kk(e,t){return e[0]===t[0]&&e[1]===t[1]}class Bc extends Array{constructor(t=0,r=t){return super(t,r),this}get x(){return this[0]}get y(){return this[1]}set x(t){this[0]=t}set y(t){this[1]=t}set(t,r=t){return t.length?this.copy(t):(uk(this,t,r),this)}copy(t){return lk(this,t),this}add(t,r){return r?zh(this,t,r):zh(this,this,t),this}sub(t,r){return r?Oh(this,t,r):Oh(this,this,t),this}multiply(t){return t.length?ck(this,this,t):nl(this,this,t),this}divide(t){return t.length?dk(this,this,t):nl(this,this,1/t),this}inverse(t=this){return gk(this,t),this}len(){return $h(this)}distance(t){return t?fk(this,t):$h(this)}squaredLen(){return this.squaredDistance()}squaredDistance(t){return t?hk(this,t):pk(this)}negate(t=this){return mk(this,t),this}cross(t,r){return r?Bh(t,r):Bh(this,t)}scale(t){return nl(this,this,t),this}normalize(){return yk(this,this),this}dot(t){return vk(this,t)}equals(t){return kk(this,t)}applyMatrix3(t){return bk(this,this,t),this}applyMatrix4(t){return Sk(this,this,t),this}lerp(t,r){return xk(this,this,t,r),this}smoothLerp(t,r,n){return wk(this,this,t,r,n),this}clone(){return new Bc(this[0],this[1])}fromArray(t,r=0){return this[0]=t[r],this[1]=t[r+1],this}toArray(t=[],r=0){return t[r]=this[0],t[r+1]=this[1],t}}class jk extends rS{constructor(t,{attributes:r={}}={}){Object.assign(r,{position:{size:2,data:new Float32Array([-1,-1,3,-1,-1,3])},uv:{size:2,data:new Float32Array([0,0,2,0,0,2])}}),super(t,r)}}const Ck=`
attribute vec2 position;
void main(){gl_Position=vec4(position,0.0,1.0);}
`,Nk=`
#ifdef GL_ES
precision lowp float;
#endif
uniform vec2 uResolution;
uniform float uTime;
uniform float uHueShift;
uniform float uNoise;
uniform float uScan;
uniform float uScanFreq;
uniform float uWarp;
#define iTime uTime
#define iResolution uResolution
vec4 buf[8];
float rand(vec2 c){return fract(sin(dot(c,vec2(12.9898,78.233)))*43758.5453);}
mat3 rgb2yiq=mat3(0.299,0.587,0.114,0.596,-0.274,-0.322,0.211,-0.523,0.312);
mat3 yiq2rgb=mat3(1.0,0.956,0.621,1.0,-0.272,-0.647,1.0,-1.106,1.703);
vec3 hueShiftRGB(vec3 col,float deg){
vec3 yiq=rgb2yiq*col;
float rad=radians(deg);
float cosh=cos(rad),sinh=sin(rad);
vec3 yiqShift=vec3(yiq.x,yiq.y*cosh-yiq.z*sinh,yiq.y*sinh+yiq.z*cosh);
return clamp(yiq2rgb*yiqShift,0.0,1.0);
}
vec4 sigmoid(vec4 x){return 1./(1.+exp(-x));}
vec4 cppn_fn(vec2 coordinate,float in0,float in1,float in2){
buf[6]=vec4(coordinate.x,coordinate.y,0.3948333106474662+in0,0.36+in1);
buf[7]=vec4(0.14+in2,sqrt(coordinate.x*coordinate.x+coordinate.y*coordinate.y),0.,0.);
buf[0]=mat4(vec4(6.5404263,-3.6126034,0.7590882,-1.13613),vec4(2.4582713,3.1660357,1.2219609,0.06276096),vec4(-5.478085,-6.159632,1.8701609,-4.7742867),vec4(6.039214,-5.542865,-0.90925294,3.251348))*buf[6]+mat4(vec4(0.8473259,-5.722911,3.975766,1.6522468),vec4(-0.24321538,0.5839259,-1.7661959,-5.350116),vec4(0.,0.,0.,0.),vec4(0.,0.,0.,0.))*buf[7]+vec4(0.21808943,1.1243913,-1.7969975,5.0294676);
buf[1]=mat4(vec4(-3.3522482,-6.0612736,0.55641043,-4.4719114),vec4(0.8631464,1.7432913,5.643898,1.6106541),vec4(2.4941394,-3.5012043,1.7184316,6.357333),vec4(3.310376,8.209261,1.1355612,-1.165539))*buf[6]+mat4(vec4(5.24046,-13.034365,0.009859298,15.870829),vec4(2.987511,3.129433,-0.89023495,-1.6822904),vec4(0.,0.,0.,0.),vec4(0.,0.,0.,0.))*buf[7]+vec4(-5.9457836,-6.573602,-0.8812491,1.5436668);
buf[0]=sigmoid(buf[0]);buf[1]=sigmoid(buf[1]);
buf[2]=mat4(vec4(-15.219568,8.095543,-2.429353,-1.9381982),vec4(-5.951362,4.3115187,2.6393783,1.274315),vec4(-7.3145227,6.7297835,5.2473326,5.9411426),vec4(5.0796127,8.979051,-1.7278991,-1.158976))*buf[6]+mat4(vec4(-11.967154,-11.608155,6.1486754,11.237008),vec4(2.124141,-6.263192,-1.7050359,-0.7021966),vec4(0.,0.,0.,0.),vec4(0.,0.,0.,0.))*buf[7]+vec4(-4.17164,-3.2281182,-4.576417,-3.6401186);
buf[3]=mat4(vec4(3.1832156,-13.738922,1.879223,3.233465),vec4(0.64300746,12.768129,1.9141049,0.50990224),vec4(-0.049295485,4.4807224,1.4733979,1.801449),vec4(5.0039253,13.000481,3.3991797,-4.5561905))*buf[6]+mat4(vec4(-0.1285731,7.720628,-3.1425676,4.742367),vec4(0.6393625,3.714393,-0.8108378,-0.39174938),vec4(0.,0.,0.,0.),vec4(0.,0.,0.,0.))*buf[7]+vec4(-1.1811101,-21.621881,0.7851888,1.2329718);
buf[2]=sigmoid(buf[2]);buf[3]=sigmoid(buf[3]);
buf[4]=mat4(vec4(5.214916,-7.183024,2.7228765,2.6592617),vec4(-5.601878,-25.3591,4.067988,0.4602802),vec4(-10.57759,24.286327,21.102104,37.546658),vec4(4.3024497,-1.9625226,2.3458803,-1.372816))*buf[0]+mat4(vec4(-17.6526,-10.507558,2.2587414,12.462782),vec4(6.265566,-502.75443,-12.642513,0.9112289),vec4(-10.983244,20.741234,-9.701768,-0.7635988),vec4(5.383626,1.4819539,-4.1911616,-4.8444734))*buf[1]+mat4(vec4(12.785233,-16.345072,-0.39901125,1.7955981),vec4(-30.48365,-1.8345358,1.4542528,-1.1118771),vec4(19.872723,-7.337935,-42.941723,-98.52709),vec4(8.337645,-2.7312303,-2.2927687,-36.142323))*buf[2]+mat4(vec4(-16.298317,3.5471997,-0.44300047,-9.444417),vec4(57.5077,-35.609753,16.163465,-4.1534753),vec4(-0.07470326,-3.8656476,-7.0901804,3.1523974),vec4(-12.559385,-7.077619,1.490437,-0.8211543))*buf[3]+vec4(-7.67914,15.927437,1.3207729,-1.6686112);
buf[5]=mat4(vec4(-1.4109162,-0.372762,-3.770383,-21.367174),vec4(-6.2103205,-9.35908,0.92529047,8.82561),vec4(11.460242,-22.348068,13.625772,-18.693201),vec4(-0.3429052,-3.9905605,-2.4626114,-0.45033523))*buf[0]+mat4(vec4(7.3481627,-4.3661838,-6.3037653,-3.868115),vec4(1.5462853,6.5488915,1.9701879,-0.58291394),vec4(6.5858274,-2.2180402,3.7127688,-1.3730392),vec4(-5.7973905,10.134961,-2.3395722,-5.965605))*buf[1]+mat4(vec4(-2.5132585,-6.6685553,-1.4029363,-0.16285264),vec4(-0.37908727,0.53738135,4.389061,-1.3024765),vec4(-0.70647055,2.0111287,-5.1659346,-3.728635),vec4(-13.562562,10.487719,-0.9173751,-2.6487076))*buf[2]+mat4(vec4(-8.645013,6.5546675,-6.3944063,-5.5933375),vec4(-0.57783127,-1.077275,36.91025,5.736769),vec4(14.283112,3.7146652,7.1452246,-4.5958776),vec4(2.7192075,3.6021907,-4.366337,-2.3653464))*buf[3]+vec4(-5.9000807,-4.329569,1.2427121,8.59503);
buf[4]=sigmoid(buf[4]);buf[5]=sigmoid(buf[5]);
buf[6]=mat4(vec4(-1.61102,0.7970257,1.4675229,0.20917463),vec4(-28.793737,-7.1390953,1.5025433,4.656581),vec4(-10.94861,39.66238,0.74318546,-10.095605),vec4(-0.7229728,-1.5483948,0.7301322,2.1687684))*buf[0]+mat4(vec4(3.2547753,21.489103,-1.0194173,-3.3100595),vec4(-3.7316632,-3.3792162,-7.223193,-0.23685838),vec4(13.1804495,0.7916005,5.338587,5.687114),vec4(-4.167605,-17.798311,-6.815736,-1.6451967))*buf[1]+mat4(vec4(0.604885,-7.800309,-7.213122,-2.741014),vec4(-3.522382,-0.12359311,-0.5258442,0.43852118),vec4(9.6752825,-22.853785,2.062431,0.099892326),vec4(-4.3196306,-17.730087,2.5184598,5.30267))*buf[2]+mat4(vec4(-6.545563,-15.790176,-6.0438633,-5.415399),vec4(-43.591583,28.551912,-16.00161,18.84728),vec4(4.212382,8.394307,3.0958717,8.657522),vec4(-5.0237565,-4.450633,-4.4768,-5.5010443))*buf[3]+mat4(vec4(1.6985557,-67.05806,6.897715,1.9004834),vec4(1.8680354,2.3915145,2.5231109,4.081538),vec4(11.158006,1.7294737,2.0738268,7.386411),vec4(-4.256034,-306.24686,8.258898,-17.132736))*buf[4]+mat4(vec4(1.6889864,-4.5852966,3.8534803,-6.3482175),vec4(1.3543309,-1.2640043,9.932754,2.9079645),vec4(-5.2770967,0.07150358,-0.13962056,3.3269649),vec4(28.34703,-4.918278,6.1044083,4.085355))*buf[5]+vec4(6.6818056,12.522166,-3.7075126,-4.104386);
buf[7]=mat4(vec4(-8.265602,-4.7027016,5.098234,0.7509808),vec4(8.6507845,-17.15949,16.51939,-8.884479),vec4(-4.036479,-2.3946867,-2.6055532,-1.9866527),vec4(-2.2167742,-1.8135649,-5.9759874,4.8846445))*buf[0]+mat4(vec4(6.7790847,3.5076547,-2.8191125,-2.7028968),vec4(-5.743024,-0.27844876,1.4958696,-5.0517144),vec4(13.122226,15.735168,-2.9397483,-4.101023),vec4(-14.375265,-5.030483,-6.2599335,2.9848232))*buf[1]+mat4(vec4(4.0950394,-0.94011575,-5.674733,4.755022),vec4(4.3809423,4.8310084,1.7425908,-3.437416),vec4(2.117492,0.16342592,-104.56341,16.949184),vec4(-5.22543,-2.994248,3.8350096,-1.9364246))*buf[2]+mat4(vec4(-5.900337,1.7946124,-13.604192,-3.8060522),vec4(6.6583457,31.911177,25.164474,91.81147),vec4(11.840538,4.1503043,-0.7314397,6.768467),vec4(-6.3967767,4.034772,6.1714606,-0.32874924))*buf[3]+mat4(vec4(3.4992442,-196.91893,-8.923708,2.8142626),vec4(3.4806502,-3.1846354,5.1725626,5.1804223),vec4(-2.4009497,15.585794,1.2863957,2.0252278),vec4(-71.25271,-62.441242,-8.138444,0.50670296))*buf[4]+mat4(vec4(-12.291733,-11.176166,-7.3474145,4.390294),vec4(10.805477,5.6337385,-0.9385842,-4.7348723),vec4(-12.869276,-7.039391,5.3029537,7.5436664),vec4(1.4593618,8.91898,3.5101583,5.840625))*buf[5]+vec4(2.2415268,-6.705987,-0.98861027,-2.117676);
buf[6]=sigmoid(buf[6]);buf[7]=sigmoid(buf[7]);
buf[0]=mat4(vec4(1.6794263,1.3817469,2.9625452,0.),vec4(-1.8834411,-1.4806935,-3.5924516,0.),vec4(-1.3279216,-1.0918057,-2.3124623,0.),vec4(0.2662234,0.23235129,0.44178495,0.))*buf[0]+mat4(vec4(-0.6299101,-0.5945583,-0.9125601,0.),vec4(0.17828953,0.18300213,0.18182953,0.),vec4(-2.96544,-2.5819945,-4.9001055,0.),vec4(1.4195864,1.1868085,2.5176322,0.))*buf[1]+mat4(vec4(-1.2584374,-1.0552157,-2.1688404,0.),vec4(-0.7200217,-0.52666044,-1.438251,0.),vec4(0.15345335,0.15196142,0.272854,0.),vec4(0.945728,0.8861938,1.2766753,0.))*buf[2]+mat4(vec4(-2.4218085,-1.968602,-4.35166,0.),vec4(-22.683098,-18.0544,-41.954372,0.),vec4(0.63792,0.5470648,1.1078634,0.),vec4(-1.5489894,-1.3075932,-2.6444845,0.))*buf[3]+mat4(vec4(-0.49252132,-0.39877754,-0.91366625,0.),vec4(0.95609266,0.7923952,1.640221,0.),vec4(0.30616966,0.15693925,0.8639857,0.),vec4(1.1825981,0.94504964,2.176963,0.))*buf[4]+mat4(vec4(0.35446745,0.3293795,0.59547555,0.),vec4(-0.58784515,-0.48177817,-1.0614829,0.),vec4(2.5271258,1.9991658,4.6846647,0.),vec4(0.13042648,0.08864098,0.30187556,0.))*buf[5]+mat4(vec4(-1.7718065,-1.4033192,-3.3355875,0.),vec4(3.1664357,2.638297,5.378702,0.),vec4(-3.1724713,-2.6107926,-5.549295,0.),vec4(-2.851368,-2.249092,-5.3013067,0.))*buf[6]+mat4(vec4(1.5203838,1.2212278,2.8404984,0.),vec4(1.5210563,1.2651345,2.683903,0.),vec4(2.9789467,2.4364579,5.2347264,0.),vec4(2.2270417,1.8825914,3.8028636,0.))*buf[7]+vec4(-1.5468478,-3.6171484,0.24762098,0.);
buf[0]=sigmoid(buf[0]);
return vec4(buf[0].x,buf[0].y,buf[0].z,1.);
}
void mainImage(out vec4 fragColor,in vec2 fragCoord){
vec2 uv=fragCoord/uResolution.xy*2.-1.;
uv.y*=-1.;
uv+=uWarp*vec2(sin(uv.y*6.283+uTime*0.5),cos(uv.x*6.283+uTime*0.5))*0.05;
fragColor=cppn_fn(uv,0.1*sin(0.3*uTime),0.1*sin(0.69*uTime),0.1*sin(0.44*uTime));
}
void main(){
vec4 col;mainImage(col,gl_FragCoord.xy);
col.rgb=hueShiftRGB(col.rgb,uHueShift);
float scanline_val=sin(gl_FragCoord.y*uScanFreq)*0.5+0.5;
col.rgb*=1.-(scanline_val*scanline_val)*uScan;
col.rgb+=(rand(gl_FragCoord.xy+uTime)-0.5)*uNoise;
gl_FragColor=vec4(clamp(col.rgb,0.0,1.0),1.0);
}
`;class Pk extends S.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("ErrorBoundary caught an error:",t,r)}render(){return this.state.hasError?this.props.fallback||h.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",background:"radial-gradient(circle at center, rgba(0,0,0,0.8) 0%, rgba(0,0,0,1) 100%)",zIndex:-1,pointerEvents:"none"}}):this.props.children}}function Ek({hueShift:e=60,noiseIntensity:t=.03,scanlineIntensity:r=.08,speed:n=.4,scanlineFrequency:s=.6,warpAmount:i=.15,resolutionScale:o=1}){const a=S.useRef(null);return S.useEffect(()=>{const l=a.current;if(!l){console.error("DarkVeil: Canvas not found");return}let c,d,f;try{c=new uS({dpr:Math.min(window.devicePixelRatio,2),canvas:l});const w=c.gl;if(!w){console.error("DarkVeil: WebGL context not available");return}const v=new jk(w);d=new sS(w,{vertex:Ck,fragment:Nk,uniforms:{uTime:{value:0},uResolution:{value:new Bc},uHueShift:{value:e},uNoise:{value:t},uScan:{value:r},uScanFreq:{value:s},uWarp:{value:i}}}),f=new ak(w,{geometry:v,program:d}),console.log("DarkVeil: Successfully initialized")}catch(w){console.error("DarkVeil: Initialization error:",w);return}const u=()=>{const w=window.innerWidth,v=window.innerHeight;c.setSize(w*o,v*o),d.uniforms.uResolution.value.set(w,v)};window.addEventListener("resize",u),u();const p=performance.now();let m=0;const g=()=>{d.uniforms.uTime.value=(performance.now()-p)/1e3*n,d.uniforms.uHueShift.value=e,d.uniforms.uNoise.value=t,d.uniforms.uScan.value=r,d.uniforms.uScanFreq.value=s,d.uniforms.uWarp.value=i,c.render({scene:f}),m=requestAnimationFrame(g)};return g(),()=>{cancelAnimationFrame(m),window.removeEventListener("resize",u)}},[e,t,r,n,s,i,o]),h.jsxs(h.Fragment,{children:[h.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"radial-gradient(circle at center, rgba(50,20,80,0.8) 0%, rgba(20,10,40,0.9) 50%, rgba(0,0,0,1) 100%)",zIndex:-10,pointerEvents:"none"}}),h.jsx("canvas",{ref:a,style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:-5,pointerEvents:"none",display:"block"}})]})}function _s(e){return h.jsx(Pk,{children:h.jsx(Ek,{...e})})}/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Tk={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Mk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Z=(e,t)=>{const r=S.forwardRef(({color:n="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:a="",children:l,...c},d)=>S.createElement("svg",{ref:d,...Tk,width:s,height:s,stroke:n,strokeWidth:o?Number(i)*24/Number(s):i,className:["lucide",`lucide-${Mk(e)}`,a].join(" "),...c},[...t.map(([f,u])=>S.createElement(f,u)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ak=Z("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _k=Z("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Lk=Z("Award",[["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}],["path",{d:"M15.477 12.89 17 22l-5-3-5 3 1.523-9.11",key:"em7aur"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sy=Z("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Dk=Z("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Rk=Z("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vk=Z("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Fk=Z("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Un=Z("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const iy=Z("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const et=Z("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ik=Z("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Uh=Z("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zk=Z("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ok=Z("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ke=Z("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $k=Z("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const oy=Z("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wh=Z("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Uc=Z("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hh=Z("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Nr=Z("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ay=Z("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Bk=Z("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ly=Z("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uy=Z("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ls=Z("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wc=Z("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Uk=Z("Volume2",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wk=Z("Wand2",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72Z",key:"1bcowg"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hk=Z("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qh=Z("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
* @license lucide-react v0.294.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qk=Z("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);function cy(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=cy(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Gk(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=cy(e))&&(n&&(n+=" "),n+=t);return n}const Hc="-",Yk=e=>{const t=Xk(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const a=o.split(Hc);return a[0]===""&&a.length!==1&&a.shift(),dy(a,t)||Kk(o)},getConflictingClassGroupIds:(o,a)=>{const l=r[o]||[];return a&&n[o]?[...l,...n[o]]:l}}},dy=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?dy(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Hc);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Gh=/^\[(.+)\]$/,Kk=e=>{if(Gh.test(e)){const t=Gh.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Xk=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Zk(Object.entries(e.classGroups),r).forEach(([i,o])=>{xu(o,n,i,t)}),n},xu=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Yh(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(Qk(s)){xu(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{xu(o,Yh(t,i),r,n)})})},Yh=(e,t)=>{let r=e;return t.split(Hc).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Qk=e=>e.isThemeGetter,Zk=(e,t)=>t?e.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[r,s]}):e,Jk=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}},fy="!",ej=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],i=t.length,o=a=>{const l=[];let c=0,d=0,f;for(let w=0;w<a.length;w++){let v=a[w];if(c===0){if(v===s&&(n||a.slice(w,w+i)===t)){l.push(a.slice(d,w)),d=w+i;continue}if(v==="/"){f=w;continue}}v==="["?c++:v==="]"&&c--}const u=l.length===0?a:a.substring(d),p=u.startsWith(fy),m=p?u.substring(1):u,g=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return r?a=>r({className:a,parseClassName:o}):o},tj=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},rj=e=>({cache:Jk(e.cacheSize),parseClassName:ej(e),...Yk(e)}),nj=/\s+/,sj=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(nj);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:d,hasImportantModifier:f,baseClassName:u,maybePostfixModifierPosition:p}=r(c);let m=!!p,g=n(m?u.substring(0,p):u);if(!g){if(!m){a=c+(a.length>0?" "+a:a);continue}if(g=n(u),!g){a=c+(a.length>0?" "+a:a);continue}m=!1}const w=tj(d).join(":"),v=f?w+fy:w,y=v+g;if(i.includes(y))continue;i.push(y);const x=s(g,m);for(let b=0;b<x.length;++b){const k=x[b];i.push(v+k)}a=c+(a.length>0?" "+a:a)}return a};function ij(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=hy(t))&&(n&&(n+=" "),n+=r);return n}const hy=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=hy(e[n]))&&(r&&(r+=" "),r+=t);return r};function oj(e,...t){let r,n,s,i=o;function o(l){const c=t.reduce((d,f)=>f(d),e());return r=rj(c),n=r.cache.get,s=r.cache.set,i=a,a(l)}function a(l){const c=n(l);if(c)return c;const d=sj(l,r);return s(l,d),d}return function(){return i(ij.apply(null,arguments))}}const se=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},py=/^\[(?:([a-z-]+):)?(.+)\]$/i,aj=/^\d+\/\d+$/,lj=new Set(["px","full","screen"]),uj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,fj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rt=e=>An(e)||lj.has(e)||aj.test(e),er=e=>Xn(e,"length",bj),An=e=>!!e&&!Number.isNaN(Number(e)),sl=e=>Xn(e,"number",An),cs=e=>!!e&&Number.isInteger(Number(e)),pj=e=>e.endsWith("%")&&An(e.slice(0,-1)),Y=e=>py.test(e),tr=e=>uj.test(e),mj=new Set(["length","size","percentage"]),gj=e=>Xn(e,mj,my),yj=e=>Xn(e,"position",my),vj=new Set(["image","url"]),xj=e=>Xn(e,vj,kj),wj=e=>Xn(e,"",Sj),ds=()=>!0,Xn=(e,t,r)=>{const n=py.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},bj=e=>cj.test(e)&&!dj.test(e),my=()=>!1,Sj=e=>fj.test(e),kj=e=>hj.test(e),jj=()=>{const e=se("colors"),t=se("spacing"),r=se("blur"),n=se("brightness"),s=se("borderColor"),i=se("borderRadius"),o=se("borderSpacing"),a=se("borderWidth"),l=se("contrast"),c=se("grayscale"),d=se("hueRotate"),f=se("invert"),u=se("gap"),p=se("gradientColorStops"),m=se("gradientColorStopPositions"),g=se("inset"),w=se("margin"),v=se("opacity"),y=se("padding"),x=se("saturate"),b=se("scale"),k=se("sepia"),C=se("skew"),N=se("space"),P=se("translate"),V=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",Y,t],j=()=>[Y,t],F=()=>["",Rt,er],D=()=>["auto",An,Y],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",Y],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>[An,Y];return{cacheSize:500,separator:":",theme:{colors:[ds],spacing:[Rt,er],blur:["none","",tr,Y],brightness:R(),borderColor:[e],borderRadius:["none","","full",tr,Y],borderSpacing:j(),borderWidth:F(),contrast:R(),grayscale:A(),hueRotate:R(),invert:A(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[pj,er],inset:O(),margin:O(),opacity:R(),padding:j(),saturate:R(),scale:R(),sepia:A(),skew:R(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",Y]}],container:["container"],columns:[{columns:[tr]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...G(),Y]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",cs,Y]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Y]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",cs,Y]}],"grid-cols":[{"grid-cols":[ds]}],"col-start-end":[{col:["auto",{span:["full",cs,Y]},Y]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[ds]}],"row-start-end":[{row:["auto",{span:[cs,Y]},Y]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Y]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Y,t]}],"min-w":[{"min-w":[Y,t,"min","max","fit"]}],"max-w":[{"max-w":[Y,t,"none","full","min","max","fit","prose",{screen:[tr]},tr]}],h:[{h:[Y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",tr,er]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",sl]}],"font-family":[{font:[ds]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Y]}],"line-clamp":[{"line-clamp":["none",An,sl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Rt,Y]}],"list-image":[{"list-image":["none",Y]}],"list-style-type":[{list:["none","disc","decimal",Y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Rt,er]}],"underline-offset":[{"underline-offset":["auto",Rt,Y]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),yj]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gj]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xj]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:M()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[Rt,Y]}],"outline-w":[{outline:[Rt,er]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Rt,er]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",tr,wj]}],"shadow-color":[{shadow:[ds]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",tr,Y]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[x]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Y]}],duration:[{duration:R()}],ease:[{ease:["linear","in","out","in-out",Y]}],delay:[{delay:R()}],animate:[{animate:["none","spin","ping","pulse","bounce",Y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[cs,Y]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Y]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Rt,er,sl]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Cj=oj(jj);function Kh(...e){return Cj(Gk(e))}function Ds(e){const t=Math.floor(e/6e4),r=Math.floor(e%6e4/1e3);return`${t}:${r.toString().padStart(2,"0")}`}function _n(e){const t=new Date(e),n=(new Date().getTime()-t.getTime())/(1e3*60*60);return n<1?`${Math.floor(n*60)}m ago`:n<24?`${Math.floor(n)}h ago`:`${Math.floor(n/24)}d ago`}const Nj=()=>{var j,F,D,G,M,W,_,A,I,R;const[e,t]=S.useState(!1),[r,n]=S.useState(!1),[s,i]=S.useState({x:0,y:0}),[o,a]=S.useState(!1),[l,c]=S.useState({x:0,y:0}),{currentUser:d,partnerUser:f,logout:u,theme:p,setTheme:m,setPartnerUser:g}=oe(),[w,v]=S.useState(""),[y,x]=S.useState(!1),[b,k]=S.useState(!1),C=_r(),N=[{name:"Dashboard",href:"/",icon:et},{name:"Last Listened",href:"/last-listened",icon:Ke},{name:"Mixed Playlist",href:"/mixed-playlist",icon:oy},{name:"Memory Lane",href:"/memory-lane",icon:Nr},{name:"Wrapped",href:"/wrapped",icon:Lk}],P=()=>{u(),localStorage.removeItem("spotify-user"),localStorage.removeItem("spotify-partner")},V=async()=>{var E,H;if(!(!((E=d==null?void 0:d.user)!=null&&E.id)||!((H=f==null?void 0:f.user)!=null&&H.id))&&confirm(`Are you sure you want to remove ${f.user.display_name} as your partner?`)){k(!0);try{await Et("/partners/remove",{partnerId:f.user.id})}catch(X){try{await Et("/partners/clear",{userId:d.user.id})}catch(ee){console.error("Failed to remove partner:",X,ee)}}finally{g(null),localStorage.removeItem("spotify-partner"),k(!1)}}},T=en(p);S.useEffect(()=>{en(p)},[p]),S.useEffect(()=>{if(r){const E=Math.min(600,window.innerWidth-40),H=Math.min(window.innerHeight*.9,800),X=(window.innerWidth-E)/2,ee=(window.innerHeight-H)/2;i({x:X,y:ee})}},[r]),S.useEffect(()=>{const E=X=>{o&&i({x:X.clientX-l.x,y:X.clientY-l.y})},H=()=>{a(!1)};return o&&(document.addEventListener("mousemove",E),document.addEventListener("mouseup",H)),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",H)}},[o,l]);const O=E=>{a(!0),c({x:E.clientX-s.x,y:E.clientY-s.y})};return h.jsxs(z.nav,{initial:{y:-100,opacity:0},animate:{y:0,opacity:1},className:"sticky top-0 z-50",style:{background:"rgba(0, 0, 0, 0.8)",backdropFilter:"blur(20px)",borderBottom:"1px solid rgba(255, 255, 255, 0.05)"},children:[h.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[h.jsxs("div",{className:"flex justify-between items-center h-16",children:[h.jsxs(Xi,{to:"/",className:"flex items-center space-x-2",children:[h.jsx(z.div,{whileHover:{scale:1.1,rotate:5},className:"w-8 h-8 rounded-full flex items-center justify-center",style:{background:`linear-gradient(135deg, ${((j=T.cssVars)==null?void 0:j.primary)||"#1db954"} 0%, ${((F=T.cssVars)==null?void 0:F.secondary)||"#1ed760"} 100%)`},children:h.jsx(et,{className:"w-5 h-5 text-white"})}),h.jsx("span",{className:"text-xl font-bold gradient-text",children:"Our Musical Journey"})]}),h.jsx("div",{className:"hidden md:flex items-center space-x-1",children:N.map(E=>{var X,ee,q,me;const H=C.pathname===E.href;return h.jsxs(Xi,{to:E.href,className:Kh("flex items-center space-x-2 px-4 py-2 rounded-xl transition-all duration-300",H?"text-white":"text-white/60 hover:text-white hover:bg-white/5"),style:H?{background:`linear-gradient(135deg, ${((X=T.cssVars)==null?void 0:X.primary)||"#1db954"}15 0%, ${((ee=T.cssVars)==null?void 0:ee.secondary)||"#1ed760"}10 100%)`,border:`1px solid ${((q=T.cssVars)==null?void 0:q.primary)||"#1db954"}30`}:{},children:[h.jsx(E.icon,{className:"w-4 h-4",style:{color:H?(me=T.cssVars)==null?void 0:me.primary:void 0}}),h.jsx("span",{className:"font-medium",children:E.name})]},E.name)})}),h.jsxs("div",{className:"hidden md:flex items-center space-x-4",children:[!f&&h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("input",{value:w,onChange:E=>v(E.target.value),placeholder:"Partner Spotify ID",className:"bg-white/10 text-white text-sm px-2 py-1 rounded"}),h.jsx("button",{disabled:y||!w,onClick:async()=>{var E;if(!(!((E=d==null?void 0:d.user)!=null&&E.id)||!w)){x(!0);try{await Et("/partners/request",{toUid:w})}finally{x(!1)}}},className:`${T.primary} ${T.hover} text-white px-3 py-1 rounded text-sm disabled:opacity-50`,children:y?"Sending...":"Send Request"})]}),f&&h.jsxs(z.div,{initial:{scale:0},animate:{scale:1},className:"flex items-center space-x-2 text-sm text-white/70",children:[h.jsx(Ls,{className:"w-4 h-4"}),h.jsxs("span",{children:["+ ",(D=f.user)==null?void 0:D.display_name]})]}),h.jsxs(z.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>n(!0),className:"flex items-center space-x-2 px-3 py-2 rounded-xl text-white/60 hover:text-white transition-all duration-300",style:{color:(G=T.cssVars)==null?void 0:G.primary},onMouseEnter:E=>{E.currentTarget.style.background="rgba(255, 255, 255, 0.05)"},onMouseLeave:E=>{E.currentTarget.style.background="transparent"},children:[h.jsx(Hh,{className:"w-4 h-4"}),h.jsx("span",{className:"hidden lg:block",children:"Settings"})]}),h.jsxs(z.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:P,className:"flex items-center space-x-2 px-3 py-2 rounded-xl text-white/60 hover:text-white transition-all duration-300",onMouseEnter:E=>{E.currentTarget.style.background="rgba(239, 68, 68, 0.1)"},onMouseLeave:E=>{E.currentTarget.style.background="transparent"},children:[h.jsx(Uh,{className:"w-4 h-4"}),h.jsx("span",{className:"hidden lg:block",children:"Logout"})]})]}),h.jsx("button",{onClick:()=>t(!e),className:"md:hidden p-2 rounded-lg text-white/70 hover:text-white hover:bg-white/10 transition-all duration-300",children:e?h.jsx(qh,{className:"w-6 h-6"}):h.jsx(zk,{className:"w-6 h-6"})})]}),e&&h.jsx(z.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"md:hidden py-4 border-t border-white/10",children:h.jsxs("div",{className:"space-y-2",children:[N.map(E=>{var X,ee,q,me;const H=C.pathname===E.href;return h.jsxs(Xi,{to:E.href,onClick:()=>t(!1),className:Kh("flex items-center space-x-3 px-4 py-3 rounded-xl transition-all duration-300",H?"text-white":"text-white/60 hover:text-white hover:bg-white/5"),style:H?{background:`linear-gradient(135deg, ${((X=T.cssVars)==null?void 0:X.primary)||"#1db954"}15 0%, ${((ee=T.cssVars)==null?void 0:ee.secondary)||"#1ed760"}10 100%)`,border:`1px solid ${((q=T.cssVars)==null?void 0:q.primary)||"#1db954"}30`}:{},children:[h.jsx(E.icon,{className:"w-5 h-5",style:{color:H?(me=T.cssVars)==null?void 0:me.primary:void 0}}),h.jsx("span",{className:"font-medium",children:E.name})]},E.name)}),h.jsxs("div",{className:"pt-4 border-t border-white/10",children:[f&&h.jsxs("div",{className:"flex items-center space-x-3 px-4 py-2 text-sm text-white/70",children:[h.jsx(Ls,{className:"w-4 h-4"}),h.jsxs("span",{children:["Connected with ",(M=f.user)==null?void 0:M.display_name]})]}),h.jsxs("button",{onClick:()=>{n(!0),t(!1)},className:"w-full flex items-center space-x-3 px-4 py-3 rounded-xl text-white/60 hover:text-white transition-all duration-300",style:{color:(W=T.cssVars)==null?void 0:W.primary},onMouseEnter:E=>{E.currentTarget.style.background="rgba(255, 255, 255, 0.05)"},onMouseLeave:E=>{E.currentTarget.style.background="transparent"},children:[h.jsx(Hh,{className:"w-5 h-5"}),h.jsx("span",{className:"font-medium",children:"Settings"})]}),h.jsxs("button",{onClick:P,className:"w-full flex items-center space-x-3 px-4 py-3 rounded-xl text-white/60 hover:text-white transition-all duration-300",onMouseEnter:E=>{E.currentTarget.style.background="rgba(239, 68, 68, 0.1)"},onMouseLeave:E=>{E.currentTarget.style.background="transparent"},children:[h.jsx(Uh,{className:"w-5 h-5"}),h.jsx("span",{className:"font-medium",children:"Logout"})]})]})]})})]}),r&&h.jsxs(h.Fragment,{children:[h.jsx(z.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 backdrop-blur-md z-40",onClick:()=>n(!1)}),h.jsxs(z.div,{initial:{opacity:0,scale:.8,y:30},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:30},className:"fixed z-50 overflow-hidden",style:{left:s.x,top:s.y,width:Math.min(600,window.innerWidth-40),height:Math.min(window.innerHeight*.9,800),background:"linear-gradient(135deg, rgba(0,0,0,0.9) 0%, rgba(20,20,20,0.95) 50%, rgba(0,0,0,0.9) 100%)",backdropFilter:"blur(24px) saturate(180%)",WebkitBackdropFilter:"blur(24px) saturate(180%)",border:"1px solid rgba(255,255,255,0.2)",borderRadius:"16px",boxShadow:"0 25px 50px rgba(0,0,0,0.5)",cursor:o?"grabbing":"default"},children:[h.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-white/20 cursor-grab active:cursor-grabbing select-none",onMouseDown:O,style:{background:"linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)"},children:[h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsxs("div",{className:"flex space-x-2",children:[h.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),h.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),h.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"})]}),h.jsx("h2",{className:"text-lg font-semibold text-white",children:"Settings"})]}),h.jsx("button",{onClick:()=>n(!1),className:"text-white/70 hover:text-white hover:bg-white/10 p-2 rounded-lg transition-all duration-200",children:h.jsx(qh,{className:"w-5 h-5"})})]}),h.jsx("div",{className:"overflow-y-auto p-4 sm:p-6",style:{height:"calc(100% - 60px)"},children:h.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[(d==null?void 0:d.user)&&h.jsxs("div",{children:[h.jsx("h3",{className:"text-lg font-semibold text-white mb-4 drop-shadow-md",children:"Your Account"}),h.jsxs("div",{className:"rounded-xl p-4 border border-white/20 transition-all duration-300 hover:border-white/30 hover:shadow-lg hover:shadow-white/5",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},onMouseEnter:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%)"},onMouseLeave:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)"},children:[h.jsx("div",{className:"text-sm text-white/70 mb-2 font-medium",children:"Spotify ID"}),h.jsx("div",{className:"text-white font-mono text-sm break-all rounded-lg p-3 mb-3",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.1)"},children:d.user.id}),h.jsxs("div",{className:"text-sm text-white/80",children:["Display Name: ",h.jsx("span",{className:"text-white font-medium",children:d.user.display_name})]})]})]}),h.jsxs("div",{children:[h.jsx("h3",{className:"text-lg font-semibold text-white mb-4 drop-shadow-md",children:"Partner"}),f?h.jsx("div",{className:"rounded-xl p-4 border border-white/20 transition-all duration-300 hover:border-white/30 hover:shadow-lg hover:shadow-white/5",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},onMouseEnter:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%)"},onMouseLeave:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)"},children:h.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between space-y-3 sm:space-y-0",children:[h.jsxs("div",{className:"flex items-center space-x-3 sm:space-x-4",children:[h.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-gradient-to-br from-purple-500 to-pink-500 rounded-full flex items-center justify-center shadow-lg",children:h.jsx(Ls,{className:"w-5 h-5 sm:w-6 sm:h-6 text-white"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-white font-semibold text-base sm:text-lg truncate",children:(_=f.user)==null?void 0:_.display_name}),h.jsx("div",{className:"text-xs text-white/70 break-all rounded px-2 py-1 mt-1 inline-block",style:{background:"rgba(0,0,0,0.3)",border:"1px solid rgba(255,255,255,0.1)"},children:(A=f.user)==null?void 0:A.id}),h.jsx("div",{className:"text-sm text-green-400 font-medium mt-2",children:"✓ Connected"})]})]}),h.jsxs("button",{onClick:V,disabled:b,className:"flex items-center space-x-2 p-2 sm:p-3 text-red-400 hover:text-red-300 rounded-xl transition-all duration-200 disabled:opacity-50 self-start sm:self-auto",style:{background:"rgba(239, 68, 68, 0.1)"},onMouseEnter:E=>{E.currentTarget.style.background="rgba(239, 68, 68, 0.2)"},onMouseLeave:E=>{E.currentTarget.style.background="rgba(239, 68, 68, 0.1)"},children:[h.jsx(ly,{className:"w-4 h-4 sm:w-5 sm:h-5"}),h.jsx("span",{className:"text-sm sm:hidden",children:"Remove"})]})]})}):h.jsxs("div",{className:"rounded-xl p-4 border border-white/20 space-y-4 transition-all duration-300 hover:border-white/30 hover:shadow-lg hover:shadow-white/5",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},onMouseEnter:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%)"},onMouseLeave:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)"},children:[h.jsxs("div",{children:[h.jsx("label",{className:"text-sm text-white/70 mb-2 block font-medium",children:"Partner Spotify ID"}),h.jsx("input",{value:w,onChange:E=>v(E.target.value),placeholder:"Enter partner's Spotify ID...",className:"w-full text-white text-sm px-4 py-3 rounded-xl placeholder-white/50 border focus:outline-none transition-all",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.2)"},onFocus:E=>{E.target.style.border="1px solid rgba(255,255,255,0.4)"},onBlur:E=>{E.target.style.border="1px solid rgba(255,255,255,0.2)"}})]}),h.jsx("button",{disabled:y||!w,onClick:async()=>{var E;if(!(!((E=d==null?void 0:d.user)!=null&&E.id)||!w)){x(!0);try{await Et("/partners/request",{toUid:w}),v("")}finally{x(!1)}}},className:"w-full text-white px-4 py-3 rounded-xl text-sm disabled:opacity-50 transition-all duration-200 font-medium",style:{background:`linear-gradient(135deg, ${((I=T.cssVars)==null?void 0:I.primary)||"#1db954"} 0%, ${((R=T.cssVars)==null?void 0:R.secondary)||"#1ed760"} 100%)`},onMouseEnter:E=>{var H;E.currentTarget.style.transform="translateY(-1px)",E.currentTarget.style.boxShadow=`0 8px 25px ${((H=T.cssVars)==null?void 0:H.primary)||"#1db954"}40`},onMouseLeave:E=>{E.currentTarget.style.transform="translateY(0)",E.currentTarget.style.boxShadow="none"},children:y?"Sending...":"Send Partner Request"})]})]}),h.jsxs("div",{children:[h.jsx("h3",{className:"text-lg font-semibold text-white mb-4 drop-shadow-md",children:"Color Theme"}),h.jsx("div",{className:"rounded-xl p-4 border border-white/20 transition-all duration-300 hover:border-white/30 hover:shadow-lg hover:shadow-white/5",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},onMouseEnter:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%)"},onMouseLeave:E=>{E.currentTarget.style.background="linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%)"},children:h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3",children:[{name:"Green",value:"green",color:"from-green-500 to-emerald-500"},{name:"Pink",value:"pink",color:"from-pink-500 to-rose-500"},{name:"Blue",value:"blue",color:"from-blue-400 to-cyan-400"},{name:"Red",value:"red",color:"from-red-600 to-red-800"},{name:"Purple",value:"purple",color:"from-purple-500 to-violet-600"},{name:"Yellow",value:"yellow",color:"from-yellow-400 to-orange-500"},{name:"Turquoise",value:"turquoise",color:"from-cyan-400 to-blue-500"}].map(E=>{var H,X,ee;return h.jsxs("button",{onClick:()=>m(E.value),className:"flex items-center space-x-3 p-3 rounded-xl border transition-all duration-200",style:{border:p===E.value?`2px solid ${((H=T.cssVars)==null?void 0:H.primary)||"#1db954"}`:"1px solid rgba(255,255,255,0.2)",background:p===E.value?`linear-gradient(135deg, ${((X=T.cssVars)==null?void 0:X.primary)||"#1db954"}15 0%, ${((ee=T.cssVars)==null?void 0:ee.secondary)||"#1ed760"}10 100%)`:"rgba(255,255,255,0.02)"},onMouseEnter:q=>{var me;p!==E.value?(q.currentTarget.style.background="rgba(255,255,255,0.08)",q.currentTarget.style.border="1px solid rgba(255,255,255,0.4)",q.currentTarget.style.transform="translateY(-2px)",q.currentTarget.style.boxShadow="0 4px 12px rgba(0,0,0,0.3)"):(q.currentTarget.style.transform="translateY(-1px)",q.currentTarget.style.boxShadow=`0 6px 20px ${((me=T.cssVars)==null?void 0:me.primary)||"#1db954"}30`)},onMouseLeave:q=>{p!==E.value?(q.currentTarget.style.background="rgba(255,255,255,0.02)",q.currentTarget.style.border="1px solid rgba(255,255,255,0.2)",q.currentTarget.style.transform="translateY(0)",q.currentTarget.style.boxShadow="none"):(q.currentTarget.style.transform="translateY(0)",q.currentTarget.style.boxShadow="none")},children:[h.jsx("div",{className:`w-5 h-5 rounded-full bg-gradient-to-r ${E.color} shadow-sm`}),h.jsx("span",{className:"text-white text-sm font-medium",children:E.name})]},E.value)})})})]})]})})]})]})]})};var gy={exports:{}};(function(e){var t=function(){var r="https://api.spotify.com/v1",n=null,s=null,i=function(u,p){return u.abort=p,u},o=function(u,p){var m;if(s!==null){var g=s.defer();u(function(w){g.resolve(w)},function(w){g.reject(w)}),m=g.promise}else window.Promise&&(m=new window.Promise(u));return m?new i(m,p):null},a=function(){var u=Array.prototype.slice.call(arguments),p=u[0],m=u.slice(1);return p=p||{},m.forEach(function(g){for(var w in g)g.hasOwnProperty(w)&&(p[w]=g[w])}),p},l=function(u,p){var m="";for(var g in p)if(p.hasOwnProperty(g)){var w=p[g];m+=encodeURIComponent(g)+"="+encodeURIComponent(w)+"&"}return m.length>0&&(m=m.substring(0,m.length-1),u=u+"?"+m),u},c=function(u,p){var m=new XMLHttpRequest,g=function(w,v){function y(C){w&&w(C),p&&p(null,C)}function x(){v&&v(m),p&&p(m,null)}var b=u.type||"GET";if(m.open(b,l(u.url,u.params)),n&&m.setRequestHeader("Authorization","Bearer "+n),m.onreadystatechange=function(){if(m.readyState===4){var C=null;try{C=m.responseText?JSON.parse(m.responseText):""}catch(N){console.error(N)}m.status>=200&&m.status<300?y(C):x()}},b==="GET")m.send(null);else{var k=null;u.postData&&(u.contentType==="image/jpeg"?(k=u.postData,m.setRequestHeader("Content-Type",u.contentType)):(k=JSON.stringify(u.postData),m.setRequestHeader("Content-Type","application/json"))),m.send(k)}};return p?(g(),null):o(g,function(){m.abort()})},d=function(u,p,m,g){var w={},v=null;typeof p=="object"?(w=p,v=m):typeof p=="function"&&(v=p);var y=u.type||"GET";return y!=="GET"&&u.postData&&!g?u.postData=a(u.postData,w):u.params=a(u.params,w),c(u,v)},f=function(){};return f.prototype={constructor:t},f.prototype.getGeneric=function(u,p){var m={url:u};return d(m,p)},f.prototype.getMe=function(u,p){var m={url:r+"/me"};return d(m,u,p)},f.prototype.getMySavedTracks=function(u,p){var m={url:r+"/me/tracks"};return d(m,u,p)},f.prototype.addToMySavedTracks=function(u,p,m){var g={url:r+"/me/tracks",type:"PUT",postData:u};return d(g,p,m)},f.prototype.removeFromMySavedTracks=function(u,p,m){var g={url:r+"/me/tracks",type:"DELETE",postData:u};return d(g,p,m)},f.prototype.containsMySavedTracks=function(u,p,m){var g={url:r+"/me/tracks/contains",params:{ids:u.join(",")}};return d(g,p,m)},f.prototype.getMySavedAlbums=function(u,p){var m={url:r+"/me/albums"};return d(m,u,p)},f.prototype.addToMySavedAlbums=function(u,p,m){var g={url:r+"/me/albums",type:"PUT",postData:u};return d(g,p,m)},f.prototype.removeFromMySavedAlbums=function(u,p,m){var g={url:r+"/me/albums",type:"DELETE",postData:u};return d(g,p,m)},f.prototype.containsMySavedAlbums=function(u,p,m){var g={url:r+"/me/albums/contains",params:{ids:u.join(",")}};return d(g,p,m)},f.prototype.getMyTopArtists=function(u,p){var m={url:r+"/me/top/artists"};return d(m,u,p)},f.prototype.getMyTopTracks=function(u,p){var m={url:r+"/me/top/tracks"};return d(m,u,p)},f.prototype.getMyRecentlyPlayedTracks=function(u,p){var m={url:r+"/me/player/recently-played"};return d(m,u,p)},f.prototype.followUsers=function(u,p){var m={url:r+"/me/following/",type:"PUT",params:{ids:u.join(","),type:"user"}};return d(m,p)},f.prototype.followArtists=function(u,p){var m={url:r+"/me/following/",type:"PUT",params:{ids:u.join(","),type:"artist"}};return d(m,p)},f.prototype.followPlaylist=function(u,p,m){var g={url:r+"/playlists/"+u+"/followers",type:"PUT",postData:{}};return d(g,p,m)},f.prototype.unfollowUsers=function(u,p){var m={url:r+"/me/following/",type:"DELETE",params:{ids:u.join(","),type:"user"}};return d(m,p)},f.prototype.unfollowArtists=function(u,p){var m={url:r+"/me/following/",type:"DELETE",params:{ids:u.join(","),type:"artist"}};return d(m,p)},f.prototype.unfollowPlaylist=function(u,p){var m={url:r+"/playlists/"+u+"/followers",type:"DELETE"};return d(m,p)},f.prototype.isFollowingUsers=function(u,p){var m={url:r+"/me/following/contains",type:"GET",params:{ids:u.join(","),type:"user"}};return d(m,p)},f.prototype.isFollowingArtists=function(u,p){var m={url:r+"/me/following/contains",type:"GET",params:{ids:u.join(","),type:"artist"}};return d(m,p)},f.prototype.areFollowingPlaylist=function(u,p,m){var g={url:r+"/playlists/"+u+"/followers/contains",type:"GET",params:{ids:p.join(",")}};return d(g,m)},f.prototype.getFollowedArtists=function(u,p){var m={url:r+"/me/following",type:"GET",params:{type:"artist"}};return d(m,u,p)},f.prototype.getUser=function(u,p,m){var g={url:r+"/users/"+encodeURIComponent(u)};return d(g,p,m)},f.prototype.getUserPlaylists=function(u,p,m){var g;return typeof u=="string"?g={url:r+"/users/"+encodeURIComponent(u)+"/playlists"}:(g={url:r+"/me/playlists"},m=p,p=u),d(g,p,m)},f.prototype.getPlaylist=function(u,p,m){var g={url:r+"/playlists/"+u};return d(g,p,m)},f.prototype.getPlaylistTracks=function(u,p,m){var g={url:r+"/playlists/"+u+"/tracks"};return d(g,p,m)},f.prototype.getPlaylistCoverImage=function(u,p){var m={url:r+"/playlists/"+u+"/images"};return d(m,p)},f.prototype.createPlaylist=function(u,p,m){var g={url:r+"/users/"+encodeURIComponent(u)+"/playlists",type:"POST",postData:p};return d(g,p,m)},f.prototype.changePlaylistDetails=function(u,p,m){var g={url:r+"/playlists/"+u,type:"PUT",postData:p};return d(g,p,m)},f.prototype.addTracksToPlaylist=function(u,p,m,g){var w={url:r+"/playlists/"+u+"/tracks",type:"POST",postData:{uris:p}};return d(w,m,g,!0)},f.prototype.replaceTracksInPlaylist=function(u,p,m){var g={url:r+"/playlists/"+u+"/tracks",type:"PUT",postData:{uris:p}};return d(g,{},m)},f.prototype.reorderTracksInPlaylist=function(u,p,m,g,w){var v={url:r+"/playlists/"+u+"/tracks",type:"PUT",postData:{range_start:p,insert_before:m}};return d(v,g,w)},f.prototype.removeTracksFromPlaylist=function(u,p,m){var g=p.map(function(v){return typeof v=="string"?{uri:v}:v}),w={url:r+"/playlists/"+u+"/tracks",type:"DELETE",postData:{tracks:g}};return d(w,{},m)},f.prototype.removeTracksFromPlaylistWithSnapshotId=function(u,p,m,g){var w=p.map(function(y){return typeof y=="string"?{uri:y}:y}),v={url:r+"/playlists/"+u+"/tracks",type:"DELETE",postData:{tracks:w,snapshot_id:m}};return d(v,{},g)},f.prototype.removeTracksFromPlaylistInPositions=function(u,p,m,g){var w={url:r+"/playlists/"+u+"/tracks",type:"DELETE",postData:{positions:p,snapshot_id:m}};return d(w,{},g)},f.prototype.uploadCustomPlaylistCoverImage=function(u,p,m){var g={url:r+"/playlists/"+u+"/images",type:"PUT",postData:p.replace(/^data:image\/jpeg;base64,/,""),contentType:"image/jpeg"};return d(g,{},m)},f.prototype.getAlbum=function(u,p,m){var g={url:r+"/albums/"+u};return d(g,p,m)},f.prototype.getAlbumTracks=function(u,p,m){var g={url:r+"/albums/"+u+"/tracks"};return d(g,p,m)},f.prototype.getAlbums=function(u,p,m){var g={url:r+"/albums/",params:{ids:u.join(",")}};return d(g,p,m)},f.prototype.getTrack=function(u,p,m){var g={};return g.url=r+"/tracks/"+u,d(g,p,m)},f.prototype.getTracks=function(u,p,m){var g={url:r+"/tracks/",params:{ids:u.join(",")}};return d(g,p,m)},f.prototype.getArtist=function(u,p,m){var g={url:r+"/artists/"+u};return d(g,p,m)},f.prototype.getArtists=function(u,p,m){var g={url:r+"/artists/",params:{ids:u.join(",")}};return d(g,p,m)},f.prototype.getArtistAlbums=function(u,p,m){var g={url:r+"/artists/"+u+"/albums"};return d(g,p,m)},f.prototype.getArtistTopTracks=function(u,p,m,g){var w={url:r+"/artists/"+u+"/top-tracks",params:{country:p}};return d(w,m,g)},f.prototype.getArtistRelatedArtists=function(u,p,m){var g={url:r+"/artists/"+u+"/related-artists"};return d(g,p,m)},f.prototype.getFeaturedPlaylists=function(u,p){var m={url:r+"/browse/featured-playlists"};return d(m,u,p)},f.prototype.getNewReleases=function(u,p){var m={url:r+"/browse/new-releases"};return d(m,u,p)},f.prototype.getCategories=function(u,p){var m={url:r+"/browse/categories"};return d(m,u,p)},f.prototype.getCategory=function(u,p,m){var g={url:r+"/browse/categories/"+u};return d(g,p,m)},f.prototype.getCategoryPlaylists=function(u,p,m){var g={url:r+"/browse/categories/"+u+"/playlists"};return d(g,p,m)},f.prototype.search=function(u,p,m,g){var w={url:r+"/search/",params:{q:u,type:p.join(",")}};return d(w,m,g)},f.prototype.searchAlbums=function(u,p,m){return this.search(u,["album"],p,m)},f.prototype.searchArtists=function(u,p,m){return this.search(u,["artist"],p,m)},f.prototype.searchTracks=function(u,p,m){return this.search(u,["track"],p,m)},f.prototype.searchPlaylists=function(u,p,m){return this.search(u,["playlist"],p,m)},f.prototype.searchShows=function(u,p,m){return this.search(u,["show"],p,m)},f.prototype.searchEpisodes=function(u,p,m){return this.search(u,["episode"],p,m)},f.prototype.getAudioFeaturesForTrack=function(u,p){var m={};return m.url=r+"/audio-features/"+u,d(m,{},p)},f.prototype.getAudioFeaturesForTracks=function(u,p){var m={url:r+"/audio-features",params:{ids:u}};return d(m,{},p)},f.prototype.getAudioAnalysisForTrack=function(u,p){var m={};return m.url=r+"/audio-analysis/"+u,d(m,{},p)},f.prototype.getRecommendations=function(u,p){var m={url:r+"/recommendations"};return d(m,u,p)},f.prototype.getAvailableGenreSeeds=function(u){var p={url:r+"/recommendations/available-genre-seeds"};return d(p,{},u)},f.prototype.getMyDevices=function(u){var p={url:r+"/me/player/devices"};return d(p,{},u)},f.prototype.getMyCurrentPlaybackState=function(u,p){var m={url:r+"/me/player"};return d(m,u,p)},f.prototype.getMyCurrentPlayingTrack=function(u,p){var m={url:r+"/me/player/currently-playing"};return d(m,u,p)},f.prototype.transferMyPlayback=function(u,p,m){var g=p||{};g.device_ids=u;var w={type:"PUT",url:r+"/me/player",postData:g};return d(w,p,m)},f.prototype.play=function(u,p){u=u||{};var m="device_id"in u?{device_id:u.device_id}:null,g={};["context_uri","uris","offset","position_ms"].forEach(function(y){y in u&&(g[y]=u[y])});var w={type:"PUT",url:r+"/me/player/play",params:m,postData:g},v=typeof u=="function"?u:{};return d(w,v,p)},f.prototype.queue=function(u,p,m){p=p||{};var g="device_id"in p?{uri:u,device_id:p.device_id}:{uri:u},w={type:"POST",url:r+"/me/player/queue",params:g};return d(w,p,m)},f.prototype.pause=function(u,p){u=u||{};var m="device_id"in u?{device_id:u.device_id}:null,g={type:"PUT",url:r+"/me/player/pause",params:m};return d(g,u,p)},f.prototype.skipToNext=function(u,p){u=u||{};var m="device_id"in u?{device_id:u.device_id}:null,g={type:"POST",url:r+"/me/player/next",params:m};return d(g,u,p)},f.prototype.skipToPrevious=function(u,p){u=u||{};var m="device_id"in u?{device_id:u.device_id}:null,g={type:"POST",url:r+"/me/player/previous",params:m};return d(g,u,p)},f.prototype.seek=function(u,p,m){p=p||{};var g={position_ms:u};"device_id"in p&&(g.device_id=p.device_id);var w={type:"PUT",url:r+"/me/player/seek",params:g};return d(w,p,m)},f.prototype.setRepeat=function(u,p,m){p=p||{};var g={state:u};"device_id"in p&&(g.device_id=p.device_id);var w={type:"PUT",url:r+"/me/player/repeat",params:g};return d(w,p,m)},f.prototype.setVolume=function(u,p,m){p=p||{};var g={volume_percent:u};"device_id"in p&&(g.device_id=p.device_id);var w={type:"PUT",url:r+"/me/player/volume",params:g};return d(w,p,m)},f.prototype.setShuffle=function(u,p,m){p=p||{};var g={state:u};"device_id"in p&&(g.device_id=p.device_id);var w={type:"PUT",url:r+"/me/player/shuffle",params:g};return d(w,p,m)},f.prototype.getShow=function(u,p,m){var g={};return g.url=r+"/shows/"+u,d(g,p,m)},f.prototype.getShows=function(u,p,m){var g={url:r+"/shows/",params:{ids:u.join(",")}};return d(g,p,m)},f.prototype.getMySavedShows=function(u,p){var m={url:r+"/me/shows"};return d(m,u,p)},f.prototype.addToMySavedShows=function(u,p,m){var g={url:r+"/me/shows",type:"PUT",postData:u};return d(g,p,m)},f.prototype.removeFromMySavedShows=function(u,p,m){var g={url:r+"/me/shows",type:"DELETE",postData:u};return d(g,p,m)},f.prototype.containsMySavedShows=function(u,p,m){var g={url:r+"/me/shows/contains",params:{ids:u.join(",")}};return d(g,p,m)},f.prototype.getShowEpisodes=function(u,p,m){var g={url:r+"/shows/"+u+"/episodes"};return d(g,p,m)},f.prototype.getEpisode=function(u,p,m){var g={};return g.url=r+"/episodes/"+u,d(g,p,m)},f.prototype.getEpisodes=function(u,p,m){var g={url:r+"/episodes/",params:{ids:u.join(",")}};return d(g,p,m)},f.prototype.getAccessToken=function(){return n},f.prototype.setAccessToken=function(u){n=u},f.prototype.setPromiseImplementation=function(u){var p=!1;try{var m=new u(function(g){g()});typeof m.then=="function"&&typeof m.catch=="function"&&(p=!0)}catch(g){console.error(g)}if(p)s=u;else throw new Error("Unsupported implementation of Promises/A+")},f}();e.exports=t})(gy);var Pj=gy.exports;const Ej=wu(Pj),Tj="7cab80d02df44a5bb96725be60a45875",yy="https://159.195.9.107:3443/callback.html";console.log("🔍 Debug - Current redirect URI:",yy);console.log("🔍 Debug - Environment VITE_REDIRECT_URI:","https://159.195.9.107:3443/callback.html");const Vo=new Ej,Mj=e=>{const t=(e==null?void 0:e.forceDialog)??!0,r=["user-read-private","user-read-email","user-read-recently-played","user-top-read","playlist-read-private","playlist-read-collaborative","playlist-modify-public","playlist-modify-private","user-read-playback-state","user-modify-playback-state","user-read-currently-playing","ugc-image-upload"].join(" "),s=`https://accounts.spotify.com/authorize?${new URLSearchParams({client_id:Tj,response_type:"code",redirect_uri:yy,scope:r,show_dialog:t?"true":"false"}).toString()}`;return console.log("🔍 Debug - Generated Spotify Auth URL:",s),s},Aj=async(e,t)=>{Vo.setAccessToken(e),await Vo.play({uris:[t]})},_j=async e=>{Vo.setAccessToken(e),await Vo.pause()},Lj=()=>{const[e,t]=S.useState(!1),[r,n]=S.useState(!1),[s,i]=S.useState(null),o=()=>{t(!0);const l=navigator.userAgent||navigator.vendor||window.opera,c=/iPad|iPhone|iPod/.test(l)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,d=/Android/.test(l),u=Mj({forceDialog:!(c||d)});window.location.href=u},a=[{icon:Ke,title:"Last Listened",description:"Discover what your partner is listening to right now and play it instantly"},{icon:Nr,title:"Mixed Playlist",description:"AI-powered playlists that blend your musical tastes perfectly"},{icon:et,title:"Memory Lane",description:"Create beautiful musical memories and shared experiences together"}];return h.jsxs("div",{className:"min-h-screen flex items-center justify-center px-4 bg-black",children:[h.jsxs("div",{className:"max-w-4xl w-full relative",children:[h.jsxs(z.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{duration:.8},className:"text-center mb-12",children:[h.jsx(z.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,type:"spring",stiffness:200},className:"w-20 h-20 mx-auto mb-6 bg-gradient-to-br from-pink-500 to-red-500 rounded-full flex items-center justify-center",children:h.jsx(et,{className:"w-10 h-10 text-white"})}),h.jsxs("h1",{className:"text-5xl md:text-6xl font-bold mb-4",children:[h.jsx("span",{className:"gradient-text",children:"Our Musical"}),h.jsx("br",{}),h.jsx("span",{className:"text-white",children:"Journey"})]}),h.jsx("p",{className:"text-xl text-white/70 max-w-2xl mx-auto leading-relaxed",children:"A private space where two hearts connect through music. Discover, share, and create beautiful musical memories together."})]}),h.jsx(z.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{delay:.4,duration:.8},className:"grid md:grid-cols-3 gap-6 mb-12",children:a.map((l,c)=>h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5+c*.1},whileHover:{y:-8,scale:1.03},className:"glass-bubble rounded-3xl p-8 text-center group cursor-pointer",children:[h.jsx(z.div,{whileHover:{rotate:15,scale:1.15},className:"w-16 h-16 mx-auto mb-6 bg-gradient-to-br from-purple-500/30 via-blue-500/30 to-pink-500/30 rounded-2xl flex items-center justify-center backdrop-blur-sm",children:h.jsx(l.icon,{className:"w-8 h-8 text-white"})}),h.jsx("h3",{className:"text-2xl font-bold text-white mb-3",children:l.title}),h.jsx("p",{className:"text-white/70 text-sm leading-relaxed",children:l.description})]},l.title))}),h.jsxs(z.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.8,duration:.6},className:"glass-fluid rounded-3xl p-10 max-w-lg mx-auto",children:[h.jsxs("div",{className:"text-center mb-8",children:[h.jsx(z.div,{initial:{scale:0},animate:{scale:1},transition:{delay:1,type:"spring",stiffness:200},className:"w-20 h-20 mx-auto mb-6 bg-gradient-to-br from-purple-500/30 via-blue-500/30 to-pink-500/30 rounded-2xl flex items-center justify-center backdrop-blur-sm",children:h.jsx(Wc,{className:"w-10 h-10 text-white"})}),h.jsx("h2",{className:"text-3xl font-bold text-white mb-3",children:"Begin Your Journey"}),h.jsx("p",{className:"text-white/70 text-lg",children:"Connect your Spotify account to start your musical love story"})]}),h.jsx(z.button,{whileHover:{scale:1.05,boxShadow:"0 15px 40px rgba(147, 51, 234, 0.4)"},whileTap:{scale:.95},onClick:o,disabled:e,className:"w-full bg-gradient-to-r from-purple-600 via-blue-600 to-pink-600 hover:from-purple-700 hover:via-blue-700 hover:to-pink-700 text-white font-bold py-5 px-8 rounded-2xl transition-all duration-300 flex items-center justify-center space-x-3 disabled:opacity-50 shadow-2xl",children:e?h.jsx("div",{className:"w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin"}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-lg",children:"Connect with Spotify"}),h.jsx(_k,{className:"w-6 h-6"})]})}),h.jsx("p",{className:"text-sm text-white/60 text-center mt-6 leading-relaxed",children:"We'll only access your listening history and playlist data to create your personalized musical journey"})]}),h.jsx(z.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:1,duration:.6},className:"text-center mt-12",children:h.jsx("p",{className:"text-white/40 text-sm",children:"Made with 💕 for a special someone"})})]}),h.jsx(Dj,{open:r,onClose:()=>n(!1),authUrl:s})]})};function Dj({open:e,onClose:t,authUrl:r}){if(!e||!r)return null;const n=()=>{window.open(r,"_blank","noopener,noreferrer")||(window.location.href=r)},s=async()=>{try{await navigator.clipboard.writeText(r),alert("Link copied. Paste in Safari/Chrome to continue.")}catch{}};return h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-4",children:[h.jsx("div",{className:"absolute inset-0 bg-black/70",onClick:t}),h.jsxs("div",{className:"relative z-10 w-full max-w-md glass-fluid rounded-2xl p-6 text-white",children:[h.jsx("h3",{className:"text-xl font-bold mb-2",children:"Open Spotify Login"}),h.jsx("p",{className:"text-white/80 text-sm mb-4",children:"If this opened inside another app (Instagram, Facebook, Twitter), use your system browser to avoid password overlays."}),h.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[h.jsx("button",{onClick:n,className:"w-full bg-white/10 hover:bg-white/20 border border-white/20 rounded-xl py-3 font-medium",children:"Open in new tab"}),h.jsx("button",{onClick:s,className:"w-full bg-white/10 hover:bg-white/20 border border-white/20 rounded-xl py-3 font-medium",children:"Copy link"}),h.jsx("button",{onClick:t,className:"w-full bg-transparent text-white/70 underline py-2",children:"Cancel"})]})]})]})}const Rj=()=>{var N,P,V,T,O,j,F,D,G,M,W,_,A,I,R,E,H,X,ee,q,me,Rr,_t,St,Qe,on,Qn;const{currentUser:e,partnerUser:t,theme:r}=oe(),n=en(r),[s,i]=S.useState([]),[o,a]=S.useState(!1),[l,c]=S.useState(null),[d,f]=S.useState(""),[u,p]=S.useState(!1),[m,g]=S.useState(null),[w,v]=S.useState(null);S.useEffect(()=>{let B;const le=async()=>{var ye,be,Fe;try{const Lt=(ye=e==null?void 0:e.user)==null?void 0:ye.id;if(Lt){const an=await te(`/users/${Lt}/recently-played`),Zt=oe.getState().currentUser;Zt&&oe.getState().setCurrentUser({...Zt,recentlyPlayed:an})}const Zn=(Fe=(be=oe.getState().partnerUser)==null?void 0:be.user)==null?void 0:Fe.id;if(Zn){const an=await te(`/users/${Zn}/recently-played`),Zt=oe.getState().partnerUser;Zt&&oe.getState().setPartnerUser({...Zt,recentlyPlayed:an})}}catch{}B=setTimeout(le,3e4)};return le(),()=>clearTimeout(B)},[(N=e==null?void 0:e.user)==null?void 0:N.id,(P=t==null?void 0:t.user)==null?void 0:P.id]),S.useEffect(()=>{(async()=>{var le;if((le=e==null?void 0:e.user)!=null&&le.id){a(!0);try{const ye=await te(`/partners/requests/${e.user.id}`);i(ye)}catch{i([])}finally{a(!1)}}})()},[(V=e==null?void 0:e.user)==null?void 0:V.id]),S.useEffect(()=>{let B;const le=async()=>{var be;if((be=e==null?void 0:e.user)!=null&&be.id)try{const Fe=await te(`/users/${e.user.id}/status`);c(Fe)}catch{}},ye=()=>{if(!(l!=null&&l.nextSyncAt)){f("");return}const be=l.nextSyncAt-Date.now();if(be<=0){f("now");return}const Fe=Math.floor(be/6e4),Lt=Math.floor(be%6e4/1e3);f(`${Fe}m ${Lt}s`)};return le(),B=setInterval(()=>{ye()},1e3),()=>clearInterval(B)},[(T=e==null?void 0:e.user)==null?void 0:T.id,l==null?void 0:l.nextSyncAt]),S.useEffect(()=>{let B;const le=async()=>{var ye,be;try{const Fe=(ye=e==null?void 0:e.user)==null?void 0:ye.id;Fe&&(g(await te(`/users/${Fe}/now-playing`)),(be=t==null?void 0:t.user)!=null&&be.id?v(await te(`/users/${t.user.id}/now-playing`)):v(null))}catch{}B=setTimeout(le,8e3)};return le(),()=>clearTimeout(B)},[(O=e==null?void 0:e.user)==null?void 0:O.id,(j=t==null?void 0:t.user)==null?void 0:j.id]);const y=async()=>{var B;if((B=e==null?void 0:e.user)!=null&&B.id){p(!0);try{await Et(`/users/${e.user.id}/sync`);const le=await te(`/users/${e.user.id}/status`);c(le);const[ye,be]=await Promise.all([te(`/users/${e.user.id}/recently-played`),te(`/users/${e.user.id}/top-tracks?time_range=short_term`)]),Fe=oe.getState().currentUser;Fe&&oe.getState().setCurrentUser({...Fe,recentlyPlayed:ye,topTracks:be.map(Lt=>Lt.track)}),ce.success("Synced latest data")}catch{ce.error("Failed to sync")}finally{p(!1)}}},x=async B=>{await Et(`/partners/requests/${B}/accept`),i(le=>le.filter(ye=>ye.id!==B))},b=async B=>{await Et(`/partners/requests/${B}/decline`),i(le=>le.filter(ye=>ye.id!==B))},k=[{title:"Last Listened",description:"See what your partner is listening to right now",icon:Ke,href:"/last-listened",primaryColor:((F=n.cssVars)==null?void 0:F.primary)||"#1db954",secondaryColor:((D=n.cssVars)==null?void 0:D.secondary)||"#1ed760",accentColor:((G=n.cssVars)==null?void 0:G.accent)||"#00e676"},{title:"Mixed Playlist",description:"Create AI-powered playlists blending both your tastes",icon:oy,href:"/mixed-playlist",primaryColor:((M=n.cssVars)==null?void 0:M.secondary)||"#1ed760",secondaryColor:((W=n.cssVars)==null?void 0:W.accent)||"#00e676",accentColor:((_=n.cssVars)==null?void 0:_.primary)||"#1db954"},{title:"Memory Lane",description:"Your shared musical journey and memories",icon:Nr,href:"/memory-lane",primaryColor:((A=n.cssVars)==null?void 0:A.accent)||"#00e676",secondaryColor:((I=n.cssVars)==null?void 0:I.primary)||"#1db954",accentColor:((R=n.cssVars)==null?void 0:R.secondary)||"#1ed760"}],C=()=>{var B;return(B=e==null?void 0:e.recentlyPlayed)!=null&&B[0]?_n(e.recentlyPlayed[0].played_at):null};return h.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:[h.jsxs("h1",{className:"text-4xl font-bold text-white mb-2",children:["Welcome back, ",h.jsx("span",{className:"gradient-text",children:(E=e==null?void 0:e.user)==null?void 0:E.display_name})]}),h.jsx("p",{className:"text-white/70 text-lg",children:"Ready to explore your musical connection together?"})]}),h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"grid md:grid-cols-2 gap-6 mb-8",children:[h.jsxs("div",{className:"glass rounded-2xl p-6",children:[h.jsx("div",{className:"text-white/70 mb-2",children:"You"}),m!=null&&m.is_playing&&(m!=null&&m.item)?h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("img",{src:((ee=(X=(H=m.item.album)==null?void 0:H.images)==null?void 0:X[0])==null?void 0:ee.url)||"/placeholder-album.png",className:"w-14 h-14 rounded"}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-white font-semibold truncate",children:m.item.name}),h.jsx("div",{className:"text-white/70 text-sm truncate",children:(q=m.item.artists)==null?void 0:q.map(B=>B.name).join(", ")})]})]}):h.jsx("div",{className:"text-white/50",children:"Not playing"})]}),h.jsxs("div",{className:"glass rounded-2xl p-6",children:[h.jsx("div",{className:"text-white/70 mb-2",children:"Partner"}),w!=null&&w.is_playing&&(w!=null&&w.item)?h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("img",{src:((_t=(Rr=(me=w.item.album)==null?void 0:me.images)==null?void 0:Rr[0])==null?void 0:_t.url)||"/placeholder-album.png",className:"w-14 h-14 rounded"}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-white font-semibold truncate",children:w.item.name}),h.jsx("div",{className:"text-white/70 text-sm truncate",children:(St=w.item.artists)==null?void 0:St.map(B=>B.name).join(", ")})]})]}):h.jsx("div",{className:"text-white/50",children:"Not playing"})]})]}),h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"mb-8",children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsx("div",{className:"text-white/70 text-sm",children:(l==null?void 0:l.lastSyncedAt)&&h.jsxs("span",{children:["Last sync: ",new Date(l.lastSyncedAt).toLocaleTimeString()," • Next in: ",d||"—"]})}),h.jsx("button",{onClick:y,disabled:u,className:"bg-white/10 hover:bg-white/20 text-white px-4 py-2 rounded-lg text-sm disabled:opacity-50",children:u?"Refreshing…":"Hard Refresh"})]}),t?h.jsx("div",{className:"glass-bubble rounded-3xl p-8 border border-spotify-green/30 glow",children:h.jsxs("div",{className:"flex items-center space-x-6",children:[h.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-spotify-green to-green-600 rounded-2xl flex items-center justify-center",children:h.jsx(et,{className:"w-8 h-8 text-white"})}),h.jsxs("div",{children:[h.jsxs("h3",{className:"text-xl font-semibold text-white",children:["Connected with ",(Qe=t.user)==null?void 0:Qe.display_name]}),h.jsx("p",{className:"text-white/70",children:"Your musical journey is ready to begin! 💕"})]})]})}):h.jsx("div",{className:"glass-bubble rounded-3xl p-8 border border-orange-500/30",children:h.jsxs("div",{className:"flex items-center space-x-6",children:[h.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-orange-500 to-red-500 rounded-2xl flex items-center justify-center",children:h.jsx(Uc,{className:"w-8 h-8 text-white"})}),h.jsxs("div",{children:[h.jsx("h3",{className:"text-xl font-semibold text-white",children:"Invite your partner"}),h.jsx("p",{className:"text-white/70 mb-2",children:"Ask your partner to search you in the app and send a request."}),o?h.jsx("div",{className:"text-white/60",children:"Loading requests..."}):s.length>0?h.jsx("div",{className:"space-y-3",children:s.map(B=>h.jsxs("div",{className:"flex items-center justify-between bg-white/5 rounded-lg p-3",children:[h.jsxs("div",{className:"text-white/80 text-sm",children:["Request from ",B.from_user_id]}),h.jsxs("div",{className:"space-x-2",children:[h.jsx("button",{onClick:()=>x(B.id),className:"bg-spotify-green hover:bg-spotify-green/90 text-white px-3 py-1 rounded-md text-sm",children:"Accept"}),h.jsx("button",{onClick:()=>b(B.id),className:"bg-white/10 hover:bg-white/20 text-white px-3 py-1 rounded-md text-sm",children:"Decline"})]})]},B.id))}):h.jsx("div",{className:"text-white/60 text-sm",children:"No incoming requests yet"})]})]})})]}),h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[h.jsx("div",{className:"glass-bubble rounded-2xl p-6",children:h.jsxs("div",{className:"flex items-center space-x-4",children:[h.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500/30 to-cyan-500/30 rounded-xl flex items-center justify-center",children:h.jsx(Un,{className:"w-6 h-6 text-blue-400"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-white/70 text-sm",children:"Your last played"}),h.jsx("p",{className:"text-white font-semibold",children:C()||"No recent plays"})]})]})}),h.jsx("div",{className:"glass-bubble rounded-2xl p-6",children:h.jsxs("div",{className:"flex items-center space-x-4",children:[h.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-green-500/30 to-emerald-500/30 rounded-xl flex items-center justify-center",children:h.jsx(uy,{className:"w-6 h-6 text-green-400"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-white/70 text-sm",children:"Top tracks analyzed"}),h.jsxs("p",{className:"text-white font-semibold",children:[((on=e==null?void 0:e.topTracks)==null?void 0:on.length)||0," songs"]})]})]})}),h.jsx("div",{className:"glass-bubble rounded-2xl p-6",children:h.jsxs("div",{className:"flex items-center space-x-4",children:[h.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-purple-500/30 to-pink-500/30 rounded-xl flex items-center justify-center",children:h.jsx(Ls,{className:"w-6 h-6 text-purple-400"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-white/70 text-sm",children:"Recently played"}),h.jsxs("p",{className:"text-white font-semibold",children:[((Qn=e==null?void 0:e.recentlyPlayed)==null?void 0:Qn.length)||0," tracks"]})]})]})})]}),h.jsx(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},className:"grid md:grid-cols-3 gap-6",children:k.map((B,le)=>h.jsx(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4+le*.1},whileHover:{y:-5,scale:1.02},children:h.jsx(Xi,{to:B.href,children:h.jsxs("div",{className:`glass rounded-2xl p-6 h-full border ${B.borderColor} group cursor-pointer transition-all duration-300 hover:shadow-xl`,children:[h.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center mb-4 group-hover:scale-110 transition-transform duration-300",style:{background:`linear-gradient(135deg, ${B.primaryColor}20 0%, ${B.secondaryColor}10 100%)`,border:`1px solid ${B.primaryColor}30`},children:h.jsx(B.icon,{className:"w-6 h-6",style:{color:B.primaryColor}})}),h.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:B.title}),h.jsx("p",{className:"text-white/70 text-sm leading-relaxed mb-4",children:B.description}),h.jsx("div",{className:"w-full h-1 rounded-full opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:`linear-gradient(90deg, ${B.primaryColor} 0%, ${B.secondaryColor} 100%)`}})]})})},B.title))}),(e==null?void 0:e.recentlyPlayed)&&e.recentlyPlayed.length>0&&h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.6},className:"mt-8",children:[h.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:"Your Recent Activity"}),h.jsx("div",{className:"glass rounded-2xl p-6",children:h.jsx("div",{className:"space-y-4",children:e.recentlyPlayed.slice(0,3).map((B,le)=>{var ye,be;return h.jsxs(z.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.7+le*.1},className:"flex items-center space-x-4 p-3 rounded-lg hover:bg-white/5 transition-colors",children:[h.jsx("img",{src:((ye=B.track.album.images[0])==null?void 0:ye.url)||"/placeholder-album.png",alt:B.track.album.name,className:"w-12 h-12 rounded-lg object-cover"}),h.jsxs("div",{className:"flex-1",children:[h.jsx("h4",{className:"text-white font-medium",children:B.track.name}),h.jsx("p",{className:"text-white/70 text-sm",children:(be=B.track.artists[0])==null?void 0:be.name})]}),h.jsx("div",{className:"text-white/50 text-sm",children:_n(B.played_at)})]},B.track.id)})})})]})]})};let Fi=!1;const Xh=()=>{const[e]=Kx(),t=ea(),{setCurrentUser:r,setPartnerUser:n,currentUser:s}=oe(),[i,o]=S.useState("loading"),[a,l]=S.useState("");S.useEffect(()=>{(async()=>{if(Fi){console.log("🔍 CallbackPage - Already processing globally, skipping...");return}Fi=!0,console.log("🔍 CallbackPage - Global processing flag set to TRUE");try{const u=e.get("code"),p=e.get("error");if(console.log("🔍 CallbackPage - Code:",u),console.log("🔍 CallbackPage - Error:",p),p)throw new Error("Spotify authorization was denied");if(!u)throw new Error("No authorization code received");l("Exchanging authorization code..."),console.log("🔍 CallbackPage - Exchanging code with backend...");const m=await F3("/auth/exchange",{code:u});l("Syncing your music data..."),await Et(`/users/${m.uid}/sync`,void 0,m.token),l("Loading your profile...");const[g,w,v]=await Promise.all([te(`/users/${m.uid}`),te(`/users/${m.uid}/recently-played`),te(`/users/${m.uid}/top-tracks?time_range=short_term`)]),y={user:g,accessToken:m.access_token,refreshToken:m.refresh_token,isAuthenticated:!0,recentlyPlayed:w,topTracks:v.map(x=>x.track),topArtists:[],jwt:m.token};localStorage.setItem("spotify-user",JSON.stringify(y)),s?(n(y),localStorage.setItem("spotify-partner",JSON.stringify(y)),l("Partner connected! Your musical journey begins...")):(r(y),l("Welcome! Setting up your musical journey...")),o("success"),ce.success(s?"Partner connected successfully!":"Successfully connected to Spotify!",{duration:3e3}),setTimeout(()=>{t("/"),setTimeout(()=>{Fi=!1,console.log("🔍 CallbackPage - Global processing flag set to FALSE (after success)")},1e3)},2e3)}catch(u){console.error("🔍 CallbackPage - ERROR:",u),console.error("🔍 CallbackPage - Error details:",{message:u instanceof Error?u.message:"Unknown error",stack:u instanceof Error?u.stack:void 0}),o("error"),l(u instanceof Error?u.message:"An unexpected error occurred"),ce.error("Failed to connect to Spotify. Please try again."),setTimeout(()=>{t("/"),setTimeout(()=>{Fi=!1,console.log("🔍 CallbackPage - Global processing flag set to FALSE (after error)")},1e3)},3e3)}})()},[e,t,r,n,s]);const c=()=>{switch(i){case"loading":return h.jsx(Ik,{className:"w-12 h-12 text-spotify-green animate-spin"});case"success":return h.jsx(Rk,{className:"w-12 h-12 text-green-400"});case"error":return h.jsx(Hk,{className:"w-12 h-12 text-red-400"})}},d=()=>{switch(i){case"loading":return"border-spotify-green/30";case"success":return"border-green-400/30";case"error":return"border-red-400/30"}};return h.jsx("div",{className:"min-h-screen flex items-center justify-center px-4 bg-black",children:h.jsxs(z.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"glass-fluid rounded-3xl p-10 max-w-md w-full text-center",children:[h.jsx(z.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,type:"spring",stiffness:200},className:`w-20 h-20 mx-auto mb-6 rounded-full border-2 flex items-center justify-center ${d()}`,children:c()}),h.jsxs(z.h2,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},className:"text-2xl font-bold text-white mb-4",children:[i==="loading"&&"Connecting...",i==="success"&&"Success!",i==="error"&&"Connection Failed"]}),h.jsx(z.p,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},className:"text-white/70 mb-6",children:a}),i==="loading"&&h.jsx(z.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},className:"w-full bg-white/10 rounded-full h-2 mb-4",children:h.jsx(z.div,{className:"bg-spotify-green h-2 rounded-full",initial:{width:0},animate:{width:"100%"},transition:{duration:3,ease:"easeInOut"}})}),i==="error"&&h.jsx(z.button,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>t("/"),className:"bg-spotify-green hover:bg-spotify-green/90 text-white font-semibold py-3 px-6 rounded-lg transition-all duration-300",children:"Try Again"}),i==="success"&&h.jsx(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},className:"text-spotify-green text-sm",children:"Redirecting you to your musical journey..."})]})})},Vj=()=>{var g,w,v;const{currentUser:e,partnerUser:t,currentTrack:r,isPlaying:n,setCurrentTrack:s,setIsPlaying:i,theme:o}=oe(),a=en(o),[l,c]=S.useState(!1),[d,f]=S.useState(null),u=S.useMemo(()=>{const y=((e==null?void 0:e.recentlyPlayed)||[]).map(N=>({who:"you",played_at:new Date(N.played_at).getTime(),track:N.track,key:`you-${N.track.id}-${N.played_at}`})),x=((t==null?void 0:t.recentlyPlayed)||[]).map(N=>({who:"partner",played_at:new Date(N.played_at).getTime(),track:N.track,key:`partner-${N.track.id}-${N.played_at}`})),b=[...y,...x].sort((N,P)=>P.played_at-N.played_at).slice(0,30),k=new Set,C=new Set;return b.forEach(N=>{const P=N.track.id;k.has(P)?C.add(P):k.add(P)}),{items:b,overlaps:C}},[e==null?void 0:e.recentlyPlayed,t==null?void 0:t.recentlyPlayed]),p=async(y,x)=>{var b,k;if(!(e!=null&&e.accessToken)){ce.error("Not authenticated with Spotify");return}try{c(!0),f(x),n&&d===x?(await _j(e.accessToken),i(!1),s(null),f(null)):(await Aj(e.accessToken,y),i(!0),s(((k=(b=e.recentlyPlayed)==null?void 0:b.find(C=>C.track.id===x))==null?void 0:k.track)||null)),ce.success(n&&d===x?"Paused":"Now playing")}catch(C){console.error("Playback error:",C),ce.error("Failed to play track. Make sure Spotify is open on your device.")}finally{c(!1)}},m=({user:y,title:x,isPartner:b=!1})=>{var C,N,P,V,T;if(!((C=y==null?void 0:y.recentlyPlayed)!=null&&C.length))return h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-8 text-center",children:[h.jsx(Ke,{className:"w-16 h-16 mx-auto mb-4 text-white/30"}),h.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"No recent activity"}),h.jsxs("p",{className:"text-white/70",children:[b?"Your partner":"You"," haven't played any music recently"]})]});const k=y.recentlyPlayed[0];return h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-6",children:[h.jsxs("div",{className:"flex items-center space-x-4 mb-6",children:[h.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center ${b?"bg-gradient-to-br from-pink-500 to-purple-600":"bg-gradient-to-br from-blue-500 to-cyan-600"}`,children:h.jsx(Ls,{className:"w-6 h-6 text-white"})}),h.jsxs("div",{children:[h.jsx("h2",{className:"text-2xl font-bold text-white",children:x}),h.jsxs("p",{className:"text-white/70",children:["Last played: ",_n(k.played_at)]})]})]}),h.jsx(z.div,{whileHover:{scale:1.02},className:"bg-white/5 rounded-xl p-6 mb-6 border border-white/10",children:h.jsxs("div",{className:"flex items-center space-x-4 sm:space-x-6",children:[h.jsxs("div",{className:"relative flex-shrink-0",children:[h.jsx("img",{src:((N=k.track.album.images[0])==null?void 0:N.url)||"/placeholder-album.png",alt:k.track.album.name,className:"w-16 h-16 sm:w-20 sm:h-20 rounded-lg object-cover"}),n&&d===k.track.id&&h.jsx("div",{className:"absolute inset-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${((P=a.cssVars)==null?void 0:P.primary)||"#1db954"}20`},children:h.jsx(Uk,{className:"w-6 h-6",style:{color:((V=a.cssVars)==null?void 0:V.primary)||"#1db954"}})})]}),h.jsxs("div",{className:"flex-1",children:[h.jsx("h3",{className:"text-xl font-semibold text-white mb-1",children:k.track.name}),h.jsx("p",{className:"text-white/70 mb-2",children:k.track.artists.map(O=>O.name).join(", ")}),h.jsxs("p",{className:"text-white/50 text-sm",children:[k.track.album.name," • ",Ds(k.track.duration_ms)]})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx("button",{onClick:()=>p(k.track.external_urls.spotify,k.track.id),disabled:l,className:"w-12 h-12 rounded-full flex items-center justify-center transition-all duration-300 text-white disabled:opacity-50",style:{backgroundColor:n&&d===k.track.id?"#ef4444":((T=a.cssVars)==null?void 0:T.primary)||"#1db954"},onMouseEnter:O=>{l||(O.currentTarget.style.opacity="0.9")},onMouseLeave:O=>{l||(O.currentTarget.style.opacity="1")},children:l&&d===k.track.id?h.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}):n&&d===k.track.id?h.jsx($k,{className:"w-5 h-5"}):h.jsx(Wh,{className:"w-5 h-5 ml-0.5"})}),h.jsx("a",{href:k.track.external_urls.spotify,target:"_blank",rel:"noopener noreferrer",className:"w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition-colors",children:h.jsx(iy,{className:"w-4 h-4 text-white"})})]})]})}),h.jsxs("div",{children:[h.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center space-x-2",children:[h.jsx(Un,{className:"w-5 h-5"}),h.jsx("span",{children:"Recent History"})]}),h.jsx("div",{className:"space-y-3",children:y.recentlyPlayed.slice(0,5).map((O,j)=>{var F,D,G;return h.jsxs(z.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:j*.1},className:"flex items-center space-x-4 p-3 rounded-lg hover:bg-white/5 transition-colors group",children:[h.jsx("img",{src:((F=O.track.album.images[0])==null?void 0:F.url)||"/placeholder-album.png",alt:O.track.album.name,className:"w-12 h-12 rounded-lg object-cover"}),h.jsxs("div",{className:"flex-1",children:[h.jsx("h4",{className:"text-white font-medium group-hover:text-spotify-green transition-colors",children:O.track.name}),h.jsx("p",{className:"text-white/70 text-sm",children:(D=O.track.artists[0])==null?void 0:D.name})]}),h.jsx("div",{className:"text-white/50 text-sm",children:_n(O.played_at)}),h.jsx("button",{onClick:()=>p(O.track.external_urls.spotify,O.track.id),disabled:l,className:"opacity-0 group-hover:opacity-100 w-8 h-8 rounded-full flex items-center justify-center transition-all disabled:opacity-50",style:{backgroundColor:((G=a.cssVars)==null?void 0:G.primary)||"#1db954"},onMouseEnter:M=>{l||(M.currentTarget.style.opacity="0.9")},onMouseLeave:M=>{l||(M.currentTarget.style.opacity="1")},children:h.jsx(Wh,{className:"w-4 h-4 text-white ml-0.5"})})]},O.track.id)})})]})]})};return h.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:[h.jsxs("h1",{className:"text-4xl font-bold text-white mb-2 flex items-center space-x-3",children:[h.jsx(et,{className:"w-10 h-10",style:{color:((g=a.cssVars)==null?void 0:g.primary)||"#1db954"}}),h.jsx("span",{children:"What's Playing"})]}),h.jsx("p",{className:"text-white/70 text-lg",children:"Discover what you and your partner are listening to right now"})]}),h.jsxs("div",{className:"grid lg:grid-cols-2 gap-8",children:[e&&h.jsx(m,{user:e,title:`${(w=e.user)==null?void 0:w.display_name}'s Music`,isPartner:!1}),t&&h.jsx(m,{user:t,title:`${(v=t.user)==null?void 0:v.display_name}'s Music`,isPartner:!0}),!t&&h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-8 text-center",children:[h.jsx(et,{className:"w-16 h-16 mx-auto mb-4 text-pink-400"}),h.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"Waiting for your partner"}),h.jsx("p",{className:"text-white/70 mb-4",children:"Invite your partner to connect their Spotify account to see their music"}),h.jsx("button",{className:"bg-pink-500 hover:bg-pink-600 text-white px-6 py-3 rounded-lg transition-colors",children:"Send Invitation"})]})]}),e&&t&&h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-8 mt-8",children:[h.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center space-x-2",children:[h.jsx(Un,{className:"w-5 h-5"}),h.jsx("span",{children:"Shared Timeline"})]}),h.jsx("div",{className:"space-y-3",children:u.items.map(y=>{var x,b,k,C,N;return h.jsxs("div",{className:"flex items-center gap-4 p-3 rounded-lg bg-white/5",children:[h.jsx("img",{src:((k=(b=(x=y.track.album)==null?void 0:x.images)==null?void 0:b[0])==null?void 0:k.url)||"/placeholder-album.png",alt:((C=y.track.album)==null?void 0:C.name)||"Album",className:"w-10 h-10 rounded"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-white font-medium text-sm sm:text-base truncate",children:y.track.name}),u.overlaps.has(y.track.id)&&h.jsx("span",{className:"text-pink-400 text-sm flex-shrink-0",children:"💕"})]}),h.jsx("div",{className:"text-white/70 text-xs sm:text-sm truncate",children:(N=y.track.artists)==null?void 0:N.map(P=>P.name).join(", ")})]}),h.jsxs("div",{className:"text-white/50 text-xs w-32 text-right",children:[_n(new Date(y.played_at).toISOString()),h.jsx("div",{className:"text-white/60",children:y.who==="you"?"You":"Partner"})]})]},y.key)})})]})]})},Fj=({imageUrl:e,alt:t,fallbackGradient:r})=>{const[n,s]=S.useState(null),[i,o]=S.useState(!0),[a,l]=S.useState(!1);return S.useEffect(()=>{e.startsWith("http")?(s(e),o(!1)):(async()=>{try{const d=await fetch(`${Kn}${e}`);if(d.ok){const f=await d.json();s(f.dataUrl)}else l(!0)}catch{l(!0)}finally{o(!1)}})()},[e]),i?h.jsx("div",{className:"w-full h-full bg-gradient-to-br from-gray-500 to-gray-600 flex items-center justify-center",children:h.jsx(Ke,{className:"w-8 h-8 text-white animate-pulse"})}):a||!n?h.jsx("div",{className:`w-full h-full flex items-center justify-center ${r}`,children:h.jsx(Ke,{className:"w-8 h-8 text-white"})}):h.jsx("img",{src:n,alt:t,className:"w-full h-full object-cover",onError:()=>l(!0)})};function Qh(e){var n;const t=(n=e.vibe)==null?void 0:n.toLowerCase(),r=e.genres||[];if(t)switch(t){case"energetic":return"bg-gradient-to-br from-red-500 to-orange-500";case"chill":return"bg-gradient-to-br from-blue-500 to-teal-500";case"romantic":return"bg-gradient-to-br from-pink-500 to-rose-500";case"party":return"bg-gradient-to-br from-purple-500 to-pink-500";case"workout":return"bg-gradient-to-br from-green-500 to-lime-500";case"study":return"bg-gradient-to-br from-indigo-500 to-blue-500";case"sad":return"bg-gradient-to-br from-gray-500 to-slate-500";case"happy":return"bg-gradient-to-br from-yellow-500 to-orange-500"}if(r.length>0)switch(r[0].toLowerCase()){case"pop":return"bg-gradient-to-br from-pink-500 to-purple-500";case"rock":return"bg-gradient-to-br from-red-500 to-black";case"hip-hop":case"rap":return"bg-gradient-to-br from-yellow-500 to-red-500";case"electronic":case"edm":return"bg-gradient-to-br from-cyan-500 to-blue-500";case"jazz":return"bg-gradient-to-br from-amber-500 to-orange-500";case"classical":return"bg-gradient-to-br from-slate-500 to-gray-600";case"country":return"bg-gradient-to-br from-green-600 to-yellow-600";case"r&b":return"bg-gradient-to-br from-purple-600 to-pink-600";case"indie":return"bg-gradient-to-br from-teal-500 to-green-500";case"alternative":return"bg-gradient-to-br from-gray-600 to-purple-600"}return"bg-gradient-to-br from-purple-500 to-pink-500"}const Ij=()=>{var j,F,D,G;const{currentUser:e,partnerUser:t,mixedPlaylists:r,addMixedPlaylist:n,removeMixedPlaylist:s,setMixedPlaylists:i,theme:o}=oe(),a=en(o),[l,c]=S.useState(!1),[d,f]=S.useState(!1),[u,p]=S.useState(null),[m,g]=S.useState(""),[w,v]=S.useState(""),[y,x]=S.useState(!0),[b,k]=S.useState(!1),C=w.split(",").map(M=>M.trim()).filter(M=>M.length>0);S.useEffect(()=>{(async()=>{if(e!=null&&e.jwt)try{console.log("Loading playlists from database...");const W=await te("/playlists/mixed",e.jwt);console.log("Loaded playlists:",W.playlists);const _=W.playlists.map(A=>{var R;const I=A.track_uris?JSON.parse(A.track_uris):[];return console.log("Processing playlist:",A.name,"track_uris count:",I.length,"raw track_uris:",((R=A.track_uris)==null?void 0:R.substring(0,100))+"..."),{id:A.id,name:A.name,description:A.description,tracks:[],createdAt:new Date(A.created_at),createdBy:"AI Magic ✨",spotifyId:A.creator_spotify_id,spotifyUrl:A.creator_spotify_url,partnerSpotifyId:A.partner_spotify_id,partnerSpotifyUrl:A.partner_spotify_url,vibe:A.vibe,genres:A.genres?JSON.parse(A.genres):[],trackUris:I,spotifyImageUrl:A.creator_spotify_image_url}});i(_)}catch(W){console.error("Failed to load playlists:",W)}})()},[e==null?void 0:e.jwt]);const N=async()=>{var M,W,_,A,I,R;if(!u||!((M=e==null?void 0:e.user)!=null&&M.id)){ce.error("Unable to create playlist");return}if(!(e!=null&&e.jwt)){ce.error("Please login again");return}f(!0);try{const E={partnerId:((W=t==null?void 0:t.user)==null?void 0:W.id)||e.user.id,createForBoth:!1,includeKnown:!0,name:u.name,description:u.description},H=await Et("/playlists/mixed",E,e.jwt);n({...u,spotifyId:(A=(_=H==null?void 0:H.createdFor)==null?void 0:_.creator)==null?void 0:A.playlistId,spotifyUrl:(R=(I=H==null?void 0:H.createdFor)==null?void 0:I.creator)==null?void 0:R.url}),ce.success("Playlist created on Spotify!"),p(null)}catch(E){console.error("Spotify playlist creation error:",E),ce.error("Failed to create playlist on Spotify")}finally{f(!1)}},P=async()=>{var M,W,_,A;if(!((M=e==null?void 0:e.user)!=null&&M.id)||!((W=t==null?void 0:t.user)!=null&&W.id)){ce.error("Missing users");return}if(!(e!=null&&e.jwt)){ce.error("Please login again");return}f(!0);try{const I={partnerId:t.user.id,createForBoth:b,includeKnown:y,vibe:m||void 0,genres:C.length?C:void 0,description:(u==null?void 0:u.description)||"An AI-blended mix with fresh recommendations"},R=await Et("/playlists/mixed",I,e.jwt);b&&R.createdFor.partnerError?ce.success("Your playlist created! Partner sync failed: "+R.createdFor.partnerError):b&&R.createdFor.partner?ce.success("Enhanced playlist created on both accounts!"):ce.success("Enhanced playlist created!");const E={id:R.id,name:R.name,description:I.description,tracks:[],createdAt:new Date,createdBy:"AI Magic ✨",spotifyId:R.createdFor.creator.playlistId,spotifyUrl:R.createdFor.creator.url,partnerSpotifyId:(_=R.createdFor.partner)==null?void 0:_.playlistId,partnerSpotifyUrl:(A=R.createdFor.partner)==null?void 0:A.url,vibe:I.vibe,genres:I.genres||[],trackUris:R.trackUris||[],spotifyImageUrl:R.spotifyImageUrl};n(E),p(null)}catch(I){console.error(I),ce.error("Failed to create enhanced playlist")}finally{f(!1)}},V=()=>{u&&(n(u),p(null),ce.success("Playlist saved locally!"))},T=({playlist:M,isNew:W=!1})=>{var _;return h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},whileHover:{scale:1.02},className:`glass rounded-2xl p-6 ${W?"border-spotify-green/50":"border-white/10"}`,children:[h.jsxs("div",{className:"flex items-start justify-between mb-4",children:[h.jsxs("div",{className:"flex items-center space-x-4",children:[h.jsxs("div",{className:`w-16 h-16 rounded-xl flex items-center justify-center overflow-hidden flex-shrink-0 ${W?"bg-gradient-to-br from-spotify-green to-green-600":"bg-gradient-to-br from-purple-500 to-pink-500"}`,children:[W?h.jsx(Nr,{className:"w-8 h-8 text-white"}):M.spotifyImageUrl?h.jsx(Fj,{imageUrl:M.spotifyImageUrl,alt:M.name,fallbackGradient:Qh(M)}):null,!W&&h.jsx("div",{className:`w-full h-full flex items-center justify-center ${M.spotifyImageUrl?"bg-gradient-to-br from-purple-500 to-pink-500":Qh(M)}`,style:{display:M.spotifyImageUrl?"none":"flex"},children:h.jsx(Ke,{className:"w-8 h-8 text-white"})})]}),h.jsxs("div",{children:[h.jsx("h3",{className:"text-xl font-semibold text-white",children:M.name}),h.jsx("p",{className:"text-white/70 text-sm",children:M.description}),h.jsxs("div",{className:"flex flex-wrap gap-1 mt-1 mb-1",children:[M.vibe&&h.jsx("span",{className:"px-2 py-0.5 bg-blue-500/20 text-blue-300 text-xs rounded-full",children:M.vibe}),M.genres&&M.genres.length>0&&M.genres.slice(0,2).map((A,I)=>h.jsx("span",{className:"px-2 py-0.5 bg-green-500/20 text-green-300 text-xs rounded-full",children:A},I))]}),h.jsxs("p",{className:"text-white/50 text-xs",children:["Created ",W?"just now":new Date(M.createdAt).toLocaleDateString()," • ",M.tracks.length||((_=M.trackUris)==null?void 0:_.length)||0," tracks"]})]})]}),h.jsxs("div",{className:"flex items-center space-x-2",children:[M.spotifyUrl&&h.jsx("a",{href:M.spotifyUrl,target:"_blank",rel:"noopener noreferrer",className:"w-8 h-8 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition-colors",title:"Open in Spotify",children:h.jsx(iy,{className:"w-4 h-4 text-white"})}),M.partnerSpotifyUrl&&h.jsx("a",{href:M.partnerSpotifyUrl,target:"_blank",rel:"noopener noreferrer",className:"w-8 h-8 rounded-full bg-pink-500/20 hover:bg-pink-500/30 flex items-center justify-center transition-colors",title:"Partner's playlist in Spotify",children:h.jsx(et,{className:"w-4 h-4 text-pink-400"})}),!W&&h.jsx("button",{onClick:async()=>{try{e!=null&&e.jwt&&await I3(`/playlists/mixed/${M.id}`,e.jwt),s(M.id),ce.success("Playlist deleted successfully")}catch(A){console.error("Failed to delete playlist:",A),ce.error("Failed to delete playlist")}},className:"w-8 h-8 rounded-full bg-red-500/20 hover:bg-red-500/30 flex items-center justify-center transition-colors",children:h.jsx(ly,{className:"w-4 h-4 text-red-400"})})]})]}),h.jsx("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:M.tracks.length>0?h.jsxs(h.Fragment,{children:[M.tracks.slice(0,5).map((A,I)=>{var R,E,H,X,ee,q;return h.jsxs(z.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:I*.1},className:"flex items-center space-x-3 p-2 rounded-lg hover:bg-white/5 transition-colors",children:[h.jsx("img",{src:((H=(E=(R=A.album)==null?void 0:R.images)==null?void 0:E[0])==null?void 0:H.url)||"/placeholder-album.png",alt:((X=A.album)==null?void 0:X.name)||"Unknown Album",className:"w-10 h-10 rounded-lg object-cover"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("h4",{className:"text-white font-medium truncate",children:A.name}),h.jsx("p",{className:"text-white/70 text-sm truncate",children:((q=(ee=A.artists)==null?void 0:ee[0])==null?void 0:q.name)||"Unknown Artist"})]}),h.jsx("div",{className:"text-white/50 text-sm",children:Ds(A.duration_ms)})]},A.id)}),M.tracks.length>5&&h.jsxs("div",{className:"text-center text-white/50 text-sm py-2",children:["+",M.tracks.length-5," more tracks"]})]}):M.trackUris&&M.trackUris.length>0?h.jsx("div",{className:"text-center py-4"}):h.jsx("div",{className:"text-center text-white/50 text-sm py-4",children:"No tracks available"})}),W&&h.jsxs("div",{className:"flex items-center space-x-3 mt-6 pt-4 border-t border-white/10",children:[h.jsx("button",{onClick:N,disabled:d||b,className:"flex-1 bg-spotify-green hover:bg-spotify-green/90 text-white font-semibold py-3 px-4 rounded-lg transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:d?h.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}):h.jsxs(h.Fragment,{children:[h.jsx(Uc,{className:"w-4 h-4"}),h.jsx("span",{children:b?"Disabled (using Create for both)":"Create on Spotify"})]})}),h.jsx("button",{onClick:V,className:"px-4 py-3 bg-white/10 hover:bg-white/20 text-white rounded-lg transition-colors",children:"Save Locally"})]})]})},O=(e==null?void 0:e.topTracks)&&(t==null?void 0:t.topTracks);return h.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:[h.jsxs("h1",{className:"text-4xl font-bold text-white mb-2 flex items-center space-x-3",children:[h.jsx(Nr,{className:"w-10 h-10",style:{color:((j=a.cssVars)==null?void 0:j.primary)||"#1db954"}}),h.jsx("span",{children:"Mixed Playlists"})]}),h.jsx("p",{className:"text-white/70 text-lg",children:"AI-powered playlists that perfectly blend your musical tastes together"})]}),O&&h.jsx(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"mb-8",children:h.jsxs("div",{className:"glass rounded-2xl p-8 text-center",style:{borderColor:`${((F=a.cssVars)==null?void 0:F.primary)||"#1db954"}30`},children:[h.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full flex items-center justify-center",style:{background:`linear-gradient(135deg, ${((D=a.cssVars)==null?void 0:D.primary)||"#1db954"} 0%, ${((G=a.cssVars)==null?void 0:G.secondary)||"#1ed760"} 100%)`},children:h.jsx(Wk,{className:"w-8 h-8 text-white"})}),h.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Create Your Perfect Mix"}),h.jsx("p",{className:"text-white/70 mb-6 max-w-2xl mx-auto",children:"Our AI analyzes both your music tastes and creates a playlist that represents your unique musical connection"}),h.jsxs("div",{className:"mt-4 text-white/50 text-sm",children:["Analyzing ",e.topTracks.length+t.topTracks.length," tracks from both users"]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-left mt-8",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Vibe"}),h.jsxs("select",{className:"w-full bg-white/10 text-white rounded-lg p-2 appearance-none focus:outline-none focus:ring-2 focus:ring-spotify-green",value:m,onChange:M=>g(M.target.value),style:{backgroundColor:"rgba(255, 255, 255, 0.1)",color:"rgba(255, 255, 255, 0.9)"},children:[h.jsx("option",{value:"",style:{backgroundColor:"rgba(30, 30, 30, 0.95)",color:"rgba(255, 255, 255, 0.9)"},children:"Auto"}),h.jsx("option",{value:"energetic",style:{backgroundColor:"rgba(30, 30, 30, 0.95)",color:"rgba(255, 255, 255, 0.9)"},children:"Energetic"}),h.jsx("option",{value:"chill",style:{backgroundColor:"rgba(30, 30, 30, 0.95)",color:"rgba(255, 255, 255, 0.9)"},children:"Chill"}),h.jsx("option",{value:"happy",style:{backgroundColor:"rgba(30, 30, 30, 0.95)",color:"rgba(255, 255, 255, 0.9)"},children:"Happy"}),h.jsx("option",{value:"sad",style:{backgroundColor:"rgba(30, 30, 30, 0.95)",color:"rgba(255, 255, 255, 0.9)"},children:"Sad"}),h.jsx("option",{value:"party",style:{backgroundColor:"rgba(30, 30, 30, 0.95)",color:"rgba(255, 255, 255, 0.9)"},children:"Party"}),h.jsx("option",{value:"focus",style:{backgroundColor:"rgba(30, 30, 30, 0.95)",color:"rgba(255, 255, 255, 0.9)"},children:"Focus"})]})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-white/80 text-sm mb-1",children:"Genres (comma-separated)"}),h.jsx("input",{className:"w-full bg-white/10 text-white rounded-lg p-2 placeholder-white/60 focus:outline-none focus:ring-2 focus:ring-spotify-green",placeholder:"pop, rock, edm",value:w,onChange:M=>v(M.target.value)})]}),h.jsxs("label",{className:"flex items-center space-x-2 text-white/80",children:[h.jsx("input",{type:"checkbox",checked:y,onChange:M=>x(M.target.checked)}),h.jsx("span",{children:"Include songs we already know"})]}),h.jsxs("label",{className:"flex items-center space-x-2 text-white/80",children:[h.jsx("input",{type:"checkbox",checked:b,onChange:M=>k(M.target.checked)}),h.jsx("span",{children:"Create playlist on both accounts"}),b&&h.jsx("span",{className:"text-xs text-pink-400 ml-2",children:"✨ Synced"})]})]}),h.jsx("div",{className:"flex items-center justify-center gap-3 mt-6",children:h.jsx("button",{onClick:P,disabled:d,className:"bg-white/10 hover:bg-white/20 text-white font-semibold py-3 px-4 rounded-lg transition-colors disabled:opacity-50",children:"Create Enhanced Playlist"})})]})}),u&&h.jsxs(z.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"mb-8",children:[h.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:"✨ Your New Playlist"}),h.jsx(T,{playlist:u,isNew:!0})]}),r.length>0&&h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},children:[h.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:"Your Mixed Playlists"}),h.jsx("div",{className:"grid gap-6",children:r.map(M=>h.jsx(T,{playlist:M},M.id))})]}),!O&&h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-12 text-center",children:[h.jsx(et,{className:"w-16 h-16 mx-auto mb-4 text-pink-400"}),h.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:t?"Loading music data":"Waiting for your partner"}),h.jsx("p",{className:"text-white/70",children:t?"We need to analyze both your music tastes to create the perfect mixed playlist":"Invite your partner to connect their Spotify account to start creating mixed playlists"})]}),r.length===0&&O&&!u&&h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-12 text-center",children:[h.jsx(Ke,{className:"w-16 h-16 mx-auto mb-4 text-white/30"}),h.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"No playlists yet"}),h.jsx("p",{className:"text-white/70",children:"Create your first mixed playlist to start your musical journey together"})]})]})},zj=()=>{const{currentUser:e,partnerUser:t,memoryLane:r,addMemoryLaneItem:n}=oe(),[s,i]=S.useState(!1),[o,a]=S.useState({title:"",description:"",type:"milestone"});S.useEffect(()=>{var u,p,m,g,w,v,y,x,b,k,C,N;e&&t&&r.length===0&&[{id:"1",type:"milestone",title:"First Musical Connection",description:`${(u=e.user)==null?void 0:u.display_name} and ${(p=t.user)==null?void 0:p.display_name} discovered their shared love for music`,date:new Date(Date.now()-6048e5),users:[((m=e.user)==null?void 0:m.id)||"",((g=t.user)==null?void 0:g.id)||""]},{id:"2",type:"shared_track",title:"Shared Love for This Song",description:`Both of you have been listening to "${((v=(w=e.recentlyPlayed)==null?void 0:w[0])==null?void 0:v.track.name)||"Your favorite track"}" recently`,track:(x=(y=e.recentlyPlayed)==null?void 0:y[0])==null?void 0:x.track,date:new Date(Date.now()-2592e5),users:[((b=e.user)==null?void 0:b.id)||"",((k=t.user)==null?void 0:k.id)||""]},{id:"3",type:"playlist_created",title:"Our First Mixed Playlist",description:"Created a beautiful blend of your musical tastes",date:new Date(Date.now()-864e5),users:[((C=e.user)==null?void 0:C.id)||"",((N=t.user)==null?void 0:N.id)||""]}].forEach(V=>{n(V)})},[e,t,r.length,n]);const l=()=>{var p,m;if(!o.title.trim()||!o.description.trim()){ce.error("Please fill in both title and description");return}const u={id:Date.now().toString(),...o,date:new Date,users:[((p=e==null?void 0:e.user)==null?void 0:p.id)||"",((m=t==null?void 0:t.user)==null?void 0:m.id)||""]};n(u),a({title:"",description:"",type:"milestone"}),i(!1),ce.success("Memory added to your journey!")},c=u=>{switch(u){case"shared_track":return h.jsx(Ke,{className:"w-5 h-5"});case"playlist_created":return h.jsx(Nr,{className:"w-5 h-5"});case"milestone":return h.jsx(ay,{className:"w-5 h-5"});default:return h.jsx(et,{className:"w-5 h-5"})}},d=u=>{switch(u){case"shared_track":return"from-blue-500 to-cyan-500";case"playlist_created":return"from-purple-500 to-pink-500";case"milestone":return"from-yellow-500 to-orange-500";default:return"from-pink-500 to-red-500"}},f=({memory:u,index:p})=>{var m,g;return h.jsxs(z.div,{initial:{opacity:0,x:-50},animate:{opacity:1,x:0},transition:{delay:p*.1},className:"relative",children:[p<r.length-1&&h.jsx("div",{className:"absolute left-8 top-16 w-0.5 h-full bg-gradient-to-b from-white/20 to-transparent"}),h.jsxs("div",{className:"flex items-start space-x-6",children:[h.jsx("div",{className:`w-16 h-16 rounded-full bg-gradient-to-br ${d(u.type)} flex items-center justify-center relative z-10`,children:c(u.type)}),h.jsxs(z.div,{whileHover:{scale:1.02},className:"glass rounded-2xl p-6 flex-1 border border-white/10",children:[h.jsxs("div",{className:"flex items-start justify-between mb-4",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:u.title}),h.jsx("p",{className:"text-white/70 leading-relaxed",children:u.description})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-white/50 text-sm",children:[h.jsx(sy,{className:"w-4 h-4"}),h.jsx("span",{children:_n(u.date)})]})]}),u.track&&h.jsxs("div",{className:"flex items-center space-x-4 p-4 bg-white/5 rounded-lg",children:[h.jsx("img",{src:((m=u.track.album.images[0])==null?void 0:m.url)||"/placeholder-album.png",alt:u.track.album.name,className:"w-12 h-12 rounded-lg object-cover"}),h.jsxs("div",{className:"flex-1",children:[h.jsx("h4",{className:"text-white font-medium",children:u.track.name}),h.jsx("p",{className:"text-white/70 text-sm",children:(g=u.track.artists[0])==null?void 0:g.name})]}),h.jsx("button",{className:"w-8 h-8 rounded-full bg-spotify-green hover:bg-spotify-green/90 flex items-center justify-center transition-colors",children:h.jsx(Ke,{className:"w-4 h-4 text-white"})})]}),h.jsxs("div",{className:"flex items-center justify-between mt-4 pt-4 border-t border-white/10",children:[h.jsxs("div",{className:"flex items-center space-x-4 text-white/50 text-sm",children:[h.jsxs("div",{className:"flex items-center space-x-1",children:[h.jsx(Wc,{className:"w-4 h-4"}),h.jsx("span",{children:"Both of you"})]}),h.jsxs("div",{className:"flex items-center space-x-1",children:[h.jsx(Un,{className:"w-4 h-4"}),h.jsx("span",{children:new Date(u.date).toLocaleDateString()})]})]}),h.jsx("button",{className:"w-8 h-8 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition-colors",children:h.jsx(et,{className:"w-4 h-4 text-white"})})]})]})]})]})};return h.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[h.jsx(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsxs("h1",{className:"text-4xl font-bold text-white mb-2 flex items-center space-x-3",children:[h.jsx(et,{className:"w-10 h-10 text-pink-400"}),h.jsx("span",{children:"Memory Lane"})]}),h.jsx("p",{className:"text-white/70 text-lg",children:"Your beautiful musical journey together"})]}),h.jsxs(z.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>i(!0),className:"bg-gradient-to-r from-pink-500 to-red-500 hover:from-pink-600 hover:to-red-600 text-white font-semibold py-3 px-6 rounded-xl transition-all duration-300 flex items-center space-x-2",children:[h.jsx(Uc,{className:"w-5 h-5"}),h.jsx("span",{children:"Add Memory"})]})]})}),s&&h.jsx(z.div,{initial:{opacity:0},animate:{opacity:1},className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",onClick:()=>i(!1),children:h.jsxs(z.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},onClick:u=>u.stopPropagation(),className:"glass rounded-2xl p-8 max-w-md w-full",children:[h.jsx("h3",{className:"text-2xl font-bold text-white mb-6",children:"Add a New Memory"}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-white/70 text-sm font-medium mb-2",children:"Title"}),h.jsx("input",{type:"text",value:o.title,onChange:u=>a({...o,title:u.target.value}),className:"w-full px-4 py-3 bg-white/10 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-spotify-green",placeholder:"What's this memory about?"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-white/70 text-sm font-medium mb-2",children:"Description"}),h.jsx("textarea",{value:o.description,onChange:u=>a({...o,description:u.target.value}),className:"w-full px-4 py-3 bg-white/10 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-spotify-green h-24 resize-none",placeholder:"Tell the story of this memory..."})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-white/70 text-sm font-medium mb-2",children:"Type"}),h.jsxs("select",{value:o.type,onChange:u=>a({...o,type:u.target.value}),className:"w-full px-4 py-3 bg-white/10 border border-white/20 rounded-lg text-white focus:outline-none focus:border-spotify-green",style:{backgroundColor:"rgba(255, 255, 255, 0.1)",color:"rgba(255, 255, 255, 0.9)"},children:[h.jsx("option",{value:"milestone",style:{backgroundColor:"rgba(30, 30, 30, 0.95)",color:"rgba(255, 255, 255, 0.9)"},children:"Milestone"}),h.jsx("option",{value:"shared_track",style:{backgroundColor:"rgba(30, 30, 30, 0.95)",color:"rgba(255, 255, 255, 0.9)"},children:"Shared Track"}),h.jsx("option",{value:"playlist_created",style:{backgroundColor:"rgba(30, 30, 30, 0.95)",color:"rgba(255, 255, 255, 0.9)"},children:"Playlist Created"})]})]})]}),h.jsxs("div",{className:"flex items-center space-x-3 mt-6",children:[h.jsx("button",{onClick:l,className:"flex-1 bg-spotify-green hover:bg-spotify-green/90 text-white font-semibold py-3 px-4 rounded-lg transition-colors",children:"Add Memory"}),h.jsx("button",{onClick:()=>i(!1),className:"px-4 py-3 bg-white/10 hover:bg-white/20 text-white rounded-lg transition-colors",children:"Cancel"})]})]})}),h.jsx("div",{className:"space-y-8",children:r.length>0?r.map((u,p)=>h.jsx(f,{memory:u,index:p},u.id)):h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-12 text-center",children:[h.jsx(Dk,{className:"w-16 h-16 mx-auto mb-4 text-white/30"}),h.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"No memories yet"}),h.jsx("p",{className:"text-white/70 mb-6",children:"Start creating beautiful musical memories together"}),h.jsx("button",{onClick:()=>i(!0),className:"bg-gradient-to-r from-pink-500 to-red-500 hover:from-pink-600 hover:to-red-600 text-white font-semibold py-3 px-6 rounded-xl transition-all duration-300",children:"Create First Memory"})]})}),r.length>0&&h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},className:"mt-12 grid grid-cols-1 md:grid-cols-3 gap-6",children:[h.jsxs("div",{className:"glass rounded-2xl p-6 text-center",children:[h.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-gradient-to-br from-pink-500 to-red-500 rounded-full flex items-center justify-center",children:h.jsx(et,{className:"w-6 h-6 text-white"})}),h.jsx("h4",{className:"text-2xl font-bold text-white mb-1",children:r.length}),h.jsx("p",{className:"text-white/70 text-sm",children:"Memories Created"})]}),h.jsxs("div",{className:"glass rounded-2xl p-6 text-center",children:[h.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-gradient-to-br from-blue-500 to-cyan-500 rounded-full flex items-center justify-center",children:h.jsx(Ke,{className:"w-6 h-6 text-white"})}),h.jsx("h4",{className:"text-2xl font-bold text-white mb-1",children:r.filter(u=>u.type==="shared_track").length}),h.jsx("p",{className:"text-white/70 text-sm",children:"Shared Tracks"})]}),h.jsxs("div",{className:"glass rounded-2xl p-6 text-center",children:[h.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-gradient-to-br from-purple-500 to-pink-500 rounded-full flex items-center justify-center",children:h.jsx(Nr,{className:"w-6 h-6 text-white"})}),h.jsx("h4",{className:"text-2xl font-bold text-white mb-1",children:r.filter(u=>u.type==="playlist_created").length}),h.jsx("p",{className:"text-white/70 text-sm",children:"Playlists Created"})]})]})]})};function Oj(e,t){if(!e||!t)return 0;const r=["energy","valence"];let n=0,s=0;for(const i of r)typeof e[i]=="number"&&typeof t[i]=="number"&&(n+=1-Math.min(1,Math.abs(e[i]-t[i])),s++);return s?Math.round(n/s*100):0}const $j=()=>{var u,p;const{currentUser:e,partnerUser:t}=oe(),[r,n]=S.useState(null),[s,i]=S.useState(null),[o,a]=S.useState(null),[l,c]=S.useState(null);S.useEffect(()=>{let m;const g=async()=>{var w,v,y,x;try{const b=(w=e==null?void 0:e.user)==null?void 0:w.id;if(b){const C=await te(`/users/${b}/now-playing`);n(C);const N=(v=C==null?void 0:C.item)==null?void 0:v.id;if(N){const P=await te(`/users/${b}/audio-features?ids=${N}`);a(((P==null?void 0:P.audio_features)||[])[0]||null)}}const k=(y=t==null?void 0:t.user)==null?void 0:y.id;if(k){const C=await te(`/users/${k}/now-playing`);i(C);const N=(x=C==null?void 0:C.item)==null?void 0:x.id;if(N){const P=await te(`/users/${k}/audio-features?ids=${N}`);c(((P==null?void 0:P.audio_features)||[])[0]||null)}}}catch{}m=setTimeout(g,8e3)};return g(),()=>clearTimeout(m)},[(u=e==null?void 0:e.user)==null?void 0:u.id,(p=t==null?void 0:t.user)==null?void 0:p.id]);const d=S.useMemo(()=>Oj(o,l),[o,l]),f=({data:m,who:g})=>{var v,y,x;if(!(m!=null&&m.is_playing)||!(m!=null&&m.item))return h.jsxs("div",{className:"glass rounded-2xl p-6 text-white/70",children:[g," is not playing"]});const w=m.item;return h.jsxs("div",{className:"glass rounded-2xl p-6 flex items-center gap-4",children:[h.jsx("img",{src:((x=(y=(v=w==null?void 0:w.album)==null?void 0:v.images)==null?void 0:y[0])==null?void 0:x.url)||"/placeholder-album.png",alt:w==null?void 0:w.name,className:"w-16 h-16 rounded"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-white font-semibold truncate",children:w==null?void 0:w.name}),h.jsx("div",{className:"text-white/70 text-sm truncate",children:((w==null?void 0:w.artists)||[]).map(b=>b.name).join(", ")})]}),h.jsx("div",{className:"flex gap-1",children:[...Array(12)].map((b,k)=>h.jsx("div",{className:"w-1 bg-spotify-green/60 animate-pulse",style:{height:`${(Math.sin(k)*.5+.5)*32+8}px`,animationDelay:`${k*50}ms`}},k))})]})};return h.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-6",children:[h.jsx("h1",{className:"text-3xl font-bold text-white",children:"Live Dashboard"}),h.jsx("p",{className:"text-white/70",children:"See what you are both playing right now"})]}),h.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[h.jsx(f,{data:r,who:"You"}),h.jsx(f,{data:s,who:"Partner"})]}),(r==null?void 0:r.is_playing)&&(s==null?void 0:s.is_playing)&&h.jsxs(z.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"glass rounded-2xl p-6 mt-6 text-center",children:[h.jsx("div",{className:"text-white/80",children:"Harmony Match"}),h.jsxs("div",{className:"text-4xl font-extrabold text-white mt-1",children:[d,"%"]})]})]})},Bj=()=>{var N,P,V,T,O;const{currentUser:e,partnerUser:t,theme:r}=oe(),n=en(r),[s,i]=S.useState(null),[o,a]=S.useState(!1),[l,c]=S.useState(0),[d,f]=S.useState("all"),[u,p]=S.useState({}),g=s?(j=>{var W,_;const F=[],D=new Date(j.dataCollectionStart),G=Math.floor((Date.now()-j.dataCollectionStart)/(1e3*60*60*24)),M=Math.floor(j.totalListeningTime/(1e3*60*60));if(F.push({id:"intro",type:"intro",title:"Your Music Wrapped",subtitle:`${j.timeRange==="all"?"All Time":j.timeRange.charAt(0).toUpperCase()+j.timeRange.slice(1)} Edition`,gradient:"from-purple-500 via-pink-500 to-red-500",data:{totalTracks:j.totalTracks,hoursListened:M,daysSinceStart:G,startDate:D.toLocaleDateString()}}),F.push({id:"dataStart",type:"intro",title:"Your Musical Journey",subtitle:`Started ${D.toLocaleDateString()}`,gradient:"from-blue-500 via-purple-500 to-pink-500",data:{hoursListened:M,daysSinceStart:G,averagePerDay:G>0?Math.round(j.totalTracks/G):0}}),j.topSongs.length>0&&F.push({id:"topSongs",type:"topSongs",title:"Your Top Songs",subtitle:`You played ${((W=j.topSongs[0])==null?void 0:W.playCount)||0} times`,gradient:"from-green-400 via-blue-500 to-purple-600",data:j.topSongs.slice(0,5)}),j.topArtists.length>0&&F.push({id:"topArtists",type:"topArtists",title:"Your Top Artists",subtitle:`${((_=j.topArtists[0])==null?void 0:_.name)||"Unknown"} was your #1`,gradient:"from-yellow-400 via-red-500 to-pink-500",data:j.topArtists.slice(0,5)}),F.push({id:"listeningHabits",type:"listeningPatterns",title:"Your Listening Habits",subtitle:"When you vibe the most",gradient:"from-teal-400 via-green-500 to-blue-500",data:{mostActiveHour:j.listeningPatterns.mostActiveHour,mostActiveDay:j.listeningPatterns.mostActiveDay,listeningStreak:j.listeningPatterns.listeningStreak,lateNight:j.uniqueCategories.lateNightListener,earlyBird:j.uniqueCategories.earlyBird,weekendWarrior:j.uniqueCategories.weekendWarrior}}),F.push({id:"discovery",type:"listeningPatterns",title:"Music Explorer",subtitle:"Your discovery journey",gradient:"from-indigo-500 via-purple-500 to-pink-500",data:{discoveryRate:j.uniqueCategories.discoveryRate,averageSongLength:j.uniqueCategories.averageSongLength,listeningVelocity:j.uniqueCategories.listeningVelocity}}),j.uniqueCategories.longestSession.duration>0&&F.push({id:"longestSession",type:"listeningTime",title:"Your Longest Session",subtitle:"When you couldn't stop listening",gradient:"from-orange-400 via-red-500 to-pink-500",data:{totalTime:j.uniqueCategories.longestSession.duration,totalTracks:Math.floor(j.uniqueCategories.longestSession.duration/(j.uniqueCategories.averageSongLength||18e4)),averagePerTrack:j.uniqueCategories.averageSongLength||18e4}}),j.uniqueCategories.mostDiverseDay.artistCount>0&&F.push({id:"mostDiverseDay",type:"listeningPatterns",title:"Your Most Diverse Day",subtitle:"When you explored the most",gradient:"from-cyan-400 via-blue-500 to-indigo-600",data:{date:j.uniqueCategories.mostDiverseDay.date,artistCount:j.uniqueCategories.mostDiverseDay.artistCount}}),j.partnerData){F.push({id:"partnerComparison",type:"listeningTime",title:"You vs Your Partner",subtitle:"Musical journey together",gradient:"from-pink-400 via-purple-500 to-indigo-500",data:{yourTracks:j.totalTracks,partnerTracks:j.partnerData.totalTracks,yourTime:j.totalListeningTime,partnerTime:j.partnerData.totalListeningTime}});const A=new Set(j.topArtists.slice(0,10).map(E=>E.id)),I=new Set(j.partnerData.topArtists.map(E=>E.id)),R=Array.from(A).filter(E=>I.has(E));R.length>0&&F.push({id:"sharedTaste",type:"topArtists",title:"Your Shared Taste",subtitle:`${R.length} artists you both love`,gradient:"from-green-400 via-teal-500 to-blue-500",data:{sharedArtists:R.length}})}return F.push({id:"listeningTime",type:"listeningTime",title:"Total Listening Time",subtitle:"You've been on a musical journey",gradient:"from-orange-400 via-red-500 to-pink-500",data:{totalTime:j.totalListeningTime,totalTracks:j.totalTracks,averagePerTrack:j.totalTracks>0?j.totalListeningTime/j.totalTracks:0}}),F.push({id:"outro",type:"outro",title:"Thanks for Listening!",subtitle:"Keep discovering amazing music",gradient:"from-purple-500 via-pink-500 to-red-500",data:{generatedAt:j.generatedAt}}),F})(s):[],w=async j=>{var D;if(!((D=e==null?void 0:e.user)!=null&&D.id)||!(e!=null&&e.jwt))return;const F=j.map(async G=>{try{const M=await te(`/users/${e.user.id}/artist/${G.id}`,e.jwt);M.images&&M.images.length>0&&p(W=>({...W,[G.id]:M.images[0].url}))}catch(M){console.error(`Failed to fetch image for artist ${G.name}:`,M)}});await Promise.all(F)},v=async(j="all")=>{var F;if(!(!((F=e==null?void 0:e.user)!=null&&F.id)||!(e!=null&&e.jwt))){a(!0);try{const D=await te(`/users/${e.user.id}/wrapped?range=${j}`,e.jwt);i(D),c(0),D.topArtists&&D.topArtists.length>0&&w(D.topArtists)}catch(D){console.error("Failed to fetch wrapped data:",D),ce.error("Failed to load your music wrapped")}finally{a(!1)}}};S.useEffect(()=>{v(d)},[d,(N=e==null?void 0:e.user)==null?void 0:N.id,e==null?void 0:e.jwt]);const y=()=>{c(j=>(j+1)%g.length)},x=()=>{c(j=>(j-1+g.length)%g.length)},b=j=>{const F=Math.floor(j/36e5),D=Math.floor(j%(1e3*60*60)/(1e3*60));return`${F}h ${D}m`},k=j=>j===0?"12 AM":j<12?`${j} AM`:j===12?"12 PM":`${j-12} PM`,C=j=>{var D,G,M,W,_,A,I,R,E,H,X,ee,q,me,Rr,_t,St,Qe,on,Qn,B,le,ye,be,Fe,Lt,Zn,an,Zt,qc;const F="w-full h-full flex flex-col items-center justify-center text-center p-3 sm:p-6 overflow-y-auto";switch(j.type){case"intro":return h.jsx("div",{className:`${F} relative`,children:h.jsxs(z.div,{initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.8,ease:"easeOut"},className:"relative z-10 space-y-6",children:[h.jsx(Ke,{className:"w-16 h-16 sm:w-20 sm:h-20 lg:w-24 lg:h-24 mx-auto text-white/90"}),h.jsx("h1",{className:"text-3xl sm:text-5xl lg:text-6xl font-bold text-white mb-4",children:j.title}),h.jsx("p",{className:"text-lg sm:text-xl lg:text-2xl text-white/80 mb-8",children:j.subtitle}),((D=j.data)==null?void 0:D.hoursListened)&&h.jsxs("div",{className:"text-2xl sm:text-4xl lg:text-5xl font-bold text-white mb-4",children:[j.data.hoursListened," hours listened"]}),((G=j.data)==null?void 0:G.daysSinceStart)&&h.jsxs("div",{className:"text-lg text-white/70",children:["Since ",j.data.startDate," (",j.data.daysSinceStart," days ago)"]}),((M=j.data)==null?void 0:M.totalTracks)&&h.jsxs("div",{className:"text-2xl text-white/90",children:[j.data.totalTracks," songs played"]})]})});case"topSongs":return h.jsx("div",{className:`${F} relative`,children:h.jsxs(z.div,{initial:{y:50,opacity:0},animate:{y:0,opacity:1},transition:{duration:.6},className:"w-full max-w-3xl relative z-10",children:[h.jsx("h2",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold text-white mb-2",children:j.title}),h.jsx("p",{className:"text-lg sm:text-lg lg:text-xl text-white/80 mb-8",children:j.subtitle}),h.jsx("div",{className:"space-y-3",children:(W=j.data)==null?void 0:W.map((Ie,Jn)=>{var Gc,Yc,Kc,Xc,Qc,Zc;return h.jsxs(z.div,{initial:{x:-100,opacity:0},animate:{x:0,opacity:1},transition:{delay:Jn*.2,duration:.5},className:"flex items-center justify-between bg-white/10 backdrop-blur-md rounded-2xl p-4 border border-white/20",children:[h.jsxs("div",{className:"flex items-center space-x-4",children:[h.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-full flex items-center justify-center text-white font-bold text-lg",children:Jn+1}),h.jsx("img",{src:((Kc=(Yc=(Gc=Ie.album)==null?void 0:Gc.images)==null?void 0:Yc[0])==null?void 0:Kc.url)||"/placeholder-album.png",alt:(Xc=Ie.album)==null?void 0:Xc.name,className:"w-12 h-12 rounded-lg object-cover"}),h.jsxs("div",{className:"text-left",children:[h.jsx("h3",{className:"text-lg font-semibold text-white",children:Ie.name}),h.jsx("p",{className:"text-white/70 text-sm",children:(Zc=(Qc=Ie.artists)==null?void 0:Qc[0])==null?void 0:Zc.name})]})]}),h.jsxs("div",{className:"text-right",children:[h.jsxs("div",{className:"text-white font-bold",children:[Ie.playCount," plays"]}),h.jsx("div",{className:"text-white/70 text-sm",children:Ds(Ie.duration_ms)})]})]},Ie.id)})})]})});case"topArtists":return h.jsx("div",{className:`${F} relative`,children:h.jsxs(z.div,{initial:{y:50,opacity:0},animate:{y:0,opacity:1},transition:{duration:.6},className:"w-full max-w-4xl relative z-10",children:[h.jsx("h2",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold text-white mb-2",children:j.title}),h.jsx("p",{className:"text-lg sm:text-lg lg:text-xl text-white/80 mb-8",children:j.subtitle}),h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:(_=j.data)==null?void 0:_.map((Ie,Jn)=>h.jsxs(z.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},transition:{delay:Jn*.1,duration:.5},className:"bg-white/10 backdrop-blur-md rounded-2xl p-6 text-center border border-white/20",children:[h.jsx("div",{className:"w-20 h-20 mx-auto mb-4 rounded-full overflow-hidden border-2 border-white/20",children:u[Ie.id]?h.jsx("img",{src:u[Ie.id],alt:Ie.name,className:"w-full h-full object-cover"}):h.jsx("div",{className:"w-full h-full bg-white/20 flex items-center justify-center text-white font-bold text-xl",children:Jn+1})}),h.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:Ie.name}),h.jsxs("p",{className:"text-white/70",children:[Ie.playCount," plays"]}),h.jsx("p",{className:"text-white/60 text-sm",children:b(Ie.totalDuration)})]},Ie.id))})]})});case"listeningTime":return h.jsx("div",{className:`${F} relative`,children:h.jsxs(z.div,{initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.8,ease:"easeOut"},className:"space-y-6 relative z-10",children:[h.jsx(Un,{className:"w-16 h-16 sm:w-20 sm:h-20 lg:w-24 lg:h-24 mx-auto text-white/90"}),h.jsx("h2",{className:"text-3xl sm:text-5xl lg:text-6xl font-bold text-white mb-4",children:j.title}),h.jsx("p",{className:"text-lg sm:text-xl lg:text-2xl text-white/80 mb-8",children:j.subtitle}),h.jsx("div",{className:"text-4xl sm:text-6xl lg:text-7xl font-bold text-white mb-8",children:b(((A=j.data)==null?void 0:A.totalTime)||((I=j.data)==null?void 0:I.duration)||0)}),h.jsxs("div",{className:"grid grid-cols-2 gap-6 text-center",children:[h.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-6 border border-white/20",children:[h.jsx("div",{className:"text-3xl font-bold text-white",children:((R=j.data)==null?void 0:R.totalTracks)||0}),h.jsx("div",{className:"text-white/70",children:"Total Songs"})]}),h.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-6 border border-white/20",children:[h.jsx("div",{className:"text-3xl font-bold text-white",children:Ds(((E=j.data)==null?void 0:E.averagePerTrack)||0)}),h.jsx("div",{className:"text-white/70",children:"Avg per Song"})]})]})]})});case"listeningPatterns":return h.jsx("div",{className:`${F} relative`,children:h.jsxs(z.div,{initial:{y:50,opacity:0},animate:{y:0,opacity:1},transition:{duration:.6},className:"w-full max-w-4xl relative z-10",children:[h.jsx("h2",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold text-white mb-2",children:j.title}),h.jsx("p",{className:"text-lg sm:text-lg lg:text-xl text-white/80 mb-8",children:j.subtitle}),h.jsxs("div",{className:`grid gap-6 justify-items-center ${((H=j.data)==null?void 0:H.artistCount)!==void 0&&!((X=j.data)!=null&&X.mostActiveHour)&&!((ee=j.data)!=null&&ee.mostActiveDay)&&!((q=j.data)!=null&&q.listeningStreak)&&!((me=j.data)!=null&&me.lateNight)&&!((Rr=j.data)!=null&&Rr.earlyBird)&&!((_t=j.data)!=null&&_t.weekendWarrior)&&!((St=j.data)!=null&&St.discoveryRate)&&!((Qe=j.data)!=null&&Qe.listeningVelocity)&&!((on=j.data)!=null&&on.averageSongLength)?"grid-cols-1 justify-center":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:[((Qn=j.data)==null?void 0:Qn.mostActiveHour)!==void 0&&h.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-6 text-center border border-white/20 w-full max-w-xs h-40 flex flex-col justify-center",children:[h.jsx(Un,{className:"w-12 h-12 mx-auto text-white/90 mb-4"}),h.jsx("div",{className:"text-2xl font-bold text-white mb-2",children:k(j.data.mostActiveHour)}),h.jsx("div",{className:"text-white/70",children:"Most Active Hour"})]}),((B=j.data)==null?void 0:B.mostActiveDay)&&h.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-6 text-center border border-white/20 w-full max-w-xs h-40 flex flex-col justify-center",children:[h.jsx(sy,{className:"w-12 h-12 mx-auto text-white/90 mb-4"}),h.jsx("div",{className:"text-2xl font-bold text-white mb-2",children:j.data.mostActiveDay}),h.jsx("div",{className:"text-white/70",children:"Most Active Day"})]}),((le=j.data)==null?void 0:le.listeningStreak)!==void 0&&h.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-6 text-center border border-white/20 w-full max-w-xs h-40 flex flex-col justify-center",children:[h.jsx(uy,{className:"w-12 h-12 mx-auto text-white/90 mb-4"}),h.jsx("div",{className:"text-2xl font-bold text-white mb-2",children:j.data.listeningStreak}),h.jsx("div",{className:"text-white/70",children:"Day Streak"})]}),((ye=j.data)==null?void 0:ye.lateNight)!==void 0&&h.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-6 text-center border border-white/20 w-full max-w-xs h-40 flex flex-col justify-center",children:[h.jsx(Ok,{className:"w-12 h-12 mx-auto text-white/90 mb-4"}),h.jsx("div",{className:"text-2xl font-bold text-white mb-2",children:j.data.lateNight}),h.jsx("div",{className:"text-white/70",children:"Late Night Plays"})]}),((be=j.data)==null?void 0:be.earlyBird)!==void 0&&h.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-6 text-center border border-white/20 w-full max-w-xs h-40 flex flex-col justify-center",children:[h.jsx(Bk,{className:"w-12 h-12 mx-auto text-white/90 mb-4"}),h.jsx("div",{className:"text-2xl font-bold text-white mb-2",children:j.data.earlyBird}),h.jsx("div",{className:"text-white/70",children:"Early Bird Plays"})]}),((Fe=j.data)==null?void 0:Fe.weekendWarrior)!==void 0&&h.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-6 text-center border border-white/20 w-full max-w-xs h-40 flex flex-col justify-center",children:[h.jsx(Ak,{className:"w-12 h-12 mx-auto text-white/90 mb-4"}),h.jsx("div",{className:"text-2xl font-bold text-white mb-2",children:j.data.weekendWarrior}),h.jsx("div",{className:"text-white/70",children:"Weekend Plays"})]}),((Lt=j.data)==null?void 0:Lt.discoveryRate)!==void 0&&h.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-6 text-center border border-white/20 w-full max-w-xs h-40 flex flex-col justify-center",children:[h.jsx(ay,{className:"w-12 h-12 mx-auto text-white/90 mb-4"}),h.jsx("div",{className:"text-2xl font-bold text-white mb-2",children:j.data.discoveryRate}),h.jsx("div",{className:"text-white/70",children:"Artists Discovered"})]}),((Zn=j.data)==null?void 0:Zn.listeningVelocity)!==void 0&&h.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-6 text-center border border-white/20 w-full max-w-xs h-40 flex flex-col justify-center",children:[h.jsx(qk,{className:"w-12 h-12 mx-auto text-white/90 mb-4"}),h.jsx("div",{className:"text-2xl font-bold text-white mb-2",children:j.data.listeningVelocity.toFixed(1)}),h.jsx("div",{className:"text-white/70",children:"Songs per Day"})]}),((an=j.data)==null?void 0:an.averageSongLength)!==void 0&&h.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-6 text-center border border-white/20 w-full max-w-xs h-40 flex flex-col justify-center",children:[h.jsx(Ke,{className:"w-12 h-12 mx-auto text-white/90 mb-4"}),h.jsx("div",{className:"text-2xl font-bold text-white mb-2",children:Ds(j.data.averageSongLength)}),h.jsx("div",{className:"text-white/70",children:"Avg Song Length"})]}),((Zt=j.data)==null?void 0:Zt.artistCount)!==void 0&&h.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-6 text-center border border-white/20 w-full max-w-xs h-40 flex flex-col justify-center",children:[h.jsx(Wc,{className:"w-12 h-12 mx-auto text-white/90 mb-4"}),h.jsx("div",{className:"text-2xl font-bold text-white mb-2",children:j.data.artistCount}),h.jsxs("div",{className:"text-white/70",children:["Artists on ",j.data.date]})]})]})]})});case"outro":return h.jsx("div",{className:`${F} relative`,children:h.jsxs(z.div,{initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.8,ease:"easeOut"},className:"space-y-6 relative z-10",children:[h.jsx(Nr,{className:"w-16 h-16 sm:w-20 sm:h-20 lg:w-24 lg:h-24 mx-auto text-white/90"}),h.jsx("h1",{className:"text-3xl sm:text-5xl lg:text-6xl font-bold text-white mb-4",children:j.title}),h.jsx("p",{className:"text-lg sm:text-xl lg:text-2xl text-white/80 mb-8",children:j.subtitle}),h.jsxs("div",{className:"text-lg text-white/60",children:["Generated on ",new Date(((qc=j.data)==null?void 0:qc.generatedAt)||Date.now()).toLocaleDateString()]})]})});default:return null}};return o?h.jsxs("div",{className:"min-h-screen flex items-center justify-center relative",children:[h.jsx(_s,{hueShift:Ms(r)}),h.jsxs(z.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"glass-fluid rounded-3xl p-10 flex flex-col items-center space-y-6 relative z-20",children:[h.jsx("div",{className:"w-16 h-16 border-4 border-t-transparent rounded-full animate-spin",style:{borderColor:"var(--theme-primary) var(--theme-primary) var(--theme-primary) transparent"}}),h.jsx("p",{className:"text-white font-medium text-lg",children:"Generating your music wrapped..."})]})]}):s?h.jsxs("div",{className:"min-h-screen relative",children:[h.jsx(_s,{hueShift:Ms(r)}),h.jsxs("div",{className:"relative z-20",children:[h.jsx("div",{className:"fixed top-0 left-0 right-0 z-50 p-4 sm:p-6 bg-black/30 backdrop-blur-md border-b border-white/10",children:h.jsx("div",{className:"flex items-center justify-between",children:h.jsxs("div",{className:"flex items-center space-x-4",children:[h.jsx("h1",{className:"text-2xl font-bold text-white",children:"Music Wrapped"}),h.jsxs("select",{value:d,onChange:j=>f(j.target.value),className:"bg-white/10 backdrop-blur-md text-white rounded-lg px-3 py-1 border border-white/20",children:[h.jsx("option",{value:"all",className:"bg-gray-800",children:"All Time"}),h.jsx("option",{value:"year",className:"bg-gray-800",children:"This Year"}),h.jsx("option",{value:"month",className:"bg-gray-800",children:"This Month"}),h.jsx("option",{value:"week",className:"bg-gray-800",children:"This Week"})]})]})})}),h.jsx("div",{className:"relative w-full min-h-screen flex items-center justify-center p-2 sm:p-4 pt-20 sm:pt-24",children:h.jsxs("div",{className:"w-full max-w-2xl sm:max-w-4xl h-[60vh] sm:h-[80vh] relative",children:[h.jsx(e3,{mode:"wait",children:h.jsx(z.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:-20},transition:{duration:.5,ease:"easeInOut"},className:"absolute inset-0 rounded-3xl overflow-hidden shadow-2xl overflow-y-auto",style:{background:`linear-gradient(135deg, ${((P=n.cssVars)==null?void 0:P.primary)||"#1db954"}20 0%, ${((V=n.cssVars)==null?void 0:V.secondary)||"#1ed760"}15 100%)`,backdropFilter:"blur(25px) saturate(180%)",WebkitBackdropFilter:"blur(25px) saturate(180%)",border:`1px solid ${((T=n.cssVars)==null?void 0:T.primary)||"#1db954"}40`,boxShadow:`0 25px 50px rgba(0,0,0,0.4), 0 0 0 1px ${((O=n.cssVars)==null?void 0:O.primary)||"#1db954"}30, inset 0 1px 0 rgba(255,255,255,0.1)`},children:C(g[l])},l)}),g.length>1&&h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:x,className:"absolute left-4 top-1/2 transform -translate-y-1/2 bg-white/10 backdrop-blur-md hover:bg-white/20 text-white p-3 rounded-full transition-colors border border-white/20",children:h.jsx(Vk,{className:"w-6 h-6"})}),h.jsx("button",{onClick:y,className:"absolute right-4 top-1/2 transform -translate-y-1/2 bg-white/10 backdrop-blur-md hover:bg-white/20 text-white p-3 rounded-full transition-colors border border-white/20",children:h.jsx(Fk,{className:"w-6 h-6"})})]}),h.jsx("div",{className:"absolute bottom-6 left-1/2 transform -translate-x-1/2 flex space-x-2",children:g.map((j,F)=>h.jsx("button",{onClick:()=>c(F),className:`w-3 h-3 rounded-full transition-colors ${F===l?"bg-white":"bg-white/30"}`},F))}),h.jsxs("div",{className:"absolute top-6 right-6 text-white/70 text-sm bg-white/10 backdrop-blur-md px-3 py-1 rounded-full border border-white/20",children:[l+1," / ",g.length]})]})})]})]}):h.jsxs("div",{className:"min-h-screen flex items-center justify-center relative",children:[h.jsx(_s,{hueShift:Ms(r)}),h.jsxs("div",{className:"text-center relative z-20",children:[h.jsx(Ke,{className:"w-24 h-24 text-white/50 mx-auto mb-4"}),h.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"No Music Data"}),h.jsx("p",{className:"text-white/70 mb-6",children:"Start listening to music to generate your wrapped!"})]})]})};function Uj(){var o,a;const{currentUser:e,partnerUser:t,isLoading:r,theme:n}=oe(),s=_r();console.log("🔍 App - Current location:",s.pathname),S.useEffect(()=>{en(n)},[n]),S.useEffect(()=>{const l=localStorage.getItem("spotify-user"),c=localStorage.getItem("spotify-partner");if(l)try{const d=JSON.parse(l);oe.getState().setCurrentUser(d)}catch(d){console.error("Failed to parse stored user data:",d),localStorage.removeItem("spotify-user")}if(c)try{const d=JSON.parse(c);oe.getState().setPartnerUser(d)}catch(d){console.error("Failed to parse stored partner data:",d),localStorage.removeItem("spotify-partner")}},[]),S.useEffect(()=>{(async()=>{var d,f;const c=(f=(d=oe.getState().currentUser)==null?void 0:d.user)==null?void 0:f.id;if(c&&!oe.getState().partnerUser)try{const u=await te(`/partners/partner/${c}`);if(u.partnerId){const[p,m,g]=await Promise.all([te(`/users/${u.partnerId}`),te(`/users/${u.partnerId}/recently-played`),te(`/users/${u.partnerId}/top-tracks?time_range=short_term`)]);oe.getState().setPartnerUser({user:p,accessToken:null,refreshToken:null,isAuthenticated:!0,recentlyPlayed:m,topTracks:g.map(w=>w.track),topArtists:[]})}}catch{}})()},[(o=e==null?void 0:e.user)==null?void 0:o.id]),S.useEffect(()=>{var d,f;const l=(f=(d=oe.getState().currentUser)==null?void 0:d.user)==null?void 0:f.id;if(!l)return;const c=V3(`/partners/events/${l}`);return c.onmessage=async u=>{var p,m;if(u.data)try{const g=JSON.parse(u.data);if((g==null?void 0:g.type)==="partner:connected"||(g==null?void 0:g.type)==="partner:disconnected"){const w=await te(`/partners/partner/${l}`),v=((m=(p=oe.getState().partnerUser)==null?void 0:p.user)==null?void 0:m.id)||null;if(!(w!=null&&w.partnerId)&&v){oe.getState().setPartnerUser(null),localStorage.removeItem("spotify-partner");return}if(w!=null&&w.partnerId&&w.partnerId!==v)try{const[y,x,b]=await Promise.all([te(`/users/${w.partnerId}`),te(`/users/${w.partnerId}/recently-played`),te(`/users/${w.partnerId}/top-tracks?time_range=short_term`)]);oe.getState().setPartnerUser({user:y,accessToken:null,refreshToken:null,isAuthenticated:!0,recentlyPlayed:x,topTracks:b.map(k=>k.track),topArtists:[]})}catch{}}(g==null?void 0:g.type)==="partner:request"||(g==null||g.type)}catch{}},c.onerror=()=>{try{c.close()}catch{}},()=>{try{c.close()}catch{}}},[(a=e==null?void 0:e.user)==null?void 0:a.id]);const i=(e==null?void 0:e.isAuthenticated)||!1;return r?h.jsxs("div",{className:"min-h-screen flex items-center justify-center relative",children:[h.jsx(_s,{hueShift:Ms(n)}),h.jsxs(z.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"glass-fluid rounded-3xl p-10 flex flex-col items-center space-y-6 relative z-20",children:[h.jsx("div",{className:"w-16 h-16 border-4 border-t-transparent rounded-full animate-spin",style:{borderColor:"var(--theme-primary) var(--theme-primary) var(--theme-primary) transparent"}}),h.jsx("p",{className:"text-white font-medium text-lg",children:"Loading your musical journey..."})]})]}):h.jsxs("div",{className:"min-h-screen relative overflow-hidden",children:[h.jsx(_s,{hueShift:Ms(n)}),h.jsxs("div",{className:"relative z-20",children:[i&&h.jsx(Nj,{}),h.jsxs(Fx,{children:[h.jsx(jt,{path:"/",element:i?h.jsx(Rj,{}):h.jsx(Lj,{})}),h.jsx(jt,{path:"/callback",element:h.jsx(Xh,{})}),h.jsx(jt,{path:"/callback.html",element:h.jsx(Xh,{})}),i&&h.jsxs(h.Fragment,{children:[h.jsx(jt,{path:"/last-listened",element:h.jsx(Vj,{})}),h.jsx(jt,{path:"/mixed-playlist",element:h.jsx(Ij,{})}),h.jsx(jt,{path:"/memory-lane",element:h.jsx(zj,{})}),h.jsx(jt,{path:"/live",element:h.jsx($j,{})}),h.jsx(jt,{path:"/wrapped",element:h.jsx(Bj,{})})]}),h.jsx(jt,{path:"*",element:h.jsx(Rx,{to:"/",replace:!0})})]})]})]})}il.createRoot(document.getElementById("root")).render(h.jsx(ii.StrictMode,{children:h.jsxs(Hx,{children:[h.jsx(Uj,{}),h.jsx(F2,{position:"top-right",toastOptions:{duration:4e3,style:{background:"rgba(255, 255, 255, 0.1)",backdropFilter:"blur(20px)",border:"1px solid rgba(255, 255, 255, 0.2)",color:"#fff"}}})]})}));