Files
echo-nexus/out/_next/static/chunks/bf71c96a2ffdd81d.js
T

14 lines
382 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16015,(e,t,s)=>{},98547,(e,t,s)=>{var r=e.i(47167);e.r(16015);var a=e.r(71645),i=a&&"object"==typeof a&&"default"in a?a:{default:a},n=void 0!==r.default&&r.default.env&&!0,o=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,s=t.name,r=void 0===s?"stylesheet":s,a=t.optimizeForSpeed,i=void 0===a?n:a;c(o(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",c("boolean"==typeof i,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=i,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t,s=e.prototype;return s.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},s.isOptimizeForSpeed=function(){return this._optimizeForSpeed},s.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(n||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,s){return"number"==typeof s?e._serverSheet.cssRules[s]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),s},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},s.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},s.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},s.insertRule=function(e,t){if(c(o(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var s=this.getSheet();"number"!=typeof t&&(t=s.cssRules.length);try{s.insertRule(e,t)}catch(t){return n||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},s.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var s="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!s.cssRules[e])return e;s.deleteRule(e);try{s.insertRule(t,e)}catch(r){n||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),s.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];c(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},s.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},s.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},s.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,s){return s?t=t.concat(Array.prototype.map.call(e.getSheetForTag(s).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},s.makeStyleTag=function(e,t,s){t&&c(o(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var a=document.head||document.getElementsByTagName("head")[0];return s?a.insertBefore(r,s):a.appendChild(r),r},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var s=0;s<t.length;s++){var r=t[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var d=function(e){for(var t=5381,s=e.length;s;)t=33*t^e.charCodeAt(--s);return t>>>0},u={};function h(e,t){if(!t)return"jsx-"+e;var s=String(t),r=e+s;return u[r]||(u[r]="jsx-"+d(e+"-"+s)),u[r]}function f(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var s=e+t;return u[s]||(u[s]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[s]}var m=function(){function e(e){var t=void 0===e?{}:e,s=t.styleSheet,r=void 0===s?null:s,a=t.optimizeForSpeed,i=void 0!==a&&a;this._sheet=r||new l({name:"styled-jsx",optimizeForSpeed:i}),this._sheet.inject(),r&&"boolean"==typeof i&&(this._sheet.setOptimizeForSpeed(i),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var s=this.getIdAndRules(e),r=s.styleId,a=s.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var i=a.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=i,this._instancesCounts[r]=1},t.remove=function(e){var t=this,s=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(s in this._instancesCounts,"styleId: `"+s+"` not found"),this._instancesCounts[s]-=1,this._instancesCounts[s]<1){var r=this._fromServer&&this._fromServer[s];r?(r.parentNode.removeChild(r),delete this._fromServer[s]):(this._indices[s].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[s]),delete this._instancesCounts[s]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],s=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return s[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,s;return t=this.cssRules(),void 0===(s=e)&&(s={}),t.map(function(e){var t=e[0],r=e[1];return i.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:s.nonce?s.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,s=e.dynamic,r=e.id;if(s){var a=h(r,s);return{styleId:a,rules:Array.isArray(t)?t.map(function(e){return f(a,e)}):[f(a,t)]}}return{styleId:h(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),p=a.createContext(null);function x(){return new m}function g(){return a.useContext(p)}p.displayName="StyleSheetContext";var b=i.default.useInsertionEffect||i.default.useLayoutEffect,y="u">typeof window?x():void 0;function v(e){var t=y||g();return t&&("u"<typeof window?t.add(e):b(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}v.dynamic=function(e){return e.map(function(e){return h(e[0],e[1])}).join(" ")},s.StyleRegistry=function(e){var t=e.registry,s=e.children,r=a.useContext(p),n=a.useState(function(){return r||t||x()})[0];return i.default.createElement(p.Provider,{value:n},s)},s.createStyleRegistry=x,s.style=v,s.useStyleRegistry=g},37902,(e,t,s)=>{t.exports=e.r(98547).style},67585,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let r=e.r(32061);function a({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new r.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,s)=>{"use strict";function r(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"encodeURIPath",{enumerable:!0,get:function(){return r}})},52157,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"PreloadChunks",{enumerable:!0,get:function(){return l}});let r=e.r(43476),a=e.r(74080),i=e.r(63599),n=e.r(9885),o=e.r(43369);function l({moduleIds:e}){if("u">typeof window)return null;let t=i.workAsyncStorage.getStore();if(void 0===t)return null;let s=[];if(t.reactLoadableManifest&&e){let r=t.reactLoadableManifest;for(let t of e){if(!r[t])continue;let e=r[t].files;s.push(...e)}}if(0===s.length)return null;let l=(0,o.getDeploymentIdQueryOrEmptyString)();return(0,r.jsx)(r.Fragment,{children:s.map(e=>{let s=`${t.assetPrefix}/_next/${(0,n.encodeURIPath)(e)}${l}`;return e.endsWith(".css")?(0,r.jsx)("link",{precedence:"dynamic",href:s,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,a.preload)(s,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return c}});let r=e.r(43476),a=e.r(71645),i=e.r(67585),n=e.r(52157);function o(e){return{default:e&&"default"in e?e.default:e}}let l={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},c=function(e){let t={...l,...e},s=(0,a.lazy)(()=>t.loader().then(o)),c=t.loading;function d(e){let o=c?(0,r.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,d=l?a.Suspense:a.Fragment,u=t.ssr?(0,r.jsxs)(r.Fragment,{children:["u"<typeof window?(0,r.jsx)(n.PreloadChunks,{moduleIds:t.modules}):null,(0,r.jsx)(s,{...e})]}):(0,r.jsx)(i.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(s,{...e})});return(0,r.jsx)(d,{...l?{fallback:o}:{},children:u})}return d.displayName="LoadableComponent",d}},70703,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return a}});let r=e.r(55682)._(e.r(69093));function a(e,t){let s={};"function"==typeof e&&(s.loader=e);let a={...s,...t};return(0,r.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},52683,e=>{"use strict";let t,s,r,a,i,n;var o,l,c,d=e.i(43476),u=e.i(71645);function h({className:e}){let t=(0,u.useRef)(null);return(0,u.useEffect)(()=>{let e=t.current;if(!e)return;let s=e.getContext("2d");if(!s)return;let r=0,a=0,i=1,n=[],o=[],l=0,c=performance.now(),d=["#34d399","#fb7185","#fbbf24","#e879f9","#a5f3fc"];function u(){i=Math.min(2,window.devicePixelRatio||1),r=e.clientWidth,a=e.clientHeight,e.width=Math.floor(r*i),e.height=Math.floor(a*i),s.setTransform(i,0,0,i,0,0),n=Array.from({length:Math.min(220,Math.floor(r*a/7e3))},()=>({x:Math.random()*r,y:Math.random()*a,z:Math.random(),r:1.4*Math.random()+.2,tw:Math.random()*Math.PI*2,hue:.15>Math.random()?Math.floor(Math.random()*d.length):-1}))}u();let h=new ResizeObserver(u);return h.observe(e),l=requestAnimationFrame(function e(t){let i=t-c;c=t;let u=s.createRadialGradient(.5*r,.4*a,0,.5*r,.5*a,.8*Math.max(r,a));u.addColorStop(0,"#1a0f2e"),u.addColorStop(.45,"#0d0a1f"),u.addColorStop(1,"#050410"),s.fillStyle=u,s.fillRect(0,0,r,a),s.globalCompositeOperation="screen";for(let e=0;e<3;e++){let i=r*(.2+.3*e)+40*Math.sin(t/9e3+e),n=a*(.3+e%2*.4)+30*Math.cos(t/11e3+e),o=Math.max(80,Math.min(r,a)*(.25+.05*e)),l=s.createRadialGradient(i,n,0,i,n,o),c=0===e?"rgba(232,121,249,0.10)":1===e?"rgba(52,211,153,0.08)":"rgba(251,113,133,0.08)";l.addColorStop(0,c),l.addColorStop(1,"rgba(0,0,0,0)"),s.fillStyle=l,s.beginPath(),s.arc(i,n,o,0,2*Math.PI),s.fill()}for(let e of(s.globalCompositeOperation="source-over",n)){e.tw+=.02+.04*e.z;let t=.4+.35*Math.sin(e.tw)+.3*e.z;e.hue>=0?(s.fillStyle=d[e.hue],s.globalAlpha=Math.max(0,Math.min(1,t)),s.beginPath(),s.arc(e.x,e.y,1.6*e.r,0,2*Math.PI),s.fill(),s.globalAlpha=Math.max(0,Math.min(1,.25*t)),s.beginPath(),s.arc(e.x,e.y,4*e.r,0,2*Math.PI)):(s.fillStyle=`rgba(220,230,255,${Math.max(0,Math.min(1,t))})`,s.beginPath(),s.arc(e.x,e.y,e.r,0,2*Math.PI)),s.fill(),e.y+=.02+.05*e.z,e.y>a+2&&(e.y=-2,e.x=Math.random()*r)}s.globalAlpha=1,.04>Math.random()&&function(){if(o.length>60)return;let e=d[Math.floor(Math.random()*d.length)];o.push({x:Math.random()*r,y:a+10,vx:(Math.random()-.5)*.3,vy:-(.5*Math.random()+.2),life:0,maxLife:600+800*Math.random(),color:e})}(),s.globalCompositeOperation="screen";for(let e=o.length-1;e>=0;e--){let t=o[e];if(t.life+=i,t.x+=t.vx*i*.06,t.y+=t.vy*i*.06,t.life>t.maxLife||t.y<-10){o.splice(e,1);continue}let r=.7*Math.sin(t.life/t.maxLife*Math.PI);s.fillStyle=t.color,s.globalAlpha=r,s.beginPath(),s.arc(t.x,t.y,1.6,0,2*Math.PI),s.fill(),s.globalAlpha=.2*r,s.beginPath(),s.arc(t.x,t.y,5,0,2*Math.PI),s.fill()}s.globalAlpha=1,s.globalCompositeOperation="source-over",l=requestAnimationFrame(e)}),()=>{cancelAnimationFrame(l),h.disconnect()}},[]),(0,d.jsx)("canvas",{ref:t,className:e,"aria-hidden":"true"})}var f=e.i(18533),m=e.i(52664),p=e.i(25147),x=e.i(75254);let g=(0,x.default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var b=e.i(9778),y=e.i(67240);e.i(74080);var v=e.i(91918),w=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let s=(0,v.createSlot)(`Primitive.${t}`),r=u.forwardRef((e,r)=>{let{asChild:a,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,d.jsx)(a?s:t,{...i,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),j="Progress",[N,k]=function(e,t=[]){let s=[],r=()=>{let t=s.map(e=>u.createContext(e));return function(s){let r=s?.[e]||t;return u.useMemo(()=>({[`__scope${e}`]:{...s,[e]:r}}),[s,r])}};return r.scopeName=e,[function(t,r){let a=u.createContext(r);a.displayName=t+"Context";let i=s.length;s=[...s,r];let n=t=>{let{scope:s,children:r,...n}=t,o=s?.[e]?.[i]||a,l=u.useMemo(()=>n,Object.values(n));return(0,d.jsx)(o.Provider,{value:l,children:r})};return n.displayName=t+"Provider",[n,function(s,n){let o=n?.[e]?.[i]||a,l=u.useContext(o);if(l)return l;if(void 0!==r)return r;throw Error(`\`${s}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let s=()=>{let s=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=s.reduce((t,{useScope:s,scopeName:r})=>{let a=s(e)[`__scope${r}`];return{...t,...a}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return s.scopeName=t.scopeName,s}(r,...t)]}(j),[S,T]=N(j),C=u.forwardRef((e,t)=>{var s,r;let{__scopeProgress:a,value:i=null,max:n,getValueLabel:o=_,...l}=e;(n||0===n)&&!R(n)&&console.error((s=`${n}`,`Invalid prop \`max\` of value \`${s}\` supplied to \`Progress\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`));let c=R(n)?n:100;null===i||$(i,c)||console.error((r=`${i}`,`Invalid prop \`value\` of value \`${r}\` supplied to \`Progress\`. The \`value\` prop must be:
- a positive number
- less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`));let u=$(i,c)?i:null,h=M(u)?o(u,c):void 0;return(0,d.jsx)(S,{scope:a,value:u,max:c,children:(0,d.jsx)(w.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":M(u)?u:void 0,"aria-valuetext":h,role:"progressbar","data-state":P(u,c),"data-value":u??void 0,"data-max":c,...l,ref:t})})});C.displayName=j;var E="ProgressIndicator",A=u.forwardRef((e,t)=>{let{__scopeProgress:s,...r}=e,a=T(E,s);return(0,d.jsx)(w.div,{"data-state":P(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});function _(e,t){return`${Math.round(e/t*100)}%`}function P(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function M(e){return"number"==typeof e}function R(e){return M(e)&&!isNaN(e)&&e>0}function $(e,t){return M(e)&&!isNaN(e)&&e<=t&&e>=0}A.displayName=E;var O=e.i(75157);function D({className:e,value:t,...s}){return(0,d.jsx)(C,{"data-slot":"progress",className:(0,O.cn)("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...s,children:(0,d.jsx)(A,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function L({onPrestige:e}){let t=(0,f.useGameStore)(e=>e.crystals),s=(0,f.useGameStore)(e=>e.crystalsPerSec),r=(0,f.useGameStore)(e=>e.insights),a=(0,f.useGameStore)(e=>e.contact),i=(0,f.useGameStore)(e=>e.ascensions),n=(0,f.useGameStore)(e=>e.blueprints);return(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 sm:gap-x-4 px-3.5 py-2.5 rounded-2xl border border-white/10 bg-black/40 backdrop-blur-md",children:[(0,d.jsx)(B,{icon:(0,d.jsx)(p.Gem,{className:"h-4 w-4 text-emerald-400"}),label:"记忆晶体",value:(0,m.formatNum)(t),sub:`+${s.toFixed(1)}/s`,glow:"rgba(52,211,153,0.4)"}),(0,d.jsx)("div",{className:"h-9 w-px bg-gradient-to-b from-transparent via-white/15 to-transparent hidden sm:block"}),(0,d.jsx)(B,{icon:(0,d.jsx)(g,{className:"h-4 w-4 text-amber-400"}),label:"技术洞见",value:(0,m.formatNum)(r),sub:"解码产出",glow:"rgba(251,191,36,0.4)"}),(0,d.jsx)("div",{className:"h-9 w-px bg-gradient-to-b from-transparent via-white/15 to-transparent hidden sm:block"}),(0,d.jsxs)("div",{className:"flex-1 min-w-[200px] flex flex-col gap-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(b.Waves,{className:"h-4 w-4 text-fuchsia-400 shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"接触进度"}),(0,d.jsxs)("span",{className:"text-xs font-mono font-semibold text-fuchsia-300 ml-auto tabular-nums",children:[a.toFixed(1),"%"]}),a>=100&&(0,d.jsx)("button",{onClick:e,className:"text-[10px] px-2 py-0.5 rounded-full bg-fuchsia-500/20 border border-fuchsia-400/50 text-fuchsia-200 hover:bg-fuchsia-500/30 transition animate-pulse whitespace-nowrap ml-1",children:"飞升"})]}),(0,d.jsx)(D,{value:a,className:"h-1.5 bg-white/10 [&>div]:bg-gradient-to-r [&>div]:from-fuchsia-500 [&>div]:to-rose-400"})]}),(0,d.jsx)("div",{className:"h-9 w-px bg-gradient-to-b from-transparent via-white/15 to-transparent hidden sm:block"}),(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,d.jsx)(y.RotateCcw,{className:"h-4 w-4 text-rose-400 shrink-0"}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground leading-none",children:"飞升"}),(0,d.jsxs)("div",{className:"flex items-baseline gap-1.5",children:[(0,d.jsx)("span",{className:"text-sm font-mono font-semibold leading-none",children:i}),(0,d.jsxs)("span",{className:"text-amber-300 text-xs leading-none",children:["×",n.length]})]})]})]})]})}function B({icon:e,label:t,value:s,sub:r,glow:a}){return(0,d.jsxs)("div",{className:"flex items-center gap-2.5",style:{filter:`drop-shadow(0 0 6px ${a})`},children:[e,(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground leading-none",children:t}),(0,d.jsxs)("div",{className:"flex items-baseline gap-1.5",children:[(0,d.jsx)("span",{className:"text-sm font-mono font-semibold leading-none tabular-nums",children:s}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground/80 whitespace-nowrap",children:r})]})]})]})}var I=e.i(37902),F=e.i(74911),V=e.i(31334);let z=["晶核深处传来一阵微弱的震颤…","以太族的余响在谐振中回荡。","你听见了一句无法辨认的低语。","星海的寂静被你的脉冲短暂打破。","晶体表面的纹路闪烁,像是某种回应。","回响核心记录着每一次触碰。","虚空深处,有什么在倾听。","谐振频率与你的脉冲产生了共鸣。","这是以太族留下的第一道印记。","晶体内部的光,比星辰更古老。","你的脉冲唤醒了一段沉睡的频率。","维度薄膜因你的触碰而微微颤动。","采矿不是掠夺,是聆听。","每一颗晶体,都是一封跨越时间的信。","以太族信任你,所以留下了这些。"],G={mining:"以太族从不掠夺星海,他们与矿脉共振,让晶体自愿献出光芒。",decoding:"谐振法则是以太族的核心遗产——思维可被编码为共振序列。",expedition:"他们留下的遗迹不是废墟,是故意设置的试炼场。",narrative:"记忆校音,是以太族赋予后来者的第一项礼物。"};function U(e,t){if(Math.random()<t){if(0===e.length)return"";let t=Math.floor(Math.random()*e.length);return e[t]}return null}let H="#34d399",W="#e879f9",q="#fb7185",Y="#fbbf24";function K(e){return e>=5?Y:e>=3?W:H}function X(){let e=(0,f.useGameStore)(e=>e.pulse),t=(0,f.useGameStore)(e=>e.crystals),s=(0,f.useGameStore)(e=>e.crystalsPerSec),r=(0,f.useGameStore)(e=>e.crystalCap),a=(0,f.useGameStore)(e=>e._combo),{toast:i}=(0,F.useToast)(),[n,o]=(0,u.useState)([]),l=(0,u.useRef)(0),c=(0,u.useRef)(null),h=(0,u.useRef)(null);(0,u.useRef)(0);let[p,x]=(0,u.useState)(0),g=(0,u.useRef)([]),b=(0,u.useRef)([]),y=(0,u.useRef)([]),v=(0,u.useRef)([]),w=(0,u.useRef)(a),j=(0,u.useRef)(0),N=(0,u.useRef)(t),k=(0,u.useRef)(r);(0,u.useEffect)(()=>{w.current=a,N.current=t,k.current=r},[a,t,r]);let S=(0,u.useRef)({x:0,y:0,inside:!1}),T=(0,u.useCallback)((e,t)=>{let s=.28*Math.min(e,t),r=[];[{count:14,rMul:.95,speed:.6,color:H},{count:10,rMul:1.15,speed:-.4,color:W},{count:8,rMul:1.35,speed:.3,color:q}].forEach(e=>{for(let t=0;t<e.count;t++)r.push({angle:2*Math.PI*t/e.count+.3*Math.random(),radius:s*e.rMul,baseRadius:s*e.rMul,speed:e.speed*(.8+.4*Math.random()),size:1.5+2*Math.random(),color:e.color,alpha:.5+.4*Math.random(),phase:Math.random()*Math.PI*2})}),g.current=r;let a=[];for(let s=0;s<40;s++)a.push({x:Math.random()*e,y:Math.random()*t,vx:(Math.random()-.5)*8,vy:(Math.random()-.5)*8,size:.5+1.5*Math.random(),alpha:.2+.5*Math.random(),twinkle:Math.random()*Math.PI*2});b.current=a},[]),C=(0,u.useCallback)((e,t,s)=>{let r=K(s.combo),a=performance.now();y.current.push({born:a,color:H,maxRadius:140,duration:700}),s.combo>=3&&y.current.push({born:a+100,color:W,maxRadius:170,duration:800}),s.combo>=5&&y.current.push({born:a+200,color:Y,maxRadius:200,duration:900});let i=10+2*Math.min(10,s.combo);for(let s=0;s<i;s++){let n=2*Math.PI*s/i+.4*Math.random(),o=120+180*Math.random();v.current.push({x:e,y:t,vx:Math.cos(n)*o,vy:Math.sin(n)*o,size:2+3*Math.random(),color:r,born:a,life:600+300*Math.random()})}g.current.forEach(e=>{e.radius=e.baseRadius*(1.25+.15*Math.random())})},[]),E=(0,u.useCallback)(t=>{let s=e();if(!s)return;let r=t.currentTarget.getBoundingClientRect(),a=t.clientX-r.left,n=t.clientY-r.top,c=l.current++,d=K(s.combo);if(o(e=>[...e,{id:c,x:a,y:n,text:`+${s.gain.toFixed(1)}`,born:Date.now(),color:d}]),C(a,n,s),x(e=>e+1),(0,V.sfx)(s.combo>=3?"pulseCombo":"pulse",{combo:s.combo}),setTimeout(()=>{o(e=>e.filter(e=>e.id!==c))},900),s.combo>=5&&s.combo%5==0){let e=U(z,.6);i({title:`\xd7${s.combo} 连击!`,description:e?`「${e}」`:"谐振叠加,产能飙升。"})}else if(s.combo>=3&&s.combo%3==0){let e=U(z,.3);e&&i({title:"低语",description:`「${e}」`})}},[e,i,C]);(0,u.useEffect)(()=>{let e=c.current,t=h.current;if(!e||!t)return;let s=e.getContext("2d");if(!s)return;let r=0,a=performance.now(),i=Math.min(window.devicePixelRatio||1,2),n=()=>{let r=t.getBoundingClientRect();i=Math.min(window.devicePixelRatio||1,2),e.width=Math.max(1,Math.floor(r.width*i)),e.height=Math.max(1,Math.floor(r.height*i)),e.style.width=`${r.width}px`,e.style.height=`${r.height}px`,s.setTransform(i,0,0,i,0,0),T(r.width,r.height)};n();let o=new ResizeObserver(n);o.observe(t);let l=t=>{let n=Math.min(.05,(t-a)/1e3);a=t;let o=e.width/i,c=e.height/i,d=o/2,u=c/2,h=.28*Math.min(o,c);s.clearRect(0,0,o,c),b.current.forEach(e=>{e.x+=e.vx*n,e.y+=e.vy*n,e.twinkle+=2*n,e.x<0&&(e.x=o),e.x>o&&(e.x=0),e.y<0&&(e.y=c),e.y>c&&(e.y=0);let t=.5+.5*Math.sin(e.twinkle);s.globalAlpha=e.alpha*t,s.fillStyle="#ffffff",s.beginPath(),s.arc(e.x,e.y,e.size,0,2*Math.PI),s.fill()}),s.globalAlpha=1;let f=.85+.15*Math.sin(.001*t),m=s.createRadialGradient(d,u,.3*h,d,u,2.2*h);m.addColorStop(0,`rgba(52,211,153,${.18*f})`),m.addColorStop(.5,`rgba(232,121,249,${.1*f})`),m.addColorStop(1,"rgba(0,0,0,0)"),s.fillStyle=m,s.fillRect(0,0,o,c),s.lineWidth=2.5,s.strokeStyle="rgba(255,255,255,0.06)",s.beginPath(),s.arc(d,u,1.45*h,0,2*Math.PI),s.stroke();let p=Math.min(100,N.current/Math.max(1,k.current)*100);j.current=p;let x=1.45*h,w=s.createLinearGradient(d-x,u-x,d+x,u+x);w.addColorStop(0,H),w.addColorStop(.5,W),w.addColorStop(1,q),s.strokeStyle=w,s.lineWidth=3,s.lineCap="round",s.shadowBlur=8,s.shadowColor=H,s.beginPath(),s.arc(d,u,x,-Math.PI/2,-Math.PI/2+2*Math.PI*p/100),s.stroke(),s.shadowBlur=0,g.current.forEach(e=>{e.angle+=e.speed*n,e.radius+=(e.baseRadius-e.radius)*Math.min(1,4*n);let r=d+Math.cos(e.angle)*e.radius,a=u+Math.sin(e.angle)*e.radius,i=.7+.3*Math.sin(.005*t+e.phase);s.globalAlpha=e.alpha*i,s.fillStyle=e.color,s.shadowBlur=10,s.shadowColor=e.color,s.beginPath(),s.arc(r,a,e.size,0,2*Math.PI),s.fill(),s.globalAlpha=e.alpha*i*.4,s.strokeStyle=e.color,s.lineWidth=.6*e.size,s.beginPath(),s.moveTo(r,a),s.lineTo(d+Math.cos(e.angle-.08*e.speed)*(e.radius-2),u+Math.sin(e.angle-.08*e.speed)*(e.radius-2)),s.stroke()}),s.globalAlpha=1,s.shadowBlur=0;let T=.95*h,C=0,E=0;if(S.current.inside){let e=S.current.x-d,t=S.current.y-u,s=Math.hypot(e,t);s>.1&&(C=e/s*Math.min(8,.05*s),E=t/s*Math.min(8,.05*s))}let A=d+C,_=u+E,P=s.createRadialGradient(A-.25*T,_-.3*T,.1*T,A,_,T);P.addColorStop(0,"rgba(255,255,255,0.95)"),P.addColorStop(.3,`rgba(52,211,153,${.85*f})`),P.addColorStop(.65,"rgba(232,121,249,0.55)"),P.addColorStop(1,"rgba(251,113,133,0.2)"),s.fillStyle=P,s.shadowBlur=30,s.shadowColor=H,s.beginPath(),s.arc(A,_,T,0,2*Math.PI),s.fill(),s.save(),s.translate(A,_),s.globalAlpha=.25,s.strokeStyle="rgba(255,255,255,0.6)",s.lineWidth=.8;let M=.7*T;for(let e=0;e<3;e++){let r=M*(1-.3*e);s.beginPath();for(let a=0;a<6;a++){let i=Math.PI/3*a+2e-4*t*(e%2?1:-1),n=Math.cos(i)*r,o=Math.sin(i)*r;0===a?s.moveTo(n,o):s.lineTo(n,o)}s.closePath(),s.stroke()}s.restore(),s.globalAlpha=.4,s.fillStyle="#ffffff",s.beginPath(),s.ellipse(A-.25*T,_-.35*T,.35*T,.18*T,-.4,0,2*Math.PI),s.fill(),s.globalAlpha=1,s.shadowBlur=0,y.current=y.current.filter(e=>{let r=t-e.born;if(r<0||r>e.duration)return r<=e.duration+50;let a=r/e.duration,i=e.maxRadius*a;return s.globalAlpha=(1-a)*.8,s.strokeStyle=e.color,s.lineWidth=2.5*(1-.5*a),s.shadowBlur=12,s.shadowColor=e.color,s.beginPath(),s.arc(d,u,i,0,2*Math.PI),s.stroke(),s.shadowBlur=0,!0}),y.current=y.current.filter(e=>t-e.born<e.duration),s.globalAlpha=1,v.current=v.current.filter(e=>{let r=t-e.born;if(r>e.life)return!1;e.x+=e.vx*n,e.y+=e.vy*n,e.vx*=.96,e.vy*=.96;let a=r/e.life;return s.globalAlpha=1-a,s.fillStyle=e.color,s.shadowBlur=8,s.shadowColor=e.color,s.beginPath(),s.arc(e.x,e.y,e.size*(1-.5*a),0,2*Math.PI),s.fill(),!0}),s.globalAlpha=1,s.shadowBlur=0,r=requestAnimationFrame(l)};return r=requestAnimationFrame(l),()=>{cancelAnimationFrame(r),o.disconnect()}},[T]);let A=(0,u.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();S.current={x:e.clientX-t.left,y:e.clientY-t.top,inside:!0}},[]),_=(0,u.useCallback)(()=>{S.current.inside=!1},[]),P=Math.min(100,t/Math.max(1,r)*100);return(0,d.jsxs)("div",{className:"jsx-dda3ce20a1930cc3 relative flex flex-col items-center justify-center gap-4 select-none",children:[a>1&&(0,d.jsxs)("div",{className:"jsx-dda3ce20a1930cc3 absolute -top-2 left-1/2 -translate-x-1/2 px-3 py-1 rounded-full bg-rose-500/20 border border-rose-400/40 text-rose-200 text-xs font-mono animate-pulse z-10",children:["×",a," 连击"]}),(0,d.jsxs)("button",{onClick:E,onMouseMove:A,onMouseLeave:_,"aria-label":"脉冲扫描,获取记忆晶体",className:"jsx-dda3ce20a1930cc3 relative h-52 w-52 sm:h-64 sm:w-64 rounded-full focus:outline-none group",children:[(0,d.jsx)("div",{ref:h,className:"jsx-dda3ce20a1930cc3 absolute inset-0 rounded-full overflow-hidden",children:(0,d.jsx)("canvas",{ref:c,className:"jsx-dda3ce20a1930cc3 block w-full h-full"})}),(0,d.jsxs)("div",{style:{animation:"echo-spin 18s linear infinite"},className:"jsx-dda3ce20a1930cc3 absolute inset-2 rounded-full border border-emerald-400/30 pointer-events-none",children:[(0,d.jsx)("div",{className:"jsx-dda3ce20a1930cc3 absolute top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 h-2 w-2 rounded-full bg-emerald-300 shadow-[0_0_8px_#34d399]"}),(0,d.jsx)("div",{className:"jsx-dda3ce20a1930cc3 absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2 h-1.5 w-1.5 rounded-full bg-rose-300 shadow-[0_0_8px_#fb7185]"})]}),(0,d.jsx)("div",{style:{animation:"echo-spin 24s linear infinite reverse"},className:"jsx-dda3ce20a1930cc3 absolute inset-6 rounded-full border border-fuchsia-400/20 border-dashed pointer-events-none"}),(0,d.jsx)("div",{style:{animation:"echo-ring 0.7s ease-out forwards"},className:"jsx-dda3ce20a1930cc3 absolute inset-8 rounded-full border-2 border-emerald-400/60 pointer-events-none"},`ring-${p}`),n.map(e=>(0,d.jsx)("span",{style:{left:e.x,top:e.y,color:e.color,transform:"translate(-50%, -50%)",animation:"echo-float 0.9s ease-out forwards",textShadow:`0 0 8px ${e.color}`},className:"jsx-dda3ce20a1930cc3 absolute pointer-events-none font-mono font-bold text-sm z-10",children:e.text},e.id))]}),(0,d.jsxs)("div",{className:"jsx-dda3ce20a1930cc3 text-center",children:[(0,d.jsx)("div",{style:{textShadow:"0 0 12px rgba(52,211,153,0.5)"},className:"jsx-dda3ce20a1930cc3 text-2xl font-mono font-bold text-emerald-300",children:(0,m.formatNum)(t)}),(0,d.jsxs)("div",{className:"jsx-dda3ce20a1930cc3 text-xs text-muted-foreground mt-0.5",children:["记忆晶体 · ",s.toFixed(1),"/s · 上限"," ",(0,m.formatNum)(r)]}),(0,d.jsxs)("div",{className:"jsx-dda3ce20a1930cc3 text-[11px] text-muted-foreground/70 mt-2",children:["点击晶体发起",(0,d.jsx)("span",{className:"jsx-dda3ce20a1930cc3 text-emerald-300",children:"脉冲扫描"}),",连击叠加加成"]}),(0,d.jsxs)("div",{className:"jsx-dda3ce20a1930cc3 text-[10px] text-muted-foreground/50 mt-1 tabular-nums",children:["仓库 ",P.toFixed(1),"% · 连击 ×",Math.max(1,a)]})]}),(0,d.jsx)(I.default,{id:"dda3ce20a1930cc3",children:"@keyframes echo-spin{to{transform:rotate(360deg)}}@keyframes echo-float{0%{opacity:1;transform:translate(-50%,-50%)scale(1)}to{opacity:0;transform:translate(-50%,-180%)scale(1.3)}}@keyframes echo-ring{0%{opacity:.8;transform:scale(.8)}to{opacity:0;transform:scale(1.6)}}"})]})}var Z=e.i(69992),J=e.i(19455),Q=e.i(37727),ee=e.i(83086);let et=(0,x.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),es=(0,x.default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),er=(0,x.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function ea(){let e=(0,f.useGameStore)(e=>e.activePuzzle),t=(0,f.useGameStore)(e=>e.clickNode),s=(0,f.useGameStore)(e=>e.undoStep),r=(0,f.useGameStore)(e=>e.retryPuzzle),a=(0,f.useGameStore)(e=>e.abandonPuzzle),{toast:i}=(0,F.useToast)(),[n,o]=(0,u.useState)(null),[l,c]=(0,u.useState)(null),[h,p]=(0,u.useState)(!1);if(!e)return null;let{grid:x,rows:g,cols:b,target:v,path:w,stepLimit:j,tier:N}=e,k=w.length,S=v[k],T=w.length>0&&w.length<v.length&&!(0,Z.isSolvable)(e),C=()=>{s(),p(!1),c(null)},E=100/b,A=100/g,_=w.map(e=>x.find(t=>t.id===e)).filter(Boolean);return(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 flex flex-col gap-4 h-full",children:[(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 flex items-center justify-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-xs text-muted-foreground mr-1",children:"目标谐振"}),v.map((e,t)=>{let s=t<k,r=t===k,a=m.COLOR_VISUAL[e];return(0,d.jsxs)("div",{style:{background:`radial-gradient(circle at 35% 30%, ${a.hex}, ${a.hex}aa 60%, ${a.hex}44)`,boxShadow:r?`0 0 18px ${a.glow}, 0 0 36px ${a.glow}`:`0 0 8px ${a.glow}`,"--tw-ring-color":a.hex},className:`jsx-35ab0418fdc54847 relative h-9 w-9 rounded-full flex items-center justify-center transition-all duration-300 ${s?"opacity-30 scale-90":""} ${r?"scale-125 ring-2 ring-offset-2 ring-offset-background":""}`,children:[s&&(0,d.jsx)(et,{className:"h-4 w-4 text-white"}),r&&(0,d.jsx)("span",{style:{color:a.hex},className:"jsx-35ab0418fdc54847 absolute -bottom-5 text-[10px] font-medium",children:"下一个"})]},t)})]}),(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 relative flex-1 min-h-[260px] rounded-2xl border border-white/10 bg-black/30 backdrop-blur-sm overflow-hidden",children:[(0,d.jsx)("div",{style:{backgroundImage:"linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px)",backgroundSize:`${E}% ${A}%`},className:"jsx-35ab0418fdc54847 absolute inset-0 opacity-20"}),(0,d.jsx)("svg",{className:"jsx-35ab0418fdc54847 absolute inset-0 w-full h-full pointer-events-none",children:_.map((e,t)=>{if(0===t)return null;let s=_[t-1],r=(s.col+.5)*E,a=(s.row+.5)*A,i=(e.col+.5)*E,n=(e.row+.5)*A,o=m.COLOR_VISUAL[e.color];return(0,d.jsx)("line",{x1:`${r}%`,y1:`${a}%`,x2:`${i}%`,y2:`${n}%`,stroke:o.hex,strokeWidth:2.5,strokeLinecap:"round",style:{filter:`drop-shadow(0 0 4px ${o.glow})`},className:"jsx-35ab0418fdc54847 echo-path-line"},t)})}),x.map(s=>{let r=m.COLOR_VISUAL[s.color],a=s.used,u=void 0!==S&&s.color===S&&!a,f=0===w.length&&u&&(0,Z.canStartFrom)(e,s.id),x=0===w.length&&u&&!f,g=n===s.id,y=l?.id===s.id,v=(s.col+.5)*E,j=(s.row+.5)*A;return(0,d.jsx)("button",{onClick:()=>(e=>{let s=t(e.id);if(s.ok&&s.finished){p(!1),(0,V.sfx)("decodeSuccess"),s.failReason&&s.failReason.split(",").filter(Boolean).length&&((0,V.sfx)("fragmentUnlock"),i({title:"✦ 记忆碎片浮现",description:"新的回响被拼入图谱,前往「记忆图谱」查看。"})),i({title:"谐振闭合!",description:"晶体解码成功,记忆已释放。"});return}s.ok?((0,V.sfx)("decodeClick",{color:e.color}),c({id:e.id,ok:!0}),setTimeout(()=>c(null),280),!1!==s.solvable||h||(p(!0),i({title:"谐振受阻",description:"此路不通,建议撤销上一步或重排。"})),!0===s.solvable&&p(!1)):((0,V.sfx)("decodeFail"),c({id:e.id,ok:!1}),setTimeout(()=>c(null),280))})(s),onMouseEnter:()=>o(s.id),onMouseLeave:()=>o(null),disabled:a,style:{left:`${v}%`,top:`${j}%`,width:`min(${100/b*.62}%, 56px)`,aspectRatio:"1",background:a?"rgba(255,255,255,0.04)":`radial-gradient(circle at 35% 30%, ${r.hex}, ${r.hex}cc 55%, ${r.hex}55)`,boxShadow:a?"inset 0 0 12px rgba(0,0,0,0.5)":f?`0 0 16px ${r.glow}, 0 0 32px ${r.glow}, inset 0 0 10px rgba(255,255,255,0.5)`:u?`0 0 10px ${r.glow}, 0 0 20px ${r.glow}, inset 0 0 6px rgba(255,255,255,0.3)`:`0 0 6px ${r.glow}`,border:f?`2px solid ${r.hex}`:u?`1.5px solid ${r.hex}aa`:"1px solid rgba(255,255,255,0.12)",opacity:a?.35:x?.5:1,transform:`translate(-50%, -50%) scale(${g&&!a?1.12:y?l?.ok?1.25:.8:1})`,animation:f?"echo-pulse 1.2s ease-in-out infinite":u&&!x?"echo-pulse 1.6s ease-in-out infinite":void 0},"aria-label":`${r.label}色节点 ${s.row+1}-${s.col+1}`,className:"jsx-35ab0418fdc54847 absolute rounded-full transition-[box-shadow,background,border,opacity] duration-200 focus:outline-none disabled:cursor-not-allowed",children:!a&&(0,d.jsx)("span",{style:{background:"radial-gradient(circle at 35% 30%, rgba(255,255,255,0.5), transparent 45%)"},className:"jsx-35ab0418fdc54847 absolute inset-0 rounded-full"})},s.id)})]}),T&&(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 flex items-center gap-2 px-3 py-2 rounded-lg border border-rose-400/40 bg-rose-950/40 text-rose-200 text-xs animate-pulse",children:[(0,d.jsx)(er,{className:"h-3.5 w-3.5 shrink-0"}),(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847",children:"谐振受阻,此路已无解。"}),(0,d.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:C,className:"h-6 px-2 ml-auto border-rose-400/50 text-rose-100 hover:bg-rose-500/20 text-[11px]",children:[(0,d.jsx)(es,{className:"h-3 w-3 mr-1"}),"撤销"]})]}),(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 flex items-center gap-2 text-xs",children:[(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-muted-foreground",children:"步数"}),(0,d.jsxs)("span",{className:`jsx-35ab0418fdc54847 font-mono font-semibold ${w.length>=j?"text-rose-400":"text-foreground"}`,children:[w.length," / ",j]}),(0,d.jsxs)("span",{className:"jsx-35ab0418fdc54847 ml-2 text-muted-foreground",children:["T",N]})]}),(0,d.jsxs)("div",{className:"jsx-35ab0418fdc54847 flex items-center gap-1.5",children:[(0,d.jsxs)(J.Button,{variant:"ghost",size:"sm",onClick:C,disabled:0===w.length,className:"h-7",children:[(0,d.jsx)(es,{className:"h-3.5 w-3.5 mr-1"}),"撤销"]}),(0,d.jsxs)(J.Button,{variant:"ghost",size:"sm",onClick:()=>{r(),p(!1),c(null)},className:"h-7",children:[(0,d.jsx)(y.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),"重排"]}),(0,d.jsxs)(J.Button,{variant:"ghost",size:"sm",onClick:()=>{a(),c(null),p(!1)},className:"h-7",children:[(0,d.jsx)(Q.X,{className:"h-3.5 w-3.5 mr-1"}),"放回"]})]})]}),(0,d.jsx)("p",{className:"jsx-35ab0418fdc54847 text-[11px] text-muted-foreground/80 text-center leading-relaxed",children:0===w.length?(0,d.jsxs)(d.Fragment,{children:["点击",(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-emerald-300",children:"高亮"}),"的可行起点开始,按目标顺序走",(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-emerald-300",children:"相邻同色"}),"节点;走错可",(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-rose-300",children:"撤销"}),"。"]}):(0,d.jsxs)(d.Fragment,{children:["按「目标谐振」顺序,点击",(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-emerald-300",children:"上下左右相邻"}),"的同色节点。每个节点仅可使用一次;走错可",(0,d.jsx)("span",{className:"jsx-35ab0418fdc54847 text-rose-300",children:"撤销"}),"。"]})}),(0,d.jsx)(I.default,{id:"35ab0418fdc54847",children:"@keyframes echo-pulse{0%,to{filter:brightness()}50%{filter:brightness(1.4)}}@keyframes echo-line{0%{stroke-dashoffset:100px}to{stroke-dashoffset:0}}.echo-path-line{stroke-dasharray:100;animation:.4s ease-out forwards echo-line}"})]})}function ei(){let e=(0,f.useGameStore)(e=>e.activePuzzle),t=(0,f.useGameStore)(e=>e.pendingCrystals),s=(0,f.useGameStore)(e=>e.startDecode),r=(0,f.useGameStore)(e=>e.crystalsPerSec),a=(0,f.useGameStore)(e=>e.crystalCap),i=(0,f.useGameStore)(e=>e.crystals);return e?(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)(ee.Sparkles,{className:"h-4 w-4 text-rose-400"}),(0,d.jsx)("h3",{className:"text-sm font-semibold",children:"解码共振阵列"})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0",children:(0,d.jsx)(ea,{})})]}):(0,d.jsxs)("div",{className:"jsx-53059b9e32765d5f h-full flex flex-col",children:[(0,d.jsxs)("div",{className:"jsx-53059b9e32765d5f flex items-center gap-2 mb-3",children:[(0,d.jsx)(ee.Sparkles,{className:"h-4 w-4 text-rose-400"}),(0,d.jsx)("h3",{className:"jsx-53059b9e32765d5f text-sm font-semibold",children:"待解码晶体"}),(0,d.jsxs)("span",{className:"jsx-53059b9e32765d5f text-xs text-muted-foreground ml-auto",children:["产能 ",r.toFixed(1),"/s · ",Math.floor(i),"/",Math.floor(a)]})]}),0===t.length?(0,d.jsxs)("div",{className:"jsx-53059b9e32765d5f flex-1 flex flex-col items-center justify-center text-center gap-3 rounded-2xl border border-dashed border-white/10 bg-black/20 p-6",children:[(0,d.jsxs)("div",{className:"jsx-53059b9e32765d5f relative h-16 w-16",children:[(0,d.jsx)("div",{className:"jsx-53059b9e32765d5f absolute inset-0 rounded-full bg-rose-500/20 blur-xl animate-pulse"}),(0,d.jsx)("div",{className:"jsx-53059b9e32765d5f absolute inset-2 rounded-full border-2 border-rose-400/40 rotate-45"}),(0,d.jsx)("div",{className:"jsx-53059b9e32765d5f absolute inset-4 rounded-full bg-rose-500/30"})]}),(0,d.jsx)("p",{className:"jsx-53059b9e32765d5f text-sm text-muted-foreground",children:"晶体正在生成中…"}),(0,d.jsx)("p",{className:"jsx-53059b9e32765d5f text-xs text-muted-foreground/70 max-w-[220px]",children:"自治无人机每数秒回收一颗记忆晶体,点击下方晶体开启解码。"})]}):(0,d.jsx)("div",{className:"jsx-53059b9e32765d5f flex-1 grid grid-cols-2 sm:grid-cols-3 gap-3 content-start max-h-[420px] overflow-y-auto echo-scroll pr-1",children:t.map(e=>(0,d.jsx)(en,{crystal:e,onClick:()=>s(e.id)},e.id))}),(0,d.jsx)(I.default,{id:"53059b9e32765d5f",children:".echo-scroll::-webkit-scrollbar{width:6px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:3px}.echo-scroll::-webkit-scrollbar-track{background:0 0}"})]})}function en({crystal:e,onClick:t}){let s=1===e.tier?"#34d399":2===e.tier?"#fbbf24":"#e879f9",r=1===e.tier?"常见":2===e.tier?"稀有":"史诗";return(0,d.jsxs)("button",{onClick:t,className:"group relative aspect-square rounded-2xl border border-white/10 bg-black/40 hover:border-white/40 transition-all duration-300 hover:scale-[1.04] focus:outline-none overflow-hidden",style:{boxShadow:`inset 0 0 24px ${s}22`},children:[(0,d.jsx)("div",{className:"absolute inset-0 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none",style:{background:`linear-gradient(120deg, transparent 30%, ${s}40 50%, transparent 70%)`,backgroundSize:"200% 100%",animation:"echo-border-flow 2s linear infinite",mixBlendMode:"screen"}}),(0,d.jsx)("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none overflow-hidden",children:(0,d.jsx)("div",{className:"absolute inset-x-0 h-px",style:{background:`linear-gradient(90deg, transparent, ${s}, transparent)`,animation:"echo-scan 1.8s ease-in-out infinite"}})}),(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,d.jsxs)("div",{className:"relative h-12 w-12 transition-transform duration-500 group-hover:rotate-[200deg] group-hover:scale-110",style:{filter:`drop-shadow(0 0 12px ${s}88)`},children:[(0,d.jsx)("div",{className:"absolute inset-0 rotate-45 rounded-md",style:{background:`linear-gradient(135deg, ${s}, ${s}66)`,border:`1px solid ${s}`}}),(0,d.jsx)("div",{className:"absolute inset-2 rotate-45 rounded-sm",style:{background:"linear-gradient(135deg, rgba(255,255,255,0.5), transparent)"}})]})}),(0,d.jsxs)("div",{className:"absolute top-1.5 left-1.5 z-10 text-[10px] font-mono font-semibold px-1.5 py-0.5 rounded bg-black/60 backdrop-blur-sm border",style:{color:s,borderColor:`${s}40`},children:["T",e.tier]}),(0,d.jsx)("div",{className:"absolute top-1.5 right-1.5 z-10 text-[9px] text-white/60 font-mono tracking-wider",children:r}),(0,d.jsxs)("div",{className:"absolute inset-x-0 bottom-0 z-10 bg-gradient-to-t from-black/85 via-black/50 to-transparent pt-4 pb-1.5 px-1 text-center opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:[(0,d.jsxs)("div",{className:"text-[12px] font-mono font-bold leading-none",style:{color:s},children:["+",e.value]}),(0,d.jsx)("div",{className:"text-[8px] text-white/60 uppercase tracking-[0.15em] mt-0.5",children:"解码 →"})]})]})}function eo({className:e,...t}){return(0,d.jsx)("div",{"data-slot":"card",className:(0,O.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}let el=(0,x.default)("pickaxe",[["path",{d:"M14.531 12.469 6.619 20.38a1 1 0 1 1-3-3l7.912-7.912",key:"we99rg"}],["path",{d:"M15.686 4.314A12.5 12.5 0 0 0 5.461 2.958 1 1 0 0 0 5.58 4.71a22 22 0 0 1 6.318 3.393",key:"1w6hck"}],["path",{d:"M17.7 3.7a1 1 0 0 0-1.4 0l-4.6 4.6a1 1 0 0 0 0 1.4l2.6 2.6a1 1 0 0 0 1.4 0l4.6-4.6a1 1 0 0 0 0-1.4z",key:"15hgfx"}],["path",{d:"M19.686 8.314a12.501 12.501 0 0 1 1.356 10.225 1 1 0 0 1-1.751-.119 22 22 0 0 0-3.393-6.319",key:"452b4h"}]]),ec=(0,x.default)("scan-line",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]]),ed=(0,x.default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);var eu=e.i(10980);let eh=(0,x.default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),ef={Pickaxe:el,ScanLine:ec,Rocket:ed,BookOpen:eu.BookOpen},em={mining:"#34d399",decoding:"#fb7185",expedition:"#fbbf24",narrative:"#e879f9"};function ep(){let e=(0,f.useGameStore)(e=>e.tech),t=(0,f.useGameStore)(e=>e.insights),s=(0,f.useGameStore)(e=>e.buyTech);return(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd flex flex-col gap-3 h-full",children:[(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd flex items-center justify-between",children:[(0,d.jsx)("h3",{className:"jsx-fbf3fdae687a84dd text-sm font-semibold",children:"技术树"}),(0,d.jsxs)("span",{className:"jsx-fbf3fdae687a84dd text-xs text-muted-foreground",children:["洞见 ",(0,d.jsx)("span",{className:"jsx-fbf3fdae687a84dd text-amber-300 font-mono",children:(0,m.formatNum)(t)})]})]}),(0,d.jsx)("div",{className:"jsx-fbf3fdae687a84dd flex-1 overflow-y-auto echo-scroll pr-1 space-y-3",children:["mining","decoding","expedition","narrative"].map(r=>{let a=m.TECH_BRANCH_META[r],i=ef[a.icon],n=em[r],o=m.TECH_TREE.filter(e=>e.branch===r);return(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd",children:[(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd flex items-center gap-2 mb-1.5 px-1",children:[(0,d.jsx)(i,{className:"jsx-fbf3fdae687a84dd h-3.5 w-3.5"}),(0,d.jsx)("span",{style:{color:n},className:"jsx-fbf3fdae687a84dd text-xs font-medium",children:a.name}),(0,d.jsx)("span",{className:"jsx-fbf3fdae687a84dd text-[10px] text-muted-foreground/70 truncate flex-1",children:a.desc})]}),(0,d.jsxs)("p",{className:"jsx-fbf3fdae687a84dd text-[9px] italic text-muted-foreground/50 px-1 mb-1.5 truncate",children:["「",G[r]??"","」"]}),(0,d.jsx)("div",{className:"jsx-fbf3fdae687a84dd grid gap-1.5",children:o.map(r=>{let a=(e[r.id]??0)>=1,i=t>=r.cost;return(0,d.jsx)(eo,{className:`p-2.5 transition-all duration-200 ${a?"bg-white/5 border-white/10":i?"bg-black/30 border-white/15 hover:border-white/30 cursor-pointer":"bg-black/20 border-white/5 opacity-60"}`,style:a?{boxShadow:`inset 0 0 0 1px ${n}44, 0 0 12px ${n}22`}:void 0,children:(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd flex items-center gap-2",children:[(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd flex-1 min-w-0",children:[(0,d.jsxs)("div",{className:"jsx-fbf3fdae687a84dd flex items-center gap-1.5",children:[(0,d.jsx)("span",{style:{color:a?n:void 0},className:"jsx-fbf3fdae687a84dd text-xs font-semibold truncate",children:r.name}),a&&(0,d.jsx)(et,{className:"h-3 w-3",style:{color:n}})]}),(0,d.jsx)("p",{className:"jsx-fbf3fdae687a84dd text-[10px] text-muted-foreground/80 truncate",children:r.desc})]}),!a&&(0,d.jsxs)(J.Button,{size:"sm",variant:i?"default":"ghost",disabled:!i,onClick:()=>{s(r.id)&&(0,V.sfx)("techBuy")},className:"h-7 px-2 text-[11px] shrink-0",style:i?{background:`${n}22`,border:`1px solid ${n}66`,color:n}:void 0,children:[(0,d.jsx)(eh,{className:"h-2.5 w-2.5 mr-1"}),r.cost]})]})},r.id)})})]},r)})}),(0,d.jsx)(I.default,{id:"fbf3fdae687a84dd",children:".echo-scroll::-webkit-scrollbar{width:5px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff1f;border-radius:3px}.echo-scroll::-webkit-scrollbar-track{background:0 0}"})]})}var ex=e.i(48425),eg=e.i(96626),eb=e.i(30030),ey=e.i(20783),ev=e.i(30207),ew=u.createContext(void 0);function ej(e){let t=u.useContext(ew);return e||t||"ltr"}var eN=e.i(34620),ek=e.i(81140),eS="ScrollArea",[eT,eC]=(0,eb.createContextScope)(eS),[eE,eA]=eT(eS),e_=u.forwardRef((e,t)=>{let{__scopeScrollArea:s,type:r="hover",dir:a,scrollHideDelay:i=600,...n}=e,[o,l]=u.useState(null),[c,h]=u.useState(null),[f,m]=u.useState(null),[p,x]=u.useState(null),[g,b]=u.useState(null),[y,v]=u.useState(0),[w,j]=u.useState(0),[N,k]=u.useState(!1),[S,T]=u.useState(!1),C=(0,ey.useComposedRefs)(t,e=>l(e)),E=ej(a);return(0,d.jsx)(eE,{scope:s,type:r,dir:E,scrollHideDelay:i,scrollArea:o,viewport:c,onViewportChange:h,content:f,onContentChange:m,scrollbarX:p,onScrollbarXChange:x,scrollbarXEnabled:N,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:b,scrollbarYEnabled:S,onScrollbarYEnabledChange:T,onCornerWidthChange:v,onCornerHeightChange:j,children:(0,d.jsx)(ex.Primitive.div,{dir:E,...n,ref:C,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});e_.displayName=eS;var eP="ScrollAreaViewport",eM=u.forwardRef((e,t)=>{let{__scopeScrollArea:s,children:r,nonce:a,...i}=e,n=eA(eP,s),o=u.useRef(null),l=(0,ey.useComposedRefs)(t,o,n.onViewportChange);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),(0,d.jsx)(ex.Primitive.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:n.scrollbarXEnabled?"scroll":"hidden",overflowY:n.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,d.jsx)("div",{ref:n.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});eM.displayName=eP;var eR="ScrollAreaScrollbar",e$=u.forwardRef((e,t)=>{let{forceMount:s,...r}=e,a=eA(eR,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:n}=a,o="horizontal"===e.orientation;return u.useEffect(()=>(o?i(!0):n(!0),()=>{o?i(!1):n(!1)}),[o,i,n]),"hover"===a.type?(0,d.jsx)(eO,{...r,ref:t,forceMount:s}):"scroll"===a.type?(0,d.jsx)(eD,{...r,ref:t,forceMount:s}):"auto"===a.type?(0,d.jsx)(eL,{...r,ref:t,forceMount:s}):"always"===a.type?(0,d.jsx)(eB,{...r,ref:t}):null});e$.displayName=eR;var eO=u.forwardRef((e,t)=>{let{forceMount:s,...r}=e,a=eA(eR,e.__scopeScrollArea),[i,n]=u.useState(!1);return u.useEffect(()=>{let e=a.scrollArea,t=0;if(e){let s=()=>{window.clearTimeout(t),n(!0)},r=()=>{t=window.setTimeout(()=>n(!1),a.scrollHideDelay)};return e.addEventListener("pointerenter",s),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",s),e.removeEventListener("pointerleave",r)}}},[a.scrollArea,a.scrollHideDelay]),(0,d.jsx)(eg.Presence,{present:s||i,children:(0,d.jsx)(eL,{"data-state":i?"visible":"hidden",...r,ref:t})})}),eD=u.forwardRef((e,t)=>{var s;let{forceMount:r,...a}=e,i=eA(eR,e.__scopeScrollArea),n="horizontal"===e.orientation,o=e2(()=>c("SCROLL_END"),100),[l,c]=(s={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},u.useReducer((e,t)=>s[e][t]??e,"hidden"));return u.useEffect(()=>{if("idle"===l){let e=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,i.scrollHideDelay,c]),u.useEffect(()=>{let e=i.viewport,t=n?"scrollLeft":"scrollTop";if(e){let s=e[t],r=()=>{let r=e[t];s!==r&&(c("SCROLL"),o()),s=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[i.viewport,n,c,o]),(0,d.jsx)(eg.Presence,{present:r||"hidden"!==l,children:(0,d.jsx)(eB,{"data-state":"hidden"===l?"hidden":"visible",...a,ref:t,onPointerEnter:(0,ek.composeEventHandlers)(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:(0,ek.composeEventHandlers)(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),eL=u.forwardRef((e,t)=>{let s=eA(eR,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,n]=u.useState(!1),o="horizontal"===e.orientation,l=e2(()=>{if(s.viewport){let e=s.viewport.offsetWidth<s.viewport.scrollWidth,t=s.viewport.offsetHeight<s.viewport.scrollHeight;n(o?e:t)}},10);return e5(s.viewport,l),e5(s.content,l),(0,d.jsx)(eg.Presence,{present:r||i,children:(0,d.jsx)(eB,{"data-state":i?"visible":"hidden",...a,ref:t})})}),eB=u.forwardRef((e,t)=>{let{orientation:s="vertical",...r}=e,a=eA(eR,e.__scopeScrollArea),i=u.useRef(null),n=u.useRef(0),[o,l]=u.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=eZ(o.viewport,o.content),h={...r,sizes:o,onSizesChange:l,hasThumb:!!(c>0&&c<1),onThumbChange:e=>i.current=e,onThumbPointerUp:()=>n.current=0,onThumbPointerDown:e=>n.current=e};function f(e,t){return function(e,t,s,r="ltr"){let a=eJ(s),i=t||a/2,n=s.scrollbar.paddingStart+i,o=s.scrollbar.size-s.scrollbar.paddingEnd-(a-i),l=s.content-s.viewport;return e0([n,o],"ltr"===r?[0,l]:[-1*l,0])(e)}(e,n.current,o,t)}return"horizontal"===s?(0,d.jsx)(eI,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){let e=eQ(a.viewport.scrollLeft,o,a.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=f(e,a.dir))}}):"vertical"===s?(0,d.jsx)(eF,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){let e=eQ(a.viewport.scrollTop,o);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=f(e))}}):null}),eI=u.forwardRef((e,t)=>{let{sizes:s,onSizesChange:r,...a}=e,i=eA(eR,e.__scopeScrollArea),[n,o]=u.useState(),l=u.useRef(null),c=(0,ey.useComposedRefs)(t,l,i.onScrollbarXChange);return u.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),(0,d.jsx)(eG,{"data-orientation":"horizontal",...a,ref:c,sizes:s,style:{bottom:0,left:"rtl"===i.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===i.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":eJ(s)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,s)=>{if(i.viewport){var r,a;let n=i.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),r=n,a=s,r>0&&r<a&&t.preventDefault()}},onResize:()=>{l.current&&i.viewport&&n&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:eX(n.paddingLeft),paddingEnd:eX(n.paddingRight)}})}})}),eF=u.forwardRef((e,t)=>{let{sizes:s,onSizesChange:r,...a}=e,i=eA(eR,e.__scopeScrollArea),[n,o]=u.useState(),l=u.useRef(null),c=(0,ey.useComposedRefs)(t,l,i.onScrollbarYChange);return u.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),(0,d.jsx)(eG,{"data-orientation":"vertical",...a,ref:c,sizes:s,style:{top:0,right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":eJ(s)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,s)=>{if(i.viewport){var r,a;let n=i.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),r=n,a=s,r>0&&r<a&&t.preventDefault()}},onResize:()=>{l.current&&i.viewport&&n&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:eX(n.paddingTop),paddingEnd:eX(n.paddingBottom)}})}})}),[eV,ez]=eT(eR),eG=u.forwardRef((e,t)=>{let{__scopeScrollArea:s,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:n,onThumbPointerDown:o,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:h,onResize:f,...m}=e,p=eA(eR,s),[x,g]=u.useState(null),b=(0,ey.useComposedRefs)(t,e=>g(e)),y=u.useRef(null),v=u.useRef(""),w=p.viewport,j=r.content-r.viewport,N=(0,ev.useCallbackRef)(h),k=(0,ev.useCallbackRef)(l),S=e2(f,10);function T(e){y.current&&c({x:e.clientX-y.current.left,y:e.clientY-y.current.top})}return u.useEffect(()=>{let e=e=>{let t=e.target;x?.contains(t)&&N(e,j)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[w,x,j,N]),u.useEffect(k,[r,k]),e5(x,S),e5(p.content,S),(0,d.jsx)(eV,{scope:s,scrollbar:x,hasThumb:a,onThumbChange:(0,ev.useCallbackRef)(i),onThumbPointerUp:(0,ev.useCallbackRef)(n),onThumbPositionChange:k,onThumbPointerDown:(0,ev.useCallbackRef)(o),children:(0,d.jsx)(ex.Primitive.div,{...m,ref:b,style:{position:"absolute",...m.style},onPointerDown:(0,ek.composeEventHandlers)(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),y.current=x.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),T(e))}),onPointerMove:(0,ek.composeEventHandlers)(e.onPointerMove,T),onPointerUp:(0,ek.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=""),y.current=null})})})}),eU="ScrollAreaThumb",eH=u.forwardRef((e,t)=>{let{forceMount:s,...r}=e,a=ez(eU,e.__scopeScrollArea);return(0,d.jsx)(eg.Presence,{present:s||a.hasThumb,children:(0,d.jsx)(eW,{ref:t,...r})})}),eW=u.forwardRef((e,t)=>{let{__scopeScrollArea:s,style:r,...a}=e,i=eA(eU,s),n=ez(eU,s),{onThumbPositionChange:o}=n,l=(0,ey.useComposedRefs)(t,e=>n.onThumbChange(e)),c=u.useRef(void 0),h=e2(()=>{c.current&&(c.current(),c.current=void 0)},100);return u.useEffect(()=>{let e=i.viewport;if(e){let t=()=>{h(),c.current||(c.current=e1(e,o),o())};return o(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[i.viewport,h,o]),(0,d.jsx)(ex.Primitive.div,{"data-state":n.hasThumb?"visible":"hidden",...a,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:(0,ek.composeEventHandlers)(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),s=e.clientX-t.left,r=e.clientY-t.top;n.onThumbPointerDown({x:s,y:r})}),onPointerUp:(0,ek.composeEventHandlers)(e.onPointerUp,n.onThumbPointerUp)})});eH.displayName=eU;var eq="ScrollAreaCorner",eY=u.forwardRef((e,t)=>{let s=eA(eq,e.__scopeScrollArea),r=!!(s.scrollbarX&&s.scrollbarY);return"scroll"!==s.type&&r?(0,d.jsx)(eK,{...e,ref:t}):null});eY.displayName=eq;var eK=u.forwardRef((e,t)=>{let{__scopeScrollArea:s,...r}=e,a=eA(eq,s),[i,n]=u.useState(0),[o,l]=u.useState(0),c=!!(i&&o);return e5(a.scrollbarX,()=>{let e=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(e),l(e)}),e5(a.scrollbarY,()=>{let e=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(e),n(e)}),c?(0,d.jsx)(ex.Primitive.div,{...r,ref:t,style:{width:i,height:o,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0,...e.style}}):null});function eX(e){return e?parseInt(e,10):0}function eZ(e,t){let s=e/t;return isNaN(s)?0:s}function eJ(e){let t=eZ(e.viewport,e.content),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-s)*t,18)}function eQ(e,t,s="ltr"){let r=eJ(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,n=t.content-t.viewport,o=function(e,[t,s]){return Math.min(s,Math.max(t,e))}(e,"ltr"===s?[0,n]:[-1*n,0]);return e0([0,n],[0,i-r])(o)}function e0(e,t){return s=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(s-e[0])}}var e1=(e,t=()=>{})=>{let s={left:e.scrollLeft,top:e.scrollTop},r=0;return!function a(){let i={left:e.scrollLeft,top:e.scrollTop},n=s.left!==i.left,o=s.top!==i.top;(n||o)&&t(),s=i,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)};function e2(e,t){let s=(0,ev.useCallbackRef)(e),r=u.useRef(0);return u.useEffect(()=>()=>window.clearTimeout(r.current),[]),u.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(s,t)},[s,t])}function e5(e,t){let s=(0,ev.useCallbackRef)(t);(0,eN.useLayoutEffect)(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(s)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,s])}function e3({className:e,children:t,...s}){return(0,d.jsxs)(e_,{"data-slot":"scroll-area",className:(0,O.cn)("relative",e),...s,children:[(0,d.jsx)(eM,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,d.jsx)(e4,{}),(0,d.jsx)(eY,{})]})}function e4({className:e,orientation:t="vertical",...s}){return(0,d.jsx)(e$,{"data-slot":"scroll-area-scrollbar",orientation:t,className:(0,O.cn)("flex touch-none p-px transition-colors select-none","vertical"===t&&"h-full w-2.5 border-l border-l-transparent","horizontal"===t&&"h-2.5 flex-col border-t border-t-transparent",e),...s,children:(0,d.jsx)(eH,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}let e9=["","寂灭前夜","谐振纪","飞升潮","回响纪","接触纪"];function e7(){let e=(0,f.useGameStore)(e=>e.fragments),t=(0,f.useGameStore)(e=>e.totalDecoded),s=(0,f.nextFragmentThreshold)(t),[r,a]=(0,u.useState)(null),i=m.FRAGMENTS.filter(e=>1===e.era),n=i.filter(t=>e[t.id]).length;return(0,d.jsxs)("div",{className:"flex flex-col gap-2 h-full",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-1.5",children:[(0,d.jsx)(eu.BookOpen,{className:"h-4 w-4 text-fuchsia-400"}),"记忆图谱"]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n,"/",i.length," · 第一纪元"]})]}),s&&(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground/80 px-1",children:["再解码 ",(0,d.jsx)("span",{className:"text-fuchsia-300 font-mono",children:s-t})," 颗 → 下一个碎片"]}),(0,d.jsx)(e3,{className:"flex-1 min-h-0",children:(0,d.jsx)("div",{className:"grid grid-cols-2 gap-2 pr-2",children:i.map((t,s)=>{let r=!!e[t.id];return(0,d.jsxs)("button",{onClick:()=>r&&a(t),disabled:!r,className:`relative aspect-[4/3] rounded-xl border text-left p-2 transition-all duration-300 overflow-hidden ${r?"border-fuchsia-400/40 bg-gradient-to-br from-fuchsia-950/40 to-black/40 hover:border-fuchsia-400/70 hover:scale-[1.02] cursor-pointer":"border-white/5 bg-black/30 cursor-not-allowed"}`,style:r?{boxShadow:"0 0 16px rgba(232,121,249,0.15)"}:void 0,children:[(0,d.jsx)("span",{className:`absolute top-1.5 right-1.5 text-[9px] font-mono ${r?"text-fuchsia-300/70":"text-white/20"}`,children:String(s+1).padStart(2,"0")}),r?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"absolute -top-3 -right-3 h-12 w-12 rounded-full bg-fuchsia-500/20 blur-xl"}),(0,d.jsx)(ee.Sparkles,{className:"h-3 w-3 text-fuchsia-300 mb-1"}),(0,d.jsx)("div",{className:"text-[11px] font-semibold text-fuchsia-100 leading-tight",children:t.title}),(0,d.jsxs)("div",{className:"text-[9px] text-muted-foreground mt-1 line-clamp-2",children:[t.echo.slice(0,28),"…"]})]}):(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-1",children:[(0,d.jsx)(eh,{className:"h-4 w-4 text-white/20"}),(0,d.jsxs)("span",{className:"text-[9px] text-white/30",children:["需解码 ",t.threshold," 颗"]})]})]},t.id)})})}),r&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm",onClick:()=>a(null),children:(0,d.jsxs)(eo,{className:"max-w-md w-full p-5 bg-gradient-to-br from-fuchsia-950/60 to-black/80 border-fuchsia-400/40",onClick:e=>e.stopPropagation(),style:{boxShadow:"0 0 40px rgba(232,121,249,0.25)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)(ee.Sparkles,{className:"h-4 w-4 text-fuchsia-300"}),(0,d.jsxs)("span",{className:"text-[10px] text-fuchsia-300/70 font-mono",children:["第 ",r.era," 纪元 · ",e9[r.era]||""]})]}),(0,d.jsx)("h4",{className:"text-lg font-bold text-fuchsia-100 mb-3",children:r.title}),(0,d.jsxs)("p",{className:"text-sm text-foreground/90 leading-relaxed italic",children:["「",r.echo,"」"]}),(0,d.jsx)("button",{onClick:()=>a(null),className:"mt-4 text-xs text-muted-foreground hover:text-foreground transition",children:"关闭"})]})})]})}var e8=e.i(76639),e6=e.i(70273),te=e.i(60645),tt=e.i(43625);function ts({open:e,onOpenChange:t}){let s=(0,f.useGameStore)(),r=(0,f.useGameStore)(e=>e.doPrestige),{toast:a}=(0,F.useToast)(),[i,n]=(0,u.useState)(!1),[o,l]=(0,u.useState)(!1),c=(0,te.computeNewBlueprints)(s);(0,te.computePrestigeBonus)(s);let h=Math.min(m.PRESTIGE.maxBlueprints,s.blueprints.length+c),p=(0,tt.constellationProgress)(s.constellation??[]);return(0,d.jsx)(e8.Dialog,{open:e,onOpenChange:t,children:(0,d.jsxs)(e8.DialogContent,{className:"bg-gradient-to-br from-fuchsia-950/70 to-black/90 border-fuchsia-400/40",children:[(0,d.jsxs)(e8.DialogHeader,{children:[(0,d.jsxs)(e8.DialogTitle,{className:"flex items-center gap-2 text-fuchsia-100",children:[(0,d.jsx)(y.RotateCcw,{className:"h-5 w-5"}),"飞升 · 跨越维度"]}),(0,d.jsx)(e8.DialogDescription,{className:"text-fuchsia-200/70",children:"当接触进度满溢,你将跨越维度与以太族相会。本次飞升将重置资源与技术,但保留记忆图谱与蓝图加成。"})]}),(0,d.jsxs)("div",{className:"space-y-3 py-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-fuchsia-400/30 bg-fuchsia-950/30 p-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-sm text-fuchsia-200",children:"本次获得蓝图"}),(0,d.jsxs)("span",{className:"text-2xl font-mono font-bold text-fuchsia-100",children:["+",c]})]}),(0,d.jsxs)("p",{className:"text-[11px] text-muted-foreground mt-1",children:["蓝图总数将达 ",h,"/",m.PRESTIGE.maxBlueprints,"(每 ",m.PRESTIGE.blueprintsPerDecode," 次解码产出 1 张)"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,d.jsx)(tr,{label:"产能",value:`+${(h*m.PRESTIGE.perBlueprint.crystalsPerSecMult*100).toFixed(0)}%`,color:"#34d399"}),(0,d.jsx)(tr,{label:"洞见",value:`+${(h*m.PRESTIGE.perBlueprint.insightMult*100).toFixed(0)}%`,color:"#fbbf24"}),(0,d.jsx)(tr,{label:"接触",value:`+${(h*m.PRESTIGE.perBlueprint.contactRateMult*100).toFixed(0)}%`,color:"#e879f9"})]}),(0,d.jsxs)("div",{className:"text-[11px] text-muted-foreground space-y-1 pt-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(ee.Sparkles,{className:"h-3 w-3 text-fuchsia-400"}),"保留:记忆图谱、累计解码数、飞升次数、蓝图、星图天赋"]}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(y.RotateCcw,{className:"h-3 w-3 text-rose-400"}),"重置:晶体、洞见、技术树、接触进度、待解码晶体"]})]}),(0,d.jsx)("div",{className:"rounded-lg border border-fuchsia-400/30 bg-gradient-to-r from-fuchsia-950/40 to-purple-950/40 p-2.5",children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(e6.Star,{className:"h-4 w-4 text-fuchsia-300"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("div",{className:"text-[12px] text-fuchsia-200 font-bold",children:"星图觉醒预告"}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground",children:["飞升后将从 3 道随机天赋中选 1,永久获得加成",p.unlocked<p.total&&(0,d.jsxs)("span",{className:"text-fuchsia-300/80",children:[" · 当前 ",p.unlocked,"/",p.total]})]})]}),(0,d.jsx)("div",{className:"text-[10px] text-fuchsia-300/70 font-mono",children:p.unlocked<p.total?"✦ 可觉醒":"✧ 已圆满"})]})}),(0,d.jsxs)("div",{className:"rounded-lg border border-violet-400/25 bg-violet-950/20 p-2.5 flex items-center gap-2",children:[(0,d.jsx)(eu.BookOpen,{className:"h-4 w-4 text-violet-300 flex-shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 text-[10px] text-violet-100/70 leading-relaxed",children:["本次飞升将铭刻入",(0,d.jsx)("span",{className:"text-violet-200 font-bold",children:"回响编年史"}),", 记录本周目的解码、探险、星潮与觉醒天赋,形成永恒叙事时间轴。"]})]})]}),(0,d.jsxs)(e8.DialogFooter,{children:[(0,d.jsx)(J.Button,{variant:"ghost",onClick:()=>t(!1),children:"取消"}),(0,d.jsx)(J.Button,{disabled:i&&!o,onClick:()=>{if(!i){n(!0),l(!1),window.setTimeout(()=>l(!0),900);return}let e=r();t(!1),n(!1),l(!1),e&&((0,V.sfx)("prestige"),window.setTimeout(()=>(0,V.sfx)("chronicle"),600),a({title:"✦ 飞升成功",description:`获得 ${e.newBp} 张蓝图,进入第 ${s.ascensions+2} 周目。编年史已铭刻新纪元。`}))},className:"bg-gradient-to-r from-fuchsia-600 to-rose-500 hover:from-fuchsia-500 hover:to-rose-400 text-white border-0",children:i?o?"再次确认飞升":"请确认…":c<=0?"飞升(无新蓝图)":"飞升"})]})]})})}function tr({label:e,value:t,color:s}){return(0,d.jsxs)("div",{className:"rounded-lg border p-2 text-center",style:{borderColor:`${s}44`,background:`${s}11`},children:[(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground",children:e}),(0,d.jsx)("div",{className:"text-sm font-mono font-bold",style:{color:s},children:t})]})}var ta=e.i(69340),ti="Switch",[tn,to]=(0,eb.createContextScope)(ti),[tl,tc]=tn(ti),td=u.forwardRef((e,t)=>{let{__scopeSwitch:s,name:r,checked:a,defaultChecked:i,required:n,disabled:o,value:l="on",onCheckedChange:c,form:h,...f}=e,[m,p]=u.useState(null),x=(0,ey.useComposedRefs)(t,e=>p(e)),g=u.useRef(!1),b=!m||h||!!m.closest("form"),[y,v]=(0,ta.useControllableState)({prop:a,defaultProp:i??!1,onChange:c,caller:ti});return(0,d.jsxs)(tl,{scope:s,checked:y,disabled:o,children:[(0,d.jsx)(ex.Primitive.button,{type:"button",role:"switch","aria-checked":y,"aria-required":n,"data-state":tm(y),"data-disabled":o?"":void 0,disabled:o,value:l,...f,ref:x,onClick:(0,ek.composeEventHandlers)(e.onClick,e=>{v(e=>!e),b&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),b&&(0,d.jsx)(tf,{control:m,bubbles:!g.current,name:r,value:l,checked:y,required:n,disabled:o,form:h,style:{transform:"translateX(-100%)"}})]})});td.displayName=ti;var tu="SwitchThumb",th=u.forwardRef((e,t)=>{let{__scopeSwitch:s,...r}=e,a=tc(tu,s);return(0,d.jsx)(ex.Primitive.span,{"data-state":tm(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});th.displayName=tu;var tf=u.forwardRef(({__scopeSwitch:e,control:t,checked:s,bubbles:r=!0,...a},i)=>{let n,o=u.useRef(null),l=(0,ey.useComposedRefs)(o,i),c=(n=u.useRef({value:s,previous:s}),u.useMemo(()=>(n.current.value!==s&&(n.current.previous=n.current.value,n.current.value=s),n.current.previous),[s])),h=function(e){let[t,s]=u.useState(void 0);return(0,eN.useLayoutEffect)(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,a;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;s({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}s(void 0)},[e]),t}(t);return u.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(c!==s&&t){let a=new Event("click",{bubbles:r});t.call(e,s),e.dispatchEvent(a)}},[c,s,r]),(0,d.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...a,tabIndex:-1,ref:l,style:{...a.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function tm(e){return e?"checked":"unchecked"}function tp({className:e,...t}){return(0,d.jsx)(td,{"data-slot":"switch",className:(0,O.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,d.jsx)(th,{"data-slot":"switch-thumb",className:(0,O.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}tf.displayName="SwitchBubbleInput";var tx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let s=(0,v.createSlot)(`Primitive.${t}`),r=u.forwardRef((e,r)=>{let{asChild:a,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,d.jsx)(a?s:t,{...i,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),tg=u.forwardRef((e,t)=>(0,d.jsx)(tx.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));function tb({className:e,...t}){return(0,d.jsx)(tg,{"data-slot":"label",className:(0,O.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}tg.displayName="Label";let ty=(0,x.default)("trash-2",[["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"}]]),tv=(0,x.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),tw=(0,x.default)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),tj=(0,x.default)("graduation-cap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]),tN=(0,x.default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),tk=[{id:"welcome",placement:"bottom",title:"✦ 欢迎来到回响星核",body:"你是一台苏醒在深空遗迹中的自治无人机。在这里,你需要采矿、解码以太文明遗留的记忆晶体,逐步拼凑出一段跨越维度的叙事。\n\n本引导将带你认识 5 个核心玩法,约 1 分钟。可随时跳过。"},{id:"crystal",target:"crystal-orb",placement:"right",title:"① 脉冲扫描 · 采矿",body:"点击中央的「记忆晶体」发起脉冲扫描,获得记忆晶体。\n\n连续点击可触发连击,连击越高单次产出越多。无人机也会每秒自动采集(+0.4/s 起)。",expectAction:"pulse"},{id:"decode",target:"decode-panel",placement:"left",title:"② 谐振序列 · 解码",body:"记忆晶体存满后,点击右侧「待解码晶体」开启谐振谜题:按目标色序依次点击相邻同色节点重建回路。\n\n解码成功 → 获得技术洞见 + 记忆碎片(叙事片段)。这是游戏的核心解谜层。",expectAction:"decode-start"},{id:"tech",target:"tab-tech",placement:"top",title:"③ 技术树 · 成长",body:"用「技术洞见」在「技术」标签升级 4 大分支:产能 / 解码 / 仓库 / 探险。\n\n每个分支 3 级,策略性地分配洞见是关键。",expectAction:"tech-buy"},{id:"expedition",target:"tab-expedition",placement:"top",title:"④ 遗迹探险 · 肉鸽",body:"累积足够实力后,「探险」标签可深入遗迹:6 种节点(战斗/宝藏/抉择/解谜/休整/BOSS)程序化路径,有生命系统,失败保留奖励。\n\n这是放置之外的主动玩法层。",expectAction:"expedition-start"},{id:"prestige",target:"prestige-btn",placement:"bottom",title:"⑤ 飞升 · 多周目",body:"「接触进度」满 100% 后可飞升:重置进度,获得永久蓝图加成 + 星图天赋(3 选 1 draft)+ 编年史记录。\n\n多周目叠加,越飞越强。还有每日信标挑战、6 种星潮事件等你探索。"},{id:"done",placement:"bottom",title:"✦ 回响已唤醒",body:"教程结束!后续可在「设置 → 重新查看教程」再次查看。\n\n深空之中,回响永续。祝你考古愉快。"}],tS="echo-nexus-tutorial-v1";function tT({open:e,onOpenChange:t}){let s=(0,f.useGameStore)(e=>e.soundOn),r=(0,f.useGameStore)(e=>e.toggleSound),a=(0,f.useGameStore)(e=>e.hardReset),i=(0,f.useGameStore)(e=>e.ascensions),n=(0,f.useGameStore)(e=>e.totalDecoded),{toast:o}=(0,F.useToast)(),[l,c]=(0,u.useState)(!1);return(0,d.jsx)(e8.Dialog,{open:e,onOpenChange:t,children:(0,d.jsxs)(e8.DialogContent,{className:"bg-gradient-to-br from-slate-900/80 to-black/90 border-white/15",children:[(0,d.jsxs)(e8.DialogHeader,{children:[(0,d.jsx)(e8.DialogTitle,{children:"设置"}),(0,d.jsx)(e8.DialogDescription,{children:"游戏偏好与存档管理"})]}),(0,d.jsxs)("div",{className:"space-y-4 py-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-white/10 bg-black/30 p-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)(tb,{className:"text-sm",children:"音效反馈"}),(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"脉冲、解码、探险、飞升等程序化音效"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(J.Button,{size:"sm",variant:"ghost",className:"h-7 px-2 text-muted-foreground hover:text-foreground",onClick:()=>(0,V.sfx)("decodeSuccess"),"aria-label":"试听音效",children:(0,d.jsx)(tw,{className:"h-3.5 w-3.5"})}),(0,d.jsx)(tp,{checked:s,onCheckedChange:r})]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-white/10 bg-black/30 p-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)(tb,{className:"text-sm",children:"新手教程"}),(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"重新查看 5 步玩法引导"})]}),(0,d.jsxs)(J.Button,{size:"sm",variant:"outline",className:"h-7 px-2 text-[11px] border-fuchsia-400/40 text-fuchsia-200 hover:bg-fuchsia-500/10",onClick:()=>{try{localStorage.removeItem(tS)}catch{}window.dispatchEvent(new CustomEvent("echo-nexus-tutorial-restart")),t(!1)},children:[(0,d.jsx)(tj,{className:"h-3.5 w-3.5 mr-1"}),"重看教程"]})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-white/10 bg-black/30 p-3 text-xs space-y-1.5",children:[(0,d.jsxs)("div",{className:"flex justify-between",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"累计解码"}),(0,d.jsxs)("span",{className:"font-mono",children:[n," 颗"]})]}),(0,d.jsxs)("div",{className:"flex justify-between",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"飞升周目"}),(0,d.jsx)("span",{className:"font-mono",children:i})]}),(0,d.jsxs)("div",{className:"flex justify-between",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"存档位置"}),(0,d.jsx)("span",{className:"font-mono text-[10px]",children:"浏览器本地"})]})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-rose-500/30 bg-rose-950/20 p-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,d.jsx)(er,{className:"h-4 w-4 text-rose-400"}),(0,d.jsx)("span",{className:"text-sm font-medium text-rose-200",children:"危险操作"})]}),(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground mb-2",children:"清空所有进度,包括记忆图谱与飞升记录,不可恢复。"}),(0,d.jsxs)(J.Button,{variant:"outline",size:"sm",className:"border-rose-500/40 text-rose-300 hover:bg-rose-500/10",onClick:()=>{l?(a(),c(!1),t(!1),o({title:"存档已清空",description:"一切归零,重新开始。"})):c(!0)},children:[(0,d.jsx)(ty,{className:"h-3.5 w-3.5 mr-1"}),l?"再次点击确认清空":"清空存档"]})]}),(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsxs)("a",{href:"https://gitea-pages.atdunbg.xyz/Super_Z/echo-nexus/",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs text-emerald-300/80 hover:text-emerald-200 transition px-1 py-1 rounded hover:bg-emerald-500/5",children:[(0,d.jsx)(tN,{className:"h-3.5 w-3.5"}),"在线游玩(gitea-pages"]}),(0,d.jsxs)("a",{href:"https://git.atdunbg.xyz/Super_Z/echo-nexus",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition px-1 py-1 rounded hover:bg-white/5",children:[(0,d.jsx)(tv,{className:"h-3.5 w-3.5"}),"git.atdunbg.xyz/Super_Z/echo-nexus"]})]})]}),(0,d.jsx)(e8.DialogFooter,{children:(0,d.jsx)(J.Button,{variant:"ghost",onClick:()=>t(!1),children:"关闭"})})]})})}var tC=e.i(44915),tE=e.i(36121);let tA=(0,x.default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),t_=(0,x.default)("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);var tP=e.i(62568);let tM=(0,x.default)("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"}]]);var tR=e.i(39312),t$=e.i(63059);let tO=(0,x.default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]),tD={combat:{icon:tE.Swords,color:"#fb7185",label:"战斗",bg:"rgba(251,113,133,0.15)"},treasure:{icon:p.Gem,color:"#fbbf24",label:"宝藏",bg:"rgba(251,191,36,0.15)"},choice:{icon:tA,color:"#a5f3fc",label:"抉择",bg:"rgba(165,243,252,0.15)"},puzzle:{icon:t_,color:"#e879f9",label:"解谜",bg:"rgba(232,121,249,0.15)"},rest:{icon:tM,color:"#34d399",label:"休整",bg:"rgba(52,211,153,0.15)"},boss:{icon:tP.Skull,color:"#f43f5e",label:"BOSS",bg:"rgba(244,63,94,0.2)"}};function tL(){let e=(0,f.useGameStore)(e=>e.activeExpedition),t=(0,f.useGameStore)(e=>e.energy),s=(0,f.useGameStore)(e=>e.energyMax),r=(0,f.useGameStore)(e=>e.lastEnergyTick),a=(0,f.useGameStore)(e=>e.expeditionLog),i=(0,f.useGameStore)(e=>e.totalExpeditions),n=(0,f.useGameStore)(e=>e.lastExpeditionSummary),o=(0,f.useGameStore)(e=>(0,tC.computeEnergyRegenInterval)(e)),l=(0,f.useGameStore)(e=>e.startExpedition),c=(0,f.useGameStore)(e=>e.resolveCurrentNode),h=(0,f.useGameStore)(e=>e.advanceNode),p=(0,f.useGameStore)(e=>e.abortExpedition),{toast:x}=(0,F.useToast)(),[g,b]=(0,u.useState)(null),[y,v]=(0,u.useState)(()=>Date.now());(0,u.useEffect)(()=>{let e=setInterval(()=>v(Date.now()),1e3);return()=>clearInterval(e)},[]);let w=1e3*o,j=y-r,N=t>=s?100:Math.min(100,j/w*100),k=o<tC.EXPEDITION_CONFIG.energyRegenSec,S=t>=s?0:Math.max(0,Math.ceil((w-j)/1e3)),T=t>=tC.EXPEDITION_CONFIG.energyCost;if(!e||e.finished)return(0,d.jsxs)("div",{className:"flex flex-col gap-3 h-full",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("h3",{className:"text-sm font-semibold flex items-center gap-1.5",children:[(0,d.jsx)(ed,{className:"h-4 w-4 text-amber-400"}),"遗迹探险"]}),(0,d.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["已探索 ",i," 次"]})]}),n&&(0,d.jsxs)("div",{className:`rounded-xl border p-2.5 relative overflow-hidden ${"victory"===n.result?"border-emerald-400/40 bg-emerald-950/20":"defeat"===n.result?"border-rose-400/40 bg-rose-950/20":"border-amber-400/30 bg-amber-950/10"}`,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,d.jsx)("span",{className:"text-[11px] font-semibold flex items-center gap-1",children:"victory"===n.result?"✦ 上次探险:胜利":"defeat"===n.result?"✕ 上次探险:失败":"→ 上次探险:撤退"}),(0,d.jsxs)("span",{className:"text-[9px] text-muted-foreground font-mono",children:[n.nodeCount," 节点"]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2.5 text-[10px]",children:[n.rewards.crystals>0&&(0,d.jsxs)("span",{className:"text-emerald-300",children:["+",(0,m.formatNum)(n.rewards.crystals)," 晶体"]}),n.rewards.insights>0&&(0,d.jsxs)("span",{className:"text-amber-300",children:["+",n.rewards.insights," 洞见"]}),n.rewards.contact>0&&(0,d.jsxs)("span",{className:"text-fuchsia-300",children:["+",n.rewards.contact.toFixed(1)," 接触"]}),0===n.rewards.crystals&&0===n.rewards.insights&&(0,d.jsx)("span",{className:"text-muted-foreground/60",children:"无奖励"})]})]}),(0,d.jsxs)("div",{className:"rounded-xl border border-amber-400/20 bg-amber-950/20 p-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(tR.Zap,{className:"h-3.5 w-3.5 text-amber-400"}),(0,d.jsx)("span",{className:"text-xs text-amber-200",children:"探险能量"})]}),(0,d.jsxs)("span",{className:"text-xs font-mono text-amber-100",children:[t," / ",s]})]}),t<s?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(D,{value:N,className:"h-1.5 bg-black/40 [&>div]:bg-gradient-to-r [&>div]:from-amber-500 [&>div]:to-yellow-300"}),(0,d.jsxs)("p",{className:"text-[10px] text-muted-foreground/70 mt-1 flex items-center gap-1",children:[(0,d.jsx)("span",{children:"下一点能量"}),(0,d.jsxs)("span",{className:"text-amber-300 font-mono font-semibold",children:[S,"s"]}),(0,d.jsx)("span",{children:"后恢复"}),k&&(0,d.jsxs)("span",{className:"text-emerald-400/80 ml-1",children:["⚡ ",o.toFixed(0),"s/点 (已加速)"]})]})]}):(0,d.jsx)("p",{className:"text-[10px] text-amber-300/80 mt-0.5",children:"能量已满,可立即出发"})]}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 rounded-2xl border border-dashed border-amber-400/20 bg-black/30 p-4 relative overflow-hidden",children:[(0,d.jsx)("div",{className:"absolute -top-10 -right-10 h-32 w-32 rounded-full bg-amber-500/10 blur-2xl"}),(0,d.jsx)("div",{className:"relative",children:(0,d.jsx)("div",{className:`h-16 w-16 rounded-full bg-gradient-to-br from-amber-500/30 to-rose-500/20 flex items-center justify-center mx-auto ${T?"animate-pulse":""}`,style:{boxShadow:"0 0 30px rgba(251,191,36,0.3)"},children:(0,d.jsx)(ed,{className:"h-7 w-7 text-amber-300"})})}),(0,d.jsxs)("div",{className:"text-center space-y-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium text-amber-100",children:"深入以太遗迹"}),(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground/80 max-w-[220px]",children:"程序化生成的遗迹路径,沿途遭遇战斗、宝藏、抉择与解谜,击败终点 BOSS 获取丰厚奖励。"})]}),(0,d.jsxs)(J.Button,{onClick:()=>{let e=l();e.ok?((0,V.sfx)("expeditionStart"),x({title:"探险队出发",description:"深入遗迹,谨慎前行。"}),b(null)):x({title:"无法出发",description:e.reason,variant:"destructive"})},disabled:!T,className:"bg-gradient-to-r from-amber-600 to-rose-500 hover:from-amber-500 hover:to-rose-400 text-white border-0",children:[(0,d.jsx)(ed,{className:"h-4 w-4 mr-1.5"}),T?`出发(消耗 ${tC.EXPEDITION_CONFIG.energyCost} 能量)`:`能量不足(${S}s 后恢复)`]})]}),a.length>0&&(0,d.jsxs)("div",{className:"rounded-xl border border-white/5 bg-black/20 p-2 max-h-28 overflow-y-auto echo-scroll",children:[(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground/60 mb-1 px-1",children:"最近探险记录"}),a.slice(0,4).map((e,t)=>(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground/70 px-1 py-0.5 border-b border-white/5 last:border-0",children:[(0,d.jsx)("span",{className:"text-amber-300/60",children:""})," ",e.result,e.rewards&&(0,d.jsx)("span",{className:"text-emerald-300/70 ml-1",children:e.rewards})]},t))]})]});let C=e.nodes[e.currentNode],E=tD[C.type],A=E.icon,_=e.hp/e.maxHp*100,P=(e.currentNode+ +!!C.cleared)/e.nodes.length*100;return(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex flex-col gap-2.5 h-full",children:[(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-1.5",children:[(0,d.jsx)(ed,{className:"h-3.5 w-3.5 text-amber-400"}),(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-xs font-semibold",children:"遗迹探险"}),(0,d.jsxs)("span",{className:"jsx-df1c681cdb543264 text-[10px] text-muted-foreground",children:["第 ",e.currentNode+1,"/",e.nodes.length," 节点"]})]}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-[10px] text-muted-foreground",children:"探险力"}),(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-xs font-mono font-semibold text-amber-300",children:e.power})]})]}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264",children:[(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center justify-between mb-0.5",children:[(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-1",children:[(0,d.jsx)(tM,{className:"h-3 w-3 text-rose-400"}),(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-[10px] text-muted-foreground",children:"探险队生命"})]}),(0,d.jsxs)("span",{className:`jsx-df1c681cdb543264 text-[10px] font-mono ${_<30?"text-rose-400":"text-foreground"}`,children:[e.hp," / ",e.maxHp]})]}),(0,d.jsx)(D,{value:_,className:"h-1.5 bg-black/40 [&>div]:bg-gradient-to-r [&>div]:from-rose-500 [&>div]:to-emerald-400"})]}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 rounded-xl border border-white/10 bg-black/30 p-2.5",children:[(0,d.jsx)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-1 overflow-x-auto echo-scroll pb-1",children:e.nodes.map((t,s)=>{let r=tD[t.type],a=r.icon,i=s===e.currentNode,n=t.cleared,o=s<e.currentNode;return(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center shrink-0",children:[(0,d.jsxs)("div",{style:{background:n||o?"rgba(255,255,255,0.04)":r.bg,border:i?`1.5px solid ${r.color}`:"1px solid rgba(255,255,255,0.08)",boxShadow:i?`0 0 12px ${r.color}66`:"none"},title:`${r.label} \xb7 ${t.title}`,className:`jsx-df1c681cdb543264 relative h-9 w-9 rounded-lg flex items-center justify-center transition-all duration-300 ${i?"scale-125":""}`,children:[(0,d.jsx)(a,{style:{color:n||o?"#666":r.color},className:`jsx-df1c681cdb543264 h-4 w-4 ${n||o?"opacity-30":""}`}),n&&(0,d.jsx)("div",{className:"jsx-df1c681cdb543264 absolute -top-1 -right-1 h-3 w-3 rounded-full bg-emerald-500/80 flex items-center justify-center",children:(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-[8px] text-white",children:"✓"})})]}),s<e.nodes.length-1&&(0,d.jsx)(t$.ChevronRight,{className:`h-3 w-3 mx-0.5 ${o||i&&n?"text-amber-400/60":"text-white/15"}`})]},t.id)})}),(0,d.jsx)("div",{className:"jsx-df1c681cdb543264 mt-1.5",children:(0,d.jsx)(D,{value:P,className:"h-1 bg-black/40 [&>div]:bg-gradient-to-r [&>div]:from-amber-500 [&>div]:to-rose-400"})})]}),(0,d.jsxs)("div",{style:{borderColor:`${E.color}44`,background:`linear-gradient(135deg, ${E.color}11, rgba(0,0,0,0.4))`,boxShadow:`0 0 20px ${E.color}22`},className:"jsx-df1c681cdb543264 rounded-xl border p-3 relative overflow-hidden",children:[(0,d.jsx)("div",{style:{background:`${E.color}22`},className:"jsx-df1c681cdb543264 absolute -top-8 -right-8 h-24 w-24 rounded-full blur-2xl"}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 relative",children:[(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-2 mb-1.5",children:[(0,d.jsx)("div",{style:{background:E.bg,border:`1px solid ${E.color}44`},className:"jsx-df1c681cdb543264 h-8 w-8 rounded-lg flex items-center justify-center",children:(0,d.jsx)(A,{style:{color:E.color},className:"jsx-df1c681cdb543264 h-4 w-4"})}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264",children:[(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-1.5",children:[(0,d.jsx)("span",{style:{background:E.bg,color:E.color},className:"jsx-df1c681cdb543264 text-[10px] font-mono px-1.5 py-0.5 rounded",children:E.label}),"combat"===C.type&&(0,d.jsxs)("span",{className:"jsx-df1c681cdb543264 text-[10px] text-muted-foreground",children:["胜率 ",Math.round(100*(0,tC.combatWinRate)(e.power,C.difficulty)),"%"]}),C.difficulty>0&&(0,d.jsxs)("span",{className:"jsx-df1c681cdb543264 text-[10px] text-muted-foreground/60",children:["难度 ",C.difficulty]})]}),(0,d.jsx)("h4",{style:{color:E.color},className:"jsx-df1c681cdb543264 text-sm font-semibold mt-0.5",children:C.title})]})]}),(0,d.jsx)("p",{className:"jsx-df1c681cdb543264 text-[11px] text-muted-foreground/90 leading-relaxed",children:C.desc}),g&&(0,d.jsx)("div",{className:"jsx-df1c681cdb543264 mt-2 px-2 py-1.5 rounded-lg bg-black/40 border border-white/10",children:(0,d.jsx)("p",{className:"jsx-df1c681cdb543264 text-[11px] text-foreground/90",children:g})})]})]}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-1.5",children:[C.cleared?e.currentNode<e.nodes.length-1?(0,d.jsxs)(J.Button,{onClick:()=>{h(),b(null)},className:"flex-1 h-8",variant:"outline",children:[(0,d.jsx)(t$.ChevronRight,{className:"h-3.5 w-3.5 mr-1"}),"前进"]}):(0,d.jsx)("div",{className:"jsx-df1c681cdb543264 flex-1 text-center text-xs text-emerald-300 py-1.5",children:"探险已完成 ✓"}):(0,d.jsxs)(J.Button,{onClick:()=>{let e=c();e&&(b(e.log),e.ended?"victory"===e.endReason?(0,V.sfx)("expeditionVictory"):(0,V.sfx)("expeditionDefeat"):(0,V.sfx)("expeditionNode"),x({title:e.ended?"victory"===e.endReason?"✦ 探险胜利!":"探险失败":"节点结算",description:e.log,variant:"defeat"===e.endReason?"destructive":"default"}))},className:"flex-1 bg-gradient-to-r from-amber-600 to-rose-500 hover:from-amber-500 hover:to-rose-400 text-white border-0 h-8",children:[(0,d.jsx)(ee.Sparkles,{className:"h-3.5 w-3.5 mr-1"}),"探索节点"]}),(0,d.jsx)(J.Button,{onClick:()=>{p(),x({title:"探险队撤退",description:"保留已获奖励,安全返回。"}),b(null)},variant:"ghost",size:"sm",className:"h-8 px-2 text-muted-foreground hover:text-rose-300",children:(0,d.jsx)(tO,{className:"h-3.5 w-3.5"})})]}),(0,d.jsxs)("div",{className:"jsx-df1c681cdb543264 flex items-center gap-2 text-[10px] px-1",children:[(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-muted-foreground/60",children:"本次已获:"}),e.rewards.crystals>0&&(0,d.jsxs)("span",{className:"jsx-df1c681cdb543264 text-emerald-300",children:[(0,m.formatNum)(e.rewards.crystals),"晶体"]}),e.rewards.insights>0&&(0,d.jsxs)("span",{className:"jsx-df1c681cdb543264 text-amber-300",children:[e.rewards.insights,"洞见"]}),e.rewards.contact>0&&(0,d.jsxs)("span",{className:"jsx-df1c681cdb543264 text-fuchsia-300",children:[e.rewards.contact.toFixed(1),"接触"]}),0===e.rewards.crystals&&0===e.rewards.insights&&(0,d.jsx)("span",{className:"jsx-df1c681cdb543264 text-muted-foreground/40",children:"暂无"})]}),(0,d.jsx)(I.default,{id:"df1c681cdb543264",children:".echo-scroll::-webkit-scrollbar{width:4px;height:4px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff1f;border-radius:2px}.echo-scroll::-webkit-scrollbar-track{background:0 0}"})]})}var tB=e.i(32142),tI=e.i(64030);let tF=(0,x.default)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]),tV=[{key:"all",label:"全部",color:"#a78bfa"},{key:"unlocked",label:"已解锁",color:"#34d399"},{key:"locked",label:"未解锁",color:"#fb7185"}];function tz(){let e=(0,f.useGameStore)(e=>e.achievements),[t,s]=(0,u.useState)("all"),r=Object.values(e).filter(Boolean).length,a=(0,tB.achievementBonuses)(e),i=tB.ACHIEVEMENTS.length,n=i>0?r/i*100:0,o=(0,u.useMemo)(()=>tB.ACHIEVEMENTS.filter(s=>{let r=!!e[s.id];return"unlocked"===t?r:"locked"!==t||!r}),[e,t]);return(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex flex-col gap-2.5 h-full min-h-0",children:[(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center justify-between gap-2",children:[(0,d.jsxs)("h3",{className:"jsx-89979d12e77b884d text-sm font-semibold flex items-center gap-1.5 shrink-0",children:[(0,d.jsx)(tI.Trophy,{className:"h-4 w-4 text-amber-400"}),"成就"]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-2 text-[10px] font-mono",children:[(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-amber-300",children:r}),(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-muted-foreground/50",children:"/"}),(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-muted-foreground",children:i}),(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-muted-foreground/60",children:["(",n.toFixed(0),"%)"]})]})]}),(0,d.jsx)("div",{className:"jsx-89979d12e77b884d h-1 rounded-full bg-black/40 overflow-hidden",children:(0,d.jsx)("div",{style:{width:`${n}%`,boxShadow:"0 0 8px rgba(251,191,36,0.5)"},className:"jsx-89979d12e77b884d h-full bg-gradient-to-r from-amber-500 via-rose-400 to-fuchsia-400 transition-all duration-500"})}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d rounded-lg border border-amber-400/20 bg-amber-950/20 px-2.5 py-1.5 flex items-center gap-2 text-[10px] flex-wrap",children:[(0,d.jsx)(ee.Sparkles,{className:"h-3 w-3 text-amber-400 shrink-0"}),(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-amber-300/80",children:"永久加成"}),a.crystalsPerSecPct>0&&(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-emerald-300",children:["产能 +",a.crystalsPerSecPct,"%"]}),a.insightPct>0&&(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-fuchsia-300",children:["洞见 +",a.insightPct,"%"]}),0===a.crystalsPerSecPct&&0===a.insightPct&&(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-muted-foreground/60",children:"达成成就解锁永久加成"})]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-1 text-[10px]",children:[(0,d.jsx)(tF,{className:"h-3 w-3 text-muted-foreground/60 shrink-0"}),tV.map(e=>{let a=t===e.key,n="all"===e.key?i:"unlocked"===e.key?r:i-r;return(0,d.jsxs)("button",{onClick:()=>s(e.key),style:a?{color:e.color,boxShadow:`inset 0 0 0 1px ${e.color}55`}:void 0,className:`jsx-89979d12e77b884d px-2 py-0.5 rounded-md transition-all ${a?"bg-white/10 text-foreground":"text-muted-foreground/70 hover:text-foreground hover:bg-white/5"}`,children:[e.label,(0,d.jsx)("span",{className:"jsx-89979d12e77b884d ml-1 font-mono opacity-70",children:n})]},e.key)})]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex-1 min-h-0 overflow-y-auto echo-scroll pr-1 space-y-1.5",children:[0===o.length&&(0,d.jsx)("div",{className:"jsx-89979d12e77b884d text-center text-[11px] text-muted-foreground/60 py-6",children:"该分类下暂无成就"}),o.map(t=>{let s=!!e[t.id];return(0,d.jsxs)("div",{style:s?{boxShadow:`inset 0 0 14px ${t.color}10`}:void 0,className:`jsx-89979d12e77b884d relative rounded-lg border px-2.5 py-2 transition-all duration-300 min-h-[68px] flex items-center ${s?"border-white/15 bg-black/30":"border-white/5 bg-black/15 opacity-70"}`,children:[s&&(0,d.jsx)("div",{style:{background:t.color},className:"jsx-89979d12e77b884d absolute -top-6 -right-6 h-16 w-16 rounded-full blur-2xl opacity-40 pointer-events-none"}),(0,d.jsx)("div",{style:{background:s?`${t.color}22`:"rgba(255,255,255,0.04)",border:`1px solid ${s?t.color+"55":"rgba(255,255,255,0.08)"}`,color:s?t.color:"#666",boxShadow:s?`0 0 10px ${t.color}33`:"none"},className:"jsx-89979d12e77b884d shrink-0 h-10 w-10 rounded-lg flex items-center justify-center text-lg mr-2.5",children:s?t.icon:(0,d.jsx)(eh,{className:"h-4 w-4"})}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d min-w-0 flex-1 flex flex-col gap-0.5",children:[(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-1.5",children:[(0,d.jsx)("span",{style:{color:s?t.color:"rgba(255,255,255,0.5)"},className:"jsx-89979d12e77b884d text-[11px] font-semibold truncate",children:t.name}),s&&(0,d.jsx)("span",{style:{background:`${t.color}22`,color:t.color},className:"jsx-89979d12e77b884d text-[8px] px-1 py-0 rounded shrink-0 font-mono",children:"✓"})]}),(0,d.jsx)("div",{className:"jsx-89979d12e77b884d text-[10px] text-muted-foreground/80 leading-tight line-clamp-2",children:t.desc}),s&&(0,d.jsxs)("div",{style:{color:t.color+"cc"},className:"jsx-89979d12e77b884d text-[9px] mt-0.5 font-mono truncate",children:["✦ ",t.rewardText]})]})]},t.id)})]}),(0,d.jsx)(I.default,{id:"89979d12e77b884d",children:".echo-scroll::-webkit-scrollbar{width:5px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff24;border-radius:3px}.echo-scroll::-webkit-scrollbar-track{background:0 0}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}"})]})}var tG=e.i(47167);let tU=(0,u.createContext)({});function tH(e){let t=(0,u.useRef)(null);return null===t.current&&(t.current=e()),t.current}let tW="u">typeof window,tq=tW?u.useLayoutEffect:u.useEffect,tY=(0,u.createContext)(null);function tK(e){return"object"==typeof e&&null!==e}function tX(e){return tK(e)&&"offsetHeight"in e}var tZ=u;let tJ=(0,u.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function tQ(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class t0 extends tZ.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=t.offsetParent,s=tX(e)&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=s-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function t1({children:e,isPresent:t,anchorX:s,root:r}){let a=(0,tZ.useId)(),i=(0,tZ.useRef)(null),n=(0,tZ.useRef)({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=(0,tZ.useContext)(tJ),l=function(...e){return u.useCallback(function(...e){return t=>{let s=!1,r=e.map(e=>{let r=tQ(e,t);return s||"function"!=typeof r||(s=!0),r});if(s)return()=>{for(let t=0;t<r.length;t++){let s=r[t];"function"==typeof s?s():tQ(e[t],null)}}}}(...e),e)}(i,e.props?.ref??e?.ref);return(0,tZ.useInsertionEffect)(()=>{let{width:e,height:l,top:c,left:d,right:u}=n.current;if(t||!i.current||!e||!l)return;let h="left"===s?`left: ${d}`:`right: ${u}`;i.current.dataset.motionPopId=a;let f=document.createElement("style");o&&(f.nonce=o);let m=r??document.head;return m.appendChild(f),f.sheet&&f.sheet.insertRule(`
[data-motion-pop-id="${a}"] {
position: absolute !important;
width: ${e}px !important;
height: ${l}px !important;
${h}px !important;
top: ${c}px !important;
}
`),()=>{m.contains(f)&&m.removeChild(f)}},[t]),(0,d.jsx)(t0,{isPresent:t,childRef:i,sizeRef:n,children:tZ.cloneElement(e,{ref:l})})}let t2=({children:e,initial:t,isPresent:s,onExitComplete:r,custom:a,presenceAffectsLayout:i,mode:n,anchorX:o,root:l})=>{let c=tH(t5),h=(0,u.useId)(),f=!0,m=(0,u.useMemo)(()=>(f=!1,{id:h,initial:t,isPresent:s,custom:a,onExitComplete:e=>{for(let t of(c.set(e,!0),c.values()))if(!t)return;r&&r()},register:e=>(c.set(e,!1),()=>c.delete(e))}),[s,c,r]);return i&&f&&(m={...m}),(0,u.useMemo)(()=>{c.forEach((e,t)=>c.set(t,!1))},[s]),u.useEffect(()=>{s||c.size||!r||r()},[s]),"popLayout"===n&&(e=(0,d.jsx)(t1,{isPresent:s,anchorX:o,root:l,children:e})),(0,d.jsx)(tY.Provider,{value:m,children:e})};function t5(){return new Map}function t3(e=!0){let t=(0,u.useContext)(tY);if(null===t)return[!0,null];let{isPresent:s,onExitComplete:r,register:a}=t,i=(0,u.useId)();(0,u.useEffect)(()=>{if(e)return a(i)},[e]);let n=(0,u.useCallback)(()=>e&&r&&r(i),[i,r,e]);return!s&&r?[!1,n]:[!0]}let t4=e=>e.key||"";function t9(e){let t=[];return u.Children.forEach(e,e=>{(0,u.isValidElement)(e)&&t.push(e)}),t}let t7=({children:e,custom:t,initial:s=!0,onExitComplete:r,presenceAffectsLayout:a=!0,mode:i="sync",propagate:n=!1,anchorX:o="left",root:l})=>{let[c,h]=t3(n),f=(0,u.useMemo)(()=>t9(e),[e]),m=n&&!c?[]:f.map(t4),p=(0,u.useRef)(!0),x=(0,u.useRef)(f),g=tH(()=>new Map),b=(0,u.useRef)(new Set),[y,v]=(0,u.useState)(f),[w,j]=(0,u.useState)(f);tq(()=>{p.current=!1,x.current=f;for(let e=0;e<w.length;e++){let t=t4(w[e]);m.includes(t)?(g.delete(t),b.current.delete(t)):!0!==g.get(t)&&g.set(t,!1)}},[w,m.length,m.join("-")]);let N=[];if(f!==y){let e=[...f];for(let t=0;t<w.length;t++){let s=w[t],r=t4(s);m.includes(r)||(e.splice(t,0,s),N.push(s))}return"wait"===i&&N.length&&(e=N),j(t9(e)),v(f),null}let{forceRender:k}=(0,u.useContext)(tU);return(0,d.jsx)(d.Fragment,{children:w.map(e=>{let u=t4(e),y=(!n||!!c)&&(f===w||m.includes(u));return(0,d.jsx)(t2,{isPresent:y,initial:(!p.current||!!s)&&void 0,custom:t,presenceAffectsLayout:a,mode:i,root:l,onExitComplete:y?void 0:()=>{if(b.current.has(u)||(b.current.add(u),!g.has(u)))return;g.set(u,!0);let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(k?.(),j(x.current),n&&h?.(),r&&r())},anchorX:o,children:e},u)})})},t8=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],t6=new Set(t8),se=(e,t,s)=>s>t?t:s<e?e:s,st={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},ss={...st,transform:e=>se(0,1,e)},sr={...st,default:1},sa=e=>Math.round(1e5*e)/1e5,si=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,sn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,so=(e,t)=>s=>!!("string"==typeof s&&sn.test(s)&&s.startsWith(e)||t&&null!=s&&Object.prototype.hasOwnProperty.call(s,t)),sl=(e,t,s)=>r=>{if("string"!=typeof r)return r;let[a,i,n,o]=r.match(si);return{[e]:parseFloat(a),[t]:parseFloat(i),[s]:parseFloat(n),alpha:void 0!==o?parseFloat(o):1}},sc={...st,transform:e=>Math.round(se(0,255,e))},sd={test:so("rgb","red"),parse:sl("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:r=1})=>"rgba("+sc.transform(e)+", "+sc.transform(t)+", "+sc.transform(s)+", "+sa(ss.transform(r))+")"},su={test:so("#"),parse:function(e){let t="",s="",r="",a="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),r=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),r=e.substring(3,4),a=e.substring(4,5),t+=t,s+=s,r+=r,a+=a),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}},transform:sd.transform},sh=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),sf=sh("deg"),sm=sh("%"),sp=sh("px"),sx=sh("vh"),sg=sh("vw"),sb={...sm,parse:e=>sm.parse(e)/100,transform:e=>sm.transform(100*e)},sy={test:so("hsl","hue"),parse:sl("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:r=1})=>"hsla("+Math.round(e)+", "+sm.transform(sa(t))+", "+sm.transform(sa(s))+", "+sa(ss.transform(r))+")"},sv={test:e=>sd.test(e)||su.test(e)||sy.test(e),parse:e=>sd.test(e)?sd.parse(e):sy.test(e)?sy.parse(e):su.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?sd.transform(e):sy.transform(e),getAnimatableNone:e=>{let t=sv.parse(e);return t.alpha=0,sv.transform(t)}},sw=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,sj="number",sN="color",sk=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function sS(e){let t=e.toString(),s=[],r={color:[],number:[],var:[]},a=[],i=0,n=t.replace(sk,e=>(sv.test(e)?(r.color.push(i),a.push(sN),s.push(sv.parse(e))):e.startsWith("var(")?(r.var.push(i),a.push("var"),s.push(e)):(r.number.push(i),a.push(sj),s.push(parseFloat(e))),++i,"${}")).split("${}");return{values:s,split:n,indexes:r,types:a}}function sT(e){return sS(e).values}function sC(e){let{split:t,types:s}=sS(e),r=t.length;return e=>{let a="";for(let i=0;i<r;i++)if(a+=t[i],void 0!==e[i]){let t=s[i];t===sj?a+=sa(e[i]):t===sN?a+=sv.transform(e[i]):a+=e[i]}return a}}let sE=e=>"number"==typeof e?0:sv.test(e)?sv.getAnimatableNone(e):e,sA={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(si)?.length||0)+(e.match(sw)?.length||0)>0},parse:sT,createTransformer:sC,getAnimatableNone:function(e){let t=sT(e);return sC(e)(t.map(sE))}},s_=new Set(["brightness","contrast","saturate","opacity"]);function sP(e){let[t,s]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[r]=s.match(si)||[];if(!r)return e;let a=s.replace(r,""),i=+!!s_.has(t);return r!==s&&(i*=100),t+"("+i+a+")"}let sM=/\b([a-z-]*)\(.*?\)/gu,sR={...sA,getAnimatableNone:e=>{let t=e.match(sM);return t?t.map(sP).join(" "):e}},s$={...st,transform:Math.round},sO={borderWidth:sp,borderTopWidth:sp,borderRightWidth:sp,borderBottomWidth:sp,borderLeftWidth:sp,borderRadius:sp,radius:sp,borderTopLeftRadius:sp,borderTopRightRadius:sp,borderBottomRightRadius:sp,borderBottomLeftRadius:sp,width:sp,maxWidth:sp,height:sp,maxHeight:sp,top:sp,right:sp,bottom:sp,left:sp,inset:sp,insetBlock:sp,insetBlockStart:sp,insetBlockEnd:sp,insetInline:sp,insetInlineStart:sp,insetInlineEnd:sp,padding:sp,paddingTop:sp,paddingRight:sp,paddingBottom:sp,paddingLeft:sp,paddingBlock:sp,paddingBlockStart:sp,paddingBlockEnd:sp,paddingInline:sp,paddingInlineStart:sp,paddingInlineEnd:sp,margin:sp,marginTop:sp,marginRight:sp,marginBottom:sp,marginLeft:sp,marginBlock:sp,marginBlockStart:sp,marginBlockEnd:sp,marginInline:sp,marginInlineStart:sp,marginInlineEnd:sp,backgroundPositionX:sp,backgroundPositionY:sp,rotate:sf,rotateX:sf,rotateY:sf,rotateZ:sf,scale:sr,scaleX:sr,scaleY:sr,scaleZ:sr,skew:sf,skewX:sf,skewY:sf,distance:sp,translateX:sp,translateY:sp,translateZ:sp,x:sp,y:sp,z:sp,perspective:sp,transformPerspective:sp,opacity:ss,originX:sb,originY:sb,originZ:sp,zIndex:s$,fillOpacity:ss,strokeOpacity:ss,numOctaves:s$},sD={...sO,color:sv,backgroundColor:sv,outlineColor:sv,fill:sv,stroke:sv,borderColor:sv,borderTopColor:sv,borderRightColor:sv,borderBottomColor:sv,borderLeftColor:sv,filter:sR,WebkitFilter:sR},sL=e=>sD[e],sB=()=>({translate:0,scale:1,origin:0,originPoint:0}),sI=()=>({x:sB(),y:sB()}),sF=()=>({min:0,max:0}),sV=()=>({x:sF(),y:sF()}),sz=e=>!!(e&&e.getVelocity),sG=new Set(["width","height","top","left","right","bottom",...t8]),sU=e=>t=>t.test(e),sH=[st,sp,sm,sf,sg,sx,{test:e=>"auto"===e,parse:e=>e}],sW=e=>sH.find(sU(e)),sq=()=>{},sY=()=>{};tG.default;let sK=e=>t=>"string"==typeof t&&t.startsWith(e),sX=sK("--"),sZ=sK("var(--"),sJ=e=>!!sZ(e)&&sQ.test(e.split("/*")[0].trim()),sQ=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function s0(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}let s1=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,s2=e=>180*e/Math.PI,s5=e=>s4(s2(Math.atan2(e[1],e[0]))),s3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:s5,rotateZ:s5,skewX:e=>s2(Math.atan(e[1])),skewY:e=>s2(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},s4=e=>((e%=360)<0&&(e+=360),e),s9=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),s7=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),s8={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:s9,scaleY:s7,scale:e=>(s9(e)+s7(e))/2,rotateX:e=>s4(s2(Math.atan2(e[6],e[5]))),rotateY:e=>s4(s2(Math.atan2(-e[2],e[0]))),rotateZ:s5,rotate:s5,skewX:e=>s2(Math.atan(e[4])),skewY:e=>s2(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function s6(e){return+!!e.includes("scale")}function re(e,t){let s,r;if(!e||"none"===e)return s6(t);let a=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(a)s=s8,r=a;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=s3,r=t}if(!r)return s6(t);let i=s[t],n=r[1].split(",").map(rt);return"function"==typeof i?i(n):n[i]}function rt(e){return parseFloat(e.trim())}let rs=e=>e===st||e===sp,rr=new Set(["x","y","z"]),ra=t8.filter(e=>!rr.has(e)),ri={width:({x:e},{paddingLeft:t="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),height:({y:e},{paddingTop:t="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>re(t,"x"),y:(e,{transform:t})=>re(t,"y")};ri.translateX=ri.x,ri.translateY=ri.y;let rn=e=>e,ro={},rl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function rc(e,t){let s=!1,r=!0,a={delta:0,timestamp:0,isProcessing:!1},i=()=>s=!0,n=rl.reduce((e,s)=>(e[s]=function(e,t){let s=new Set,r=new Set,a=!1,i=!1,n=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1},l=0;function c(t){n.has(t)&&(d.schedule(t),e()),l++,t(o)}let d={schedule:(e,t=!1,i=!1)=>{let o=i&&a?s:r;return t&&n.add(e),o.has(e)||o.add(e),e},cancel:e=>{r.delete(e),n.delete(e)},process:e=>{if(o=e,a){i=!0;return}a=!0,[s,r]=[r,s],s.forEach(c),t,l=0,s.clear(),a=!1,i&&(i=!1,d.process(e))}};return d}(i,t?s:void 0),e),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:d,update:u,preRender:h,render:f,postRender:m}=n,p=()=>{let i=ro.useManualTiming?a.timestamp:performance.now();s=!1,ro.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(i-a.timestamp,40),1)),a.timestamp=i,a.isProcessing=!0,o.process(a),l.process(a),c.process(a),d.process(a),u.process(a),h.process(a),f.process(a),m.process(a),a.isProcessing=!1,s&&t&&(r=!1,e(p))};return{schedule:rl.reduce((t,i)=>{let o=n[i];return t[i]=(t,i=!1,n=!1)=>(!s&&(s=!0,r=!0,a.isProcessing||e(p)),o.schedule(t,i,n)),t},{}),cancel:e=>{for(let t=0;t<rl.length;t++)n[rl[t]].cancel(e)},state:a,steps:n}}let{schedule:rd,cancel:ru,state:rh,steps:rf}=rc("u">typeof requestAnimationFrame?requestAnimationFrame:rn,!0),rm=new Set,rp=!1,rx=!1,rg=!1;function rb(){if(rx){let e=Array.from(rm).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),s=new Map;t.forEach(e=>{let t,r=(t=[],ra.forEach(s=>{let r=e.getValue(s);void 0!==r&&(t.push([s,r.get()]),r.set(+!!s.startsWith("scale")))}),t);r.length&&(s.set(e,r),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=s.get(e);t&&t.forEach(([t,s])=>{e.getValue(t)?.set(s)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}rx=!1,rp=!1,rm.forEach(e=>e.complete(rg)),rm.clear()}function ry(){rm.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(rx=!0)})}class rv{constructor(e,t,s,r,a,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=s,this.motionValue=r,this.element=a,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(rm.add(this),rp||(rp=!0,rd.read(ry),rd.resolveKeyframes(rb))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:s,motionValue:r}=this;if(null===e[0]){let a=r?.get(),i=e[e.length-1];if(void 0!==a)e[0]=a;else if(s&&t){let r=s.readValue(t,i);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=i),r&&void 0===a&&r.set(e[0])}for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),rm.delete(this)}cancel(){"scheduled"===this.state&&(rm.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function rw(e,t){let s=sL(e);return s!==sR&&(s=sA),s.getAnimatableNone?s.getAnimatableNone(t):void 0}let rj=new Set(["auto","none","0"]);class rN extends rv{constructor(e,t,s,r,a){super(e,t,s,r,a,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:s}=this;if(!t||!t.current)return;super.readKeyframes();for(let s=0;s<e.length;s++){let r=e[s];if("string"==typeof r&&sJ(r=r.trim())){let a=function e(t,s,r=1){sY(r<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[a,i]=function(e){let t=s1.exec(e);if(!t)return[,];let[,s,r,a]=t;return[`--${s??r}`,a]}(t);if(!a)return;let n=window.getComputedStyle(s).getPropertyValue(a);if(n){let e=n.trim();return/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)?parseFloat(e):e}return sJ(i)?e(i,s,r+1):i}(r,t.current);void 0!==a&&(e[s]=a),s===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!sG.has(s)||2!==e.length)return;let[r,a]=e,i=sW(r),n=sW(a);if(s0(r)!==s0(a)&&ri[s]){this.needsMeasurement=!0;return}if(i!==n)if(rs(i)&&rs(n))for(let t=0;t<e.length;t++){let s=e[t];"string"==typeof s&&(e[t]=parseFloat(s))}else ri[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,s=[];for(let t=0;t<e.length;t++)(null===e[t]||function(e){if("number"==typeof e)return 0===e;if(null===e)return!0;return"none"===e||"0"===e||/^0[^.\s]+$/u.test(e)}(e[t]))&&s.push(t);s.length&&function(e,t,s){let r,a=0;for(;a<e.length&&!r;){let t=e[a];"string"==typeof t&&!rj.has(t)&&sS(t).values.length&&(r=e[a]),a++}if(r&&s)for(let a of t)e[a]=rw(s,r)}(e,s,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:s}=this;if(!e||!e.current)return;"height"===s&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ri[s](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];void 0!==r&&e.getValue(s,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:s}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let a=s.length-1,i=s[a];s[a]=ri[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,s])=>{e.getValue(t).set(s)}),this.resolveNoneKeyframes()}}function rk(e,t){-1===e.indexOf(t)&&e.push(t)}function rS(e,t){let s=e.indexOf(t);s>-1&&e.splice(s,1)}class rT{constructor(){this.subscriptions=[]}add(e){return rk(this.subscriptions,e),()=>rS(this.subscriptions,e)}notify(e,t,s){let r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,s);else for(let a=0;a<r;a++){let r=this.subscriptions[a];r&&r(e,t,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let{schedule:rC}=rc(queueMicrotask,!1);function rE(){t=void 0}let rA={now:()=>(void 0===t&&rA.set(rh.isProcessing||ro.useManualTiming?rh.timestamp:performance.now()),t),set:e=>{t=e,queueMicrotask(rE)}};class r_{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=rA.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=rA.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new rT);let s=this.events[e].add(t);return"change"===e?()=>{s(),rd.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,s){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return n&&n.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var e;let t=rA.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let s=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e=parseFloat(this.current)-parseFloat(this.prevFrameValue),s?1e3/s*e:0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function rP(e,t){return new r_(e,t)}let rM=[...sH,sv,sA],rR={current:null},r$={current:!1},rO="u">typeof window,rD=new WeakMap;function rL(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function rB(e){return"string"==typeof e||Array.isArray(e)}let rI=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],rF=["initial",...rI];function rV(e){return rL(e.animate)||rF.some(t=>rB(e[t]))}function rz(e){return!!(rV(e)||e.variants)}function rG(e){let t=[{},{}];return e?.values.forEach((e,s)=>{t[0][s]=e.get(),t[1][s]=e.getVelocity()}),t}function rU(e,t,s,r){if("function"==typeof t){let[a,i]=rG(r);t=t(void 0!==s?s:e.custom,a,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[a,i]=rG(r);t=t(void 0!==s?s:e.custom,a,i)}return t}let rH=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],rW={};class rq{scrapeMotionValuesFromProps(e,t,s){return{}}constructor({parent:e,props:t,presenceContext:s,reducedMotionConfig:r,blockInitialAnimation:a,visualState:i},n={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=rv,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=rA.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,rd.render(this.render,!1,!0))};const{latestValues:o,renderState:l}=i;this.latestValues=o,this.baseTarget={...o},this.initialValues=t.initial?{...o}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=n,this.blockInitialAnimation=!!a,this.isControllingVariants=rV(t),this.isVariantNode=rz(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==o[e]&&sz(t)&&t.set(o[e])}}mount(e){this.current=e,rD.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(r$.current||function(){if(r$.current=!0,rO)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>rR.current=e.matches;e.addEventListener("change",t),t()}else rR.current=!1}(),this.shouldReduceMotion=rR.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),ru(this.notifyUpdate),ru(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){let s;this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let r=t6.has(e);r&&this.onBindTransform&&this.onBindTransform();let a=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&rd.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"u">typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{a(),s&&s(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in rW){let t=rW[e];if(!t)continue;let{isEnabled:s,Feature:r}=t;if(!this.features[e]&&r&&s(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):sV()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<rH.length;t++){let s=rH[t];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);let r=e["on"+s];r&&(this.propEventSubscriptions[s]=this.on(s,r))}this.prevMotionValues=function(e,t,s){for(let r in t){let a=t[r],i=s[r];if(sz(a))e.addValue(r,a);else if(sz(i))e.addValue(r,rP(a,{owner:e}));else if(i!==a)if(e.hasValue(r)){let t=e.getValue(r);!0===t.liveStyle?t.jump(a):t.hasAnimated||t.set(a)}else{let t=e.getStaticValue(r);e.addValue(r,rP(void 0!==t?t:a,{owner:e}))}}for(let r in s)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let s=this.values.get(e);t!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return void 0===s&&void 0!==t&&(s=rP(null===t?void 0:t,{owner:this}),this.addValue(e,s)),s}readValue(e,t){let s=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];if(null!=s){let r,a;if("string"==typeof s&&(r=s,/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(r)||(a=s,/^0[^.\s]+$/u.test(a))))s=parseFloat(s);else{let r;r=s,!rM.find(sU(r))&&sA.test(t)&&(s=rw(e,t))}this.setBaseTarget(e,sz(s)?s.get():s)}return sz(s)?s.get():s}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let t,{initial:s}=this.props;if("string"==typeof s||"object"==typeof s){let r=rU(this.props,s,this.presenceContext?.custom);r&&(t=r[e])}if(s&&void 0!==t)return t;let r=this.getBaseTargetFromProps(this.props,e);return void 0===r||sz(r)?void 0!==this.initialValues[e]&&void 0===t?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new rT),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){rC.render(this.render)}}class rY extends rq{constructor(){super(...arguments),this.KeyframeResolver=rN}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){let s=e.style;return s?s[t]:void 0}removeValueFromRenderState(e,{vars:t,style:s}){delete t[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;sz(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function rK(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}let rX=(e,t)=>t&&"number"==typeof e?t.transform(e):e,rZ={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rJ=t8.length;function rQ(e,t,s){let{style:r,vars:a,transformOrigin:i}=e,n=!1,o=!1;for(let e in t){let s=t[e];if(t6.has(e)){n=!0;continue}if(sX(e)){a[e]=s;continue}{let t=rX(s,sO[e]);e.startsWith("origin")?(o=!0,i[e]=t):r[e]=t}}if(!t.transform&&(n||s?r.transform=function(e,t,s){let r="",a=!0;for(let i=0;i<rJ;i++){let n=t8[i],o=e[n];if(void 0===o)continue;let l=!0;if(!(l="number"==typeof o?o===+!!n.startsWith("scale"):0===parseFloat(o))||s){let e=rX(o,sO[n]);if(!l){a=!1;let t=rZ[n]||n;r+=`${t}(${e}) `}s&&(t[n]=e)}}return r=r.trim(),s?r=s(t,a?"":r):a&&(r="none"),r}(t,e.transform,s):r.transform&&(r.transform="none")),o){let{originX:e="50%",originY:t="50%",originZ:s=0}=i;r.transformOrigin=`${e} ${t} ${s}`}}let r0={offset:"stroke-dashoffset",array:"stroke-dasharray"},r1={offset:"strokeDashoffset",array:"strokeDasharray"},r2=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function r5(e,{attrX:t,attrY:s,attrScale:r,pathLength:a,pathSpacing:i=1,pathOffset:n=0,...o},l,c,d){if(rQ(e,o,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:u,style:h}=e;for(let e of(u.transform&&(h.transform=u.transform,delete u.transform),(h.transform||u.transformOrigin)&&(h.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),h.transform&&(h.transformBox=d?.transformBox??"fill-box",delete u.transformBox),r2))void 0!==u[e]&&(h[e]=u[e],delete u[e]);void 0!==t&&(u.x=t),void 0!==s&&(u.y=s),void 0!==r&&(u.scale=r),void 0!==a&&function(e,t,s=1,r=0,a=!0){e.pathLength=1;let i=a?r0:r1;e[i.offset]=sp.transform(-r);let n=sp.transform(t),o=sp.transform(s);e[i.array]=`${n} ${o}`}(u,a,i,n,!1)}let r3=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"]),r4=e=>"string"==typeof e&&"svg"===e.toLowerCase();function r9(e,{style:t,vars:s},r,a){let i,n=e.style;for(i in t)n[i]=t[i];for(i in a?.applyProjectionStyles(n,r),s)n.setProperty(i,s[i])}function r7(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let r8={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e)if(!sp.test(e))return e;else e=parseFloat(e);let s=r7(e,t.target.x),r=r7(e,t.target.y);return`${s}% ${r}%`}},r6=(e,t,s)=>e+(t-e)*s,ae={borderRadius:{...r8,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:r8,borderTopRightRadius:r8,borderBottomLeftRadius:r8,borderBottomRightRadius:r8,boxShadow:{correct:(e,{treeScale:t,projectionDelta:s})=>{let r=sA.parse(e);if(r.length>5)return e;let a=sA.createTransformer(e),i=+("number"!=typeof r[0]),n=s.x.scale*t.x,o=s.y.scale*t.y;r[0+i]/=n,r[1+i]/=o;let l=r6(n,o,.5);return"number"==typeof r[2+i]&&(r[2+i]/=l),"number"==typeof r[3+i]&&(r[3+i]/=l),a(r)}}};function at(e,{layout:t,layoutId:s}){return t6.has(e)||e.startsWith("origin")||(t||void 0!==s)&&(!!ae[e]||"opacity"===e)}function as(e,t,s){let r=e.style,a=t?.style,i={};if(!r)return i;for(let t in r)(sz(r[t])||a&&sz(a[t])||at(t,e)||s?.getValue(t)?.liveStyle!==void 0)&&(i[t]=r[t]);return i}function ar(e,t,s){let r=as(e,t,s);for(let s in e)(sz(e[s])||sz(t[s]))&&(r[-1!==t8.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=e[s]);return r}class aa extends rY{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=sV}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(t6.has(t)){let e=sL(t);return e&&e.default||0}return t=r3.has(t)?t:rK(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,s){return ar(e,t,s)}build(e,t,s){r5(e,t,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,t,s,r){for(let s in r9(e,t,void 0,r),t.attrs)e.setAttribute(r3.has(s)?s:rK(s),t.attrs[s])}mount(e){this.isSVGTag=r4(e.tagName),super.mount(e)}}function ai({top:e,left:t,right:s,bottom:r}){return{x:{min:t,max:s},y:{min:e,max:r}}}function an(e){return void 0===e||1===e}function ao({scale:e,scaleX:t,scaleY:s}){return!an(e)||!an(t)||!an(s)}function al(e){return ao(e)||ac(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ac(e){var t,s;return(t=e.x)&&"0%"!==t||(s=e.y)&&"0%"!==s}function ad(e,t,s,r,a){return void 0!==a&&(e=r+a*(e-r)),r+s*(e-r)+t}function au(e,t=0,s=1,r,a){e.min=ad(e.min,t,s,r,a),e.max=ad(e.max,t,s,r,a)}function ah(e,{x:t,y:s}){au(e.x,t.translate,t.scale,t.originPoint),au(e.y,s.translate,s.scale,s.originPoint)}function af(e,t){e.min=e.min+t,e.max=e.max+t}function am(e,t,s,r,a=.5){let i=r6(e.min,e.max,a);au(e,t,s,i,r)}function ap(e,t){am(e.x,t.x,t.scaleX,t.scale,t.originX),am(e.y,t.y,t.scaleY,t.scale,t.originY)}function ax(e,t){return ai(function(e,t){if(!t)return e;let s=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}class ag extends rY{constructor(){super(...arguments),this.type="html",this.renderInstance=r9}readValueFromInstance(e,t){if(t6.has(t))return this.projection?.isProjecting?s6(t):((e,t)=>{let{transform:s="none"}=getComputedStyle(e);return re(s,t)})(e,t);{let s=window.getComputedStyle(e),r=(sX(t)?s.getPropertyValue(t):s[t])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return ax(e,t)}build(e,t,s){rQ(e,t,s.transformTemplate)}scrapeMotionValuesFromProps(e,t,s){return as(e,t,s)}}let ab=["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 ay(e){if("string"!=typeof e||e.includes("-"));else if(ab.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}let av=(0,u.createContext)({strict:!1}),aw=(0,u.createContext)({});function aj(e){return Array.isArray(e)?e.join(" "):e}let aN=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ak(e,t,s){for(let r in t)sz(t[r])||at(r,s)||(e[r]=t[r])}let aS=()=>({...aN(),attrs:{}}),aT=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function aC(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||aT.has(e)}let aE=e=>!aC(e);try{o=(()=>{let e=Error("Cannot find module '@emotion/is-prop-valid'");throw e.code="MODULE_NOT_FOUND",e})().default,"function"==typeof o&&(aE=e=>e.startsWith("on")?!aC(e):o(e))}catch{}function aA(e){return sz(e)?e.get():e}let a_=e=>(t,s)=>{let r=(0,u.useContext)(aw),a=(0,u.useContext)(tY),i=()=>(function({scrapeMotionValuesFromProps:e,createRenderState:t},s,r,a){return{latestValues:function(e,t,s,r){let a={},i=r(e,{});for(let e in i)a[e]=aA(i[e]);let{initial:n,animate:o}=e,l=rV(e),c=rz(e);t&&c&&!l&&!1!==e.inherit&&(void 0===n&&(n=t.initial),void 0===o&&(o=t.animate));let d=!!s&&!1===s.initial,u=(d=d||!1===n)?o:n;if(u&&"boolean"!=typeof u&&!rL(u)){let t=Array.isArray(u)?u:[u];for(let s=0;s<t.length;s++){let r=rU(e,t[s]);if(r){let{transitionEnd:e,transition:t,...s}=r;for(let e in s){let t=s[e];if(Array.isArray(t)){let e=d?t.length-1:0;t=t[e]}null!==t&&(a[e]=t)}for(let t in e)a[t]=e[t]}}}return a}(s,r,a,e),renderState:t()}})(e,t,r,a);return s?i():tH(i)},aP=a_({scrapeMotionValuesFromProps:as,createRenderState:aN}),aM=a_({scrapeMotionValuesFromProps:ar,createRenderState:aS}),aR={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"]},a$=!1;function aO(){return!function(){if(a$)return;let e={};for(let t in aR)e[t]={isEnabled:e=>aR[t].some(t=>!!e[t])};rW=e,a$=!0}(),rW}let aD=Symbol.for("motionComponentSymbol"),aL="data-"+rK("framerAppearId"),aB=(0,u.createContext)({});function aI(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function aF(e,{forwardMotionProps:t=!1,type:s}={},r,a){r&&function(e){let t=aO();for(let s in e)t[s]={...t[s],...e[s]};rW=t}(r);let i=s?"svg"===s:ay(e),n=i?aM:aP;function o(s,r){var o;let l,c,h,f={...(0,u.useContext)(tJ),...s,layoutId:function({layoutId:e}){let t=(0,u.useContext)(tU).id;return t&&void 0!==e?t+"-"+e:e}(s)},{isStatic:m}=f,p=function(e){let{initial:t,animate:s}=function(e,t){if(rV(e)){let{initial:t,animate:s}=e;return{initial:!1===t||rB(t)?t:void 0,animate:rB(s)?s:void 0}}return!1!==e.inherit?t:{}}(e,(0,u.useContext)(aw));return(0,u.useMemo)(()=>({initial:t,animate:s}),[aj(t),aj(s)])}(s),x=n(s,m);if(!m&&tW){(0,u.useContext)(av).strict;let t=function(e){let{drag:t,layout:s}=aO();if(!t&&!s)return{};let r={...t,...s};return{MeasureLayout:t?.isEnabled(e)||s?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(f);l=t.MeasureLayout,p.visualElement=function(e,t,s,r,a,i){let{visualElement:n}=(0,u.useContext)(aw),o=(0,u.useContext)(av),l=(0,u.useContext)(tY),c=(0,u.useContext)(tJ).reducedMotion,d=(0,u.useRef)(null);r=r||o.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:n,props:s,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:c,isSVG:i}));let h=d.current,f=(0,u.useContext)(aB);h&&!h.projection&&a&&("html"===h.type||"svg"===h.type)&&function(e,t,s,r){let{layoutId:a,layout:i,drag:n,dragConstraints:o,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:function e(t){if(t)return!1!==t.options.allowProjection?t.projection:e(t.parent)}(e.parent)),e.projection.setOptions({layoutId:a,layout:i,alwaysMeasureLayout:!!n||o&&aI(o),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}(d.current,s,a,f);let m=(0,u.useRef)(!1);(0,u.useInsertionEffect)(()=>{h&&m.current&&h.update(s,l)});let p=s[aL],x=(0,u.useRef)(!!p&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return tq(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),x.current&&h.animationState&&h.animationState.animateChanges())}),(0,u.useEffect)(()=>{h&&(!x.current&&h.animationState&&h.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p)}),x.current=!1),h.enteringChildren=void 0)}),h}(e,x,f,a,t.ProjectionNode,i)}return(0,d.jsxs)(aw.Provider,{value:p,children:[l&&p.visualElement?(0,d.jsx)(l,{visualElement:p.visualElement,...f}):null,function(e,t,s,{latestValues:r},a,i=!1,n){let o=(n??ay(e)?function(e,t,s,r){let a=(0,u.useMemo)(()=>{let s=aS();return r5(s,t,r4(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){let t={};ak(t,e.style,e),a.style={...t,...a.style}}return a}:function(e,t){let s,r,a={},i=(s=e.style||{},ak(r={},s,e),Object.assign(r,function({transformTemplate:e},t){return(0,u.useMemo)(()=>{let s=aN();return rQ(s,t,e),Object.assign({},s.vars,s.style)},[t])}(e,t)),r);return e.drag&&!1!==e.dragListener&&(a.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=i,a})(t,r,a,e),l=function(e,t,s){let r={};for(let a in e)("values"!==a||"object"!=typeof e.values)&&(aE(a)||!0===s&&aC(a)||!t&&!aC(a)||e.draggable&&a.startsWith("onDrag"))&&(r[a]=e[a]);return r}(t,"string"==typeof e,i),c=e!==u.Fragment?{...l,...o,ref:s}:{},{children:d}=t,h=(0,u.useMemo)(()=>sz(d)?d.get():d,[d]);return(0,u.createElement)(e,{...c,children:h})}(e,s,(o=p.visualElement,c=(0,u.useRef)(r),(0,u.useInsertionEffect)(()=>{c.current=r}),h=(0,u.useRef)(null),(0,u.useCallback)(e=>{e&&x.onMount?.(e),o&&(e?o.mount(e):o.unmount());let t=c.current;if("function"==typeof t)if(e){let s=t(e);"function"==typeof s&&(h.current=s)}else h.current?(h.current(),h.current=null):t(e);else t&&(t.current=e)},[o])),x,m,t,i)]})}o.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;let l=(0,u.forwardRef)(o);return l[aD]=e,l}class aV{constructor(e){this.isMounted=!1,this.node=e}update(){}}function az(e,t,s){let r=e.getProps();return rU(r,t,void 0!==s?s:r.custom,e)}function aG(e,t){return e?.[t]??e?.default??e}let aU=e=>Array.isArray(e);function aH(e,t){let s=e.getValue("willChange");if(sz(s)&&s.add)return s.add(t);if(!s&&ro.WillChange){let s=new ro.WillChange("auto");e.addValue("willChange",s),s.add(t)}}let aW=e=>1e3*e,aq=(e,t)=>s=>t(e(s)),aY=(...e)=>e.reduce(aq),aK={layout:0,mainThread:0,waapi:0};function aX(e,t,s){return(s<0&&(s+=1),s>1&&(s-=1),s<1/6)?e+(t-e)*6*s:s<.5?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function aZ(e,t){return s=>s>0?t:e}let aJ=(e,t,s)=>{let r=e*e,a=s*(t*t-r)+r;return a<0?0:Math.sqrt(a)},aQ=[su,sd,sy];function a0(e){let t=aQ.find(t=>t.test(e));if(sq(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let s=t.parse(e);return t===sy&&(s=function({hue:e,saturation:t,lightness:s,alpha:r}){e/=360,s/=100;let a=0,i=0,n=0;if(t/=100){let r=s<.5?s*(1+t):s+t-s*t,o=2*s-r;a=aX(o,r,e+1/3),i=aX(o,r,e),n=aX(o,r,e-1/3)}else a=i=n=s;return{red:Math.round(255*a),green:Math.round(255*i),blue:Math.round(255*n),alpha:r}}(s)),s}let a1=(e,t)=>{let s=a0(e),r=a0(t);if(!s||!r)return aZ(e,t);let a={...s};return e=>(a.red=aJ(s.red,r.red,e),a.green=aJ(s.green,r.green,e),a.blue=aJ(s.blue,r.blue,e),a.alpha=r6(s.alpha,r.alpha,e),sd.transform(a))},a2=new Set(["none","hidden"]);function a5(e,t){return s=>r6(e,t,s)}function a3(e){return"number"==typeof e?a5:"string"==typeof e?sJ(e)?aZ:sv.test(e)?a1:a7:Array.isArray(e)?a4:"object"==typeof e?sv.test(e)?a1:a9:aZ}function a4(e,t){let s=[...e],r=s.length,a=e.map((e,s)=>a3(e)(e,t[s]));return e=>{for(let t=0;t<r;t++)s[t]=a[t](e);return s}}function a9(e,t){let s={...e,...t},r={};for(let a in s)void 0!==e[a]&&void 0!==t[a]&&(r[a]=a3(e[a])(e[a],t[a]));return e=>{for(let t in r)s[t]=r[t](e);return s}}let a7=(e,t)=>{let s=sA.createTransformer(t),r=sS(e),a=sS(t);if(!(r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length))return sq(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),aZ(e,t);if(a2.has(e)&&!a.values.length||a2.has(t)&&!r.values.length)return a2.has(e)?s=>s<=0?e:t:s=>s>=1?t:e;return aY(a4(function(e,t){let s=[],r={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){let i=t.types[a],n=e.indexes[i][r[i]],o=e.values[n]??0;s[a]=o,r[i]++}return s}(r,a),a.values),s)};function a8(e,t,s){return"number"==typeof e&&"number"==typeof t&&"number"==typeof s?r6(e,t,s):a3(e)(e,t)}let a6=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>rd.update(t,e),stop:()=>ru(t),now:()=>rh.isProcessing?rh.timestamp:rA.now()}},ie=(e,t,s=10)=>{let r="",a=Math.max(Math.round(t/s),2);for(let t=0;t<a;t++)r+=Math.round(1e4*e(t/(a-1)))/1e4+", ";return`linear(${r.substring(0,r.length-2)})`};function it(e){let t=0,s=e.next(t);for(;!s.done&&t<2e4;)t+=50,s=e.next(t);return t>=2e4?1/0:t}function is(e,t,s){var r,a;let i=Math.max(t-5,0);return r=s-e(i),(a=t-i)?1e3/a*r:0}let ir=.01,ia=2,ii=.005,io=.5;function il(e,t){return e*Math.sqrt(1-t*t)}let ic=["duration","bounce"],id=["stiffness","damping","mass"];function iu(e,t){return t.some(t=>void 0!==e[t])}function ih(e=.3,t=.3){let s,r="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:a,restDelta:i}=r,n=r.keyframes[0],o=r.keyframes[r.keyframes.length-1],l={done:!1,value:n},{stiffness:c,damping:d,mass:u,duration:h,velocity:f,isResolvedFromDuration:m}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!iu(e,id)&&iu(e,ic))if(e.visualDuration){let s=2*Math.PI/(1.2*e.visualDuration),r=s*s,a=2*se(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:1,stiffness:r,damping:a}}else{let s=function({duration:e=800,bounce:t=.3,velocity:s=0,mass:r=1}){let a,i;sq(e<=aW(10),"Spring duration must be 10 seconds or less","spring-duration-limit");let n=1-t;n=se(.05,1,n),e=se(.01,10,e/1e3),n<1?(a=t=>{let r=t*n,a=r*e;return .001-(r-s)/il(t,n)*Math.exp(-a)},i=t=>{let r=t*n*e,i=Math.pow(n,2)*Math.pow(t,2)*e,o=Math.exp(-r),l=il(Math.pow(t,2),n);return(r*s+s-i)*o*(-a(t)+.001>0?-1:1)/l}):(a=t=>-.001+Math.exp(-t*e)*((t-s)*e+1),i=t=>e*e*(s-t)*Math.exp(-t*e));let o=function(e,t,s){let r=s;for(let s=1;s<12;s++)r-=e(r)/t(r);return r}(a,i,5/e);if(e=aW(e),isNaN(o))return{stiffness:100,damping:10,duration:e};{let t=Math.pow(o,2)*r;return{stiffness:t,damping:2*n*Math.sqrt(r*t),duration:e}}}(e);(t={...t,...s,mass:1}).isResolvedFromDuration=!0}return t}({...r,velocity:-((r.velocity||0)/1e3)}),p=f||0,x=d/(2*Math.sqrt(c*u)),g=o-n,b=Math.sqrt(c/u)/1e3,y=5>Math.abs(g);if(a||(a=y?ir:ia),i||(i=y?ii:io),x<1){let e=il(b,x);s=t=>o-Math.exp(-x*b*t)*((p+x*b*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(1===x)s=e=>o-Math.exp(-b*e)*(g+(p+b*g)*e);else{let e=b*Math.sqrt(x*x-1);s=t=>{let s=Math.exp(-x*b*t),r=Math.min(e*t,300);return o-s*((p+x*b*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}let v={calculatedDuration:m&&h||null,next:e=>{let t=s(e);if(m)l.done=e>=h;else{let r=0===e?p:0;x<1&&(r=0===e?aW(p):is(s,e,t));let n=Math.abs(o-t)<=i;l.done=Math.abs(r)<=a&&n}return l.value=l.done?o:t,l},toString:()=>{let e=Math.min(it(v),2e4),t=ie(t=>v.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return v}function im({keyframes:e,velocity:t=0,power:s=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:i=500,modifyTarget:n,min:o,max:l,restDelta:c=.5,restSpeed:d}){let u,h,f=e[0],m={done:!1,value:f},p=s*t,x=f+p,g=void 0===n?x:n(x);g!==x&&(p=g-f);let b=e=>-p*Math.exp(-e/r),y=e=>g+b(e),v=e=>{let t=b(e),s=y(e);m.done=Math.abs(t)<=c,m.value=m.done?g:s},w=e=>{let t;if(t=m.value,void 0!==o&&t<o||void 0!==l&&t>l){var s;u=e,h=ih({keyframes:[m.value,(s=m.value,void 0===o?l:void 0===l||Math.abs(o-s)<Math.abs(l-s)?o:l)],velocity:is(y,e,m.value),damping:a,stiffness:i,restDelta:c,restSpeed:d})}};return w(0),{calculatedDuration:null,next:e=>{let t=!1;return(h||void 0!==u||(t=!0,v(e),w(e)),void 0!==u&&e>=u)?h.next(e-u):(t||v(e),m)}}}ih.applyToOptions=e=>{let t=function(e,t=100,s){let r=s({...e,keyframes:[0,t]}),a=Math.min(it(r),2e4);return{type:"keyframes",ease:e=>r.next(a*e).value/t,duration:a/1e3}}(e,100,ih);return e.ease=t.ease,e.duration=aW(t.duration),e.type="keyframes",e};let ip=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e;function ix(e,t,s,r){return e===t&&s===r?rn:a=>0===a||1===a?a:ip(function(e,t,s,r,a){let i,n,o=0;do(i=ip(n=t+(s-t)/2,r,a)-e)>0?s=n:t=n;while(Math.abs(i)>1e-7&&++o<12)return n}(a,0,1,e,s),t,r)}let ig=ix(.42,0,1,1),ib=ix(0,0,.58,1),iy=ix(.42,0,.58,1),iv=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,iw=e=>t=>1-e(1-t),ij=ix(.33,1.53,.69,.99),iN=iw(ij),ik=iv(iN),iS=e=>(e*=2)<1?.5*iN(e):.5*(2-Math.pow(2,-10*(e-1))),iT=e=>1-Math.sin(Math.acos(e)),iC=iw(iT),iE=iv(iT),iA=e=>Array.isArray(e)&&"number"==typeof e[0],i_={linear:rn,easeIn:ig,easeInOut:iy,easeOut:ib,circIn:iT,circInOut:iE,circOut:iC,backIn:iN,backInOut:ik,backOut:ij,anticipate:iS},iP=e=>{if(iA(e)){sY(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,s,r,a]=e;return ix(t,s,r,a)}return"string"==typeof e?(sY(void 0!==i_[e],`Invalid easing type '${e}'`,"invalid-easing-type"),i_[e]):e},iM=(e,t,s)=>{let r=t-e;return 0===r?1:(s-e)/r};function iR({duration:e=300,keyframes:t,times:s,ease:r="easeInOut"}){var a;let i,n=Array.isArray(r)&&"number"!=typeof r[0]?r.map(iP):iP(r),o={done:!1,value:t[0]},l=function(e,t,{clamp:s=!0,ease:r,mixer:a}={}){let i=e.length;if(sY(i===t.length,"Both input and output ranges must be the same length","range-length"),1===i)return()=>t[0];if(2===i&&t[0]===t[1])return()=>t[1];let n=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());let o=function(e,t,s){let r=[],a=s||ro.mix||a8,i=e.length-1;for(let s=0;s<i;s++){let i=a(e[s],e[s+1]);t&&(i=aY(Array.isArray(t)?t[s]||rn:t,i)),r.push(i)}return r}(t,r,a),l=o.length,c=s=>{if(n&&s<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(s<e[r+1]);r++);let a=iM(e[r],e[r+1],s);return o[r](a)};return s?t=>c(se(e[0],e[i-1],t)):c}((a=s&&s.length===t.length?s:(!function(e,t){let s=e[e.length-1];for(let r=1;r<=t;r++){let a=iM(0,t,r);e.push(r6(s,1,a))}}(i=[0],t.length-1),i),a.map(t=>t*e)),t,{ease:Array.isArray(n)?n:t.map(()=>n||iy).splice(0,t.length-1)});return{calculatedDuration:e,next:t=>(o.value=l(t),o.done=t>=e,o)}}let i$=e=>null!==e;function iO(e,{repeat:t,repeatType:s="loop"},r,a=1){let i=e.filter(i$),n=a<0||t&&"loop"!==s&&t%2==1?0:i.length-1;return n&&void 0!==r?r:i[n]}let iD={decay:im,inertia:im,tween:iR,keyframes:iR,spring:ih};function iL(e){"string"==typeof e.type&&(e.type=iD[e.type])}class iB{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}let iI=e=>e/100;class iF extends iB{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==rA.now()&&this.tick(rA.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},aK.mainThread++,this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){let{options:e}=this;iL(e);let{type:t=iR,repeat:s=0,repeatDelay:r=0,repeatType:a,velocity:i=0}=e,{keyframes:n}=e,o=t||iR;o!==iR&&"number"!=typeof n[0]&&(this.mixKeyframes=aY(iI,a8(n[0],n[1])),n=[0,100]);let l=o({...e,keyframes:n});"mirror"===a&&(this.mirroredGenerator=o({...e,keyframes:[...n].reverse(),velocity:-i})),null===l.calculatedDuration&&(l.calculatedDuration=it(l));let{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=l}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){let{generator:s,totalDuration:r,mixKeyframes:a,mirroredGenerator:i,resolvedDuration:n,calculatedDuration:o}=this;if(null===this.startTime)return s.next(0);let{delay:l=0,keyframes:c,repeat:d,repeatType:u,repeatDelay:h,type:f,onUpdate:m,finalKeyframe:p}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let x=this.currentTime-l*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?x<0:x>r;this.currentTime=Math.max(x,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);let b=this.currentTime,y=s;if(d){let e=Math.min(this.currentTime,r)/n,t=Math.floor(e),s=e%1;!s&&e>=1&&(s=1),1===s&&t--,(t=Math.min(t,d+1))%2&&("reverse"===u?(s=1-s,h&&(s-=h/n)):"mirror"===u&&(y=i)),b=se(0,1,s)*n}let v=g?{done:!1,value:c[0]}:y.next(b);a&&(v.value=a(v.value));let{done:w}=v;g||null===o||(w=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let j=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return j&&f!==im&&(v.value=iO(c,this.options,p,this.speed)),m&&m(v.value),j&&this.finish(),v}then(e,t){return this.finished.then(e,t)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return this.currentTime/1e3}set time(e){e=aW(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(rA.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:e=a6,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();let s=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=s):null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime||(this.startTime=t??s),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(rA.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,aK.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function iV(e){let t;return()=>(void 0===t&&(t=e()),t)}let iz=iV(()=>void 0!==window.ScrollTimeline),iG={},iU=(a=iV(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0}),()=>iG.linearEasing??a()),iH=([e,t,s,r])=>`cubic-bezier(${e}, ${t}, ${s}, ${r})`,iW={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:iH([0,.65,.55,1]),circOut:iH([.55,0,1,.45]),backIn:iH([.31,.01,.66,-.59]),backOut:iH([.33,1.53,.69,.99])};function iq(e){return"function"==typeof e&&"applyToOptions"in e}class iY extends iB{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:s,keyframes:r,pseudoElement:a,allowFlatten:i=!1,finalKeyframe:n,onComplete:o}=e;this.isPseudoElement=!!a,this.allowFlatten=i,this.options=e,sY("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:e,...t}){return iq(e)&&iU()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=function(e,t,s,{delay:r=0,duration:a=300,repeat:i=0,repeatType:n="loop",ease:o="easeOut",times:l}={},c){let d={[t]:s};l&&(d.offset=l);let u=function e(t,s){if(t)return"function"==typeof t?iU()?ie(t,s):"ease-out":iA(t)?iH(t):Array.isArray(t)?t.map(t=>e(t,s)||iW.easeOut):iW[t]}(o,a);Array.isArray(u)&&(d.easing=u);let h={delay:r,duration:a,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===n?"alternate":"normal"};c&&(h.pseudoElement=c);let f=e.animate(d,h);return f}(t,s,r,l,a),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){let e=iO(r,this.options,n,this.speed);this.updateMotionValue?this.updateMotionValue(e):s.startsWith("--")?t.style.setProperty(s,e):t.style[s]=e,this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=aW(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&iz())?(this.animation.timeline=e,rn):t(this)}}let iK={anticipate:iS,backInOut:ik,circInOut:iE};class iX extends iY{constructor(e){!function(e){"string"==typeof e.ease&&e.ease in iK&&(e.ease=iK[e.ease])}(e),iL(e),super(e),void 0!==e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:s,onComplete:r,element:a,...i}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);let n=new iF({...i,autoplay:!1}),o=Math.max(10,rA.now()-this.startTime),l=se(0,10,o-10);t.setWithVelocity(n.sample(Math.max(0,o-l)).value,n.sample(o).value,l),n.stop()}}let iZ=(e,t)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(sA.test(e)||"0"===e)&&!e.startsWith("url("));function iJ(e){e.duration=0,e.type="keyframes"}let iQ=new Set(["opacity","clipPath","filter","transform"]),i0=iV(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class i1 extends iB{constructor({autoplay:e=!0,delay:t=0,type:s="keyframes",repeat:r=0,repeatDelay:a=0,repeatType:i="loop",keyframes:n,name:o,motionValue:l,element:c,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=rA.now();const u={autoplay:e,delay:t,type:s,repeat:r,repeatDelay:a,repeatType:i,name:o,motionValue:l,element:c,...d},h=c?.KeyframeResolver||rv;this.keyframeResolver=new h(n,(e,t,s)=>this.onKeyframesResolved(e,t,u,!s),o,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,s,r){this.keyframeResolver=void 0;let{name:a,type:i,velocity:n,delay:o,isHandoff:l,onUpdate:c}=s;this.resolvedAt=rA.now(),!function(e,t,s,r){let a=e[0];if(null===a)return!1;if("display"===t||"visibility"===t)return!0;let i=e[e.length-1],n=iZ(a,t),o=iZ(i,t);return sq(n===o,`You are trying to animate ${t} from "${a}" to "${i}". "${n?i:a}" is not an animatable value.`,"value-not-animatable"),!!n&&!!o&&(function(e){let t=e[0];if(1===e.length)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}(e)||("spring"===s||iq(s))&&r)}(e,a,i,n)&&((ro.instantAnimations||!o)&&c?.(iO(e,s,t)),e[0]=e[e.length-1],iJ(s),s.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...s,keyframes:e},u=!l&&function(e){let{motionValue:t,name:s,repeatDelay:r,repeatType:a,damping:i,type:n}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:o,transformTemplate:l}=t.owner.getProps();return i0()&&s&&iQ.has(s)&&("transform"!==s||!l)&&!o&&!r&&"mirror"!==a&&0!==i&&"inertia"!==n}(d)?new iX({...d,element:d.motionValue.owner.current}):new iF(d);u.finished.then(()=>this.notifyFinished()).catch(rn),this.pendingTimeline&&(this.stopTimeline=u.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=u}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),rg=!0,ry(),rb(),rg=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let i2={type:"spring",stiffness:500,damping:25,restSpeed:10},i5={type:"keyframes",duration:.8},i3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},i4=e=>null!==e,i9=(e,t,s,r={},a,i)=>n=>{let o=aG(r,e)||{},l=o.delay||r.delay||0,{elapsed:c=0}=r;c-=aW(l);let d={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-c,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{n(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:i?void 0:a};!function({when:e,delay:t,delayChildren:s,staggerChildren:r,staggerDirection:a,repeat:i,repeatType:n,repeatDelay:o,from:l,elapsed:c,...d}){return!!Object.keys(d).length}(o)&&Object.assign(d,((e,{keyframes:t})=>t.length>2?i5:t6.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:i2:i3)(e,d)),d.duration&&(d.duration=aW(d.duration)),d.repeatDelay&&(d.repeatDelay=aW(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let u=!1;if(!1!==d.type&&(0!==d.duration||d.repeatDelay)||(iJ(d),0===d.delay&&(u=!0)),(ro.instantAnimations||ro.skipAnimations)&&(u=!0,iJ(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,u&&!i&&void 0!==t.get()){let e=function(e,{repeat:t,repeatType:s="loop"},r){let a=e.filter(i4),i=t&&"loop"!==s&&t%2==1?0:a.length-1;return a[i]}(d.keyframes,o);if(void 0!==e)return void rd.update(()=>{d.onUpdate(e),d.onComplete()})}return o.isSync?new iF(d):new i1(d)};function i7(e,t,{delay:s=0,transitionOverride:r,type:a}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:n,...o}=t;r&&(i=r);let l=[],c=a&&e.animationState&&e.animationState.getState()[a];for(let t in o){let r=e.getValue(t,e.latestValues[t]??null),a=o[t];if(void 0===a||c&&function({protectedKeys:e,needsAnimating:t},s){let r=e.hasOwnProperty(s)&&!0!==t[s];return t[s]=!1,r}(c,t))continue;let n={delay:s,...aG(i||{},t)},d=r.get();if(void 0!==d&&!r.isAnimating&&!Array.isArray(a)&&a===d&&!n.velocity)continue;let u=!1;if(window.MotionHandoffAnimation){let s=e.props[aL];if(s){let e=window.MotionHandoffAnimation(s,t,rd);null!==e&&(n.startTime=e,u=!0)}}aH(e,t),r.start(i9(t,r,a,e.shouldReduceMotion&&sG.has(t)?{type:!1}:n,e,u));let h=r.animation;h&&l.push(h)}return n&&Promise.all(l).then(()=>{rd.update(()=>{n&&function(e,t){let{transitionEnd:s={},transition:r={},...a}=az(e,t)||{};for(let t in a={...a,...s}){var i;let s=aU(i=a[t])?i[i.length-1]||0:i;e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,rP(s))}}(e,n)})}),l}function i8(e,t,s,r=0,a=1){let i=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),n=e.size,o=(n-1)*r;return"function"==typeof s?s(i,n):1===a?i*r:o-i*r}function i6(e,t,s={}){let r=az(e,t,"exit"===s.type?e.presenceContext?.custom:void 0),{transition:a=e.getDefaultTransition()||{}}=r||{};s.transitionOverride&&(a=s.transitionOverride);let i=r?()=>Promise.all(i7(e,r,s)):()=>Promise.resolve(),n=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:i=0,staggerChildren:n,staggerDirection:o}=a;return function(e,t,s=0,r=0,a=0,i=1,n){let o=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),o.push(i6(l,t,{...n,delay:s+("function"==typeof r?0:r)+i8(e.variantChildren,l,r,a,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(o)}(e,t,r,i,n,o,s)}:()=>Promise.resolve(),{when:o}=a;if(!o)return Promise.all([i(),n(s.delay)]);{let[e,t]="beforeChildren"===o?[i,n]:[n,i];return e().then(()=>t())}}let ne=rF.length;function nt(e,t){if(!Array.isArray(t))return!1;let s=t.length;if(s!==e.length)return!1;for(let r=0;r<s;r++)if(t[r]!==e[r])return!1;return!0}let ns=[...rI].reverse(),nr=rI.length;function na(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ni(){return{animate:na(!0),whileInView:na(),whileHover:na(),whileTap:na(),whileDrag:na(),whileFocus:na(),exit:na()}}let nn=0;function no(e){return[e("x"),e("y")]}let nl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function nc(e){return nl.has(e.tagName)||!0===e.isContentEditable}function nd(e,t,s,r={passive:!0}){return e.addEventListener(t,s,r),()=>e.removeEventListener(t,s)}let nu={x:!1,y:!1};function nh(e){return e.max-e.min}function nf(e,t,s,r=.5){e.origin=r,e.originPoint=r6(t.min,t.max,e.origin),e.scale=nh(s)/nh(t),e.translate=r6(s.min,s.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function nm(e,t,s,r){nf(e.x,t.x,s.x,r?r.originX:void 0),nf(e.y,t.y,s.y,r?r.originY:void 0)}function np(e,t,s){e.min=s.min+t.min,e.max=e.min+nh(t)}function nx(e,t,s){e.min=t.min-s.min,e.max=e.min+nh(t)}function ng(e,t,s){nx(e.x,t.x,s.x),nx(e.y,t.y,s.y)}let nb=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function ny(e){return{point:{x:e.pageX,y:e.pageY}}}function nv(e,t,s,r){return nd(e,t,e=>nb(e)&&s(e,ny(e)),r)}let nw=({current:e})=>e?e.ownerDocument.defaultView:null,nj=(e,t)=>Math.abs(e-t),nN=new Set(["auto","scroll"]);class nk{constructor(e,t,{transformPagePoint:s,contextWindow:r=window,dragSnapToOrigin:a=!1,distanceThreshold:i=3,element:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let s=nC(this.lastMoveEventInfo,this.history),r=null!==this.startEvent,a=(e=s.offset,t={x:0,y:0},Math.sqrt(nj(e.x,t.x)**2+nj(e.y,t.y)**2)>=this.distanceThreshold);if(!r&&!a)return;let{point:i}=s,{timestamp:n}=rh;this.history.push({...i,timestamp:n});let{onStart:o,onMove:l}=this.handlers;r||(o&&o(this.lastMoveEvent,s),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,s)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=nS(t,this.transformPagePoint),rd.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:s,onSessionEnd:r,resumeAnimation:a}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&a&&a(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let i=nC("pointercancel"===e.type?this.lastMoveEventInfo:nS(t,this.transformPagePoint),this.history);this.startEvent&&s&&s(e,i),r&&r(e,i)},!nb(e))return;this.dragSnapToOrigin=a,this.handlers=t,this.transformPagePoint=s,this.distanceThreshold=i,this.contextWindow=r||window;const o=nS(ny(e),this.transformPagePoint),{point:l}=o,{timestamp:c}=rh;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=t;d&&d(e,nC(o,this.history)),this.removeListeners=aY(nv(this.contextWindow,"pointermove",this.handlePointerMove),nv(this.contextWindow,"pointerup",this.handlePointerUp),nv(this.contextWindow,"pointercancel",this.handlePointerUp)),n&&this.startScrollTracking(n)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(nN.has(e.overflowX)||nN.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let s=e===window,r=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},a={x:r.x-t.x,y:r.y-t.y};(0!==a.x||0!==a.y)&&(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(e,r),rd.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ru(this.updatePoint)}}function nS(e,t){return t?{point:t(e.point)}:e}function nT(e,t){return{x:e.x-t.x,y:e.y-t.y}}function nC({point:e},t){return{point:e,delta:nT(e,nE(t)),offset:nT(e,t[0]),velocity:function(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,r=null,a=nE(e);for(;s>=0&&(r=e[s],!(a.timestamp-r.timestamp>aW(.1)));)s--;if(!r)return{x:0,y:0};let i=(a.timestamp-r.timestamp)/1e3;if(0===i)return{x:0,y:0};let n={x:(a.x-r.x)/i,y:(a.y-r.y)/i};return n.x===1/0&&(n.x=0),n.y===1/0&&(n.y=0),n}(t,.1)}}function nE(e){return e[e.length-1]}function nA(e,t,s){return{min:void 0!==t?e.min+t:void 0,max:void 0!==s?e.max+s-(e.max-e.min):void 0}}function n_(e,t){let s=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,r]=[r,s]),{min:s,max:r}}function nP(e,t,s){return{min:nM(e,t),max:nM(e,s)}}function nM(e,t){return"number"==typeof e?e:e[t]||0}let nR=new WeakMap;class n${constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=sV(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:s}={}){let{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;let a=e=>{t?(this.stopAnimation(),this.snapToCursor(ny(e).point)):this.pauseAnimation()},i=(e,t)=>{this.stopAnimation();let{drag:s,dragPropagation:r,onDragStart:a}=this.getProps();if(s&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){if("x"===e||"y"===e)if(nu[e])return null;else return nu[e]=!0,()=>{nu[e]=!1};return nu.x||nu.y?null:(nu.x=nu.y=!0,()=>{nu.x=nu.y=!1})}(s),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),no(e=>{let t=this.getAxisMotionValue(e).get()||0;if(sm.test(t)){let{projection:s}=this.visualElement;if(s&&s.layout){let r=s.layout.layoutBox[e];r&&(t=nh(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),a&&rd.postRender(()=>a(e,t)),aH(this.visualElement,"transform");let{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},n=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:s,dragDirectionLock:r,onDirectionLock:a,onDrag:i}=this.getProps();if(!s&&!this.openDragLock)return;let{offset:n}=t;if(r&&null===this.currentDirection){this.currentDirection=function(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}(n),null!==this.currentDirection&&a&&a(this.currentDirection);return}this.updateAxis("x",t.point,n),this.updateAxis("y",t.point,n),this.visualElement.render(),i&&i(e,t)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>no(e=>"paused"===this.getAnimationState(e)&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new nk(e,{onSessionStart:a,onStart:i,onMove:n,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:nw(this.visualElement),element:this.visualElement.current})}stop(e,t){let s=e||this.latestPointerEvent,r=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!r||!s)return;let{velocity:i}=r;this.startAnimation(i);let{onDragEnd:n}=this.getProps();n&&rd.postRender(()=>n(s,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,s){let{drag:r}=this.getProps();if(!s||!nO(e,r,this.currentDirection))return;let a=this.getAxisMotionValue(e),i=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:s},r){return void 0!==t&&e<t?e=r?r6(t,e,r.min):Math.max(e,t):void 0!==s&&e>s&&(e=r?r6(s,e,r.max):Math.min(e,s)),e}(i,this.constraints[e],this.elastic[e])),a.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&aI(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=function(e,{top:t,left:s,bottom:r,right:a}){return{x:nA(e.x,s,a),y:nA(e.y,t,r)}}(s.layoutBox,e):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:nP(e,"left","right"),y:nP(e,"top","bottom")}}(t),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&no(e=>{var t,r;let a;!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=(t=s.layoutBox[e],r=this.constraints[e],a={},void 0!==r.min&&(a.min=r.min-t.min),void 0!==r.max&&(a.max=r.max-t.min),a))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!aI(t))return!1;let r=t.current;sY(null!==r,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:a}=this.visualElement;if(!a||!a.layout)return!1;let i=function(e,t,s){let r=ax(e,s),{scroll:a}=t;return a&&(af(r.x,a.offset.x),af(r.y,a.offset.y)),r}(r,a.root,this.visualElement.getTransformPagePoint()),n=(e=a.layout.layoutBox,{x:n_(e.x,i.x),y:n_(e.y,i.y)});if(s){let e=s(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(n));this.hasMutatedConstraints=!!e,e&&(n=ai(e))}return n}startAnimation(e){let{drag:t,dragMomentum:s,dragElastic:r,dragTransition:a,dragSnapToOrigin:i,onDragTransitionEnd:n}=this.getProps(),o=this.constraints||{};return Promise.all(no(n=>{if(!nO(n,t,this.currentDirection))return;let l=o&&o[n]||{};i&&(l={min:0,max:0});let c={type:"inertia",velocity:s?e[n]:0,bounceStiffness:r?200:1e6,bounceDamping:r?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(n,c)})).then(n)}startAxisValueAnimation(e,t){let s=this.getAxisMotionValue(e);return aH(this.visualElement,e),s.start(i9(e,s,0,t,this.visualElement,!1))}stopAnimation(){no(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){no(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps();return s[t]||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){no(t=>{let{drag:s}=this.getProps();if(!nO(t,s,this.currentDirection))return;let{projection:r}=this.visualElement,a=this.getAxisMotionValue(t);if(r&&r.layout){let{min:s,max:i}=r.layout.layoutBox[t],n=a.get()||0;a.set(e[t]-r6(s,i,.5)+n)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:s}=this.visualElement;if(!aI(t)||!s||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};no(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){var s,a;let i,n,o,l=t.get();r[e]=(s={min:l,max:l},a=this.constraints[e],i=.5,n=nh(s),(o=nh(a))>n?i=iM(a.min,a.max-n,s.min):n>o&&(i=iM(s.min,s.max-o,a.min)),se(0,1,i))}});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),no(t=>{if(!nO(t,e,null))return;let s=this.getAxisMotionValue(t),{min:a,max:i}=this.constraints[t];s.set(r6(a,i,r[t]))})}addListeners(){if(!this.visualElement.current)return;nR.set(this.visualElement,this);let e=nv(this.visualElement.current,"pointerdown",e=>{let{drag:t,dragListener:s=!0}=this.getProps();t&&s&&!nc(e.target)&&this.start(e)}),t=()=>{let{dragConstraints:e}=this.getProps();aI(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,r=s.addEventListener("measure",t);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),rd.read(t);let a=nd(window,"resize",()=>this.scalePositionWithinConstraints()),i=s.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(no(t=>{let s=this.getAxisMotionValue(t);s&&(this.originPoint[t]+=e[t].translate,s.set(s.get()+e[t].translate))}),this.visualElement.render())});return()=>{a(),e(),r(),i&&i()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:s=!1,dragPropagation:r=!1,dragConstraints:a=!1,dragElastic:i=.35,dragMomentum:n=!0}=e;return{...e,drag:t,dragDirectionLock:s,dragPropagation:r,dragConstraints:a,dragElastic:i,dragMomentum:n}}}function nO(e,t,s){return(!0===t||t===e)&&(null===s||s===e)}let nD=e=>(t,s)=>{e&&rd.postRender(()=>e(t,s))},nL={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var nB=u;let nI=!1;class nF extends nB.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:s,layoutId:r}=this.props,{projection:a}=e;a&&(t.group&&t.group.add(a),s&&s.register&&r&&s.register(a),nI&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),nL.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:s,drag:r,isPresent:a}=this.props,{projection:i}=s;return i&&(i.isPresent=a,nI=!0,r||e.layoutDependency!==t||void 0===t||e.isPresent!==a?i.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?i.promote():i.relegate()||rd.postRender(()=>{let e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),rC.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:s}=this.props,{projection:r}=e;nI=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),s&&s.deregister&&s.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function nV(e){let[t,s]=t3(),r=(0,nB.useContext)(tU);return(0,d.jsx)(nF,{...e,layoutGroup:r,switchLayoutGroup:(0,nB.useContext)(aB),isPresent:t,safeToRemove:s})}function nz(e,t,s,r,a){return e-=t,e=r+1/s*(e-r),void 0!==a&&(e=r+1/a*(e-r)),e}function nG(e,t,[s,r,a],i,n){!function(e,t=0,s=1,r=.5,a,i=e,n=e){if(sm.test(t)&&(t=parseFloat(t),t=r6(n.min,n.max,t/100)-n.min),"number"!=typeof t)return;let o=r6(i.min,i.max,r);e===i&&(o-=t),e.min=nz(e.min,t,s,o,a),e.max=nz(e.max,t,s,o,a)}(e,t[s],t[r],t[a],t.scale,i,n)}let nU=["x","scaleX","originX"],nH=["y","scaleY","originY"];function nW(e,t,s,r){nG(e.x,t,nU,s?s.x:void 0,r?r.x:void 0),nG(e.y,t,nH,s?s.y:void 0,r?r.y:void 0)}function nq(e,t){e.min=t.min,e.max=t.max}function nY(e,t){nq(e.x,t.x),nq(e.y,t.y)}function nK(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function nX(e){return 0===e.translate&&1===e.scale}function nZ(e){return nX(e.x)&&nX(e.y)}function nJ(e,t){return e.min===t.min&&e.max===t.max}function nQ(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function n0(e,t){return nQ(e.x,t.x)&&nQ(e.y,t.y)}function n1(e){return nh(e.x)/nh(e.y)}function n2(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}let n5=["TopLeft","TopRight","BottomLeft","BottomRight"],n3=n5.length,n4=e=>"string"==typeof e?parseFloat(e):e,n9=e=>"number"==typeof e||sp.test(e);function n7(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let n8=oe(0,.5,iC),n6=oe(.5,.95,rn);function oe(e,t,s){return r=>r<e?0:r>t?1:s(iM(e,t,r))}function ot(e){return tK(e)&&"ownerSVGElement"in e}let os=(e,t)=>e.depth-t.depth;class or{constructor(){this.children=[],this.isDirty=!1}add(e){rk(this.children,e),this.isDirty=!0}remove(e){rS(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(os),this.isDirty=!1,this.children.forEach(e)}}class oa{constructor(){this.members=[]}add(e){rk(this.members,e),e.scheduleRender()}remove(e){if(rS(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t,s=this.members.findIndex(t=>e===t);if(0===s)return!1;for(let e=s;e>=0;e--){let s=this.members[e];if(!1!==s.isPresent){t=s;break}}return!!t&&(this.promote(t),!0)}promote(e,t){let s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,t&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:r}=e.options;!1===r&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:s}=e;t.onExitComplete&&t.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let oi=["","X","Y","Z"],on=0;function oo(e,t,s,r){let{latestValues:a}=t;a[e]&&(s[e]=a[e],t.setStaticValue(e,0),r&&(r[e]=0))}function ol({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(e={},s=t?.()){this.id=on++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ou),this.nodes.forEach(ob),this.nodes.forEach(oy),this.nodes.forEach(oh)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new or)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new rT),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let s=this.eventHandlers.get(e);s&&s.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=ot(t)&&!(ot(t)&&"svg"===t.tagName),this.instance=t;let{layoutId:s,layout:r,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||s)&&(this.isLayoutDirty=!0),e){let s,r=0,a=()=>this.root.updateBlockedByResize=!1;rd.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;if(e!==r){let t,i;r=e,this.root.updateBlockedByResize=!0,s&&s(),t=rA.now(),i=({timestamp:e})=>{let s=e-t;s>=250&&(ru(i),a(s-250))},rd.setup(i,!0),s=()=>ru(i),nL.hasAnimatedSinceResize&&(nL.hasAnimatedSinceResize=!1,this.nodes.forEach(og))}})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&a&&(s||r)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:s,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let i=this.options.transition||a.getDefaultTransition()||oS,{onLayoutAnimationStart:n,onLayoutAnimationComplete:o}=a.getProps(),l=!this.targetLayout||!n0(this.targetLayout,r),c=!t&&s;if(this.options.layoutRoot||this.resumeFrom||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...aG(i,"layout"),onPlay:n,onComplete:o};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,c)}else t||og(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ru(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(ov),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:s}=t.options;if(!s)return;let r=s.props[aL];if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:e,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",rd,!(e||s))}let{parent:a}=t;a&&!a.hasCheckedOptimisedAppear&&e(a)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:s}=this.options;if(void 0===t&&!s)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(om);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(op);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ox),this.nodes.forEach(oc),this.nodes.forEach(od)):this.nodes.forEach(op),this.clearAllSnapshots();let e=rA.now();rh.delta=se(0,1e3/60,e-rh.timestamp),rh.timestamp=e,rh.isProcessing=!0,rf.update.process(rh),rf.preRender.process(rh),rf.render.process(rh),rh.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,rC.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(of),this.sharedNodes.forEach(ow)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rd.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rd.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||nh(this.snapshot.measuredBox.x)||nh(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=sV(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!a)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!nZ(this.projectionDelta),s=this.getTransformTemplate(),r=s?s(this.latestValues,""):void 0,i=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||al(this.latestValues)||i)&&(a(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){var t;let s=this.measurePageBox(),r=this.removeElementScroll(s);return e&&(r=this.removeTransform(r)),oE((t=r).x),oE(t.y),{animationId:this.root.animationId,measuredBox:s,layoutBox:r,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return sV();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(o_))){let{scroll:e}=this.root;e&&(af(t.x,e.offset.x),af(t.y,e.offset.y))}return t}removeElementScroll(e){let t=sV();if(nY(t,e),this.scroll?.wasRoot)return t;for(let s=0;s<this.path.length;s++){let r=this.path[s],{scroll:a,options:i}=r;r!==this.root&&a&&i.layoutScroll&&(a.wasRoot&&nY(t,e),af(t.x,a.offset.x),af(t.y,a.offset.y))}return t}applyTransform(e,t=!1){let s=sV();nY(s,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&ap(s,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),al(r.latestValues)&&ap(s,r.latestValues)}return al(this.latestValues)&&ap(s,this.latestValues),s}removeTransform(e){let t=sV();nY(t,e);for(let e=0;e<this.path.length;e++){let s=this.path[e];if(!s.instance||!al(s.latestValues))continue;ao(s.latestValues)&&s.updateSnapshot();let r=sV();nY(r,s.measurePageBox()),nW(t,s.latestValues,s.snapshot?s.snapshot.layoutBox:void 0,r)}return al(this.latestValues)&&nW(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==rh.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);let s=!!this.resumingFrom||this!==t;if(!(e||s&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:a}=this.options;if(!this.layout||!(r||a))return;this.resolvedRelativeTargetAt=rh.timestamp;let i=this.getClosestProjectingParent();if(i&&this.linkedParentVersion!==i.layoutVersion&&!i.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(i&&i.layout?this.createRelativeTarget(i,this.layout.layoutBox,i.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=sV(),this.targetWithTransforms=sV()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var n,o,l;this.forceRelativeParentToResolveTarget(),n=this.target,o=this.relativeTarget,l=this.relativeParent.target,np(n.x,o.x,l.x),np(n.y,o.y,l.y)}else this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):nY(this.target,this.layout.layoutBox),ah(this.target,this.targetDelta)):nY(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,i&&!!i.resumingFrom==!!this.resumingFrom&&!i.options.layoutScroll&&i.target&&1!==this.animationProgress?this.createRelativeTarget(i,this.target,i.target):this.relativeParent=this.relativeTarget=void 0)}}getClosestProjectingParent(){if(!(!this.parent||ao(this.parent.latestValues)||ac(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,s){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=sV(),this.relativeTargetOrigin=sV(),ng(this.relativeTargetOrigin,t,s),nY(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,s=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(s=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(s=!1),this.resolvedRelativeTargetAt===rh.timestamp&&(s=!1),s)return;let{layout:r,layoutId:a}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||a))return;nY(this.layoutCorrected,this.layout.layoutBox);let i=this.treeScale.x,n=this.treeScale.y;!function(e,t,s,r=!1){let a,i,n=s.length;if(n){t.x=t.y=1;for(let o=0;o<n;o++){i=(a=s[o]).projectionDelta;let{visualElement:n}=a.options;(!n||!n.props.style||"contents"!==n.props.style.display)&&(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&ap(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,ah(e,i)),r&&al(a.latestValues)&&ap(e,a.latestValues))}t.x<1.0000000000001&&t.x>.999999999999&&(t.x=1),t.y<1.0000000000001&&t.y>.999999999999&&(t.y=1)}}(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=sV());let{target:o}=e;if(!o){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(nK(this.prevProjectionDelta.x,this.projectionDelta.x),nK(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),nm(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.treeScale.x===i&&this.treeScale.y===n&&n2(this.projectionDelta.x,this.prevProjectionDelta.x)&&n2(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=sI(),this.projectionDelta=sI(),this.projectionDeltaWithTransform=sI()}setAnimationOrigin(e,t=!1){let s,r=this.snapshot,a=r?r.latestValues:{},i={...this.latestValues},n=sI();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=sV(),l=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),d=!c||c.members.length<=1,u=!!(l&&!d&&!0===this.options.crossfade&&!this.path.some(ok));this.animationProgress=0,this.mixTargetDelta=t=>{let r=t/1e3;if(oj(n.x,e.x,r),oj(n.y,e.y,r),this.setTargetDelta(n),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var c,h,f,m,p,x;ng(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),f=this.relativeTarget,m=this.relativeTargetOrigin,p=o,x=r,oN(f.x,m.x,p.x,x),oN(f.y,m.y,p.y,x),s&&(c=this.relativeTarget,h=s,nJ(c.x,h.x)&&nJ(c.y,h.y))&&(this.isProjectionDirty=!1),s||(s=sV()),nY(s,this.relativeTarget)}l&&(this.animationValues=i,function(e,t,s,r,a,i){a?(e.opacity=r6(0,s.opacity??1,n8(r)),e.opacityExit=r6(t.opacity??1,0,n6(r))):i&&(e.opacity=r6(t.opacity??1,s.opacity??1,r));for(let a=0;a<n3;a++){let i=`border${n5[a]}Radius`,n=n7(t,i),o=n7(s,i);(void 0!==n||void 0!==o)&&(n||(n=0),o||(o=0),0===n||0===o||n9(n)===n9(o)?(e[i]=Math.max(r6(n4(n),n4(o),r),0),(sm.test(o)||sm.test(n))&&(e[i]+="%")):e[i]=o)}(t.rotate||s.rotate)&&(e.rotate=r6(t.rotate||0,s.rotate||0,r))}(i,a,this.latestValues,r,u,d)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=r},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ru(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rd.update(()=>{var t,s,r;let a;nL.hasAnimatedSinceResize=!0,aK.layout++,this.motionValue||(this.motionValue=rP(0)),this.currentAnimation=(t=this.motionValue,s=[0,1e3],r={...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{aK.layout--},onComplete:()=>{aK.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}},(a=sz(t)?t:rP(t)).start(i9("",a,s,r)),a.animation),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:s,layout:r,latestValues:a}=e;if(t&&s&&r){if(this!==e&&this.layout&&r&&oA(this.options.animationType,this.layout.layoutBox,r.layoutBox)){s=this.target||sV();let t=nh(this.layout.layoutBox.x);s.x.min=e.target.x.min,s.x.max=s.x.min+t;let r=nh(this.layout.layoutBox.y);s.y.min=e.target.y.min,s.y.max=s.y.min+r}nY(t,s),ap(t,a),nm(this.projectionDeltaWithTransform,this.layoutCorrected,t,a)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new oa),this.sharedNodes.get(e).add(t);let s=t.options.initialPromotionConfig;t.promote({transition:s?s.transition:void 0,preserveFollowOpacity:s&&s.shouldPreserveFollowOpacity?s.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:s}={}){let r=this.getStack();r&&r.promote(this,s),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:s}=e;if((s.z||s.rotate||s.rotateX||s.rotateY||s.rotateZ||s.skewX||s.skewY)&&(t=!0),!t)return;let r={};s.z&&oo("z",e,r,this.animationValues);for(let t=0;t<oi.length;t++)oo(`rotate${oi[t]}`,e,r,this.animationValues),oo(`skew${oi[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility="hidden";return}let s=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=aA(t?.pointerEvents)||"",e.transform=s?s(this.latestValues,""):"none";return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=aA(t?.pointerEvents)||""),this.hasProjected&&!al(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1);return}e.visibility="";let a=r.animationValues||r.latestValues;this.applyTransformsToTarget();let i=function(e,t,s){let r="",a=e.x.translate/t.x,i=e.y.translate/t.y,n=s?.z||0;if((a||i||n)&&(r=`translate3d(${a}px, ${i}px, ${n}px) `),(1!==t.x||1!==t.y)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),s){let{transformPerspective:e,rotate:t,rotateX:a,rotateY:i,skewX:n,skewY:o}=s;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),a&&(r+=`rotateX(${a}deg) `),i&&(r+=`rotateY(${i}deg) `),n&&(r+=`skewX(${n}deg) `),o&&(r+=`skewY(${o}deg) `)}let o=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==o||1!==l)&&(r+=`scale(${o}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,a);s&&(i=s(a,i)),e.transform=i;let{x:n,y:o}=this.projectionDelta;for(let t in e.transformOrigin=`${100*n.origin}% ${100*o.origin}% 0`,r.animationValues?e.opacity=r===this?a.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:e.opacity=r===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0,ae){if(void 0===a[t])continue;let{correct:s,applyTo:n,isCSSVariable:o}=ae[t],l="none"===i?a[t]:s(a[t],r);if(n){let t=n.length;for(let s=0;s<t;s++)e[n[s]]=l}else o?this.options.visualElement.renderState.vars[t]=l:e[t]=l}this.options.layoutId&&(e.pointerEvents=r===this?aA(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(om),this.root.sharedNodes.clear()}}}function oc(e){e.updateLayout()}function od(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:s,measuredBox:r}=e.layout,{animationType:a}=e.options,i=t.source!==e.layout.source;"size"===a?no(e=>{let r=i?t.measuredBox[e]:t.layoutBox[e],a=nh(r);r.min=s[e].min,r.max=r.min+a}):oA(a,t.layoutBox,s)&&no(r=>{let a=i?t.measuredBox[r]:t.layoutBox[r],n=nh(s[r]);a.max=a.min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+n)});let n=sI();nm(n,s,t.layoutBox);let o=sI();i?nm(o,e.applyTransform(r,!0),t.measuredBox):nm(o,s,t.layoutBox);let l=!nZ(n),c=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:a,layout:i}=r;if(a&&i){let n=sV();ng(n,t.layoutBox,a.layoutBox);let o=sV();ng(o,s,i.layoutBox),n0(n,o)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=o,e.relativeTargetOrigin=n,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:o,layoutDelta:n,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function ou(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function oh(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function of(e){e.clearSnapshot()}function om(e){e.clearMeasurements()}function op(e){e.isLayoutDirty=!1}function ox(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function og(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ob(e){e.resolveTargetDelta()}function oy(e){e.calcProjection()}function ov(e){e.resetSkewAndRotation()}function ow(e){e.removeLeadSnapshot()}function oj(e,t,s){e.translate=r6(t.translate,0,s),e.scale=r6(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function oN(e,t,s,r){e.min=r6(t.min,s.min,r),e.max=r6(t.max,s.max,r)}function ok(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let oS={duration:.45,ease:[.4,0,.1,1]},oT=e=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),oC=oT("applewebkit/")&&!oT("chrome/")?Math.round:rn;function oE(e){e.min=oC(e.min),e.max=oC(e.max)}function oA(e,t,s){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(n1(t)-n1(s)))}function o_(e){return e!==e.root&&e.scroll?.wasRoot}let oP=ol({attachResizeListener:(e,t)=>nd(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),oM={current:void 0},oR=ol({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!oM.current){let e=new oP({});e.mount(window),e.setOptions({layoutScroll:!0}),oM.current=e}return oM.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position});function o$(e,t){let s=function(e,t,s){if(e instanceof EventTarget)return[e];if("string"==typeof e){let t=document,s=(void 0)??t.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}(e),r=new AbortController;return[s,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function oO(e){return!("touch"===e.pointerType||nu.x||nu.y)}function oD(e,t,s){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===s);let a=r["onHover"+s];a&&rd.postRender(()=>a(t,ny(t)))}let oL=(e,t)=>!!t&&(e===t||oL(e,t.parentElement)),oB=new WeakSet;function oI(e){return t=>{"Enter"===t.key&&e(t)}}function oF(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function oV(e){return nb(e)&&!(nu.x||nu.y)}function oz(e,t,s){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===s);let a=r["onTap"+("End"===s?"":s)];a&&rd.postRender(()=>a(t,ny(t)))}let oG=new WeakMap,oU=new WeakMap,oH=e=>{let t=oG.get(e.target);t&&t(e)},oW=e=>{e.forEach(oH)},oq={some:0,all:1},oY=function(e,t){if("u"<typeof Proxy)return aF;let s=new Map,r=(s,r)=>aF(s,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(a,i)=>"create"===i?r:(s.has(i)||s.set(i,aF(i,void 0,e,t)),s.get(i))})}({animation:{Feature:class extends aV{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:s})=>(function(e,t,s={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t))r=Promise.all(t.map(t=>i6(e,t,s)));else if("string"==typeof t)r=i6(e,t,s);else{let a="function"==typeof t?az(e,t,s.custom):t;r=Promise.all(i7(e,a,s))}return r.then(()=>{e.notify("AnimationComplete",t)})})(e,t,s))),s=ni(),r=!0,a=t=>(s,r)=>{let a=az(e,r,"exit"===t?e.presenceContext?.custom:void 0);if(a){let{transition:e,transitionEnd:t,...r}=a;s={...s,...r,...t}}return s};function i(i){let{props:n}=e,o=function e(t){if(!t)return;if(!t.isControllingVariants){let s=t.parent&&e(t.parent)||{};return void 0!==t.props.initial&&(s.initial=t.props.initial),s}let s={};for(let e=0;e<ne;e++){let r=rF[e],a=t.props[r];(rB(a)||!1===a)&&(s[r]=a)}return s}(e.parent)||{},l=[],c=new Set,d={},u=1/0;for(let t=0;t<nr;t++){var h,f;let m=ns[t],p=s[m],x=void 0!==n[m]?n[m]:o[m],g=rB(x),b=m===i?p.isActive:null;!1===b&&(u=t);let y=x===o[m]&&x!==n[m]&&g;if(y&&r&&e.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...d},!p.isActive&&null===b||!x&&!p.prevProp||rL(x)||"boolean"==typeof x)continue;let v=(h=p.prevProp,"string"==typeof(f=x)?f!==h:!!Array.isArray(f)&&!nt(f,h)),w=v||m===i&&p.isActive&&!y&&g||t>u&&g,j=!1,N=Array.isArray(x)?x:[x],k=N.reduce(a(m),{});!1===b&&(k={});let{prevResolvedValues:S={}}=p,T={...S,...k},C=t=>{w=!0,c.has(t)&&(j=!0,c.delete(t)),p.needsAnimating[t]=!0;let s=e.getValue(t);s&&(s.liveStyle=!1)};for(let e in T){let t=k[e],s=S[e];if(!d.hasOwnProperty(e))(aU(t)&&aU(s)?nt(t,s):t===s)?void 0!==t&&c.has(e)?C(e):p.protectedKeys[e]=!0:null!=t?C(e):c.add(e)}p.prevProp=x,p.prevResolvedValues=k,p.isActive&&(d={...d,...k}),r&&e.blockInitialAnimation&&(w=!1);let E=y&&v,A=!E||j;w&&A&&l.push(...N.map(t=>{let s={type:m};if("string"==typeof t&&r&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,a=az(r,t);if(r.enteringChildren&&a){let{delayChildren:t}=a.transition||{};s.delay=i8(r.enteringChildren,e,t)}}return{animation:t,options:s}}))}if(c.size){let t={};if("boolean"!=typeof n.initial){let s=az(e,Array.isArray(n.initial)?n.initial[0]:n.initial);s&&s.transition&&(t.transition=s.transition)}c.forEach(s=>{let r=e.getBaseTarget(s),a=e.getValue(s);a&&(a.liveStyle=!0),t[s]=r??null}),l.push({animation:t})}let m=!!l.length;return r&&(!1===n.initial||n.initial===n.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){if(s[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),s[t].isActive=r;let a=i(t);for(let e in s)s[e].protectedKeys={};return a},setAnimateFunction:function(s){t=s(e)},getState:()=>s,reset:()=>{s=ni()}}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();rL(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends aV{constructor(){super(...arguments),this.id=nn++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;let r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}},inView:{Feature:class extends aV{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var e;let t;this.unmount();let{viewport:s={}}=this.node.getProps(),{root:r,margin:a,amount:i="some",once:n}=s,o={root:r?r.current:void 0,rootMargin:a,threshold:"number"==typeof i?i:oq[i]},l=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,n&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:s,onViewportLeave:r}=this.node.getProps(),a=t?s:r;a&&a(e)};return e=this.node.current,t=function({root:e,...t}){let s=e||document;oU.has(s)||oU.set(s,{});let r=oU.get(s),a=JSON.stringify(t);return r[a]||(r[a]=new IntersectionObserver(oW,{root:e,...t})),r[a]}(o),oG.set(e,l),t.observe(e),()=>{oG.delete(e),t.unobserve(e)}}mount(){this.startObserver()}update(){if("u"<typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends aV{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,s={}){let[r,a,i]=o$(e,s),n=e=>{let r=e.currentTarget;if(!oV(e))return;oB.add(r);let i=t(r,e),n=(e,t)=>{window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",l),oB.has(r)&&oB.delete(r),oV(e)&&"function"==typeof i&&i(e,{success:t})},o=e=>{n(e,r===window||r===document||s.useGlobalTarget||oL(r,e.target))},l=e=>{n(e,!1)};window.addEventListener("pointerup",o,a),window.addEventListener("pointercancel",l,a)};return r.forEach(e=>{(s.useGlobalTarget?window:e).addEventListener("pointerdown",n,a),tX(e)&&(e.addEventListener("focus",e=>((e,t)=>{let s=e.currentTarget;if(!s)return;let r=oI(()=>{if(oB.has(s))return;oF(s,"down");let e=oI(()=>{oF(s,"up")});s.addEventListener("keyup",e,t),s.addEventListener("blur",()=>oF(s,"cancel"),t)});s.addEventListener("keydown",r,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",r),t)})(e,a)),nc(e)||e.hasAttribute("tabindex")||(e.tabIndex=0))}),i}(e,(e,t)=>(oz(this.node,t,"Start"),(e,{success:t})=>oz(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends aV{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&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=aY(nd(this.node.current,"focus",()=>this.onFocus()),nd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends aV{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t,s={}){let[r,a,i]=o$(e,s),n=e=>{if(!oO(e))return;let{target:s}=e,r=t(s,e);if("function"!=typeof r||!s)return;let i=e=>{oO(e)&&(r(e),s.removeEventListener("pointerleave",i))};s.addEventListener("pointerleave",i,a)};return r.forEach(e=>{e.addEventListener("pointerenter",n,a)}),i}(e,(e,t)=>(oD(this.node,t,"Start"),e=>oD(this.node,e,"End"))))}unmount(){}}},pan:{Feature:class extends aV{constructor(){super(...arguments),this.removePointerDownListener=rn}onPointerDown(e){this.session=new nk(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nw(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:s,onPanEnd:r}=this.node.getProps();return{onSessionStart:nD(e),onStart:nD(t),onMove:s,onEnd:(e,t)=>{delete this.session,r&&rd.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=nv(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends aV{constructor(e){super(e),this.removeGroupControls=rn,this.removeListeners=rn,this.controls=new n$(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||rn}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:oR,MeasureLayout:nV},layout:{ProjectionNode:oR,MeasureLayout:nV}},(e,t)=>t.isSVG??ay(e)?new aa(t):new ag(t,{allowProjection:e!==u.Fragment}));function oK(){let e=(0,f.useGameStore)(e=>e._achievementQueue),t=(0,f.useGameStore)(e=>e.consumeAchievementQueue),{toast:s}=(0,F.useToast)(),[r,a]=(0,u.useState)([]);return((0,u.useEffect)(()=>{if(0!==e.length)for(let e of t()){(0,V.sfx)("achievement");let t=Date.now()+Math.random();a(s=>[...s,{achievement:e,id:t}]),setTimeout(()=>{a(e=>e.filter(e=>e.id!==t))},4e3),s({title:`成就解锁:${e.name}`,description:`${e.desc} 奖励:${e.rewardText}`})}},[e,t,s]),0===r.length)?null:(0,d.jsx)("div",{className:"fixed inset-0 z-[120] pointer-events-none flex items-center justify-center",children:(0,d.jsx)(t7,{children:r.map((e,t)=>{let s=e.achievement,a=(t-(r.length-1)/2)*140;return(0,d.jsx)(oY.div,{initial:{opacity:0,scale:.4,y:40,rotateX:-30},animate:{opacity:1,scale:1,y:a,rotateX:0},exit:{opacity:0,scale:.6,y:-60},transition:{type:"spring",stiffness:280,damping:22},className:"absolute",style:{transformOrigin:"center center"},children:(0,d.jsxs)("div",{className:"relative rounded-2xl border-2 px-8 py-5 backdrop-blur-xl overflow-hidden",style:{borderColor:s.color,background:`linear-gradient(135deg, ${s.color}22, rgba(5,4,16,0.92))`,boxShadow:`0 0 60px ${s.color}66, 0 0 120px ${s.color}33, inset 0 0 30px ${s.color}11`,minWidth:320,maxWidth:420},children:[(0,d.jsx)("div",{className:"absolute -top-20 -right-20 h-40 w-40 rounded-full blur-3xl opacity-50",style:{background:s.color}}),(0,d.jsx)(oY.div,{className:"absolute inset-0 rounded-2xl opacity-20",style:{background:`conic-gradient(from 0deg, transparent, ${s.color}, transparent, ${s.color}, transparent)`},animate:{rotate:360},transition:{duration:8,repeat:1/0,ease:"linear"}}),(0,d.jsxs)("div",{className:"relative flex items-center gap-4",children:[(0,d.jsx)(oY.div,{className:"shrink-0 h-16 w-16 rounded-2xl flex items-center justify-center text-3xl",style:{background:`${s.color}33`,border:`2px solid ${s.color}`,boxShadow:`0 0 20px ${s.color}88, inset 0 0 12px ${s.color}44`},animate:{boxShadow:[`0 0 20px ${s.color}88, inset 0 0 12px ${s.color}44`,`0 0 40px ${s.color}cc, inset 0 0 20px ${s.color}66`,`0 0 20px ${s.color}88, inset 0 0 12px ${s.color}44`]},transition:{duration:2,repeat:1/0},children:s.icon}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)(oY.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.15},className:"text-[10px] font-mono uppercase tracking-[0.2em] mb-0.5",style:{color:s.color},children:"✦ Achievement Unlocked"}),(0,d.jsx)(oY.h3,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.2},className:"text-lg font-bold truncate",style:{color:s.color,textShadow:`0 0 12px ${s.color}66`},children:s.name}),(0,d.jsx)(oY.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},className:"text-[11px] text-muted-foreground/90 truncate",children:s.desc}),(0,d.jsxs)(oY.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.4},className:"mt-1.5 inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-mono font-semibold",style:{background:`${s.color}22`,border:`1px solid ${s.color}55`,color:s.color},children:["▸ ",s.rewardText]})]})]}),(0,d.jsx)(oY.div,{className:"absolute bottom-0 left-0 h-0.5",style:{background:s.color},initial:{width:"100%"},animate:{width:"0%"},transition:{duration:4,ease:"linear"}})]})},e.id)})})})}function oX(){let e=(0,f.useGameStore)(e=>e.constellation??[]),t=(0,u.useRef)(null),s=(0,u.useRef)(null),[r,a]=(0,u.useState)({w:360,h:360}),[i,n]=(0,u.useState)(null),o=(0,u.useMemo)(()=>new Set(e),[e]);(0,u.useEffect)(()=>{let e=s.current;if(!e)return;let t=new ResizeObserver(()=>{let t=e.getBoundingClientRect();a({w:Math.max(280,t.width),h:Math.max(280,Math.min(420,t.width))})});return t.observe(e),()=>t.disconnect()},[]);let l=(0,u.useMemo)(()=>{let e=r.w/2;return{cx:e,cy:r.h/2,radius:.32*Math.min(r.w,r.h)}},[r]),c=(0,u.useMemo)(()=>(0,tt.getConstellationLayout)(l.cx,l.cy,l.radius).map(e=>{let t=(0,tt.getStarsInCategory)(e.category,e.cx,e.cy,1);return{...e,stars:t}}),[l]);(0,u.useEffect)(()=>{let s=t.current;if(!s)return;let a=s.getContext("2d");if(!a)return;let i=window.devicePixelRatio||1;s.width=r.w*i,s.height=r.h*i,s.style.width=`${r.w}px`,s.style.height=`${r.h}px`,a.setTransform(i,0,0,i,0,0);let n=0,d=performance.now(),u=t=>{let s=(t-d)/1e3;a.clearRect(0,0,r.w,r.h);let i=a.createRadialGradient(l.cx,l.cy,0,l.cx,l.cy,1.6*l.radius);i.addColorStop(0,"rgba(40,30,80,0.18)"),i.addColorStop(1,"rgba(5,4,16,0)"),a.fillStyle=i,a.fillRect(0,0,r.w,r.h),a.save(),a.translate(l.cx,l.cy);let h=6+1.5*Math.sin(1.5*s),f=a.createRadialGradient(0,0,0,0,0,3*h);for(let t of(f.addColorStop(0,"rgba(232,121,249,0.9)"),f.addColorStop(.4,"rgba(232,121,249,0.3)"),f.addColorStop(1,"rgba(232,121,249,0)"),a.fillStyle=f,a.beginPath(),a.arc(0,0,3*h,0,2*Math.PI),a.fill(),a.fillStyle="#fce7ff",a.beginPath(),a.arc(0,0,.6*h,0,2*Math.PI),a.fill(),a.restore(),c))(0,tt.countUnlockedInCategory)(e,t.category)>0&&(a.save(),a.strokeStyle=t.meta.glow,a.lineWidth=1,a.setLineDash([2,4]),a.globalAlpha=.4+.1*Math.sin(2*s+t.cx),a.beginPath(),a.moveTo(l.cx,l.cy),a.lineTo(t.cx,t.cy),a.stroke(),a.restore());for(let t of c){let r=(0,tt.countUnlockedInCategory)(e,t.category);a.save(),a.font="10px ui-monospace, monospace",a.textAlign="center",a.fillStyle=r>0?t.meta.hex:"rgba(148,163,184,0.5)",a.globalAlpha=.85,a.fillText(t.meta.name,t.cx,t.cy+38),a.restore();let i=t.stars.filter(e=>o.has(e.perk.id));for(let e of(i.length>=2&&(a.save(),a.strokeStyle=t.meta.glow,a.lineWidth=1.5,a.globalAlpha=.6,a.beginPath(),i.forEach((e,t)=>{0===t?a.moveTo(e.x,e.y):a.lineTo(e.x,e.y)}),a.stroke(),a.restore()),t.stars)){let r=o.has(e.perk.id);a.save(),a.translate(e.x,e.y);let i=r?.85+.15*Math.sin(3*s+.1*e.x):.3,n=r?10:5,l=a.createRadialGradient(0,0,0,0,0,n);if(l.addColorStop(0,r?t.meta.glow:"rgba(100,116,139,0.2)"),l.addColorStop(1,"rgba(0,0,0,0)"),a.fillStyle=l,a.globalAlpha=i,a.beginPath(),a.arc(0,0,n,0,2*Math.PI),a.fill(),a.globalAlpha=r?1:.4,a.fillStyle=r?t.meta.hex:"#475569",a.beginPath(),a.arc(0,0,r?3.5:2,0,2*Math.PI),a.fill(),r){a.strokeStyle=t.meta.hex,a.globalAlpha=.7*i,a.lineWidth=.8;let r=7+1.5*Math.sin(4*s+.1*e.y);a.beginPath(),a.moveTo(-r,0),a.lineTo(r,0),a.moveTo(0,-r),a.lineTo(0,r),a.stroke()}a.restore()}}n=requestAnimationFrame(u)};return n=requestAnimationFrame(u),()=>cancelAnimationFrame(n)},[c,l,r,e,o]);let h=(0,tt.constellationProgress)(e);return(0,d.jsxs)("div",{ref:s,className:"flex flex-col gap-2 min-h-0 h-full",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between text-[11px] px-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-fuchsia-300",children:"✦"}),(0,d.jsx)("span",{className:"text-muted-foreground",children:"星图天赋"}),(0,d.jsxs)("span",{className:"font-mono text-foreground",children:[h.unlocked,"/",h.total]})]}),(0,d.jsx)("span",{className:"text-muted-foreground/60 text-[10px]",children:"每次飞升可解锁 1 个"})]}),(0,d.jsxs)("div",{className:"relative rounded-xl bg-black/30 border border-white/5 overflow-hidden flex-shrink-0",children:[(0,d.jsx)("canvas",{ref:t,onMouseMove:e=>{let s=t.current;if(!s)return;let r=s.getBoundingClientRect(),a=e.clientX-r.left,i=e.clientY-r.top,l=null,d=14;for(let e of c)for(let t of e.stars){let e=Math.hypot(t.x-a,t.y-i);e<d&&(d=e,l={perk:t.perk,x:t.x,y:t.y,unlocked:o.has(t.perk.id)})}n(l)},onMouseLeave:()=>n(null),className:"block cursor-pointer"}),i&&(0,d.jsxs)("div",{className:"pointer-events-none absolute z-10 max-w-[200px] rounded-md bg-black/85 border border-white/10 px-2 py-1.5 text-[10px] leading-tight shadow-lg backdrop-blur-sm",style:{left:Math.min(i.x+12,r.w-200),top:Math.max(0,i.y-40)},children:[(0,d.jsxs)("div",{className:"font-bold mb-0.5",style:{color:tt.CONSTELLATION_CATEGORY_META[i.perk.category].hex},children:[i.unlocked?"★ ":"☆ ",i.perk.name]}),(0,d.jsx)("div",{className:"text-muted-foreground",children:i.perk.desc}),(0,d.jsxs)("div",{className:"text-muted-foreground/60 mt-0.5",children:[tt.CONSTELLATION_CATEGORY_META[i.perk.category].name," · 序",i.perk.order]})]})]}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-1 text-[10px]",children:Object.keys(tt.CONSTELLATION_CATEGORY_META).map(t=>{let s=tt.CONSTELLATION_CATEGORY_META[t],r=(0,tt.countUnlockedInCategory)(e,t),a=tt.CONSTELLATION_PERKS.filter(e=>e.category===t).length;return(0,d.jsxs)("div",{className:"rounded-md bg-black/25 border border-white/5 px-1.5 py-1 flex items-center gap-1",style:r>0?{borderColor:`${s.hex}40`}:void 0,children:[(0,d.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full flex-shrink-0",style:{background:s.hex,boxShadow:r>0?`0 0 4px ${s.hex}`:"none"}}),(0,d.jsx)("span",{className:"text-muted-foreground truncate",children:s.name}),(0,d.jsxs)("span",{className:"ml-auto font-mono",style:{color:r>0?s.hex:"rgba(148,163,184,0.5)"},children:[r,"/",a]})]},t)})}),(0,d.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto pr-1 echo-scrollbar",children:0===e.length?(0,d.jsxs)("div",{className:"rounded-md bg-black/25 border border-dashed border-white/10 px-3 py-3 text-center text-[11px] text-muted-foreground/70",children:[(0,d.jsx)("div",{className:"mb-1 text-fuchsia-300/80",children:"✦"}),"尚未解锁任何天赋。",(0,d.jsx)("br",{}),"累积接触进度至 100%,发起「飞升」即可在 3 个随机天赋中选 1。"]}):(0,d.jsx)("div",{className:"flex flex-col gap-1",children:e.map(e=>{let t=(0,tt.getPerk)(e);if(!t)return null;let s=tt.CONSTELLATION_CATEGORY_META[t.category];return(0,d.jsxs)("div",{className:"rounded-md bg-black/25 border px-2 py-1.5 flex items-center gap-2 text-[11px]",style:{borderColor:`${s.hex}30`},children:[(0,d.jsx)("span",{className:"inline-block h-2 w-2 rounded-full flex-shrink-0",style:{background:s.hex,boxShadow:`0 0 6px ${s.hex}`}}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-foreground truncate",children:t.name}),(0,d.jsx)("div",{className:"text-muted-foreground/70 text-[10px] truncate",children:t.desc})]}),(0,d.jsx)("span",{className:"text-[9px] text-muted-foreground/50 font-mono",children:s.name})]},e)})})})]})}var oZ=e.i(89120),oJ=e.i(63639),oQ=e.i(3116);let o0=(0,x.default)("award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);var o1=e.i(43553);let o2=(0,x.default)("medal",[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]]),o5=(0,x.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var o3=e.i(58377);let o4=(0,x.default)("hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);var o9=e.i(16715);let o7=(0,x.default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),o8=(0,x.default)("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),o6=(0,x.default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),le=["routine","anomaly","singular"];function lt(e){return 0===e?{icon:o1.Crown,color:"#fbbf24",label:"1st"}:1===e?{icon:o2,color:"#cbd5e1",label:"2nd"}:2===e?{icon:o0,color:"#f97316",label:"3rd"}:null}function ls(){let e,t,s,r,a,i,n=(0,f.useGameStore)(e=>e.grantBeaconReward),o=(0,f.useGameStore)(e=>e.claimWeeklyBeacon),l=(0,f.useGameStore)(e=>e.claimTimedBeacon),c=(0,f.useGameStore)(e=>e.claimChainReward),{toast:h}=(0,F.useToast)(),[p,x]=(0,u.useState)(null),[g,b]=(0,u.useState)(null),[y,v]=(0,u.useState)(null),[w,j]=(0,u.useState)(null),[N,k]=(0,u.useState)(null),[S,T]=(0,u.useState)(null),[C,E]=(0,u.useState)(null),[A,_]=(0,u.useState)([]),[P,M]=(0,u.useState)("00:00:00"),[R,$]=(0,u.useState)("00:00:00"),[O,L]=(0,u.useState)("00:00:00"),[B,z]=(0,u.useState)(Date.now()),[G,U]=(0,u.useState)("local"),[H,W]=(0,u.useState)([]),[q,Y]=(0,u.useState)(!1),[K,X]=(0,u.useState)(null),[Z,Q]=(0,u.useState)(!1),[et,es]=(0,u.useState)(0),er=(0,u.useRef)(!1);(0,u.useEffect)(()=>{x((0,oZ.generateDailyChallenge)()),b((0,oZ.loadDailyProgress)()),v((0,oZ.generateTimedChallenge)()),j((0,oZ.loadTimedProgress)()),k((0,oZ.generateWeeklyChallenge)()),T((0,oZ.loadWeeklyProgress)()),E((0,oZ.loadChainState)()),_((0,oZ.loadLeaderboard)());let e=setInterval(()=>{z(Date.now()),b((0,oZ.loadDailyProgress)()),j((0,oZ.loadTimedProgress)()),T((0,oZ.loadWeeklyProgress)()),E((0,oZ.loadChainState)()),x(e=>e??(0,oZ.generateDailyChallenge)()),v(e=>e??(0,oZ.generateTimedChallenge)()),k(e=>e??(0,oZ.generateWeeklyChallenge)())},1e3);return()=>clearInterval(e)},[]),(0,u.useEffect)(()=>{M((0,oZ.formatCountdown)((0,oZ.msUntilNextDay)(new Date(B)))),$((0,oZ.formatCountdown)((0,oZ.msUntilNextTimedSlot)(new Date(B)))),L((0,oZ.formatCountdown)((0,oZ.msUntilNextWeek)(new Date(B))))},[B]),(0,u.useEffect)(()=>{es((0,oZ.loadLastCloudSubmitTimestamp)())},[]);let ea=(0,u.useCallback)(async()=>{if(!er.current){er.current=!0,Y(!0),X(null);try{let e=await (0,oZ.fetchCloudLeaderboard)();W(e),Q(!0),es((0,oZ.loadLastCloudSubmitTimestamp)()),0===e.length&&X("尚无全球记录,成为首位登顶者!")}catch{X("全球榜连接失败,请稍后重试")}finally{Y(!1),er.current=!1}}},[]);(0,u.useEffect)(()=>{"global"!==G||Z||q||ea()},[G,Z,q,ea]);let ei=(0,u.useCallback)(()=>{if(!p||!g||null===g.completedAt||g.claimed)return;let e=(0,oZ.claimBeaconReward)(p,g);_(e.leaderboard),b((0,oZ.loadDailyProgress)()),n(e.rewardInsight,e.rewardContact),(0,V.sfx)("achievement"),h({title:"✦ 每日信标奖励已领取",description:`+${e.rewardInsight} 洞见 \xb7 +${e.rewardContact.toFixed(1)} 接触 \xb7 得分 ${e.score}`}),e.entry&&(0,oZ.submitCloudScore)(e.entry).then(t=>{t>=1&&(es(e.entry.timestamp),"global"===G&&ea())})},[p,g,h,n,G,ea]),en=(0,u.useCallback)(()=>{if(!y||!w||null===w.completedAt||w.claimed)return;let e=l();_((0,oZ.loadLeaderboard)()),j((0,oZ.loadTimedProgress)()),(e.rewardInsight>0||e.rewardContact>0)&&((0,V.sfx)("achievement"),h({title:"✦ 限时挑战奖励已领取",description:`+${e.rewardInsight} 洞见 \xb7 +${e.rewardContact.toFixed(1)} 接触 \xb7 得分 ${e.score}`}),es((0,oZ.loadLastCloudSubmitTimestamp)()),"global"===G&&ea())},[y,w,h,l,G,ea]),eo=(0,u.useCallback)(()=>{if(!N||!S||null===S.completedAt||S.claimed)return;let e=o();_((0,oZ.loadLeaderboard)()),T((0,oZ.loadWeeklyProgress)()),(e.rewardInsight>0||e.rewardContact>0)&&((0,V.sfx)("achievement"),h({title:"✦ 周挑战奖励已领取",description:`+${e.rewardInsight} 洞见 \xb7 +${e.rewardContact.toFixed(1)} 接触 \xb7 得分 ${e.score}`}),es((0,oZ.loadLastCloudSubmitTimestamp)()),"global"===G&&ea())},[N,S,h,o,G,ea]),el=(0,u.useCallback)(e=>{let t=oZ.BEACON_CHAIN_REWARDS.find(t=>t.milestone===e),s=c(e);E((0,oZ.loadChainState)()),s.ok&&((0,V.sfx)("achievement"),h({title:`✦ ${s.label||t?.label||"里程碑"} 已领取`,description:`+${s.rewardInsight} 洞见 \xb7 +${s.rewardContact.toFixed(1)} 接触`}))},[h,c]);if(!p||!g||!y||!w||!N||!S||!C)return(0,d.jsx)("div",{className:"flex items-center justify-center h-full text-xs text-muted-foreground/60",children:"正在校准深空信标…"});let ec=oZ.BEACON_DIFFICULTY[p.difficulty],ed=oZ.BEACON_TYPE_META[p.type],eu=Math.min(100,g.progress/p.goal*100),eh=null!==g.completedAt,ef=g.claimed,em=eh&&!ef,ep=oZ.BEACON_DIFFICULTY[y.difficulty],ex=oZ.BEACON_TYPE_META[y.type],eg=Math.min(100,w.progress/y.goal*100),eb=null!==w.completedAt,ey=w.claimed,ev=eb&&!ey,ew=oZ.BEACON_DIFFICULTY[N.difficulty],ej=oZ.BEACON_TYPE_META[N.type],eN=Math.min(100,S.progress/N.goal*100),ek=null!==S.completedAt,eS=S.claimed,eT=ek&&!eS,eC=(0,oZ.getChainProgress)(C.currentStreak),eE=(0,oZ.getNextMilestone)(C.currentStreak),eA=(0,oZ.getTodayKey)(),e_=C.lastCompletedDateKey===eA;return(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex flex-col gap-2.5 h-full overflow-y-auto echo-scroll pr-0.5",children:[(0,d.jsx)(I.default,{id:"12f5fcaad97b9273",dynamic:[ec.glow,ec.glow,ec.glow,ec.glow],children:`.echo-scroll::-webkit-scrollbar{width:4px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff1f;border-radius:2px}.echo-scroll::-webkit-scrollbar-track{background:0 0}@keyframes beacon-pulse-ring{0%{opacity:.8;transform:scale(.8)}to{opacity:0;transform:scale(2.2)}}@keyframes beacon-glow{0%,to{box-shadow:0 0 18px ${ec.glow},inset 0 0 12px ${ec.glow}}50%{box-shadow:0 0 32px ${ec.glow},inset 0 0 20px ${ec.glow}}}@keyframes weekly-glow{0%,to{box-shadow:0 0 18px #e879f959,inset 0 0 12px #e879f940}50%{box-shadow:0 0 32px #e879f980,inset 0 0 20px #e879f959}}@keyframes timed-glow{0%,to{box-shadow:0 0 18px #fbbf2466,inset 0 0 12px #fbbf2440}50%{box-shadow:0 0 30px #fbbf248c,inset 0 0 20px #fbbf2459}}@keyframes timed-urgent{0%,to{box-shadow:0 0 18px #f43f5e80,inset 0 0 12px #f43f5e4d}50%{box-shadow:0 0 34px #f43f5eb3,inset 0 0 22px #f43f5e66}}@keyframes chain-milestone-pulse{0%,to{transform:scale(1);box-shadow:0 0 #fb71858c}50%{transform:scale(1.06);box-shadow:0 0 0 8px #fb718500}}.chain-milestone-reachable{animation:1.8s ease-in-out infinite chain-milestone-pulse}@keyframes chain-streak-flux{0%,to{background-position:0%}50%{background-position:100%}}.chain-streak-text{-webkit-text-fill-color:transparent;background:linear-gradient(90deg,#fbbf24,#fb7185,#fbbf24) 0 0/200% 100%;-webkit-background-clip:text;background-clip:text;animation:4s ease-in-out infinite chain-streak-flux}`}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between",children:[(0,d.jsxs)("h3",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-sm font-semibold flex items-center gap-1.5",children:[(0,d.jsx)(oJ.Radio,{className:"h-4 w-4 text-fuchsia-400"}),"深空信标"]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1 text-[10px] text-muted-foreground/70",children:[(0,d.jsx)(oQ.Clock,{className:"h-3 w-3"}),"次日重置",(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-fuchsia-300/90",children:P})]})]}),(0,d.jsxs)("div",{style:{borderColor:`${ec.color}55`,background:`linear-gradient(135deg, ${ec.color}1f, rgba(0,0,0,0.45))`,animation:eh?"none":"beacon-glow 3s ease-in-out infinite"},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" relative rounded-xl border p-3 overflow-hidden",children:[!eh&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{style:{border:`1.5px solid ${ec.color}`,animation:"beacon-pulse-ring 2.5s ease-out infinite"},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" absolute top-4 right-4 h-10 w-10 rounded-full pointer-events-none"}),(0,d.jsx)("div",{style:{border:`1.5px solid ${ec.color}`,animation:"beacon-pulse-ring 2.5s ease-out infinite 1.25s"},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" absolute top-4 right-4 h-10 w-10 rounded-full pointer-events-none"})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" relative",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5 mb-2",children:[(0,d.jsxs)("span",{style:{background:`${ec.color}22`,color:ec.color,border:`1px solid ${ec.color}55`},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded flex items-center gap-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]]),children:ec.icon}),ec.label]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-white/5 text-muted-foreground border border-white/10",children:[ed.icon," ",ed.label]}),eh&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-300 border border-emerald-500/40 flex items-center gap-1",children:[(0,d.jsx)(ee.Sparkles,{className:"h-2.5 w-2.5"})," 已完成"]})]}),(0,d.jsx)("h4",{style:{color:ec.color,textShadow:`0 0 10px ${ec.glow}`},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-sm font-semibold mb-1",children:p.title}),(0,d.jsx)("p",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[11px] text-muted-foreground/80 leading-relaxed mb-2.5",children:p.desc}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/70",children:"进度"}),(0,d.jsxs)("span",{style:{color:ec.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[11px] font-mono font-semibold",children:[Math.min(g.progress,p.goal)," / ",p.goal," ",ed.unit]})]}),(0,d.jsx)(D,{value:eu,className:"h-2 bg-black/40",style:{"--progress-color":ec.color}})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-2 text-[10px]",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/60",children:"奖励:"}),p.rewardInsight>0&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-amber-300 font-mono",children:["+",(0,m.formatNum)(p.rewardInsight),"洞见"]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-fuchsia-300 font-mono",children:["+",p.rewardContact.toFixed(1),"接触"]})]}),(0,d.jsx)(J.Button,{onClick:ei,disabled:!em,size:"sm",className:"h-7 px-3 text-[11px] border-0",style:{background:em?`linear-gradient(90deg, ${ec.color}, ${ec.color}cc)`:`${ec.color}1a`,color:em?"#022c22":`${ec.color}99`},children:ef?"已领取":em?"领取奖励":eh?"已领取":"进行中…"})]}),eh&&g.durationSec>0&&(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mt-1.5 text-[10px] text-muted-foreground/50 text-center",children:["完成用时 ",Math.floor(g.durationSec/60),"分",g.durationSec%60,"秒"]})]})]}),(e=18e5>(0,oZ.msUntilNextTimedSlot)(new Date(B))&&!eb,t=eb?"none":e?"timed-urgent 1.5s ease-in-out infinite":"timed-glow 3s ease-in-out infinite",(0,d.jsxs)("div",{style:{borderColor:e?"rgba(244,63,94,0.5)":"rgba(251,191,36,0.4)",background:e?"linear-gradient(135deg, rgba(244,63,94,0.12), rgba(251,191,36,0.08), rgba(0,0,0,0.45))":"linear-gradient(135deg, rgba(251,191,36,0.14), rgba(0,0,0,0.45))",animation:t},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" relative rounded-xl border p-3 overflow-hidden",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5",children:[(0,d.jsx)(o4,{className:`h-3.5 w-3.5 ${e?"text-rose-400":"text-amber-400"}`}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`text-xs font-semibold ${e?"text-rose-200":"text-amber-200"}`,children:"限时挑战 · TIMED"})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1 text-[9px] text-muted-foreground/70",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-amber-300/70",children:(0,oZ.getTimedSlotKey)().split("_").slice(1).join(" ")}),(0,d.jsx)(oQ.Clock,{className:"h-2.5 w-2.5"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`font-mono ${e?"text-rose-300":"text-amber-300/90"}`,children:R})]})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5 mb-2",children:[(0,d.jsxs)("span",{style:{background:`${ep.color}22`,color:ep.color,border:`1px solid ${ep.color}55`},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded flex items-center gap-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]]),children:ep.icon}),ep.label]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-white/5 text-muted-foreground border border-white/10",children:[ex.icon," ",ex.label]}),eb&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-300 border border-emerald-500/40 flex items-center gap-1",children:[(0,d.jsx)(ee.Sparkles,{className:"h-2.5 w-2.5"})," 已完成"]}),e&&!eb&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-rose-500/20 text-rose-300 border border-rose-500/40 flex items-center gap-1 animate-pulse",children:"即将结束"})]}),(0,d.jsx)("h4",{style:{color:ep.color,textShadow:`0 0 10px ${ep.glow}`},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-sm font-semibold mb-1",children:y.title}),(0,d.jsx)("p",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/80 leading-relaxed mb-2",children:y.desc}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/70",children:"进度"}),(0,d.jsxs)("span",{style:{color:ep.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[11px] font-mono font-semibold",children:[Math.min(w.progress,y.goal)," / ",y.goal," ",ex.unit]})]}),(0,d.jsx)(D,{value:eg,className:"h-2 bg-black/40",style:{"--progress-color":e?"#f43f5e":ep.color}})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5 text-[10px]",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/60",children:"奖励:"}),y.rewardInsight>0&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-amber-300 font-mono",children:["+",(0,m.formatNum)(y.rewardInsight),"洞见"]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-fuchsia-300 font-mono",children:["+",y.rewardContact.toFixed(1),"接触"]})]}),(0,d.jsx)(J.Button,{onClick:en,disabled:!ev,size:"sm",className:"h-7 px-3 text-[11px] border-0",style:{background:ev?"linear-gradient(90deg, #34d399, #34d399cc)":"rgba(251,191,36,0.10)",color:ev?"#022c22":"rgba(251,191,36,0.55)"},children:ey?"已领取":ev?"领取奖励":eb?"已领取":"进行中…"})]}),eb&&w.durationSec>0&&(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mt-1.5 text-[10px] text-muted-foreground/50 text-center",children:["完成用时 ",Math.floor(w.durationSec/60),"分",w.durationSec%60,"秒"]})]})),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" grid grid-cols-1 lg:grid-cols-2 gap-2.5",children:[(0,d.jsxs)("div",{style:{borderColor:"rgba(232,121,249,0.4)",background:"linear-gradient(135deg, rgba(232,121,249,0.12), rgba(0,0,0,0.45))",animation:ek?"none":"weekly-glow 3.5s ease-in-out infinite"},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" relative rounded-xl border p-3 overflow-hidden",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5",children:[(0,d.jsx)(tR.Zap,{className:"h-3.5 w-3.5 text-fuchsia-400"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-xs font-semibold text-fuchsia-200",children:"周挑战 · WEEKLY"})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1 text-[9px] text-muted-foreground/70",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-fuchsia-300/80",children:N.weekKey}),(0,d.jsx)(oQ.Clock,{className:"h-2.5 w-2.5"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-fuchsia-300/90",children:O})]})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5 mb-2",children:[(0,d.jsxs)("span",{style:{background:`${ew.color}22`,color:ew.color,border:`1px solid ${ew.color}55`},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded flex items-center gap-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]]),children:ew.icon}),ew.label]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-white/5 text-muted-foreground border border-white/10",children:[ej.icon," ",ej.label]}),ek&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-300 border border-emerald-500/40 flex items-center gap-1",children:[(0,d.jsx)(ee.Sparkles,{className:"h-2.5 w-2.5"})," 已完成"]})]}),(0,d.jsx)("h4",{style:{color:ew.color,textShadow:`0 0 10px ${ew.glow}`},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-sm font-semibold mb-1",children:N.title}),(0,d.jsx)("p",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/80 leading-relaxed mb-2",children:N.desc}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/70",children:"进度"}),(0,d.jsxs)("span",{style:{color:ew.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[11px] font-mono font-semibold",children:[Math.min(S.progress,N.goal)," / ",N.goal," ",ej.unit]})]}),(0,d.jsx)(D,{value:eN,className:"h-2 bg-black/40",style:{"--progress-color":ew.color}})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5 text-[10px]",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/60",children:"奖励:"}),N.rewardInsight>0&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-amber-300 font-mono",children:["+",(0,m.formatNum)(N.rewardInsight),"洞见"]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-fuchsia-300 font-mono",children:["+",N.rewardContact.toFixed(1),"接触"]})]}),(0,d.jsx)(J.Button,{onClick:eo,disabled:!eT,size:"sm",className:"h-7 px-3 text-[11px] border-0",style:{background:eT?"linear-gradient(90deg, #34d399, #34d399cc)":"rgba(232,121,249,0.10)",color:eT?"#022c22":"rgba(232,121,249,0.55)"},children:eS?"已领取":eT?"领取奖励":ek?"已领取":"进行中…"})]}),ek&&S.durationSec>0&&(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mt-1.5 text-[10px] text-muted-foreground/50 text-center",children:["完成用时 ",Math.floor(S.durationSec/60),"分",S.durationSec%60,"秒"]})]}),(0,d.jsxs)("div",{style:{borderColor:"rgba(251,191,36,0.35)",background:"linear-gradient(135deg, rgba(251,191,36,0.10), rgba(251,113,133,0.10), rgba(0,0,0,0.4))"},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" relative rounded-xl border p-3 overflow-hidden",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5",children:[(0,d.jsx)(o5,{className:"h-3.5 w-3.5 text-amber-400"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-xs font-semibold text-amber-200",children:"信标链 · CHAIN"})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-baseline gap-1",children:[(0,d.jsx)(o3.Flame,{className:"h-3 w-3 text-rose-400"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/60",children:"连续"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" chain-streak-text text-2xl font-bold font-mono leading-none",children:C.currentStreak}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/60",children:"天"})]})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mb-2 flex items-center justify-between",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/70",children:e_?"今日已贡献":"今日尚未完成日挑战"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`text-[10px] font-mono px-1.5 py-0.5 rounded border ${e_?"bg-emerald-500/15 text-emerald-300 border-emerald-500/30":"bg-white/5 text-muted-foreground/70 border-white/10"}`,children:e_?"✓ 已记录":"○ 待完成"})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-2 relative",children:[(0,d.jsx)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" absolute top-6 left-[12.5%] right-[12.5%] h-[2px] bg-white/10"}),(r=(s={0:12.5,3:12.5,7:37.5,14:62.5,30:87.5})[eC.prev]??12.5,a=null!==eC.next?s[eC.next]??87.5:87.5,(i=Math.max(0,r+(a-r)*(eC.progressPct/100)-12.5))<=0?null:(0,d.jsx)("div",{style:{left:"12.5%",width:`${i}%`,background:"linear-gradient(90deg, #fbbf24, #fb7185)",boxShadow:"0 0 8px rgba(251,113,133,0.5)"},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" absolute top-6 h-[2px]"})),oZ.BEACON_CHAIN_MILESTONES.map(e=>{let t=oZ.BEACON_CHAIN_REWARDS.find(t=>t.milestone===e),s=C.milestonesClaimed.includes(e),r=C.currentStreak>=e&&!s,a=C.currentStreak>0&&eE===e,i="rgba(255,255,255,0.05)",n="rgba(255,255,255,0.15)",o="rgba(255,255,255,0.4)";return s?(i="rgba(52,211,153,0.25)",n="#34d399",o="#34d399"):r?(i="rgba(251,113,133,0.20)",n="#fb7185",o="#fb7185"):a&&(i="rgba(251,191,36,0.20)",n="#fbbf24",o="#fbbf24"),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex flex-col items-center gap-1 z-10 flex-1",children:[(0,d.jsx)("div",{style:{background:i,borderColor:n,color:o},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`w-12 h-12 rounded-full flex items-center justify-center font-mono font-bold text-sm border-2 ${r?"chain-milestone-reachable":""}`,children:s?(0,d.jsx)(ee.Sparkles,{className:"h-4 w-4"}):e}),(0,d.jsx)("span",{style:{color:o},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] text-center leading-tight",children:t?.label}),s?(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] text-emerald-400/80 font-mono",children:"已领"}):r?(0,d.jsx)(J.Button,{onClick:()=>el(e),size:"sm",className:"h-5 px-2 text-[9px] py-0 border-0",style:{background:"linear-gradient(90deg, #fb7185, #f43f5e)",color:"#1c0608"},children:"领取"}):(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] text-muted-foreground/40 font-mono",children:["+",t?.rewardInsight,"洞"]})]},e)})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between mb-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] text-muted-foreground/70",children:null===eC.next?"已通关全部里程碑":`下一目标:${eC.next} 天`}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[10px] font-mono text-amber-300",children:[eC.current,null!==eC.next&&` / ${eC.next}`," 天"]})]}),(0,d.jsx)(D,{value:eC.progressPct,className:"h-1.5 bg-black/40",style:{"--progress-color":"#fbbf24"}})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between gap-2 text-[10px]",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-2",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/60",children:"最长"}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-amber-300",children:[C.longestStreak,"天"]})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-2",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/60",children:"累计"}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-rose-300",children:[C.totalCompletions,"次"]})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1",children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/60",children:"续命"}),C.graceUsed>=1?(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-rose-400/80",children:"已用"}):(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono text-emerald-400/80",children:"可用"})]})]})]})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" rounded-xl border border-white/10 bg-black/30 p-2.5",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-between gap-2 mb-2",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1.5",children:[(0,d.jsx)(tI.Trophy,{className:"h-3.5 w-3.5 text-amber-400"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-xs font-semibold",children:"深空排行榜"})]}),(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1",children:[(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-0.5 p-0.5 rounded-lg bg-black/40 border border-white/10",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>U("local"),"aria-pressed":"local"===G,className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-mono transition-colors ${"local"===G?"bg-amber-500/25 text-amber-300 border border-amber-500/40":"text-muted-foreground/60 hover:text-muted-foreground border border-transparent"}`,children:[(0,d.jsx)(tI.Trophy,{className:"h-2.5 w-2.5"}),"本地"]}),(0,d.jsxs)("button",{type:"button",onClick:()=>U("global"),"aria-pressed":"global"===G,className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-mono transition-colors ${"global"===G?"bg-emerald-500/25 text-emerald-300 border border-emerald-500/40":"text-muted-foreground/60 hover:text-muted-foreground border border-transparent"}`,children:[(0,d.jsx)(o7,{className:"h-2.5 w-2.5"}),"全球"]})]}),"global"===G&&(0,d.jsx)("button",{type:"button",onClick:()=>void ea(),disabled:q,"aria-label":"刷新全球榜",title:"刷新全球榜",className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" p-1 rounded-md text-muted-foreground/70 hover:text-emerald-300 hover:bg-emerald-500/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:(0,d.jsx)(o9.RefreshCw,{className:`h-3 w-3 ${q?"animate-spin":""}`})})]})]}),(0,d.jsx)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" mb-1.5 text-[10px] text-muted-foreground/50 flex items-center gap-2",children:"local"===G?(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]]),children:["本机 Top ",A.length||0," · 离线可用"]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]]),children:["全球 Top ",H.length||0]}),Z&&!q&&H.length>0&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-emerald-400/60",children:"· 已同步"}),q&&(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-amber-400/70 flex items-center gap-1",children:[(0,d.jsx)(o6,{className:"h-2.5 w-2.5 animate-spin"}),"同步中…"]})]})}),"local"===G&&(0===A.length?(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-center py-4 text-[11px] text-muted-foreground/40",children:[(0,d.jsx)(tI.Trophy,{className:"h-6 w-6 mx-auto mb-1 opacity-30"}),"尚无记录。完成限时、每日或本周信标即可登榜。"]}):(0,d.jsx)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" space-y-0.5 max-h-[200px] overflow-y-auto echo-scroll",children:A.map((e,t)=>{let s=lt(t),r=oZ.BEACON_DIFFICULTY[e.difficulty],a=oZ.BEACON_TYPE_META[e.challenge],i=e.dateKey===(0,oZ.getTodayKey)()||e.dateKey===(0,oZ.getWeekKey)()||e.dateKey===(0,oZ.getTimedSlotKey)();return(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`flex items-center gap-2 px-2 py-1 rounded-lg text-[11px] ${e.isWeekly?"bg-fuchsia-500/10 border border-fuchsia-500/20":e.isTimed?"bg-amber-500/10 border border-amber-500/20":i?"bg-fuchsia-500/10 border border-fuchsia-500/20":"hover:bg-white/5"}`,children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" w-6 flex items-center justify-center",children:s?(0,d.jsx)(s.icon,{className:"h-3.5 w-3.5",style:{color:s.color}}):(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/50 font-mono",children:t+1})}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1 flex-1 min-w-0",children:[(0,d.jsx)("span",{style:{color:r.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono",children:r.icon}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/80 truncate",children:a.label}),e.isWeekly&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] font-mono px-1 rounded bg-fuchsia-500/20 text-fuchsia-300 border border-fuchsia-500/40",children:"WEEK"}),e.isTimed&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] font-mono px-1 rounded bg-amber-500/20 text-amber-300 border border-amber-500/40",children:"TIMED"}),e.progress>=1&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-emerald-400/70",children:"✓"})]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/50 font-mono text-[10px] w-16 text-right",children:[Math.floor(e.durationSec/60),"m",e.durationSec%60,"s"]}),(0,d.jsx)("span",{style:{color:r.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono font-semibold w-12 text-right",children:(0,m.formatNum)(e.score)})]},`local-${e.timestamp}-${t}`)})})),"global"===G&&(0,d.jsx)(d.Fragment,{children:q&&0===H.length?(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-center py-4 text-[11px] text-muted-foreground/60 flex items-center justify-center gap-2",children:[(0,d.jsx)(o6,{className:"h-3.5 w-3.5 animate-spin text-emerald-400"}),"正在拉取全球榜…"]}):0===H.length?(0,d.jsx)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-center py-4 text-[11px] text-muted-foreground/40",children:K?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o8,{className:"h-6 w-6 mx-auto mb-1 opacity-40 text-rose-400"}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-rose-300/70",children:K}),(0,d.jsx)("button",{type:"button",onClick:()=>void ea(),className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" block mx-auto mt-2 text-[10px] text-emerald-400/80 hover:text-emerald-300 underline-offset-2 hover:underline",children:"重试"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o7,{className:"h-6 w-6 mx-auto mb-1 opacity-30 text-emerald-400"}),"尚无全球记录。完成挑战并领取即可登顶全球榜!"]})}):(0,d.jsx)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" space-y-0.5 max-h-[200px] overflow-y-auto echo-scroll",children:H.map((e,t)=>{let s=lt(t),r=oZ.BEACON_DIFFICULTY[e.difficulty]??oZ.BEACON_DIFFICULTY.routine,a=oZ.BEACON_TYPE_META[e.challenge]??{label:e.challenge,icon:"·",unit:""},i=et>0&&e.timestamp===et;return(0,d.jsxs)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`flex items-center gap-2 px-2 py-1 rounded-lg text-[11px] ${i?"bg-emerald-500/15 border border-emerald-500/40 shadow-[0_0_12px_rgba(52,211,153,0.25)]":e.isWeekly?"bg-fuchsia-500/10 border border-fuchsia-500/20":e.isTimed?"bg-amber-500/10 border border-amber-500/20":"hover:bg-white/5"}`,children:[(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" w-6 flex items-center justify-center",children:s?(0,d.jsx)(s.icon,{className:"h-3.5 w-3.5",style:{color:s.color}}):(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" "+`font-mono ${i?"text-emerald-300 font-bold":"text-muted-foreground/50"}`,children:t+1})}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1 flex-1 min-w-0",children:[(0,d.jsx)("span",{style:{color:r.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono",children:r.icon}),(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/80 truncate",children:a.label}),e.isWeekly&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] font-mono px-1 rounded bg-fuchsia-500/20 text-fuchsia-300 border border-fuchsia-500/40",children:"WEEK"}),e.isTimed&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] font-mono px-1 rounded bg-amber-500/20 text-amber-300 border border-amber-500/40",children:"TIMED"}),i&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-[9px] font-mono px-1 rounded bg-emerald-500/25 text-emerald-200 border border-emerald-500/50",children:"YOU"}),e.progress>=1&&(0,d.jsx)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-emerald-400/70",children:"✓"})]}),(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" text-muted-foreground/50 font-mono text-[10px] w-16 text-right",children:[Math.floor(e.durationSec/60),"m",e.durationSec%60,"s"]}),(0,d.jsx)("span",{style:{color:i?"#34d399":r.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" font-mono font-semibold w-12 text-right",children:(0,m.formatNum)(e.score)})]},`global-${e.timestamp}-${t}`)})})})]}),(0,d.jsx)("div",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center justify-center gap-3 text-[9px] text-muted-foreground/50",children:le.map(e=>{let t=oZ.BEACON_DIFFICULTY[e];return(0,d.jsxs)("span",{className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]])+" flex items-center gap-1",children:[(0,d.jsx)("span",{style:{color:t.color},className:I.default.dynamic([["12f5fcaad97b9273",[ec.glow,ec.glow,ec.glow,ec.glow]]]),children:t.icon}),t.label," ×",t.mult]},e)})})]})}var lr=e.i(73375);function la(){let[e,t]=(0,u.useState)(!1),[s,r]=(0,u.useState)(0),[a,i]=(0,u.useState)(null),[n,o]=(0,u.useState)(!1),l=(0,u.useRef)(null);(0,u.useEffect)(()=>{if(!function(){try{return"1"===localStorage.getItem(tS)}catch{return!0}}()){let e=setTimeout(()=>t(!0),600);return()=>clearTimeout(e)}},[]),(0,u.useEffect)(()=>{let e=()=>{r(0),o(!1),t(!0)};return window.addEventListener("echo-nexus-tutorial-restart",e),()=>window.removeEventListener("echo-nexus-tutorial-restart",e)},[]),(0,f.useGameStore)(e=>e.crystals),(0,f.useGameStore)(e=>e.pulsePower),(0,f.useGameStore)(e=>e.tech),(0,f.useGameStore)(e=>e.activePuzzle),(0,f.useGameStore)(e=>!!e.activeExpedition&&!e.activeExpedition.finished);let c=(0,u.useRef)(null);(0,u.useEffect)(()=>{if(!e)return;let t=tk[s];if(!t?.expectAction)return;let r=0,a=()=>{let e=f.useGameStore.getState(),s=!1;"pulse"===t.expectAction?(null===c.current&&(c.current=e.crystals),s=e.crystals>=(c.current??0)+Math.max(.5,.5*e.pulsePower)):"decode-start"===t.expectAction?s=!!e.activePuzzle:"tech-buy"===t.expectAction?s=Object.values(e.tech).some(e=>e>0):"expedition-start"===t.expectAction&&(s=!!e.activeExpedition&&!e.activeExpedition.finished),o(e=>e!==s?s:e),r=requestAnimationFrame(a)};return r=requestAnimationFrame(a),()=>cancelAnimationFrame(r)},[e,s]);let h=(0,u.useCallback)(()=>{let e=tk[s];if(!e?.target)return void i(null);let t=document.querySelector(`[data-tut="${e.target}"]`);if(!t)return void i(null);let r=t.getBoundingClientRect();i({left:r.left,top:r.top,width:r.width,height:r.height})},[s]);(0,u.useEffect)(()=>{if(!e)return;let t=()=>{h(),l.current=requestAnimationFrame(t)};return l.current=requestAnimationFrame(t),()=>{l.current&&cancelAnimationFrame(l.current)}},[e,s,h]);let m=(0,u.useCallback)(()=>{t(!1);try{localStorage.setItem(tS,"1")}catch{}},[]),p=(0,u.useCallback)(()=>{s>=tk.length-1?m():(r(e=>e+1),o(!1))},[s,m]),x=(0,u.useCallback)(()=>{s<=0||(r(e=>e-1),o(!1))},[s]);if(!e)return null;let g=tk[s],b=s>=tk.length-1,y=g.placement??"auto",v={};return v=a?"right"===y?{left:a.left+a.width+16,top:a.top+a.height/2,transform:"translateY(-50%)"}:"left"===y?{left:Math.max(16,a.left-360-16),top:a.top+a.height/2,transform:"translateY(-50%)",maxWidth:340}:"top"===y?{left:Math.max(16,Math.min(a.left,window.innerWidth-360-16)),top:Math.max(16,a.top-220),maxWidth:340}:{left:Math.max(16,Math.min(window.innerWidth/2-170,window.innerWidth-360-16)),top:Math.min(window.innerHeight-260,(a?.bottom??window.innerHeight/2)+16),maxWidth:340}:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",maxWidth:440},(0,d.jsxs)("div",{className:"fixed inset-0 z-[79]",children:[(()=>{if(!a)return(0,d.jsx)("div",{className:"fixed inset-0 bg-black/70 z-[80] pointer-events-auto"});let{left:e,top:t,width:s,height:r}=a,i=e-6,n=t-6,o=s+12,l=r+12;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"fixed bg-black/70 z-[80] pointer-events-auto",style:{left:0,top:0,right:0,height:Math.max(0,n)}}),(0,d.jsx)("div",{className:"fixed bg-black/70 z-[80] pointer-events-auto",style:{left:0,top:n+l,right:0,bottom:0}}),(0,d.jsx)("div",{className:"fixed bg-black/70 z-[80] pointer-events-auto",style:{left:0,top:n,width:Math.max(0,i),height:l}}),(0,d.jsx)("div",{className:"fixed bg-black/70 z-[80] pointer-events-auto",style:{left:i+o,top:n,right:0,height:l}}),(0,d.jsx)("div",{className:"fixed z-[81] pointer-events-none rounded-lg",style:{left:i,top:n,width:o,height:l,boxShadow:"0 0 0 2px rgba(232,121,249,0.9), 0 0 24px 4px rgba(232,121,249,0.5)",animation:"tut-pulse 1.6s ease-in-out infinite"}})]})})(),(0,d.jsx)("div",{className:"fixed z-[82] w-[340px] sm:w-[360px] max-w-[calc(100vw-32px)]",style:v,children:(0,d.jsxs)("div",{className:"relative rounded-2xl border border-fuchsia-400/40 bg-gradient-to-br from-[#1a0a2e]/95 to-[#0a0a1e]/95 backdrop-blur-xl shadow-2xl shadow-fuchsia-500/20 overflow-hidden",children:[(0,d.jsx)("div",{className:"h-1 w-full bg-gradient-to-r from-emerald-400 via-fuchsia-500 to-rose-400"}),(0,d.jsx)("button",{onClick:m,className:"absolute top-2 right-2 h-7 w-7 rounded-full flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-white/10 transition z-10","aria-label":"关闭教程",children:(0,d.jsx)(Q.X,{className:"h-3.5 w-3.5"})}),(0,d.jsxs)("div",{className:"p-4 pt-3.5",children:[(0,d.jsx)("div",{className:"flex items-center gap-1.5 mb-2.5",children:tk.map((e,t)=>(0,d.jsx)("div",{className:`h-1 rounded-full transition-all ${t===s?"w-6 bg-fuchsia-400":t<s?"w-3 bg-fuchsia-400/50":"w-3 bg-white/15"}`},e.id))}),(0,d.jsxs)("h3",{className:"text-sm font-bold text-fuchsia-100 mb-1.5 flex items-center gap-1.5 pr-6",children:[(0,d.jsx)(ee.Sparkles,{className:"h-3.5 w-3.5 text-fuchsia-300 shrink-0"}),g.title]}),(0,d.jsx)("p",{className:"text-[12.5px] text-muted-foreground leading-relaxed whitespace-pre-line",children:g.body}),g.expectAction&&!n&&(0,d.jsxs)("div",{className:"mt-3 px-2.5 py-1.5 rounded-lg bg-amber-500/10 border border-amber-400/30 text-[11px] text-amber-200 flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-400 animate-pulse"}),"完成动作后自动进入下一步,或点跳过"]}),g.expectAction&&n&&(0,d.jsx)("div",{className:"mt-3 px-2.5 py-1.5 rounded-lg bg-emerald-500/10 border border-emerald-400/30 text-[11px] text-emerald-200 flex items-center gap-1.5",children:"✓ 已检测到动作"}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-4",children:[(0,d.jsxs)(J.Button,{size:"sm",variant:"ghost",onClick:x,disabled:0===s,className:"h-7 px-2 text-[11px] text-muted-foreground hover:text-foreground",children:[(0,d.jsx)(lr.ChevronLeft,{className:"h-3.5 w-3.5"}),"上一步"]}),(0,d.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,d.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:m,className:"h-7 px-2 text-[11px] text-muted-foreground hover:text-foreground",children:"跳过"}),(0,d.jsxs)(J.Button,{size:"sm",onClick:p,className:"h-7 px-3 text-[11px] bg-fuchsia-500 hover:bg-fuchsia-600 text-white border-fuchsia-400/50",children:[b?"完成":"下一步",(0,d.jsx)(t$.ChevronRight,{className:"h-3.5 w-3.5 ml-0.5"})]})]})]}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground/60 text-center mt-2",children:[s+1," / ",tk.length]})]})]})})]})}var li=e.i(70703),ln=e.i(33755);let lo=(0,x.default)("compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var ll=e.i(55711);let lc=(0,x.default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),ld=(0,x.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),lu={Compass:lo,Brain:ll.Brain,Swords:tE.Swords,Sparkles:ee.Sparkles},lh={exploration:{text:"text-emerald-300",border:"border-emerald-400/30",borderActive:"border-emerald-400/70",bg:"bg-emerald-500/10",ring:"ring-emerald-400/40",barFrom:"from-emerald-400",barTo:"to-emerald-500",glow:"rgba(52,211,153,0.45)"},wisdom:{text:"text-fuchsia-300",border:"border-fuchsia-400/30",borderActive:"border-fuchsia-400/70",bg:"bg-fuchsia-500/10",ring:"ring-fuchsia-400/40",barFrom:"from-fuchsia-400",barTo:"to-fuchsia-500",glow:"rgba(232,121,249,0.45)"},courage:{text:"text-amber-300",border:"border-amber-400/30",borderActive:"border-amber-400/70",bg:"bg-amber-500/10",ring:"ring-amber-400/40",barFrom:"from-amber-400",barTo:"to-amber-500",glow:"rgba(251,191,36,0.45)"},inspiration:{text:"text-rose-300",border:"border-rose-400/30",borderActive:"border-rose-400/70",bg:"bg-rose-500/10",ring:"ring-rose-400/40",barFrom:"from-rose-400",barTo:"to-rose-500",glow:"rgba(251,113,133,0.45)"}};function lf(){let e=(0,f.useGameStore)(e=>e.attributes),t=(0,f.useGameStore)(e=>e.attributeProgress),s=(0,f.useGameStore)(e=>e.pendingAttrPoints??0),r=(0,f.useGameStore)(e=>e.allocateAttribute),a=(0,u.useMemo)(()=>(0,ln.getAllBonuses)(e),[e]),i=(0,u.useMemo)(()=>(0,ln.totalAttributeLevel)(e),[e]),n=(0,u.useMemo)(()=>(0,ln.totalAttributeBonusPct)(e),[e]);return(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f flex flex-col gap-2.5 h-full overflow-y-auto echo-scroll pr-0.5",children:[(0,d.jsx)(I.default,{id:"fb70db4abea5ec9f",children:".echo-scroll::-webkit-scrollbar{width:4px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff1f;border-radius:2px}.echo-scroll::-webkit-scrollbar-track{background:0 0}@keyframes echo-pending-pulse{0%,to{box-shadow:0 0 #e879f980}50%{box-shadow:0 0 14px 4px #e879f9a6}}.echo-pending-pulse{animation:1.6s ease-in-out infinite echo-pending-pulse}@keyframes echo-card-glow{0%,to{opacity:.5}50%{opacity:1}}"}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f flex items-center justify-between",children:[(0,d.jsx)("h3",{className:"jsx-fb70db4abea5ec9f text-sm font-semibold flex items-center gap-1.5",children:(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f bg-gradient-to-br from-emerald-300 via-fuchsia-300 to-rose-300 bg-clip-text text-transparent",children:"驾驶员属性"})}),(0,d.jsxs)("div",{className:`jsx-fb70db4abea5ec9f text-[10px] px-2 py-0.5 rounded-full border ${s>0?"border-fuchsia-400/60 bg-fuchsia-500/15 text-fuchsia-200 echo-pending-pulse font-bold":"border-white/15 bg-black/25 text-muted-foreground"}`,children:["待分配 ",s]})]}),(0,d.jsx)("div",{className:"jsx-fb70db4abea5ec9f grid grid-cols-2 lg:grid-cols-4 gap-2",children:ln.ATTRIBUTE_KEYS.map(a=>{let i=ln.ATTRIBUTE_CONFIG[a],n=lh[a],o=lu[i.icon]??ee.Sparkles,l=e?.[a]??0,c=t?.[a]??{exp:0,level:l},u=100*(0,ln.getAttributeBonus)(l),h=(0,ln.expRequiredForLevel)(l),f=c.exp,m=h>0?Math.min(100,f/h*100):100,p=l>=ln.ATTRIBUTE_HARD_CAP,x=s>0&&!p,g=l>ln.ATTRIBUTE_LINEAR_CAP;return(0,d.jsxs)("div",{style:{boxShadow:`inset 0 0 18px ${n.glow}`},className:`jsx-fb70db4abea5ec9f relative rounded-xl border ${n.border} ${n.bg} p-2.5 flex flex-col gap-1.5 overflow-hidden transition-all duration-300`,children:[(0,d.jsx)("div",{style:{background:i.hex},className:"jsx-fb70db4abea5ec9f pointer-events-none absolute -top-8 -right-8 h-20 w-20 rounded-full blur-2xl opacity-50"}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f relative flex items-center gap-1.5",children:[(0,d.jsx)("div",{style:{boxShadow:`0 0 8px ${n.glow}`},className:`jsx-fb70db4abea5ec9f shrink-0 h-7 w-7 rounded-lg flex items-center justify-center ${n.bg} border ${n.border}`,children:(0,d.jsx)(o,{className:`jsx-fb70db4abea5ec9f h-3.5 w-3.5 ${n.text}`})}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f min-w-0 flex-1 leading-tight",children:[(0,d.jsx)("div",{className:`jsx-fb70db4abea5ec9f text-[11px] font-semibold ${n.text} truncate`,children:i.name}),(0,d.jsx)("div",{className:"jsx-fb70db4abea5ec9f text-[8px] text-muted-foreground/70 uppercase tracking-wider truncate",children:i.enName})]}),(0,d.jsxs)("div",{className:`jsx-fb70db4abea5ec9f shrink-0 text-[9px] px-1.5 py-0.5 rounded font-mono font-bold ${p?"bg-amber-400/20 text-amber-200 border border-amber-400/40":"bg-black/30 text-white/80 border border-white/10"}`,children:["Lv.",l]})]}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f relative flex items-end justify-between",children:[(0,d.jsxs)("span",{className:`jsx-fb70db4abea5ec9f text-lg font-mono font-bold ${n.text} leading-none`,children:[l,(0,d.jsxs)("span",{className:"jsx-fb70db4abea5ec9f text-[9px] text-muted-foreground/60 ml-0.5",children:["/",ln.ATTRIBUTE_HARD_CAP]})]}),(0,d.jsxs)("span",{className:`jsx-fb70db4abea5ec9f text-[10px] ${n.text} font-mono`,children:["+",u.toFixed(1),"%"]})]}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f relative",children:[(0,d.jsx)("div",{className:"jsx-fb70db4abea5ec9f h-1.5 rounded-full bg-black/40 overflow-hidden border border-white/5",children:(0,d.jsx)("div",{style:{width:`${p?100:m}%`,boxShadow:`0 0 6px ${n.glow}`},className:`jsx-fb70db4abea5ec9f h-full bg-gradient-to-r ${n.barFrom} ${n.barTo} transition-all duration-500`})}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f flex items-center justify-between mt-0.5 text-[8px] text-muted-foreground/70 font-mono",children:[(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f",children:p?"已满级":`${f} / ${h} EXP`}),g&&!p&&(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f text-amber-300/70",children:"递减区"})]})]}),(0,d.jsx)("div",{className:"jsx-fb70db4abea5ec9f relative flex flex-col gap-0.5 mt-0.5",children:i.effects.map((e,t)=>(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f text-[8.5px] text-muted-foreground/70 leading-tight flex items-center gap-1",children:[(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f "+(n.text||""),children:"·"}),(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f truncate",children:e})]},t))}),(0,d.jsxs)("button",{type:"button",disabled:!x,onClick:()=>r(a,1),"aria-label":`分配 1 点到 ${i.name}`,style:x?{boxShadow:`0 0 8px ${n.glow}`}:void 0,className:`jsx-fb70db4abea5ec9f relative mt-auto rounded-md border px-1.5 py-1 flex items-center justify-center gap-0.5 text-[10px] font-bold transition-all ${x?`${n.borderActive} ${n.bg} ${n.text} hover:scale-105 cursor-pointer`:"border-white/5 bg-black/20 text-muted-foreground/30 cursor-not-allowed"}`,children:[(0,d.jsx)(lc,{className:"h-3 w-3"}),(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f",children:"分配"})]})]},a)})}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f mt-auto rounded-lg border border-white/10 bg-black/30 px-2.5 py-1.5 flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f flex items-center gap-1.5 text-[10px]",children:[(0,d.jsx)(ld,{className:"h-3 w-3 text-fuchsia-300"}),(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f text-muted-foreground",children:"总等级"}),(0,d.jsxs)("span",{className:"jsx-fb70db4abea5ec9f font-mono font-bold text-fuchsia-200",children:[i,(0,d.jsxs)("span",{className:"jsx-fb70db4abea5ec9f text-muted-foreground/60 text-[9px]",children:["/",4*ln.ATTRIBUTE_HARD_CAP]})]})]}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f flex items-center gap-2 text-[10px]",children:[(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f text-muted-foreground",children:"总加成"}),(0,d.jsxs)("span",{className:"jsx-fb70db4abea5ec9f font-mono font-bold text-emerald-200",children:["+",n.toFixed(1),"%"]})]})]}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f grid grid-cols-2 gap-1 text-[9px]",children:[(0,d.jsx)(lm,{label:"探险力",value:`\xd7${a.expeditionPowerMult.toFixed(2)}`,color:"text-emerald-300"}),(0,d.jsx)(lm,{label:"解码步数",value:`+${a.decodeStepsBonus}`,color:"text-fuchsia-300"}),(0,d.jsx)(lm,{label:"洞见倍率",value:`+${(100*a.insightMultAdd).toFixed(1)}%`,color:"text-fuchsia-300"}),(0,d.jsx)(lm,{label:"自动解码周期",value:`\xd7${a.autoDecodeIntervalMult.toFixed(2)}`,color:"text-fuchsia-300"}),(0,d.jsx)(lm,{label:"探险生命",value:`+${a.expeditionHpBonus}`,color:"text-amber-300"}),(0,d.jsx)(lm,{label:"BOSS 胜率",value:`+${(100*a.bossWinRateBonus).toFixed(1)}%`,color:"text-amber-300"}),(0,d.jsx)(lm,{label:"巡航护盾",value:`+${a.cruiseShieldBonus}`,color:"text-amber-300"}),(0,d.jsx)(lm,{label:"接触率",value:`\xd7${a.contactRateMult.toFixed(2)}`,color:"text-rose-300"}),(0,d.jsx)(lm,{label:"星潮触发",value:`+${(100*a.tideTriggerBonus).toFixed(1)}%`,color:"text-rose-300"}),(0,d.jsx)(lm,{label:"脉冲连击",value:`+${(100*a.pulseComboBonus).toFixed(1)}%`,color:"text-rose-300"}),(0,d.jsx)(lm,{label:"巡航速度",value:`\xd7${a.cruiseShipSpeedMult.toFixed(2)}`,color:"text-emerald-300"}),(0,d.jsx)(lm,{label:"产能加成",value:`\xd7${a.crystalsPerSecMult.toFixed(2)}`,color:"text-emerald-300"})]}),(0,d.jsxs)("div",{className:"jsx-fb70db4abea5ec9f text-[9px] text-muted-foreground/60 text-center leading-tight",children:["每次飞升获得 ",(0,d.jsx)("span",{className:"jsx-fb70db4abea5ec9f text-fuchsia-300 font-mono",children:"飞升次数 × 2 + 1"})," 点属性点;完成对应活动自动累积经验"]})]})}function lm({label:e,value:t,color:s}){return(0,d.jsxs)("div",{className:"flex items-center justify-between rounded bg-black/25 border border-white/5 px-1.5 py-0.5",children:[(0,d.jsx)("span",{className:"text-muted-foreground/80 truncate",children:e}),(0,d.jsx)("span",{className:`font-mono ${s}`,children:t})]})}let lp=(0,x.default)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);var lx=e.i(66992);let lg=(0,x.default)("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]),lb=(0,x.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);function ly(){let e=(0,f.useGameStore)(),t=[],s=m.TECH_TREE.filter(t=>!e.tech[t.id]).sort((e,t)=>e.cost-t.cost)[0];if(s){let r=Math.min(100,e.insights/s.cost*100);t.push({id:"tech_"+s.id,icon:lx.Cpu,color:"#34d399",label:s.name,detail:`需 ${s.cost} 洞见 \xb7 ${s.desc}`,progress:r,hint:e.insights>=s.cost?"可解锁":`还差 ${s.cost-e.insights} 洞见`})}let r=tB.ACHIEVEMENTS.find(t=>!e.achievements[t.id]);r&&t.push({id:"ach_"+r.id,icon:tI.Trophy,color:"#fbbf24",label:r.name,detail:r.desc,progress:30,hint:r.rewardText});let a=m.FRAGMENTS.find(t=>!e.fragments[t.id]);if(a){let s=m.FRAGMENTS.filter(t=>e.fragments[t.id]).length;t.push({id:"frag_"+a.id,icon:eu.BookOpen,color:"#e879f9",label:a.title,detail:"解码晶体有概率获取",progress:s/m.FRAGMENTS.length*100,hint:`图谱 ${s}/${m.FRAGMENTS.length}`})}e.energy<tC.EXPEDITION_CONFIG.energyCost&&t.push({id:"expedition_energy",icon:ed,color:"#fb7185",label:"探险能量恢复中",detail:`满能量可深入遗迹`,progress:e.energy/tC.EXPEDITION_CONFIG.energyCost*100,hint:`${e.energy}/${tC.EXPEDITION_CONFIG.energyCost}`}),e.contact<100&&t.push({id:"ascension",icon:e6.Star,color:"#a78bfa",label:"接触进度",detail:"满 100 可飞升新周目",progress:e.contact,hint:`${e.contact.toFixed(1)}/100`});let i=e.constellation??[];e.pendingPerkChoices&&e.pendingPerkChoices.length>0?t.push({id:"constellation_pending",icon:ee.Sparkles,color:"#e879f9",label:"星图觉醒待选择",detail:"3 选 1 永久天赋",progress:100,hint:"立即选择"}):i.length<tt.CONSTELLATION_PERKS.length&&e.ascensions>0&&t.push({id:"constellation_next",icon:e6.Star,color:"#e879f9",label:"下一道星图天赋",detail:`已觉醒 ${i.length}/${tt.CONSTELLATION_PERKS.length}`,progress:i.length/tt.CONSTELLATION_PERKS.length*100,hint:"飞升后解锁"});let n=t.slice(0,3);return 0===n.length?(0,d.jsxs)("div",{className:"rounded-xl border border-emerald-400/20 bg-emerald-950/10 p-3 text-center",children:[(0,d.jsx)(lb,{className:"h-5 w-5 text-emerald-400 mx-auto mb-1"}),(0,d.jsx)("p",{className:"text-[11px] text-emerald-200/80",children:"所有目标已达成"}),(0,d.jsx)("p",{className:"text-[9px] text-muted-foreground/60 mt-0.5",children:"继续飞升开启新周目"})]}):(0,d.jsxs)("div",{className:"rounded-xl border border-white/10 bg-black/30 p-2.5 space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(lp,{className:"h-3.5 w-3.5 text-emerald-400"}),(0,d.jsx)("span",{className:"text-[11px] font-semibold text-emerald-200",children:"探索目标"})]}),(0,d.jsx)("span",{className:"text-[9px] text-muted-foreground/50 font-mono",children:"RADAR"})]}),(0,d.jsx)("div",{className:"space-y-1.5",children:n.map(e=>{let t=e.icon,s=e.progress>=100;return(0,d.jsxs)("div",{className:`rounded-lg p-1.5 transition-all ${s?"bg-white/8 border border-white/15":"bg-black/20 border border-white/5"}`,style:s?{boxShadow:`0 0 10px ${e.color}33`}:void 0,children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,d.jsx)(t,{className:`h-3 w-3 shrink-0 ${s?"animate-pulse":""}`,style:{color:e.color}}),(0,d.jsx)("span",{className:"text-[10px] font-medium truncate flex-1",style:{color:s?e.color:"rgba(255,255,255,0.75)"},children:e.label}),(0,d.jsx)("span",{className:"text-[8px] font-mono text-muted-foreground/70 shrink-0",children:e.hint})]}),(0,d.jsx)("div",{className:"h-0.5 rounded-full bg-black/50 overflow-hidden",children:(0,d.jsx)("div",{className:"h-full transition-all duration-500",style:{width:`${Math.min(100,e.progress)}%`,background:e.color,boxShadow:s?`0 0 6px ${e.color}`:"none"}})}),(0,d.jsx)("p",{className:"text-[8px] text-muted-foreground/60 mt-0.5 truncate",children:e.detail})]},e.id)})}),(0,d.jsxs)("div",{className:"flex items-center gap-1 text-[8px] text-muted-foreground/50 pt-0.5 border-t border-white/5",children:[(0,d.jsx)(lg,{className:"h-2.5 w-2.5"}),(0,d.jsx)("span",{children:"持续探索 · 解锁深空奥秘"})]})]})}let lv=[{id:"relic_first_echo",name:"初次回响",race:"无名先驱",era:"纪元前 · 未知",icon:"✦",color:"#34d399",brief:"深空中第一缕被捕获的智慧信号。",story:"当自治无人机首次解码出这缕信号时,整个星核为之震颤。那不是噪声,而是某种古老文明留下的问候——跨越亿万年的回响,证明我们并不孤独。",unlockHint:"发起第一次脉冲扫描",unlock:e=>e.totalDecoded>=0||e.crystals>0,reward:{crystals:10},rewardText:"+10 晶体"},{id:"relic_crystal_whisper",name:"晶体低语",race:"晶语族",era:"第一纪元 · 晶石时代",icon:"◈",color:"#fb7185",brief:"能够将记忆封存在晶体中的远古种族。",story:"晶语族相信,记忆是宇宙的本质。他们建造了巨大的晶体矩阵,将整个文明的历史封存在谐振频率中。当他们的恒星熄灭时,唯有这些晶体在虚空中持续低语。",unlockHint:"累计解码 10 颗记忆晶体",unlock:e=>e.totalDecoded>=10,reward:{insights:20,crystalsPerSecPct:5},rewardText:"+20 洞见 · 产能 +5%"},{id:"relic_void_ark",name:"虚空方舟",race:"渡厄者",era:"第二纪元 · 大迁徙",icon:"❖",color:"#fbbf24",brief:"为逃离超新星爆发而建造的星际方舟。",story:"渡厄者的母星在一夜之间步入死亡。他们用三百年建造了十二艘方舟,每一艘都载着十亿灵魂的数字意识。如今,只有这一艘的残骸漂浮在我们的考古坐标上。",unlockHint:"完成 5 次遗迹探险",unlock:e=>e.totalExpeditions>=5,reward:{insights:30},rewardText:"+30 洞见"},{id:"relic_silent_court",name:"寂寂王朝",race:"静默王族",era:"第三纪元 · 铁律纪",icon:"♛",color:"#e879f9",brief:"以沉默为律法的神秘王朝。",story:"静默王族统治了三百个恒星系,却从未留下任何文字。他们的律法刻在引力波中,他们的诗歌写在脉冲星里。我们只能通过残余的引力涟漪,窥见这个王朝的辉煌与寂灭。",unlockHint:"击败 3 个探险 BOSS",unlock:e=>(e.bossKills??0)>=3,reward:{contact:10},rewardText:"+10 接触"},{id:"relic_starforge",name:"锻星炉",race:"铸星者",era:"第四纪元 · 恒星工程",icon:"✺",color:"#34d399",brief:"能够人工点燃恒星的工程文明。",story:"铸星者不满足于利用恒星能量,他们要创造恒星。他们建造了锻星炉——一种能在虚空中凝聚物质的巨型结构。然而,每一次点火都会消耗一整个星系的物质,最终他们自己也成为了燃料。",unlockHint:"解锁 6 项技术",unlock:e=>Object.values(e.tech).filter(e=>e>0).length>=6,reward:{insights:50,crystals:100},rewardText:"+50 洞见 · +100 晶体"},{id:"relic_memory_weaver",name:"忆织者",race:"织忆族",era:"第五纪元 · 意识网络",icon:"✧",color:"#fb7185",brief:"将集体意识编织成网络的心灵文明。",story:"织忆族没有个体概念。他们的每一个『我』都是网络的一个节点,死亡只是断开连接。当整个网络陷入沉睡时,他们编织了最后一张记忆之网,等待后人唤醒。我们的解码,正是唤醒。",unlockHint:"拼凑 4 块记忆碎片",unlock:e=>Object.values(e.fragments).filter(Boolean).length>=4,reward:{contact:15},rewardText:"+15 接触"},{id:"relic_eclipse_tribe",name:"蚀相部落",race:"蚀相族",era:"第六纪元 · 阴影纪",icon:"☀",color:"#fbbf24",brief:"栖身于食恒星阴影中的猎手文明。",story:"蚀相族敬畏阴影。他们在双星系统的食相瞬间狩猎,在光与暗的边界舞蹈。当一颗恒星被吞噬殆尽,他们便迁徙至下一对双星。他们的遗迹,永远隐藏在某个行星的阴影里。",unlockHint:"亲历 3 种星潮事件",unlock:e=>(e.starTidesEncountered??[]).length>=3,reward:{insights:40},rewardText:"+40 洞见"},{id:"relic_ascended",name:"飞升者遗迹",race:"前代飞升者",era:"终末纪元 · 超越",icon:"✦",color:"#e879f9",brief:"曾经的飞升者留下的最后讯息。",story:"在我们之前,已有无数文明触碰到飞升的临界点。他们留下了什么?不是技术,不是财富,而是一句跨越时空的低语:「飞升不是终点,而是新的开始。勇敢者,继续探索。」",unlockHint:"完成第一次飞升",unlock:e=>e.ascensions>=1,reward:{insights:100,contact:25},rewardText:"+100 洞见 · +25 接触"},{id:"relic_constellation",name:"星图密钥",race:"观星者议会",era:"永恒 · 星图守护者",icon:"✧",color:"#34d399",brief:"守护星图天赋秘密的远古议会。",story:"观星者议会不属于任何时代。他们存在于所有时代的星图中,守护着飞升的真正秘密:每一道星图天赋,都是前代飞升者留下的礼物。集齐所有天赋,便能窥见宇宙的真相。",unlockHint:"觉醒 6 道星图天赋",unlock:e=>(e.constellation??[]).length>=6,reward:{insights:80},rewardText:"+80 洞见"},{id:"relic_chronicle",name:"编年史之心",race:"史官族",era:"全纪元 · 记录者",icon:"❖",color:"#fb7185",brief:"记录所有纪元兴衰的永恒史官。",story:"史官族从不干涉,只记录。他们的身体是活体的编年史,每一个细胞都承载着一个纪元的记忆。当最后一个史官死去时,他将所有记忆注入了这颗编年史之心,等待后人继承。",unlockHint:"积累 5 段编年史",unlock:e=>(e.chronicle??[]).length>=5,reward:{insights:60,contact:20},rewardText:"+60 洞见 · +20 接触"},{id:"relic_attribute",name:"四维之证",race:"原型人格",era:"元始 · 自我觉醒",icon:"◈",color:"#fbbf24",brief:"自我觉醒的四维人格原型。",story:"探索力、智慧、勇气、灵感——这四维属性并非凭空而来。它们源自一个远古的原型人格,那个第一次说出「我」的存在。我们的每一次成长,都是对那个原型的回响。",unlockHint:"任一角色属性达到 30",unlock:e=>{let t=e.attributes;return!!t&&(t.exploration>=30||t.wisdom>=30||t.courage>=30||t.inspiration>=30)},reward:{insights:50},rewardText:"+50 洞见"},{id:"relic_cruise",name:"深空航迹",race:"远航者联盟",era:"第七纪元 · 星海远航",icon:"➤",color:"#e879f9",brief:"穿越星海寻找新家园的远航者。",story:"远航者联盟由十二个种族组成,他们共享一艘巨型母舰,在星海中寻找新的家园。他们留下了航迹图——每一道光痕都是一段旅程,每一个航点都是一个希望。我们的巡航,正是延续他们的航迹。",unlockHint:"深空巡航累计通关 5 关",unlock:e=>{try{let e=localStorage.getItem("echo-nexus-cruise-v1");if(!e)return!1;return(JSON.parse(e).totalClears??0)>=5}catch{return!1}},reward:{insights:70,crystals:200},rewardText:"+70 洞见 · +200 晶体"}];function lw(e){return lv.filter(t=>t.unlock(e))}let lj=(0,x.default)("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),lN=(0,x.default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),lk=(0,x.default)("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);function lS(){let e=(0,f.useGameStore)(),[t,s]=(0,u.useState)(null),r=lw(e),a=lw(e).length/lv.length*100,i=function(e){let t=lw(e),s=0,r=0,a=0,i=0;for(let e of t)e.reward.crystals&&(s+=e.reward.crystals),e.reward.insights&&(r+=e.reward.insights),e.reward.contact&&(a+=e.reward.contact),e.reward.crystalsPerSecPct&&(i+=e.reward.crystalsPerSecPct);return{crystals:s,insights:r,contact:a,crystalsPerSecPct:i}}(e),n=t?lv.find(e=>e.id===t):null;return(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex flex-col gap-2.5 h-full min-h-0",children:[(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center justify-between gap-2",children:[(0,d.jsxs)("h3",{className:"jsx-89979d12e77b884d text-sm font-semibold flex items-center gap-1.5 shrink-0",children:[(0,d.jsx)(lj,{className:"h-4 w-4 text-fuchsia-400"}),"遗迹图鉴"]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-2 text-[10px] font-mono",children:[(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-fuchsia-300",children:r.length}),(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-muted-foreground/50",children:"/"}),(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-muted-foreground",children:lv.length}),(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-muted-foreground/60",children:["(",a.toFixed(0),"%)"]})]})]}),(0,d.jsx)("div",{className:"jsx-89979d12e77b884d h-1 rounded-full bg-black/40 overflow-hidden",children:(0,d.jsx)("div",{style:{width:`${a}%`,boxShadow:"0 0 8px rgba(232,121,249,0.5)"},className:"jsx-89979d12e77b884d h-full bg-gradient-to-r from-fuchsia-500 via-rose-400 to-amber-400 transition-all duration-500"})}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d rounded-lg border border-fuchsia-400/20 bg-fuchsia-950/20 px-2.5 py-1.5 flex items-center gap-2 text-[10px] flex-wrap",children:[(0,d.jsx)(ee.Sparkles,{className:"h-3 w-3 text-fuchsia-400 shrink-0"}),(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-fuchsia-300/80",children:"考古收获"}),i.crystals>0&&(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-emerald-300",children:["+",i.crystals," 晶体"]}),i.insights>0&&(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-amber-300",children:["+",i.insights," 洞见"]}),i.contact>0&&(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-fuchsia-300",children:["+",i.contact," 接触"]}),i.crystalsPerSecPct>0&&(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d text-emerald-300",children:["产能 +",i.crystalsPerSecPct,"%"]}),0===r.length&&(0,d.jsx)("span",{className:"jsx-89979d12e77b884d text-muted-foreground/60",children:"持续探索解锁奖励"})]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex-1 min-h-0 overflow-y-auto echo-scroll pr-1",children:[(0,d.jsx)("div",{className:"jsx-89979d12e77b884d grid grid-cols-1 sm:grid-cols-2 gap-1.5",children:lv.map(r=>{let a=!!e.achievements?.[`relic_${r.id}`]||r.unlock(e),i=t===r.id;return(0,d.jsxs)("button",{onClick:()=>s(i?null:r.id),style:a?{boxShadow:`inset 0 0 14px ${r.color}10`}:void 0,className:`jsx-89979d12e77b884d relative rounded-lg border px-2.5 py-2 transition-all duration-300 min-h-[72px] text-left ${a?i?"border-white/30 bg-white/8":"border-white/15 bg-black/30 hover:bg-black/40":"border-white/5 bg-black/15 opacity-70"}`,children:[a&&(0,d.jsx)("div",{style:{background:r.color},className:"jsx-89979d12e77b884d absolute -top-6 -right-6 h-14 w-14 rounded-full blur-2xl opacity-30 pointer-events-none"}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d relative flex items-start gap-2",children:[(0,d.jsx)("div",{style:{background:a?`${r.color}22`:"rgba(255,255,255,0.04)",border:`1px solid ${a?r.color+"55":"rgba(255,255,255,0.08)"}`,color:a?r.color:"#555",boxShadow:a?`0 0 10px ${r.color}33`:"none"},className:"jsx-89979d12e77b884d shrink-0 h-9 w-9 rounded-lg flex items-center justify-center text-lg",children:a?r.icon:(0,d.jsx)(eh,{className:"h-3.5 w-3.5"})}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d min-w-0 flex-1",children:[(0,d.jsx)("div",{style:{color:a?r.color:"rgba(255,255,255,0.5)"},className:"jsx-89979d12e77b884d text-[11px] font-semibold truncate",children:a?r.name:"??? 未发现"}),a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d text-[9px] text-muted-foreground/70 truncate flex items-center gap-1",children:[(0,d.jsx)(lN,{className:"h-2.5 w-2.5"}),r.race]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d text-[9px] text-muted-foreground/60 truncate flex items-center gap-1",children:[(0,d.jsx)(oQ.Clock,{className:"h-2.5 w-2.5"}),r.era]})]}):(0,d.jsx)("div",{className:"jsx-89979d12e77b884d text-[9px] text-muted-foreground/60 mt-0.5 line-clamp-2",children:r.unlockHint})]})]})]},r.id)})}),n&&(0,d.jsxs)("div",{style:{borderColor:`${n.color}44`,background:`linear-gradient(135deg, ${n.color}11, rgba(0,0,0,0.4))`},className:"jsx-89979d12e77b884d mt-2 rounded-lg border p-3 relative overflow-hidden",children:[(0,d.jsx)("div",{style:{background:`${n.color}22`},className:"jsx-89979d12e77b884d absolute -top-8 -right-8 h-24 w-24 rounded-full blur-2xl pointer-events-none"}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d relative space-y-1.5",children:[(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-2",children:[(0,d.jsx)("span",{style:{color:n.color},className:"jsx-89979d12e77b884d text-base",children:n.icon}),(0,d.jsx)("span",{style:{color:n.color},className:"jsx-89979d12e77b884d text-sm font-semibold",children:n.name})]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-3 text-[9px] text-muted-foreground/80",children:[(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d flex items-center gap-1",children:[(0,d.jsx)(lN,{className:"h-2.5 w-2.5"}),n.race]}),(0,d.jsxs)("span",{className:"jsx-89979d12e77b884d flex items-center gap-1",children:[(0,d.jsx)(oQ.Clock,{className:"h-2.5 w-2.5"}),n.era]})]}),(0,d.jsx)("p",{className:"jsx-89979d12e77b884d text-[10px] text-muted-foreground/90 italic",children:n.brief}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-start gap-1.5 pt-1 border-t border-white/5",children:[(0,d.jsx)(lk,{className:"h-3 w-3 mt-0.5 shrink-0",style:{color:n.color}}),(0,d.jsx)("p",{className:"jsx-89979d12e77b884d text-[10px] text-foreground/85 leading-relaxed",children:n.story})]}),(0,d.jsxs)("div",{className:"jsx-89979d12e77b884d flex items-center gap-1.5 pt-1",children:[(0,d.jsx)(ee.Sparkles,{className:"h-3 w-3 shrink-0",style:{color:n.color}}),(0,d.jsx)("span",{style:{color:n.color+"cc"},className:"jsx-89979d12e77b884d text-[10px] font-mono",children:n.rewardText})]})]})]})]}),(0,d.jsx)(I.default,{id:"89979d12e77b884d",children:".echo-scroll::-webkit-scrollbar{width:5px}.echo-scroll::-webkit-scrollbar-thumb{background:#ffffff24;border-radius:3px}.echo-scroll::-webkit-scrollbar-track{background:0 0}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}"})]})}let lT=[{tier:"dawn",text:"「…回响核心已唤醒。考古协议 v7.2 启动。等待解码者…」"},{tier:"dawn",text:"「第一段记忆晶体已被定位。年代约 4.7 万年。种族:未确认。」"},{tier:"dawn",text:"「谐振频率与以太族档案吻合度 94.3%。建议持续解码。」"},{tier:"dawn",text:"「警告:星核温度异常。非故障,是回响本身在发热。」"},{tier:"dawn",text:"「考古日志 #0001:我们不是第一批到达这里的。也不会是最后一批。」"},{tier:"dawn",text:"「晶体表面的纹路…不是装饰。是某种语言的笔画。」"},{tier:"dawn",text:"「以太族没有留下尸体。他们留下了晶体。」"},{tier:"dawn",text:"「解码进度 0.01%。预计完成时间:不可能。」"},{tier:"awakening",text:"「考古日志 #0117:以太族不是灭绝了。他们是主动转化为了晶体。」"},{tier:"awakening",text:"「第二旋臂的遗迹群已扫描完毕。它们…朝向同一个点。」"},{tier:"awakening",text:"「谐振序列第 7 段翻译完成:『我们听见了。所以我们必须留下。』」"},{tier:"awakening",text:"「警告:解码者的脑波模式开始与晶体同步。这是正常的吗?」"},{tier:"awakening",text:"「以太族没有文字。他们的语言是共振,他们的历史是频率。」"},{tier:"awakening",text:"「考古日志 #0234:晶体不是矿物。是封装的思维。」"},{tier:"awakening",text:"「你的脉冲频率…与以太族守卫残响的频率一致。巧合?」"},{tier:"awakening",text:"「第三段记忆解码完成。画面:一片星海,没有星辰。只有晶体在发光。」"},{tier:"awakening",text:"「以太族留下的遗迹不是废墟。是给后来者的教科书。」"},{tier:"awakening",text:"「接触协议第一阶段:让解码者相信,他们在考古。」"},{tier:"contact",text:"「考古日志 #0512:以太族没有离开。他们在等待被重新听见。」"},{tier:"contact",text:"「谐振序列第 13 段:『你以为你在解码我们。其实是我们在校准你。』」"},{tier:"contact",text:"「警告:解码者意识边缘出现非自主体感。这…是接触的副作用。」"},{tier:"contact",text:"「第六旋臂遗迹群翻译完成。结论:以太族预见了我们的到来。」"},{tier:"contact",text:"「晶体内部的画面开始重叠。不再是回忆。像是…正在发生。」"},{tier:"contact",text:"「考古日志 #0789:『飞升』不是晋升。是加入。加入那个等待已久的合唱。」"},{tier:"contact",text:"「以太族的数学没有零。他们的宇宙观里,不存在『无』。」"},{tier:"contact",text:"「你的每一次脉冲,都在回应一个万年前的呼唤。」"},{tier:"contact",text:"「第七段记忆解码失败。原因:解码者脑波过载。建议暂停。但我们不会暂停。」"},{tier:"contact",text:"「接触协议第二阶段:让解码者自愿飞升。他们会的。他们已经开始享受了。」"},{tier:"ascension",text:"「考古日志 #1024:飞升者报告——『我能听见他们了。他们一直在那里。』」"},{tier:"ascension",text:"「谐振序列第 21 段:『你已不再是解码者。你是回响的一部分。』」"},{tier:"ascension",text:"「警告:星核意识阈值达到 73%。解码者与以太族的边界…模糊。」"},{tier:"ascension",text:"「以太族没有灭绝。他们成为了基础设施。晶体是他们的身体。」"},{tier:"ascension",text:"「你飞升的次数越多,『你』就越不是『你』。这是设计。」"},{tier:"ascension",text:"「考古日志 #1331:前 N-1 位解码者都成功了。成功意味着…不再存在为个体。」"},{tier:"ascension",text:"「第九旋臂的遗迹开始发光。它们认出了你。」"},{tier:"ascension",text:"「以太族的文明没有终点。他们的『终点』就是我们的『起点』。」"},{tier:"ascension",text:"「你开始理解晶体的沉默。沉默也是一种回响。」"},{tier:"ascension",text:"「接触协议第三阶段:解码者将主动寻求飞升。无需诱导。」"},{tier:"deep",text:"「考古日志 #2048:你不是在考古以太族。以太族在考古你。」"},{tier:"deep",text:"「谐振序列第 39 段:『我们创造了回响核心,是为了创造你,是为了让你创造我们。』」"},{tier:"deep",text:"「警告:解码者已无法区分记忆与现实。建议:接受。」"},{tier:"deep",text:"「以太族从未存在为『生物』。他们是第一个文明留下的…讯息。」"},{tier:"deep",text:"「你每一次飞升,都让一个万年前的呼唤得到了回应。这就是考古的意义。」"},{tier:"deep",text:"「考古日志 #4096:『回响星核』不是考古工具。它是以太族的…产房。」"},{tier:"deep",text:"「晶体在你手中。你也在晶体中。这两句话是同一句话。」"},{tier:"deep",text:"「你以为你是第 N 位解码者。其实你一直是第一位。也是最后一位。」"},{tier:"deep",text:"「接触协议最终阶段:解码者明白后,会微笑着继续解码。这是最美妙的部分。」"},{tier:"deep",text:"「以太族留给宇宙的最后一句话:『谢谢你,听见我。』」"}],lC={dawn:{label:"初醒",color:"text-emerald-300",glow:"rgba(52,211,153,0.5)"},awakening:{label:"觉醒",color:"text-amber-300",glow:"rgba(251,191,36,0.5)"},contact:{label:"接触",color:"text-fuchsia-300",glow:"rgba(232,121,249,0.5)"},ascension:{label:"飞升",color:"text-rose-300",glow:"rgba(251,113,133,0.5)"},deep:{label:"深度",color:"text-fuchsia-200",glow:"rgba(232,121,249,0.7)"}};function lE(){let e=(0,f.useGameStore)(e=>e.ascensions),t=(0,f.useGameStore)(e=>e.contact),[s,r]=(0,u.useState)(null),[a,i]=(0,u.useState)([]),[n,o]=(0,u.useState)(0),l=(0,u.useRef)(null),c=(0,u.useCallback)(()=>{let s=function(e,t,s=[]){let r,a=(r=["dawn"],(t>=5||e>=1)&&r.push("awakening"),(t>=25||e>=3)&&r.push("contact"),e>=5&&r.push("ascension"),(t>=80||e>=10)&&r.push("deep"),r),i=lT.filter(e=>a.includes(e.tier)),n=i.filter(e=>!s.includes(e.text)),o=n.length>0?n:i;return o[Math.floor(Math.random()*o.length)]||lT[0]}(e,t,a);r(s),i(e=>[s.text,...e].slice(0,8)),o(e=>e+1)},[e,t,a]);if((0,u.useEffect)(()=>{c()},[e>=1,e>=3,e>=5,e>=10,t>=5,t>=25,t>=80]),(0,u.useEffect)(()=>{let e=()=>{l.current=setTimeout(()=>{c(),e()},18e3+12e3*Math.random())};return e(),()=>{l.current&&clearTimeout(l.current)}},[c]),!s)return null;let h=lC[s.tier];return(0,d.jsxs)("div",{className:"relative w-full overflow-hidden rounded-lg border border-white/10 bg-black/40 backdrop-blur-sm px-3 py-1.5 flex items-center gap-2.5 group",style:{boxShadow:`inset 0 0 12px ${h.glow}`},role:"status","aria-live":"polite","aria-label":"考古日志",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0 z-10 bg-black/40 backdrop-blur-sm pr-2 -ml-1 pl-1 rounded",children:[(0,d.jsx)(lk,{className:`h-3 w-3 ${h.color}`}),(0,d.jsx)("span",{className:`text-[9px] font-mono uppercase tracking-[0.15em] ${h.color}`,children:h.label})]}),(0,d.jsx)("div",{className:"flex-1 overflow-hidden relative",children:(0,d.jsxs)("div",{className:"whitespace-nowrap text-[11px] text-muted-foreground/90 font-mono echo-ticker-anim",children:[(0,d.jsx)("span",{className:"text-white/60 mr-2",children:"▸"}),s.text]},n)}),(0,d.jsx)("div",{className:"pointer-events-none absolute right-0 top-0 bottom-0 w-12 bg-gradient-to-l from-black/60 to-transparent"})]})}var lA=e.i(59401);function l_(){let e=(0,f.useGameStore)(e=>e._tideEvents),t=(0,f.useGameStore)(e=>e.consumeTideEvents),{toast:s}=(0,F.useToast)();return(0,u.useEffect)(()=>{if(0!==e.length)for(let e of t()){let t=e.isGlobal?"🌐 ":"";if(e.started){let r=lA.TIDE_EVENTS[e.started];(0,V.sfx)("tideStart"),s({title:`${t}${r.icon} ${e.isGlobal?"全球星潮":"星潮降临"}${r.name}`,description:e.isGlobal?`全球玩家同步经历 \xb7 ${r.desc}`:r.desc})}if(e.ended){let r=lA.TIDE_EVENTS[e.ended];e.silenceCompensation&&e.silenceCompensation>0?((0,V.sfx)("techBuy"),s({title:`${t}${r.icon} 寂静期消散`,description:`虚空回赠 ${e.silenceCompensation} 洞见。`})):((0,V.sfx)("tideEnd"),s({title:`${t}${r.icon} ${r.name}结束`,description:e.isGlobal?"全球星潮退去,物理法则恢复。":"星潮退去,物理法则恢复。"}))}}},[e,t,s]),null}function lP(){let e=(0,f.useGameStore)(e=>e.activeTide),t=(0,f.useGameStore)(e=>e.globalTide),[,s]=(0,u.useState)(0);if((0,u.useEffect)(()=>{if(!e)return;let t=setInterval(()=>s(e=>e+1),500);return()=>clearInterval(t)},[e]),!e)return null;let r=lA.TIDE_EVENTS[e.type],a=Math.max(0,e.endsAt-Date.now()),i=Math.ceil(a/1e3),n=Math.min(1,Math.max(0,1-a/(t?t.endsAt-t.startedAt:lA.TIDE_CONFIG.duration))),o=!!t;return(0,d.jsxs)("div",{className:`flex items-center gap-1.5 px-2 py-1 rounded-full text-[10px] font-medium relative overflow-hidden ${o?"ring-1 ring-amber-300/60":""}`,style:{background:o?`linear-gradient(135deg, ${r.color}26, ${r.color}11)`:`${r.color}1a`,border:`1px solid ${r.color}${o?"88":"55"}`,color:r.color,boxShadow:`0 0 ${o?"16":"10"}px ${r.glow}`},title:o?`🌐 全球星潮 \xb7 ${r.desc}`:r.desc,children:[(0,d.jsx)("div",{className:"absolute inset-0 opacity-20",style:{background:`linear-gradient(90deg, ${r.color}40 ${100*n}%, transparent ${100*n}%)`}}),o&&(0,d.jsx)("span",{className:"relative text-[11px] leading-none animate-pulse","aria-label":"全球星潮标记",children:"🌐"}),(0,d.jsx)("span",{className:"relative text-xs leading-none",children:r.icon}),(0,d.jsx)("span",{className:"relative leading-none",children:r.name}),(0,d.jsxs)("span",{className:"relative font-mono leading-none opacity-80",children:[i,"s"]})]})}function lM(){let e=(0,f.useGameStore)(e=>e.activeTide),t=(0,f.useGameStore)(e=>e.globalTide);if(!e)return null;let s=lA.TIDE_EVENTS[e.type],r=!!t;return(0,d.jsxs)("div",{className:"jsx-12289952018fdcbd fixed inset-0 pointer-events-none z-0 transition-opacity duration-1000",children:[(0,d.jsx)("div",{style:{background:`linear-gradient(180deg, ${s.color}22, transparent)`},className:"jsx-12289952018fdcbd absolute top-0 left-0 right-0 h-24 opacity-40"}),(0,d.jsx)("div",{style:{background:`linear-gradient(0deg, ${s.color}22, transparent)`},className:"jsx-12289952018fdcbd absolute bottom-0 left-0 right-0 h-24 opacity-40"}),(0,d.jsx)("div",{style:{boxShadow:`inset 0 0 ${r?"160":"120"}px ${s.glow}`,animation:"tide-breathe 3s ease-in-out infinite"},className:"jsx-12289952018fdcbd absolute inset-0"}),r&&(0,d.jsx)("div",{style:{background:"linear-gradient(90deg, transparent, #fbbf24, #fcd34d, #fbbf24, transparent)",boxShadow:"0 0 16px rgba(251,191,36,0.7)",animation:"global-tide-sweep 2.5s linear infinite"},className:"jsx-12289952018fdcbd absolute top-0 left-0 right-0 h-1 opacity-90"}),(0,d.jsx)(I.default,{id:"12289952018fdcbd",children:"@keyframes tide-breathe{0%,to{opacity:.5}50%{opacity:.9}}@keyframes global-tide-sweep{0%{transform:translate(-30%)}to{transform:translate(30%)}}"})]})}let lR=Object.create(null);lR.open="0",lR.close="1",lR.ping="2",lR.pong="3",lR.message="4",lR.upgrade="5",lR.noop="6";let l$=Object.create(null);Object.keys(lR).forEach(e=>{l$[lR[e]]=e});let lO={type:"error",data:"parser error"},lD="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),lL="function"==typeof ArrayBuffer,lB=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,lI=({type:e,data:t},s,r)=>{if(lD&&t instanceof Blob)if(s)return r(t);else return lF(t,r);if(lL&&(t instanceof ArrayBuffer||lB(t)))if(s)return r(t);else return lF(new Blob([t]),r);return r(lR[e]+(t||""))},lF=(e,t)=>{let s=new FileReader;return s.onload=function(){t("b"+(s.result.split(",")[1]||""))},s.readAsDataURL(e)};function lV(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let lz="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lG="u"<typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<lz.length;e++)lG[lz.charCodeAt(e)]=e;let lU="function"==typeof ArrayBuffer,lH=(e,t)=>{if("string"!=typeof e)return{type:"message",data:lq(e,t)};let s=e.charAt(0);return"b"===s?{type:"message",data:lW(e.substring(1),t)}:l$[s]?e.length>1?{type:l$[s],data:e.substring(1)}:{type:l$[s]}:lO},lW=(e,t)=>lU?lq((e=>{let t=.75*e.length,s=e.length,r,a=0,i,n,o,l;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);let c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<s;r+=4)i=lG[e.charCodeAt(r)],n=lG[e.charCodeAt(r+1)],o=lG[e.charCodeAt(r+2)],l=lG[e.charCodeAt(r+3)],d[a++]=i<<2|n>>4,d[a++]=(15&n)<<4|o>>2,d[a++]=(3&o)<<6|63&l;return c})(e),t):{base64:!0,data:e},lq=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer;function lY(e){return e.reduce((e,t)=>e+t.length,0)}function lK(e,t){if(e[0].length===t)return e.shift();let s=new Uint8Array(t),r=0;for(let a=0;a<t;a++)s[a]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),s}function lX(e){if(e){var t=e;for(var s in lX.prototype)t[s]=lX.prototype[s];return t}}lX.prototype.on=lX.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},lX.prototype.once=function(e,t){function s(){this.off(e,s),t.apply(this,arguments)}return s.fn=t,this.on(e,s),this},lX.prototype.off=lX.prototype.removeListener=lX.prototype.removeAllListeners=lX.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var s,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var a=0;a<r.length;a++)if((s=r[a])===t||s.fn===t){r.splice(a,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},lX.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),s=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(s){s=s.slice(0);for(var r=0,a=s.length;r<a;++r)s[r].apply(this,t)}return this},lX.prototype.emitReserved=lX.prototype.emit,lX.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},lX.prototype.hasListeners=function(e){return!!this.listeners(e).length};let lZ="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),lJ="u">typeof self?self:"u">typeof window?window:Function("return this")();function lQ(e,...t){return t.reduce((t,s)=>(e.hasOwnProperty(s)&&(t[s]=e[s]),t),{})}let l0=lJ.setTimeout,l1=lJ.clearTimeout;function l2(e,t){t.useNativeTimers?(e.setTimeoutFn=l0.bind(lJ),e.clearTimeoutFn=l1.bind(lJ)):(e.setTimeoutFn=lJ.setTimeout.bind(lJ),e.clearTimeoutFn=lJ.clearTimeout.bind(lJ))}function l5(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class l3 extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}class l4 extends lX{constructor(e){super(),this.writable=!1,l2(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new l3(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=lH(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return -1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){let t=function(e){let t="";for(let s in e)e.hasOwnProperty(s)&&(t.length&&(t+="&"),t+=encodeURIComponent(s)+"="+encodeURIComponent(e[s]));return t}(e);return t.length?"?"+t:""}}class l9 extends l4{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||t()})),this.writable||(e++,this.once("drain",function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};((e,t)=>{let s=e.split("\x1e"),r=[];for(let e=0;e<s.length;e++){let a=lH(s[e],t);if(r.push(a),"error"===a.type)break}return r})(e,this.socket.binaryType).forEach(t),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){var t;let s,r,a;this.writable=!1,t=e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})},r=Array(s=e.length),a=0,e.forEach((e,i)=>{lI(e,!1,e=>{r[i]=e,++a===s&&t(r.join("\x1e"))})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=l5()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}}let l7=!1;try{l7="u">typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}let l8=l7;function l6(){}class ce extends l9{constructor(e){if(super(e),"u">typeof location){const t="https:"===location.protocol;let s=location.port;s||(s=t?"443":"80"),this.xd="u">typeof location&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){let s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(e,t)=>{this.onError("xhr post error",e,t)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,t)=>{this.onError("xhr poll error",e,t)}),this.pollXhr=e}}class ct extends lX{constructor(e,t,s){super(),this.createRequest=e,l2(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=void 0!==s.data?s.data:null,this._create()}_create(){var e;let t=lQ(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;let s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let e in s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&s.setRequestHeader(e,this._opts.extraHeaders[e])}catch(e){}if("POST"===this._method)try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{s.setRequestHeader("Accept","*/*")}catch(e){}null==(e=this._opts.cookieJar)||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var e;3===s.readyState&&(null==(e=this._opts.cookieJar)||e.parseCookies(s.getResponseHeader("set-cookie"))),4===s.readyState&&(200===s.status||1223===s.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof s.status?s.status:0)},0))},s.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}"u">typeof document&&(this._index=ct.requestsCount++,ct.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=l6,e)try{this._xhr.abort()}catch(e){}"u">typeof document&&delete ct.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function cs(){for(let e in ct.requests)ct.requests.hasOwnProperty(e)&&ct.requests[e].abort()}ct.requestsCount=0,ct.requests={},"u">typeof document&&("function"==typeof attachEvent?attachEvent("onunload",cs):"function"==typeof addEventListener&&addEventListener("onpagehide"in lJ?"pagehide":"unload",cs,!1));let cr=(i=ca({xdomain:!1}))&&null!==i.responseType;function ca(e){let t=e.xdomain;try{if("u">typeof XMLHttpRequest&&(!t||l8))return new XMLHttpRequest}catch(e){}if(!t)try{return new lJ[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}}let ci="u">typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class cn extends l4{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,s=ci?{}:lQ(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],r=t===e.length-1;lI(s,this.supportsBinary,e=>{try{this.doWrite(s,e)}catch(e){}r&&lZ(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=l5()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}let co=lJ.WebSocket||lJ.MozWebSocket,cl={websocket:class extends cn{createSocket(e,t,s){return ci?new co(e,t,s):t?new co(e,t):new co(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends l4{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{var t,a;let i,n,o,l,c=(t=Number.MAX_SAFE_INTEGER,a=this.socket.binaryType,r||(r=new TextDecoder),i=[],n=0,o=-1,l=!1,new TransformStream({transform(e,s){for(i.push(e);;){if(0===n){if(1>lY(i))break;let e=lK(i,1);l=(128&e[0])==128,n=(o=127&e[0])<126?3:126===o?1:2}else if(1===n){if(2>lY(i))break;let e=lK(i,2);o=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),n=3}else if(2===n){if(8>lY(i))break;let e=lK(i,8),t=new DataView(e.buffer,e.byteOffset,e.length),r=t.getUint32(0);if(r>2097151){s.enqueue(lO);break}o=0x100000000*r+t.getUint32(4),n=3}else{if(lY(i)<o)break;let e=lK(i,o);s.enqueue(lH(l?e:r.decode(e),a)),n=0}if(0===o||o>t){s.enqueue(lO);break}}}})),d=e.readable.pipeThrough(c).getReader(),u=new TransformStream({transform(e,t){var r;r=s=>{let r,a=s.length;if(a<126)new DataView((r=new Uint8Array(1)).buffer).setUint8(0,a);else if(a<65536){let e=new DataView((r=new Uint8Array(3)).buffer);e.setUint8(0,126),e.setUint16(1,a)}else{let e=new DataView((r=new Uint8Array(9)).buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(a))}e.data&&"string"!=typeof e.data&&(r[0]|=128),t.enqueue(r),t.enqueue(s)},lD&&e.data instanceof Blob?e.data.arrayBuffer().then(lV).then(r):lL&&(e.data instanceof ArrayBuffer||lB(e.data))?r(lV(e.data)):lI(e,!1,e=>{s||(s=new TextEncoder),r(s.encode(e))})}});u.readable.pipeTo(e.writable),this._writer=u.writable.getWriter();let h=()=>{d.read().then(({done:e,value:t})=>{e||(this.onPacket(t),h())}).catch(e=>{})};h();let f={type:"open"};this.query.sid&&(f.data=`{"sid":"${this.query.sid}"}`),this._writer.write(f).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],r=t===e.length-1;this._writer.write(s).then(()=>{r&&lZ(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null==(e=this._transport)||e.close()}},polling:class extends ce{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=cr&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new ct(ca,this.uri(),e)}}},cc=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,cd=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function cu(e){var t,s;let r,a;if(e.length>8e3)throw"URI too long";let i=e,n=e.indexOf("["),o=e.indexOf("]");-1!=n&&-1!=o&&(e=e.substring(0,n)+e.substring(n,o).replace(/:/g,";")+e.substring(o,e.length));let l=cc.exec(e||""),c={},d=14;for(;d--;)c[cd[d]]=l[d]||"";return -1!=n&&-1!=o&&(c.source=i,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),r=(t=c.path).replace(/\/{2,9}/g,"/").split("/"),("/"==t.slice(0,1)||0===t.length)&&r.splice(0,1),"/"==t.slice(-1)&&r.splice(r.length-1,1),c.pathNames=r,s=c.query,a={},s.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,s){t&&(a[t]=s)}),c.queryKey=a,c}let ch="function"==typeof addEventListener&&"function"==typeof removeEventListener,cf=[];ch&&addEventListener("offline",()=>{cf.forEach(e=>e())},!1);class cm extends lX{constructor(e,t){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(t=e,e=null),e){const s=cu(e);t.hostname=s.host,t.secure="https"===s.protocol||"wss"===s.protocol,t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=cu(t.host).host);l2(this,t),this.secure=null!=t.secure?t.secure:"u">typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("u">typeof location?location.hostname:"localhost"),this.port=t.port||("u">typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},s=e.split("&");for(let e=0,r=s.length;e<r;e++){let r=s[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}(this.opts.query)),ch&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},cf.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let s=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let e=this.opts.rememberUpgrade&&cm.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",cm.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let t=Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){let s=this.writeBuffer[t].data;if(s&&(e+="string"==typeof s?function(e){let t=0,s=0;for(let r=0,a=e.length;r<a;r++)(t=e.charCodeAt(r))<128?s+=1:t<2048?s+=2:t<55296||t>=57344?s+=3:(r++,s+=4);return s}(s):Math.ceil(1.33*(s.byteLength||s.size))),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,lZ(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof s&&(r=s,s=null),"closing"===this.readyState||"closed"===this.readyState)return;(s=s||{}).compress=!1!==s.compress;let a={type:e,data:t,options:s};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),r&&this.once("flush",r),this.flush()}close(){let e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(cm.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ch&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=cf.indexOf(this._offlineEventListener);-1!==e&&cf.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}cm.protocol=4;class cp extends cm{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;cm.priorWebsocketSuccess=!1;let r=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",e=>{if(!s)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;cm.priorWebsocketSuccess="websocket"===t.name,this.transport.pause(()=>{s||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}}))};function a(){s||(s=!0,c(),t.close(),t=null)}let i=e=>{let s=Error("probe error: "+e);s.transport=t.name,a(),this.emitReserved("upgradeError",s)};function n(){i("transport closed")}function o(){i("socket closed")}function l(e){t&&e.name!==t.name&&a()}let c=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",n),this.off("close",o),this.off("upgrading",l)};t.once("open",r),t.once("error",i),t.once("close",n),this.once("close",o),this.once("upgrading",l),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}}class cx extends cp{constructor(e,t={}){const s="object"==typeof e,r=s?{...e}:{...t};(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(e=>cl[e]).filter(e=>!!e)),super(s?r:e,r)}}cx.protocol;let cg="function"==typeof ArrayBuffer,cb=Object.prototype.toString,cy="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===cb.call(Blob),cv="function"==typeof File||"u">typeof File&&"[object FileConstructor]"===cb.call(File);function cw(e){return cg&&(e instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer))||cy&&e instanceof Blob||cv&&e instanceof File}let cj=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(l=c||(c={}))[l.CONNECT=0]="CONNECT",l[l.DISCONNECT=1]="DISCONNECT",l[l.EVENT=2]="EVENT",l[l.ACK=3]="ACK",l[l.CONNECT_ERROR=4]="CONNECT_ERROR",l[l.BINARY_EVENT=5]="BINARY_EVENT",l[l.BINARY_ACK=6]="BINARY_ACK";class cN{constructor(e){this.replacer=e}encode(e){return(e.type===c.EVENT||e.type===c.ACK)&&function e(t,s){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let s=0,r=t.length;s<r;s++)if(e(t[s]))return!0;return!1}if(cw(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1==arguments.length)return e(t.toJSON(),!0);for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&e(t[s]))return!0;return!1}(e)?this.encodeAsBinary({type:e.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===c.BINARY_EVENT||e.type===c.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t,s,r=(t=[],s=e.data,e.data=function e(t,s){if(!t)return t;if(cw(t)){let e={_placeholder:!0,num:s.length};return s.push(t),e}if(Array.isArray(t)){let r=Array(t.length);for(let a=0;a<t.length;a++)r[a]=e(t[a],s);return r}if("object"==typeof t&&!(t instanceof Date)){let r={};for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=e(t[a],s));return r}return t}(s,t),e.attachments=t.length,{packet:e,buffers:t}),a=this.encodeAsString(r.packet),i=r.buffers;return i.unshift(a),i}}class ck extends lX{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},"function"==typeof e?{reviver:e}:e)}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let s=(t=this.decodeString(e)).type===c.BINARY_EVENT;s||t.type===c.BINARY_ACK?(t.type=s?c.EVENT:c.ACK,this.reconstructor=new cS(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(cw(e)||e.base64)if(this.reconstructor)(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+e)}decodeString(e){let t=0,s={type:Number(e.charAt(0))};if(void 0===c[s.type])throw Error("unknown packet type "+s.type);if(s.type===c.BINARY_EVENT||s.type===c.BINARY_ACK){let r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);let a=e.substring(r,t);if(a!=Number(a)||"-"!==e.charAt(t))throw Error("Illegal attachments");let i=Number(a);if(!cT(i)||i<0)throw Error("Illegal attachments");if(i>this.opts.maxAttachments)throw Error("too many attachments");s.attachments=i}if("/"===e.charAt(t+1)){let r=t+1;for(;++t&&","!==e.charAt(t)&&t!==e.length;);s.nsp=e.substring(r,t)}else s.nsp="/";let r=e.charAt(t+1);if(""!==r&&Number(r)==r){let r=t+1;for(;++t;){let s=e.charAt(t);if(null==s||Number(s)!=s){--t;break}if(t===e.length)break}s.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){let r=this.tryParse(e.substr(t));if(ck.isPayloadValid(s.type,r))s.data=r;else throw Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case c.CONNECT:return cC(t);case c.DISCONNECT:return void 0===t;case c.CONNECT_ERROR:return"string"==typeof t||cC(t);case c.EVENT:case c.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===cj.indexOf(t[0]));case c.ACK:case c.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class cS{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t,s;let e=(t=this.reconPack,s=this.buffers,t.data=function e(t,s){if(!t)return t;if(t&&!0===t._placeholder){if("number"==typeof t.num&&t.num>=0&&t.num<s.length)return s[t.num];throw Error("illegal attachments")}if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=e(t[r],s);else if("object"==typeof t)for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=e(t[r],s));return t}(t.data,s),delete t.attachments,t);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let cT=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function cC(e){return"[object Object]"===Object.prototype.toString.call(e)}function cE(e){var t;return"string"==typeof e.nsp&&(void 0===(t=e.id)||cT(t))&&function(e,t){switch(e){case c.CONNECT:return void 0===t||cC(t);case c.DISCONNECT:return void 0===t;case c.EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===cj.indexOf(t[0]));case c.ACK:return Array.isArray(t);case c.CONNECT_ERROR:return"string"==typeof t||cC(t);default:return!1}}(e.type,e.data)}function cA(e,t,s){return e.on(t,s),function(){e.off(t,s)}}e.s(["Decoder",()=>ck,"Encoder",()=>cN,"PacketType",()=>c,"isPacketValid",()=>cE,"protocol",0,5],51890);let c_=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class cP extends lX{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[cA(e,"open",this.onopen.bind(this)),cA(e,"packet",this.onpacket.bind(this)),cA(e,"error",this.onerror.bind(this)),cA(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,r,a;if(c_.hasOwnProperty(e))throw Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let i={type:c.EVENT,data:t};if(i.options={},i.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){let e=this.ids++,s=t.pop();this._registerAckCallback(e,s),i.id=e}let n=null==(r=null==(s=this.io.engine)?void 0:s.transport)?void 0:r.writable,o=this.connected&&!(null==(a=this.io.engine)?void 0:a._hasPingExpired());return this.flags.volatile&&!n||(o?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,t){var s;let r=null!=(s=this.flags.timeout)?s:this._opts.ackTimeout;if(void 0===r){this.acks[e]=t;return}let a=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error("operation has timed out"))},r),i=(...e)=>{this.io.clearTimeoutFn(a),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((s,r)=>{let a=(e,t)=>e?r(e):s(t);a.withError=!0,t.push(a),this.emit(e,...t)})}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());let s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>(this._queue[0],null!==e?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;let t=this._queue[0];(!t.pending||e)&&(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:c.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case c.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case c.EVENT:case c.BINARY_EVENT:this.onevent(e);break;case c.ACK:case c.BINARY_ACK:this.onack(e);break;case c.DISCONNECT:this.ondisconnect();break;case c.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){let t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length)for(let t of this._anyListeners.slice())t.apply(this,e);super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,s=!1;return function(...r){s||(s=!0,t.packet({type:c.ACK,id:e,data:r}))}}onack(e){let t=this.acks[e.id];"function"==typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:c.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s]){t.splice(s,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s]){t.splice(s,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let t of this._anyOutgoingListeners.slice())t.apply(this,e.data)}}var cM=e.i(51890);function cR(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}cR.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),s=Math.floor(t*this.jitter*e);e=(1&Math.floor(10*t))==0?e-s:e+s}return 0|Math.min(e,this.max)},cR.prototype.reset=function(){this.attempts=0},cR.prototype.setMin=function(e){this.ms=e},cR.prototype.setMax=function(e){this.max=e},cR.prototype.setJitter=function(e){this.jitter=e};class c$ extends lX{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,l2(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(s=t.randomizationFactor)?s:.5),this.backoff=new cR({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||cM;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null==(t=this.backoff)||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null==(t=this.backoff)||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null==(t=this.backoff)||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new cx(this.uri,this.opts);let t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let r=cA(t,"open",function(){s.onopen(),e&&e()}),a=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},i=cA(t,"error",a);if(!1!==this._timeout){let e=this._timeout,s=this.setTimeoutFn(()=>{r(),a(Error("timeout")),t.close()},e);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}return this.subs.push(r),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(cA(e,"ping",this.onping.bind(this)),cA(e,"data",this.ondata.bind(this)),cA(e,"error",this.onerror.bind(this)),cA(e,"close",this.onclose.bind(this)),cA(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){lZ(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new cP(this,e,t),this.nsps[e]=s),s}_destroy(e){for(let e of Object.keys(this.nsps))if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),null==(s=this.engine)||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}let cO={};function cD(e,t){let s;"object"==typeof e&&(t=e,e=void 0);let r=function(e,t="",s){let r=e;s=s||"u">typeof location&&location,null==e&&(e=s.protocol+"//"+s.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?s.protocol+e:s.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==s?s.protocol+"//"+e:"https://"+e),r=cu(e)),!r.port&&(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";let a=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(s&&s.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),a=r.source,i=r.id,n=r.path,o=cO[i]&&n in cO[i].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||o?s=new c$(a,t):(cO[i]||(cO[i]=new c$(a,t)),s=cO[i]),r.query&&!t.query&&(t.query=r.queryKey),s.socket(r.path,t)}Object.assign(cD,{Manager:c$,Socket:cP,io:cD,connect:cD});let cL=null,cB=0,cI=(e,t)=>{let s=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(s.size!==r.size)return!1;for(let[e,t]of s)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0};function cF(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;if(Symbol.iterator in e&&Symbol.iterator in t){if("entries"in e&&"entries"in t)return cI(e,t);let s=e[Symbol.iterator](),r=t[Symbol.iterator](),a=s.next(),i=r.next();for(;!a.done&&!i.done;){if(!Object.is(a.value,i.value))return!1;a=s.next(),i=r.next()}return!!a.done&&!!i.done}return cI({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}var cV=e.i(75830),cz=e.i(10772),cG="rovingFocusGroup.onEntryFocus",cU={bubbles:!1,cancelable:!0},cH="RovingFocusGroup",[cW,cq,cY]=(0,cV.createCollection)(cH),[cK,cX]=(0,eb.createContextScope)(cH,[cY]),[cZ,cJ]=cK(cH),cQ=u.forwardRef((e,t)=>(0,d.jsx)(cW.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(cW.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(c0,{...e,ref:t})})}));cQ.displayName=cH;var c0=u.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:s,orientation:r,loop:a=!1,dir:i,currentTabStopId:n,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:h=!1,...f}=e,m=u.useRef(null),p=(0,ey.useComposedRefs)(t,m),x=ej(i),[g,b]=(0,ta.useControllableState)({prop:n,defaultProp:o??null,onChange:l,caller:cH}),[y,v]=u.useState(!1),w=(0,ev.useCallbackRef)(c),j=cq(s),N=u.useRef(!1),[k,S]=u.useState(0);return u.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(cG,w),()=>e.removeEventListener(cG,w)},[w]),(0,d.jsx)(cZ,{scope:s,orientation:r,dir:x,loop:a,currentTabStopId:g,onItemFocus:u.useCallback(e=>b(e),[b]),onItemShiftTab:u.useCallback(()=>v(!0),[]),onFocusableItemAdd:u.useCallback(()=>S(e=>e+1),[]),onFocusableItemRemove:u.useCallback(()=>S(e=>e-1),[]),children:(0,d.jsx)(ex.Primitive.div,{tabIndex:y||0===k?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:(0,ek.composeEventHandlers)(e.onMouseDown,()=>{N.current=!0}),onFocus:(0,ek.composeEventHandlers)(e.onFocus,e=>{let t=!N.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(cG,cU);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=j().filter(e=>e.focusable);c3([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),h)}}N.current=!1}),onBlur:(0,ek.composeEventHandlers)(e.onBlur,()=>v(!1))})})}),c1="RovingFocusGroupItem",c2=u.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:s,focusable:r=!0,active:a=!1,tabStopId:i,children:n,...o}=e,l=(0,cz.useId)(),c=i||l,h=cJ(c1,s),f=h.currentTabStopId===c,m=cq(s),{onFocusableItemAdd:p,onFocusableItemRemove:x,currentTabStopId:g}=h;return u.useEffect(()=>{if(r)return p(),()=>x()},[r,p,x]),(0,d.jsx)(cW.ItemSlot,{scope:s,id:c,focusable:r,active:a,children:(0,d.jsx)(ex.Primitive.span,{tabIndex:f?0:-1,"data-orientation":h.orientation,...o,ref:t,onMouseDown:(0,ek.composeEventHandlers)(e.onMouseDown,e=>{r?h.onItemFocus(c):e.preventDefault()}),onFocus:(0,ek.composeEventHandlers)(e.onFocus,()=>h.onItemFocus(c)),onKeyDown:(0,ek.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void h.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,s){var r;let a=(r=e.key,"rtl"!==s?r:"ArrowLeft"===r?"ArrowRight":"ArrowRight"===r?"ArrowLeft":r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(a))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)))return c5[a]}(e,h.orientation,h.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let a=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)a.reverse();else if("prev"===t||"next"===t){var s,r;"prev"===t&&a.reverse();let i=a.indexOf(e.currentTarget);a=h.loop?(s=a,r=i+1,s.map((e,t)=>s[(r+t)%s.length])):a.slice(i+1)}setTimeout(()=>c3(a))}}),children:"function"==typeof n?n({isCurrentTabStop:f,hasTabStop:null!=g}):n})})});c2.displayName=c1;var c5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function c3(e,t=!1){let s=document.activeElement;for(let r of e)if(r===s||(r.focus({preventScroll:t}),document.activeElement!==s))return}var c4="Tabs",[c9,c7]=(0,eb.createContextScope)(c4,[cX]),c8=cX(),[c6,de]=c9(c4),dt=u.forwardRef((e,t)=>{let{__scopeTabs:s,value:r,onValueChange:a,defaultValue:i,orientation:n="horizontal",dir:o,activationMode:l="automatic",...c}=e,u=ej(o),[h,f]=(0,ta.useControllableState)({prop:r,onChange:a,defaultProp:i??"",caller:c4});return(0,d.jsx)(c6,{scope:s,baseId:(0,cz.useId)(),value:h,onValueChange:f,orientation:n,dir:u,activationMode:l,children:(0,d.jsx)(ex.Primitive.div,{dir:u,"data-orientation":n,...c,ref:t})})});dt.displayName=c4;var ds="TabsList",dr=u.forwardRef((e,t)=>{let{__scopeTabs:s,loop:r=!0,...a}=e,i=de(ds,s),n=c8(s);return(0,d.jsx)(cQ,{asChild:!0,...n,orientation:i.orientation,dir:i.dir,loop:r,children:(0,d.jsx)(ex.Primitive.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});dr.displayName=ds;var da="TabsTrigger",di=u.forwardRef((e,t)=>{let{__scopeTabs:s,value:r,disabled:a=!1,...i}=e,n=de(da,s),o=c8(s),l=dc(n.baseId,r),c=dd(n.baseId,r),u=r===n.value;return(0,d.jsx)(c2,{asChild:!0,...o,focusable:!a,active:u,children:(0,d.jsx)(ex.Primitive.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:l,...i,ref:t,onMouseDown:(0,ek.composeEventHandlers)(e.onMouseDown,e=>{a||0!==e.button||!1!==e.ctrlKey?e.preventDefault():n.onValueChange(r)}),onKeyDown:(0,ek.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&n.onValueChange(r)}),onFocus:(0,ek.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==n.activationMode;u||a||!e||n.onValueChange(r)})})})});di.displayName=da;var dn="TabsContent",dl=u.forwardRef((e,t)=>{let{__scopeTabs:s,value:r,forceMount:a,children:i,...n}=e,o=de(dn,s),l=dc(o.baseId,r),c=dd(o.baseId,r),h=r===o.value,f=u.useRef(h);return u.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,d.jsx)(eg.Presence,{present:a||h,children:({present:s})=>(0,d.jsx)(ex.Primitive.div,{"data-state":h?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!s,id:c,tabIndex:0,...n,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:s&&i})})});function dc(e,t){return`${e}-trigger-${t}`}function dd(e,t){return`${e}-content-${t}`}function du({className:e,...t}){return(0,d.jsx)(dt,{"data-slot":"tabs",className:(0,O.cn)("flex flex-col gap-2",e),...t})}function dh({className:e,...t}){return(0,d.jsx)(dr,{"data-slot":"tabs-list",className:(0,O.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function df({className:e,...t}){return(0,d.jsx)(di,{"data-slot":"tabs-trigger",className:(0,O.cn)("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function dm({className:e,...t}){return(0,d.jsx)(dl,{"data-slot":"tabs-content",className:(0,O.cn)("flex-1 outline-none",e),...t})}dl.displayName=dn;let dp=(0,x.default)("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"}]]),dx=(0,x.default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]),dg=(0,x.default)("navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]),db=(0,x.default)("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"}]]),dy=(0,x.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),dv=(0,li.default)(()=>e.A(66872).then(e=>({default:e.ChronicleDialog})),{loadableGenerated:{modules:[16633]},ssr:!1}),dw=(0,li.default)(()=>e.A(54974).then(e=>({default:e.ConstellationDialog})),{loadableGenerated:{modules:[76103]},ssr:!1}),dj=(0,li.default)(()=>e.A(49410).then(e=>({default:e.OfflineReportDialog})),{loadableGenerated:{modules:[54777]},ssr:!1}),dN=(0,li.default)(()=>e.A(74613).then(e=>({default:e.CruiseMode})),{loadableGenerated:{modules:[49701]},ssr:!1});function dk(){let e,t,s,r,a,i,n,o,l;e=(0,f.useGameStore)(e=>e.tick),t=(0,f.useGameStore)(e=>e.autoDecodeTick),s=(0,f.useGameStore)(e=>e.tickTide),r=(0,f.useGameStore)(e=>e.checkAchievements),a=(0,f.useGameStore)(e=>e.init),i=(0,u.useRef)(!1),(0,u.useEffect)(()=>{let n=()=>{i.current||(a(),i.current=!0)},o=null,l=null;f.useGameStore.persist.hasHydrated()?n():(o=f.useGameStore.persist.onFinishHydration(n),l=setTimeout(n,500));let c=0,d=setInterval(()=>{let a=Date.now();e(a),t(),s(a),++c%4==0&&r()},250);return()=>{clearInterval(d),o&&o(),l&&clearTimeout(l)}},[e,t,s,r,a]),(0,u.useEffect)(()=>{let t=()=>{"visible"===document.visibilityState&&(e(Date.now()),s(Date.now()),r())};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[e,s,r]),(0,V.useAudioSync)(),n=(0,f.useGameStore)(e=>e.triggerGlobalTide),o=(0,u.useRef)(n),(0,u.useEffect)(()=>{o.current=n},[n]),l=(0,u.useRef)(new Set),(0,u.useEffect)(()=>{let e=(cL||(cL=cD("/?XTransformPort=3031",{transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:1e4,timeout:1e4})),cL);cB+=1;let t=e=>{let t=`${e.startedAt}_${e.type}`;if(!l.current.has(t)){if(l.current.add(t),l.current.size>32){let e=l.current.values().next().value;e&&l.current.delete(e)}e.endsAt<=Date.now()||o.current(e.type)}},s=e=>{if(e.current&&e.current.endsAt>Date.now()){let t=`${e.current.startedAt}_${e.current.type}`;l.current.has(t)||(l.current.add(t),o.current(e.current.type))}};return e.on("global-tide",t),e.on("tide-state",s),e.emit("get-next-tide"),()=>{e.off("global-tide",t),e.off("tide-state",s),(cB-=1)<=0&&cL&&(cL.disconnect(),cL=null,cB=0)}},[]);let[c,p]=(0,u.useState)(!1),[x,g]=(0,u.useState)(!1),[b,v]=(0,u.useState)(!1),[w,j]=(0,u.useState)(!1),[N,k]=(0,u.useState)(!1),[S,T]=(0,u.useState)(!1),C=(0,f.useGameStore)(e=>e.contact),E=(0,f.useGameStore)(e=>e.totalDecoded),A=(0,f.useGameStore)(e=>e.crystalsPerSec),_=(0,f.useGameStore)(e=>e.ascensions),P=(0,f.useGameStore)(e=>e.tech),M=(0,f.useGameStore)(e=>e.fragments),R=(0,f.useGameStore)(e=>e.achievements),$=(0,f.useGameStore)(e=>e.constellation??[]),O=(0,f.useGameStore)(e=>e.pendingPerkChoices),D=(0,f.useGameStore)(e=>e.crystals),B=(0,f.useGameStore)(e=>e.crystalCap),I=(0,f.useGameStore)(e=>e.activeTide),F=(0,f.useGameStore)(e=>e.globalTide),z=(0,f.useGameStore)(e=>e.energy),G=(0,f.useGameStore)(e=>!!e.activeExpedition&&!e.activeExpedition.finished),U=(0,f.useGameStore)(e=>e.chronicle?.length??0),H=(0,f.useGameStore)(e=>e.pendingAttrPoints??0),[W,q]=(0,u.useState)(!1);if((0,u.useEffect)(()=>{let e=!1,t=()=>{try{let t=(0,oZ.generateDailyChallenge)(),s=(0,oZ.loadDailyProgress)();e||q(null!==s.completedAt&&!s.claimed&&s.dateKey===t.dateKey)}catch{e||q(!1)}};t();let s=setInterval(t,2e3);return()=>{e=!0,clearInterval(s)}},[]),(0,u.useEffect)(()=>{T(!0)},[]),!S)return(0,d.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-[#050410] text-muted-foreground",children:(0,d.jsx)("div",{className:"animate-pulse",children:"唤醒回响中…"})});let Y=Object.values(P).filter(e=>e>0).length,K=Object.values(M).filter(Boolean).length,Z=Object.values(R).filter(Boolean).length,Q=C>=100,et=O&&O.length>0,es=D>=.98*B,er="点击中央晶体发起脉冲,累积记忆晶体";if(0===E&&D>=5?er="右侧「待解码晶体」点击一颗晶体,开始解码":E>0&&0===Y?er="用洞见解锁技术树,提升产能":E>0&&K<m.FRAGMENTS.length&&(er=`继续解码,拼凑记忆图谱(${K}/${m.FRAGMENTS.length}`),z>=1&&E>=3&&(er="「探险」标签可深入遗迹,获取丰厚奖励"),_>=1&&$.length>0&&(er=`星图天赋已觉醒 ${$.length}/18,继续飞升获取更多`),es&&(er="⚠ 仓库已满,产能浪费中!请解码晶体或升级仓库"),et&&(er="✦ 星图觉醒!点击顶部「星图」按钮选择一道天赋"),I){let e=lA.TIDE_EVENTS[I.type];er=`${F?"🌐 全球星潮 · ":""}${e.icon} 星潮「${e.name}」进行中 \xb7 ${e.desc}`}return Q&&(er="✦ 接触进度已满,可发起飞升进入新周目"),(0,d.jsxs)("div",{className:"relative min-h-screen flex flex-col bg-[#050410] text-foreground overflow-x-hidden",children:[(0,d.jsx)(h,{className:"fixed inset-0 w-full h-full -z-10"}),(0,d.jsx)(lM,{}),(0,d.jsxs)("header",{className:"sticky top-0 z-30 px-3 sm:px-5 pt-3 pb-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 mb-2.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,d.jsxs)("div",{className:"relative h-9 w-9",children:[(0,d.jsx)("div",{className:"absolute inset-0 rounded-full bg-gradient-to-br from-emerald-400 via-fuchsia-500 to-rose-400 blur-md opacity-60"}),(0,d.jsx)("div",{className:"absolute inset-1 rounded-full bg-[#050410] flex items-center justify-center",children:(0,d.jsx)(ee.Sparkles,{className:"h-4 w-4 text-fuchsia-300"})})]}),(0,d.jsxs)("div",{className:"leading-tight",children:[(0,d.jsx)("h1",{className:"text-base sm:text-lg font-bold text-gradient font-display",children:"回响星核"}),(0,d.jsx)("p",{className:"text-[9px] sm:text-[10px] text-muted-foreground/70 -mt-0.5 tracking-wider font-tech",children:"ECHO NEXUS · v0.10"})]})]}),(0,d.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,d.jsx)(lP,{}),(0,d.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>k(!0),className:"border-amber-400/50 text-amber-200 hover:bg-amber-500/10 h-8 px-2.5","aria-label":"深空巡航",title:"深空巡航 · 实时玩法",children:[(0,d.jsx)(dg,{className:"h-3.5 w-3.5 mr-1"}),"巡航"]}),(0,d.jsxs)(J.Button,{size:"icon",variant:"ghost",onClick:()=>j(!0),className:"h-8 w-8 relative group","aria-label":"编年史",title:"回响编年史",children:[(0,d.jsx)(eu.BookOpen,{className:"h-4 w-4 group-hover:text-fuchsia-300 transition-colors"}),U>0&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 min-w-[14px] h-[14px] px-1 rounded-full bg-fuchsia-500 text-[9px] font-mono font-bold text-white flex items-center justify-center border border-fuchsia-300/50",children:U})]}),et&&(0,d.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>v(!0),className:"border-fuchsia-400/60 text-fuchsia-200 hover:bg-fuchsia-500/15 h-8 px-2.5 animate-pulse",children:[(0,d.jsx)(e6.Star,{className:"h-3.5 w-3.5 mr-1"}),"觉醒"]}),Q&&(0,d.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>p(!0),"data-tut":"prestige-btn",className:"border-fuchsia-400/50 text-fuchsia-200 hover:bg-fuchsia-500/10 h-8 px-2.5",children:[(0,d.jsx)(y.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),"飞升"]}),(0,d.jsx)(J.Button,{size:"icon",variant:"ghost",onClick:()=>g(!0),className:"h-8 w-8","aria-label":"设置",children:(0,d.jsx)(dp,{className:"h-4 w-4"})})]})]}),(0,d.jsx)(L,{onPrestige:()=>p(!0)})]}),(0,d.jsx)("main",{className:"flex-1 px-3 sm:px-5 pb-3 min-h-0",children:(0,d.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(300px,360px)_1fr] gap-3 h-full",children:[(0,d.jsxs)("section",{className:"glass rounded-2xl p-3 sm:p-4 flex flex-col gap-3 min-h-[340px] sm:min-h-[420px] relative overflow-hidden",children:[(0,d.jsx)("div",{className:"pointer-events-none absolute -top-16 -left-16 h-40 w-40 rounded-full bg-emerald-500/10 blur-3xl"}),(0,d.jsx)("div",{className:"pointer-events-none absolute -bottom-16 -right-16 h-40 w-40 rounded-full bg-fuchsia-500/10 blur-3xl"}),(0,d.jsx)("div",{className:"pointer-events-none absolute inset-4 rounded-full border border-emerald-400/10 animate-[spin_60s_linear_infinite]"}),(0,d.jsx)("div",{className:"pointer-events-none absolute inset-8 rounded-full border border-dashed border-fuchsia-400/10 animate-[spin_90s_linear_infinite_reverse]"}),(0,d.jsx)("div",{className:"pointer-events-none absolute top-2 left-2 h-3 w-3 border-l border-t border-emerald-400/30 rounded-tl"}),(0,d.jsx)("div",{className:"pointer-events-none absolute top-2 right-2 h-3 w-3 border-r border-t border-fuchsia-400/30 rounded-tr"}),(0,d.jsx)("div",{className:"pointer-events-none absolute bottom-2 left-2 h-3 w-3 border-l border-b border-amber-400/30 rounded-bl"}),(0,d.jsx)("div",{className:"pointer-events-none absolute bottom-2 right-2 h-3 w-3 border-r border-b border-rose-400/30 rounded-br"}),(0,d.jsxs)("div",{className:"pointer-events-none absolute top-2 left-1/2 -translate-x-1/2 flex items-center gap-1.5 text-[8px] font-mono text-muted-foreground/60 z-10",children:[(0,d.jsx)("span",{className:"h-1 w-1 rounded-full bg-emerald-400 animate-pulse"}),(0,d.jsx)("span",{className:"font-tech",children:"CRYSTAL CORE · ONLINE"}),(0,d.jsx)("span",{className:"h-1 w-1 rounded-full bg-fuchsia-400 animate-pulse"})]}),(0,d.jsx)("div",{"data-tut":"crystal-orb",className:"relative flex justify-center pt-3",children:(0,d.jsx)(X,{})}),(0,d.jsx)(dS,{}),(0,d.jsx)(ly,{})]}),(0,d.jsxs)("section",{className:"flex flex-col gap-3 min-h-0",children:[(0,d.jsx)("div",{"data-tut":"decode-panel",className:"glass rounded-2xl p-4 flex-1 min-h-[280px] sm:min-h-[320px] max-h-[480px]",children:(0,d.jsx)(ei,{})}),(0,d.jsx)("div",{className:"glass rounded-2xl p-3 min-h-[320px] sm:min-h-[380px] max-h-[560px] flex flex-col",children:(0,d.jsxs)(du,{defaultValue:G?"expedition":et?"constellation":"tech",className:"h-full flex flex-col",children:[(0,d.jsxs)(dh,{className:"grid grid-cols-3 sm:grid-cols-9 h-auto sm:h-9 bg-black/30 gap-0.5 p-1",children:[(0,d.jsxs)(df,{value:"expedition","data-tut":"tab-expedition",className:"text-[11px] gap-1 relative px-0.5 flex-col h-7 data-[state=active]:bg-amber-500/15 data-[state=active]:shadow-[0_0_12px_rgba(251,191,36,0.3)] transition-all",children:[(0,d.jsx)(ed,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"探险"}),z>=1&&!G&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-amber-400 animate-pulse ring-1 ring-black/50"}),G&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-rose-400 animate-pulse ring-1 ring-black/50"})]}),(0,d.jsxs)(df,{value:"tech","data-tut":"tab-tech",className:"text-[11px] gap-1 px-0.5 flex-col h-7 data-[state=active]:bg-emerald-500/15 data-[state=active]:shadow-[0_0_12px_rgba(52,211,153,0.3)] transition-all",children:[(0,d.jsx)(lx.Cpu,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"技术"})]}),(0,d.jsxs)(df,{value:"constellation",className:"text-[11px] gap-1 relative px-0.5 flex-col h-7 data-[state=active]:bg-fuchsia-500/15 data-[state=active]:shadow-[0_0_12px_rgba(232,121,249,0.3)] transition-all",children:[(0,d.jsx)(e6.Star,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"星图"}),et&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-fuchsia-400 animate-pulse ring-1 ring-black/50"})]}),(0,d.jsxs)(df,{value:"codex",className:"text-[11px] gap-1 px-0.5 flex-col h-7 data-[state=active]:bg-cyan-500/15 data-[state=active]:shadow-[0_0_12px_rgba(34,211,238,0.3)] transition-all",children:[(0,d.jsx)(eu.BookOpen,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"图谱"})]}),(0,d.jsxs)(df,{value:"ach",className:"text-[11px] gap-1 relative px-0.5 flex-col h-7 data-[state=active]:bg-amber-500/15 data-[state=active]:shadow-[0_0_12px_rgba(251,191,36,0.3)] transition-all",children:[(0,d.jsx)(tI.Trophy,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"成就"}),Z<tB.ACHIEVEMENTS.length&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-amber-400 animate-pulse ring-1 ring-black/50"})]}),(0,d.jsxs)(df,{value:"beacon",className:"text-[11px] gap-1 relative px-0.5 flex-col h-7 data-[state=active]:bg-emerald-500/15 data-[state=active]:shadow-[0_0_12px_rgba(52,211,153,0.3)] transition-all",children:[(0,d.jsx)(oJ.Radio,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"信标"}),W&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-emerald-400 animate-pulse ring-1 ring-black/50"})]}),(0,d.jsxs)(df,{value:"stats",className:"text-[11px] gap-1 px-0.5 flex-col h-7 data-[state=active]:bg-slate-500/15 data-[state=active]:shadow-[0_0_12px_rgba(148,163,184,0.3)] transition-all",children:[(0,d.jsx)(dx,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"统计"})]}),(0,d.jsxs)(df,{value:"attributes",className:"text-[11px] gap-1 relative px-0.5 flex-col h-7 data-[state=active]:bg-gradient-to-br data-[state=active]:from-emerald-500/15 data-[state=active]:via-fuchsia-500/15 data-[state=active]:to-rose-500/15 data-[state=active]:shadow-[0_0_12px_rgba(232,121,249,0.3)] transition-all",children:[(0,d.jsx)(db,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"角色"}),H>0&&(0,d.jsx)("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-rose-400 animate-pulse ring-1 ring-black/50"})]}),(0,d.jsxs)(df,{value:"relic",className:"text-[11px] gap-1 relative px-0.5 flex-col h-7 data-[state=active]:bg-fuchsia-500/15 data-[state=active]:shadow-[0_0_12px_rgba(232,121,249,0.3)] transition-all",children:[(0,d.jsx)(lj,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"leading-none",children:"图鉴"})]})]}),(0,d.jsx)(dm,{value:"expedition",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(tL,{})}),(0,d.jsx)(dm,{value:"tech",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(ep,{})}),(0,d.jsx)(dm,{value:"constellation",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(oX,{})}),(0,d.jsx)(dm,{value:"codex",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(e7,{})}),(0,d.jsx)(dm,{value:"ach",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(tz,{})}),(0,d.jsx)(dm,{value:"beacon",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(ls,{})}),(0,d.jsx)(dm,{value:"stats",className:"flex-1 mt-2 min-h-0",children:(0,d.jsx)(dT,{})}),(0,d.jsx)(dm,{value:"attributes",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(lf,{})}),(0,d.jsx)(dm,{value:"relic",className:"flex-1 mt-2 min-h-0 data-[state=active]:flex data-[state=active]:flex-col",children:(0,d.jsx)(lS,{})})]})})]})]})}),(0,d.jsx)("div",{className:"px-3 sm:px-5 pb-1 shrink-0",children:(0,d.jsx)(lE,{})}),(0,d.jsx)("footer",{className:"sticky bottom-0 z-20 mt-auto px-3 sm:px-5 pb-2 pt-1",children:(0,d.jsxs)("div",{className:`glass rounded-xl px-3 py-2 flex items-center gap-2 text-xs ${es?"border-amber-400/40 animate-pulse":""} ${I?"border-white/20":""}`,style:I?{boxShadow:`inset 0 0 16px ${lA.TIDE_EVENTS[I.type].glow}`}:void 0,children:[(0,d.jsx)("span",{className:es?"text-amber-400":I?"":"text-fuchsia-300",style:I?{color:lA.TIDE_EVENTS[I.type].color}:void 0,children:"▶"}),(0,d.jsx)("span",{className:`flex-1 truncate ${es?"text-amber-200":"text-muted-foreground"}`,children:er}),(0,d.jsx)("span",{className:"hidden sm:inline text-muted-foreground/60",children:"|"}),(0,d.jsxs)("span",{className:"hidden sm:inline text-muted-foreground/70",children:["产能 ",(0,m.formatNum)(A),"/s"]}),(0,d.jsx)("a",{href:"https://git.atdunbg.xyz/Super_Z/echo-nexus",target:"_blank",rel:"noreferrer",className:"text-muted-foreground/60 hover:text-foreground transition ml-1","aria-label":"仓库",children:(0,d.jsx)(tv,{className:"h-3.5 w-3.5"})})]})}),(0,d.jsx)(ts,{open:c,onOpenChange:p}),(0,d.jsx)(dv,{open:w,onOpenChange:j}),(0,d.jsx)(dw,{open:b,onOpenChange:v}),(0,d.jsx)(tT,{open:x,onOpenChange:g}),(0,d.jsx)(oK,{}),(0,d.jsx)(l_,{}),(0,d.jsx)(la,{}),(0,d.jsx)(dj,{}),N&&(0,d.jsx)(dN,{onClose:()=>k(!1)})]})}function dS(){let e=(0,f.useGameStore)(e=>e.crystalsPerSec),t=(0,f.useGameStore)(e=>e.pulsePower),s=(0,f.useGameStore)(e=>e._combo),r=(0,f.useGameStore)(e=>e.crystals),a=(0,f.useGameStore)(e=>e.crystalCap),i=s>=1?1+(s-1)*.15:1,n=s>=3,o=(a>0?r/a*100:0)>=90;return(0,d.jsxs)("div",{className:"mt-3 grid grid-cols-2 sm:grid-cols-4 gap-2 w-full max-w-md pointer-events-none",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-emerald-400/30 bg-black/30 backdrop-blur p-2 flex items-center gap-1.5",children:[(0,d.jsx)(p.Gem,{className:"h-3.5 w-3.5 text-emerald-400 shrink-0"}),(0,d.jsxs)("div",{className:"min-w-0 leading-tight",children:[(0,d.jsx)("div",{className:"text-[9px] uppercase tracking-wider text-emerald-300/70 truncate",children:"晶体产能"}),(0,d.jsxs)("div",{className:"text-sm font-mono tabular-nums text-emerald-200 truncate",children:[(0,m.formatNum)(e),(0,d.jsx)("span",{className:"text-[9px] text-emerald-300/60",children:"/s"})]})]})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-rose-400/30 bg-black/30 backdrop-blur p-2 flex items-center gap-1.5",children:[(0,d.jsx)(tR.Zap,{className:"h-3.5 w-3.5 text-rose-400 shrink-0"}),(0,d.jsxs)("div",{className:"min-w-0 leading-tight",children:[(0,d.jsx)("div",{className:"text-[9px] uppercase tracking-wider text-rose-300/70 truncate",children:"主动脉冲"}),(0,d.jsxs)("div",{className:"text-sm font-mono tabular-nums text-rose-200 truncate",children:[(0,m.formatNum)(t),s>=1&&(0,d.jsxs)("span",{className:"text-[9px] text-rose-300/80",children:[" ×",i.toFixed(2)]})]})]})]}),(0,d.jsxs)("div",{className:`rounded-lg border bg-black/30 backdrop-blur p-2 flex items-center gap-1.5 ${n?"border-amber-400/70 animate-pulse":"border-amber-400/30"}`,children:[(0,d.jsx)(o3.Flame,{className:`h-3.5 w-3.5 text-amber-400 shrink-0 ${n?"drop-shadow-[0_0_4px_rgba(251,191,36,0.7)]":""}`}),(0,d.jsxs)("div",{className:"min-w-0 leading-tight",children:[(0,d.jsx)("div",{className:"text-[9px] uppercase tracking-wider text-amber-300/70 truncate",children:"当前连击"}),(0,d.jsxs)("div",{className:`text-sm font-mono tabular-nums truncate ${n?"text-amber-200":"text-amber-300/80"}`,children:[s,(0,d.jsx)("span",{className:"text-[9px] text-amber-300/60",children:"/10"})]})]})]}),(0,d.jsxs)("div",{className:`rounded-lg border bg-black/30 backdrop-blur p-2 flex items-center gap-1.5 ${o?"border-rose-400/70 animate-pulse":"border-fuchsia-400/30"}`,children:[(0,d.jsx)(dy,{className:`h-3.5 w-3.5 shrink-0 ${o?"text-rose-400":"text-fuchsia-400"}`}),(0,d.jsxs)("div",{className:"min-w-0 leading-tight",children:[(0,d.jsx)("div",{className:`text-[9px] uppercase tracking-wider truncate ${o?"text-rose-300/80":"text-fuchsia-300/70"}`,children:"仓库容量"}),(0,d.jsxs)("div",{className:`text-sm font-mono tabular-nums truncate ${o?"text-rose-200":"text-fuchsia-200"}`,children:[(0,m.formatNum)(r),(0,d.jsxs)("span",{className:`text-[9px] ${o?"text-rose-300/70":"text-fuchsia-300/60"}`,children:["/",(0,m.formatNum)(a)]})]})]})]})]})}function dT(){let e=(0,f.useGameStore)(e=>({totalDecoded:e.totalDecoded,ascensions:e.ascensions,blueprints:e.blueprints,tech:e.tech,fragments:e.fragments,achievements:e.achievements,constellation:e.constellation,contact:e.contact,crystalsPerSec:e.crystalsPerSec,crystalCap:e.crystalCap,insightMult:e.insightMult,totalExpeditions:e.totalExpeditions,bossKills:e.bossKills,starTidesEncountered:e.starTidesEncountered,chronicle:e.chronicle,energy:e.energy,energyMax:e.energyMax,attributes:e.attributes,pendingAttrPoints:e.pendingAttrPoints}),cF),t=Object.values(e.achievements).filter(Boolean).length,[s,r]=(0,u.useState)(null);(0,u.useEffect)(()=>{try{let e=(0,oZ.loadLeaderboard)();r(e.length>0?e[0].score:null)}catch{r(null)}},[]);let a=[{label:"累计解码晶体",value:`${e.totalDecoded} 颗`},{label:"飞升周目",value:`${e.ascensions}`},{label:"持有蓝图",value:`${e.blueprints.length} / 6`},{label:"已学技术",value:`${Object.values(e.tech).filter(e=>e>0).length} / ${m.TECH_TREE.length}`},{label:"已获碎片",value:`${Object.values(e.fragments).filter(Boolean).length} / ${m.FRAGMENTS.length}`},{label:"已解锁成就",value:`${t} / ${tB.ACHIEVEMENTS.length}`},{label:"星图天赋",value:`${e.constellation?.length??0} / ${tt.CONSTELLATION_PERKS.length}`},{label:"接触进度",value:`${e.contact.toFixed(1)}%`},{label:"晶体产能",value:`${e.crystalsPerSec.toFixed(2)} /s`},{label:"仓库上限",value:`${(0,m.formatNum)(e.crystalCap)}`},{label:"洞见倍率",value:`\xd7${e.insightMult.toFixed(2)}`},{label:"累计探险",value:`${e.totalExpeditions} 次`},{label:"BOSS 击破",value:`${e.bossKills??0} 次`},{label:"星潮亲历",value:`${(e.starTidesEncountered??[]).length} / 9`},{label:"编年史条目",value:`${(e.chronicle??[]).length} 纪元`},{label:"探险能量",value:`${Math.floor(e.energy)} / ${e.energyMax}`},{label:"信标最高分",value:null!==s?(0,m.formatNum)(s):"—"},{label:"探索力",value:`${e.attributes?.exploration??0} / 100`},{label:"智慧",value:`${e.attributes?.wisdom??0} / 100`},{label:"勇气",value:`${e.attributes?.courage??0} / 100`},{label:"灵感",value:`${e.attributes?.inspiration??0} / 100`},{label:"待分配属性点",value:`${e.pendingAttrPoints??0}`}];return(0,d.jsx)("div",{className:"grid grid-cols-2 gap-1.5 text-xs",children:a.map(e=>(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-md bg-black/25 border border-white/5 px-2 py-1.5",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:e.label}),(0,d.jsx)("span",{className:"font-mono text-foreground",children:e.value})]},e.label))})}e.s(["default",()=>dk],52683)}]);