@ttmg/cli 0.4.5 → 0.4.6-agent-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +644 -2
- package/dist/index.js +22502 -6070
- package/dist/index.js.map +1 -1
- package/dist/package.json +36 -4
- package/dist/public/assets/{Card-BAsimNoh.js → Card-CN2lxY0Y.js} +1 -1
- package/dist/public/assets/{Detail-rVxbEDgh.js → Detail-CELZZ-4h.js} +1 -1
- package/dist/public/assets/Detail-CELZZ-4h.js.br +0 -0
- package/dist/public/assets/{MonetizationMode-B20TAE9o.js → MonetizationMode-C7DNqium.js} +1 -1
- package/dist/public/assets/{MonetizationModeSummary-CnHqXyco.js → MonetizationModeSummary-DYE7XUq1.js} +1 -1
- package/dist/public/assets/{SectionHeader-Cn3FnOqh.js → SectionHeader-BKc3BWXP.js} +1 -1
- package/dist/public/assets/{baseForm-kBTxn8h8.js → baseForm-I9suIiQn.js} +1 -1
- package/dist/public/assets/baseForm-I9suIiQn.js.br +0 -0
- package/dist/public/assets/{col-VN3Ivd-x.js → col-w9Q-2mgM.js} +1 -1
- package/dist/public/assets/{compass-BabZVjAl.js → compass-D6waJ52O.js} +1 -1
- package/dist/public/assets/{index-DHdJsD10.js → index-8sDAOAcS.js} +1 -1
- package/dist/public/assets/index-8sDAOAcS.js.br +0 -0
- package/dist/public/assets/{index-DK4IvdRl.js → index-B6hY5GdS.js} +1 -1
- package/dist/public/assets/{index-Cl0_vMWE.js → index-BIrFkB6r.js} +1 -1
- package/dist/public/assets/index-BIrFkB6r.js.br +0 -0
- package/dist/public/assets/{index-BjQlJrX7.js → index-BLWgpW64.js} +1 -1
- package/dist/public/assets/{index-odEI7YQF.js → index-BY3eQmfP.js} +1 -1
- package/dist/public/assets/index-BY3eQmfP.js.br +0 -0
- package/dist/public/assets/{index-Bjn0ctEd.js → index-BegU9LBT.js} +2 -2
- package/dist/public/assets/index-BegU9LBT.js.br +0 -0
- package/dist/public/assets/{index-1WjGwqIV.js → index-BqwflQml.js} +1 -1
- package/dist/public/assets/{index-DXDZCuG4.js → index-BrOFdVbv.js} +1 -1
- package/dist/public/assets/{index-BxsB5E3u.js → index-BvPolBSn.js} +1 -1
- package/dist/public/assets/{index-BnOeYQAd.js → index-BwrZjkCc.js} +1 -1
- package/dist/public/assets/{index-CUuX90R9.js → index-CLKKui8G.js} +1 -1
- package/dist/public/assets/{index-Dohibgdp.js → index-Cb4Ja0tZ.js} +1 -1
- package/dist/public/assets/{index-C83QHLmD.js → index-CcUgN29Y.js} +1 -1
- package/dist/public/assets/{index-aSl6Wdrp.js → index-CgXOkYrX.js} +1 -1
- package/dist/public/assets/index-CgXOkYrX.js.br +0 -0
- package/dist/public/assets/{index-DulANwbq.js → index-CsiIrLKY.js} +1 -1
- package/dist/public/assets/{index-Ba-JWe4X.js → index-Csmg5oyu.js} +1 -1
- package/dist/public/assets/{index-DnnfZ7H_.js → index-DDecPuod.js} +1 -1
- package/dist/public/assets/{index-Clq0hTDI.js → index-DDy4PkWT.js} +1 -1
- package/dist/public/assets/{index-DIcz5ciL.js → index-DEQ2hVPA.js} +1 -1
- package/dist/public/assets/index-DEQ2hVPA.js.br +0 -0
- package/dist/public/assets/{index-CpM8t743.js → index-DGkgqtgJ.js} +1 -1
- package/dist/public/assets/{index-QNLvejKK.js → index-FVHabbDB.js} +1 -1
- package/dist/public/assets/{index-CzXMNZL3.js → index-M8jf-YAZ.js} +1 -1
- package/dist/public/assets/{index-BxokHznc.js → index-Q0GC8Irj.js} +1 -1
- package/dist/public/assets/index-Q0GC8Irj.js.br +0 -0
- package/dist/public/assets/{index--6iHQzho.js → index-YVB9ZW00.js} +1 -1
- package/dist/public/assets/{index-O_L1tU2b.js → index-mjEeEQcC.js} +1 -1
- package/dist/public/assets/index-mjEeEQcC.js.br +0 -0
- package/dist/public/assets/{index-BFFsJ47B.js → index-rLkONFpx.js} +1 -1
- package/dist/public/assets/{layers-B4zhx14P.js → layers-Dbwq9AyL.js} +1 -1
- package/dist/public/assets/{list-checks-Br6imjXC.js → list-checks-og1usOZf.js} +1 -1
- package/dist/public/assets/{sparkles-BjIkcbAi.js → sparkles-p-dZbjGb.js} +1 -1
- package/dist/public/assets/{triangle-alert-CgKAc3w5.js → triangle-alert-BZVAEUiL.js} +1 -1
- package/dist/public/assets/{zap-DFHw5liD.js → zap-BAhZUPPa.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/scripts/acceptance-fixture.test.js +33 -0
- package/dist/scripts/dev-capture-smoke.js +76 -0
- package/dist/scripts/dev-client-preview-control-smoke.js +606 -0
- package/dist/scripts/dev-default-smoke.js +67 -0
- package/dist/scripts/dev-game-ready-smoke.js +155 -0
- package/dist/scripts/dev-workflow-smoke.js +260 -0
- package/dist/scripts/prepare-client-preview-acceptance.js +65 -0
- package/dist/scripts/preview-page-server-smoke.js +63 -0
- package/dist/scripts/run-ts-test.js +41 -0
- package/dist/scripts/verify-agent-contract.js +410 -0
- package/dist/scripts/vibe-ppe-test-preload.cjs +23 -0
- package/dist/scripts/vibe-upload-demo.js +72 -0
- package/dist/scripts/vibe-upload-smoke.js +412 -0
- package/dist/scripts/wasm-smoke.js +53 -0
- package/dist/scripts/wasm-worker.js +63 -0
- package/dist/scripts/worker.js +28 -22
- package/package.json +36 -4
- package/CHANGELOG.md +0 -277
- package/dist/public/assets/Detail-rVxbEDgh.js.br +0 -0
- package/dist/public/assets/baseForm-kBTxn8h8.js.br +0 -0
- package/dist/public/assets/index-Bjn0ctEd.js.br +0 -0
- package/dist/public/assets/index-BxokHznc.js.br +0 -0
- package/dist/public/assets/index-Cl0_vMWE.js.br +0 -0
- package/dist/public/assets/index-DHdJsD10.js.br +0 -0
- package/dist/public/assets/index-DIcz5ciL.js.br +0 -0
- package/dist/public/assets/index-O_L1tU2b.js.br +0 -0
- package/dist/public/assets/index-aSl6Wdrp.js.br +0 -0
- package/dist/public/assets/index-odEI7YQF.js.br +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BrOFdVbv.js","assets/index-BqwflQml.js","assets/index-BPf4cmgA.css","assets/index-4NS2mMuQ.css","assets/index-FVHabbDB.js","assets/index-C-tTmNa4.css","assets/index-CsiIrLKY.js","assets/baseForm-I9suIiQn.js","assets/col-w9Q-2mgM.js","assets/col-BXewy14r.css","assets/index-DEQ2hVPA.js","assets/index-BFPQPvSA.css","assets/baseForm-BAvk37jF.css","assets/index-D-GbEkoB.css","assets/index-Csmg5oyu.js","assets/index-Crx61Qjc.css","assets/index-B6hY5GdS.js","assets/index-DKxf26_O.css","assets/index-DDecPuod.js","assets/compass-D6waJ52O.js","assets/zap-BAhZUPPa.js","assets/index-BlG-Rcwd.css","assets/index-Q0GC8Irj.js","assets/SectionHeader-BKc3BWXP.js","assets/Card-CN2lxY0Y.js","assets/index-8sDAOAcS.js","assets/index-CcUgN29Y.js","assets/index-ClU1uQYs.css","assets/triangle-alert-BZVAEUiL.js","assets/index-HqjZ5P-l.css","assets/index-CLKKui8G.js","assets/index-DDy4PkWT.js","assets/index-BvPolBSn.js","assets/index-DXFg6tGR.css","assets/index-3FxbJxwu.css","assets/index-BY3eQmfP.js","assets/index-BdixrK5I.css","assets/index-rLkONFpx.js","assets/index-faRHENEQ.css","assets/index-M8jf-YAZ.js","assets/sparkles-p-dZbjGb.js","assets/index-CoYWdJV1.css","assets/index-Cb4Ja0tZ.js","assets/MonetizationModeSummary-DYE7XUq1.js","assets/index-DGkgqtgJ.js","assets/index-Czg0RYGI.css","assets/layers-Dbwq9AyL.js","assets/Detail-CELZZ-4h.js","assets/index-YVB9ZW00.js","assets/index-BaQ9eM95.css","assets/list-checks-og1usOZf.js","assets/MonetizationMode-C7DNqium.js","assets/index-BLWgpW64.js","assets/index-AtMMzkp0.css","assets/index-mjEeEQcC.js","assets/index-BIrFkB6r.js","assets/index-CYnulX57.css","assets/index-vlN_-PRJ.css","assets/index-BwrZjkCc.js","assets/index-DfVst8q1.css","assets/index-CgXOkYrX.js","assets/index-WyNc-BTG.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();var ja=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ye(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var fu={exports:{}},Go={},hu={exports:{}},De={};var gv;function dP(){if(gv)return De;gv=1;var i=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.iterator;function S(I){return I===null||typeof I!="object"?null:(I=v&&I[v]||I["@@iterator"],typeof I=="function"?I:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,b={};function w(I,U,oe){this.props=I,this.context=U,this.refs=b,this.updater=oe||P}w.prototype.isReactComponent={},w.prototype.setState=function(I,U){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,U,"setState")},w.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function x(){}x.prototype=w.prototype;function O(I,U,oe){this.props=I,this.context=U,this.refs=b,this.updater=oe||P}var N=O.prototype=new x;N.constructor=O,T(N,w.prototype),N.isPureReactComponent=!0;var M=Array.isArray,F=Object.prototype.hasOwnProperty,j={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function z(I,U,oe){var ne,ie={},_e=null,ye=null;if(U!=null)for(ne in U.ref!==void 0&&(ye=U.ref),U.key!==void 0&&(_e=""+U.key),U)F.call(U,ne)&&!L.hasOwnProperty(ne)&&(ie[ne]=U[ne]);var ve=arguments.length-2;if(ve===1)ie.children=oe;else if(1<ve){for(var Ce=Array(ve),be=0;be<ve;be++)Ce[be]=arguments[be+2];ie.children=Ce}if(I&&I.defaultProps)for(ne in ve=I.defaultProps,ve)ie[ne]===void 0&&(ie[ne]=ve[ne]);return{$$typeof:i,type:I,key:_e,ref:ye,props:ie,_owner:j.current}}function W(I,U){return{$$typeof:i,type:I.type,key:U,ref:I.ref,props:I.props,_owner:I._owner}}function V(I){return typeof I=="object"&&I!==null&&I.$$typeof===i}function H(I){var U={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(oe){return U[oe]})}var re=/\/+/g;function ee(I,U){return typeof I=="object"&&I!==null&&I.key!=null?H(""+I.key):U.toString(36)}function se(I,U,oe,ne,ie){var _e=typeof I;(_e==="undefined"||_e==="boolean")&&(I=null);var ye=!1;if(I===null)ye=!0;else switch(_e){case"string":case"number":ye=!0;break;case"object":switch(I.$$typeof){case i:case e:ye=!0}}if(ye)return ye=I,ie=ie(ye),I=ne===""?"."+ee(ye,0):ne,M(ie)?(oe="",I!=null&&(oe=I.replace(re,"$&/")+"/"),se(ie,U,oe,"",function(be){return be})):ie!=null&&(V(ie)&&(ie=W(ie,oe+(!ie.key||ye&&ye.key===ie.key?"":(""+ie.key).replace(re,"$&/")+"/")+I)),U.push(ie)),1;if(ye=0,ne=ne===""?".":ne+":",M(I))for(var ve=0;ve<I.length;ve++){_e=I[ve];var Ce=ne+ee(_e,ve);ye+=se(_e,U,oe,Ce,ie)}else if(Ce=S(I),typeof Ce=="function")for(I=Ce.call(I),ve=0;!(_e=I.next()).done;)_e=_e.value,Ce=ne+ee(_e,ve++),ye+=se(_e,U,oe,Ce,ie);else if(_e==="object")throw U=String(I),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return ye}function ae(I,U,oe){if(I==null)return I;var ne=[],ie=0;return se(I,ne,"","",function(_e){return U.call(oe,_e,ie++)}),ne}function he(I){if(I._status===-1){var U=I._result;U=U(),U.then(function(oe){(I._status===0||I._status===-1)&&(I._status=1,I._result=oe)},function(oe){(I._status===0||I._status===-1)&&(I._status=2,I._result=oe)}),I._status===-1&&(I._status=0,I._result=U)}if(I._status===1)return I._result.default;throw I._result}var ue={current:null},K={transition:null},Z={ReactCurrentDispatcher:ue,ReactCurrentBatchConfig:K,ReactCurrentOwner:j};return De.Children={map:ae,forEach:function(I,U,oe){ae(I,function(){U.apply(this,arguments)},oe)},count:function(I){var U=0;return ae(I,function(){U++}),U},toArray:function(I){return ae(I,function(U){return U})||[]},only:function(I){if(!V(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},De.Component=w,De.Fragment=n,De.Profiler=s,De.PureComponent=O,De.StrictMode=r,De.Suspense=p,De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,De.cloneElement=function(I,U,oe){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var ne=T({},I.props),ie=I.key,_e=I.ref,ye=I._owner;if(U!=null){if(U.ref!==void 0&&(_e=U.ref,ye=j.current),U.key!==void 0&&(ie=""+U.key),I.type&&I.type.defaultProps)var ve=I.type.defaultProps;for(Ce in U)F.call(U,Ce)&&!L.hasOwnProperty(Ce)&&(ne[Ce]=U[Ce]===void 0&&ve!==void 0?ve[Ce]:U[Ce])}var Ce=arguments.length-2;if(Ce===1)ne.children=oe;else if(1<Ce){ve=Array(Ce);for(var be=0;be<Ce;be++)ve[be]=arguments[be+2];ne.children=ve}return{$$typeof:i,type:I.type,key:ie,ref:_e,props:ne,_owner:ye}},De.createContext=function(I){return I={$$typeof:c,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:l,_context:I},I.Consumer=I},De.createElement=z,De.createFactory=function(I){var U=z.bind(null,I);return U.type=I,U},De.createRef=function(){return{current:null}},De.forwardRef=function(I){return{$$typeof:u,render:I}},De.isValidElement=V,De.lazy=function(I){return{$$typeof:y,_payload:{_status:-1,_result:I},_init:he}},De.memo=function(I,U){return{$$typeof:f,type:I,compare:U===void 0?null:U}},De.startTransition=function(I){var U=K.transition;K.transition={};try{I()}finally{K.transition=U}},De.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},De.useCallback=function(I,U){return ue.current.useCallback(I,U)},De.useContext=function(I){return ue.current.useContext(I)},De.useDebugValue=function(){},De.useDeferredValue=function(I){return ue.current.useDeferredValue(I)},De.useEffect=function(I,U){return ue.current.useEffect(I,U)},De.useId=function(){return ue.current.useId()},De.useImperativeHandle=function(I,U,oe){return ue.current.useImperativeHandle(I,U,oe)},De.useInsertionEffect=function(I,U){return ue.current.useInsertionEffect(I,U)},De.useLayoutEffect=function(I,U){return ue.current.useLayoutEffect(I,U)},De.useMemo=function(I,U){return ue.current.useMemo(I,U)},De.useReducer=function(I,U,oe){return ue.current.useReducer(I,U,oe)},De.useRef=function(I){return ue.current.useRef(I)},De.useState=function(I){return ue.current.useState(I)},De.useSyncExternalStore=function(I,U,oe){return ue.current.useSyncExternalStore(I,U,oe)},De.useTransition=function(){return ue.current.useTransition()},De.version="18.2.0",De}var mv;function fs(){return mv||(mv=1,hu.exports=dP()),hu.exports}var yv;function pP(){if(yv)return Go;yv=1;var i=fs(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(u,p,f){var y,v={},S=null,P=null;f!==void 0&&(S=""+f),p.key!==void 0&&(S=""+p.key),p.ref!==void 0&&(P=p.ref);for(y in p)r.call(p,y)&&!l.hasOwnProperty(y)&&(v[y]=p[y]);if(u&&u.defaultProps)for(y in p=u.defaultProps,p)v[y]===void 0&&(v[y]=p[y]);return{$$typeof:e,type:u,key:S,ref:P,props:v,_owner:s.current}}return Go.Fragment=n,Go.jsx=c,Go.jsxs=c,Go}var vv;function fP(){return vv||(vv=1,fu.exports=pP()),fu.exports}var k=fP(),La={},gu={exports:{}},Mt={},mu={exports:{}},yu={};var bv;function hP(){return bv||(bv=1,(function(i){function e(K,Z){var I=K.length;K.push(Z);e:for(;0<I;){var U=I-1>>>1,oe=K[U];if(0<s(oe,Z))K[U]=Z,K[I]=oe,I=U;else break e}}function n(K){return K.length===0?null:K[0]}function r(K){if(K.length===0)return null;var Z=K[0],I=K.pop();if(I!==Z){K[0]=I;e:for(var U=0,oe=K.length,ne=oe>>>1;U<ne;){var ie=2*(U+1)-1,_e=K[ie],ye=ie+1,ve=K[ye];if(0>s(_e,I))ye<oe&&0>s(ve,_e)?(K[U]=ve,K[ye]=I,U=ye):(K[U]=_e,K[ie]=I,U=ie);else if(ye<oe&&0>s(ve,I))K[U]=ve,K[ye]=I,U=ye;else break e}}return Z}function s(K,Z){var I=K.sortIndex-Z.sortIndex;return I!==0?I:K.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;i.unstable_now=function(){return l.now()}}else{var c=Date,u=c.now();i.unstable_now=function(){return c.now()-u}}var p=[],f=[],y=1,v=null,S=3,P=!1,T=!1,b=!1,w=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(K){for(var Z=n(f);Z!==null;){if(Z.callback===null)r(f);else if(Z.startTime<=K)r(f),Z.sortIndex=Z.expirationTime,e(p,Z);else break;Z=n(f)}}function M(K){if(b=!1,N(K),!T)if(n(p)!==null)T=!0,he(F);else{var Z=n(f);Z!==null&&ue(M,Z.startTime-K)}}function F(K,Z){T=!1,b&&(b=!1,x(z),z=-1),P=!0;var I=S;try{for(N(Z),v=n(p);v!==null&&(!(v.expirationTime>Z)||K&&!H());){var U=v.callback;if(typeof U=="function"){v.callback=null,S=v.priorityLevel;var oe=U(v.expirationTime<=Z);Z=i.unstable_now(),typeof oe=="function"?v.callback=oe:v===n(p)&&r(p),N(Z)}else r(p);v=n(p)}if(v!==null)var ne=!0;else{var ie=n(f);ie!==null&&ue(M,ie.startTime-Z),ne=!1}return ne}finally{v=null,S=I,P=!1}}var j=!1,L=null,z=-1,W=5,V=-1;function H(){return!(i.unstable_now()-V<W)}function re(){if(L!==null){var K=i.unstable_now();V=K;var Z=!0;try{Z=L(!0,K)}finally{Z?ee():(j=!1,L=null)}}else j=!1}var ee;if(typeof O=="function")ee=function(){O(re)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ae=se.port2;se.port1.onmessage=re,ee=function(){ae.postMessage(null)}}else ee=function(){w(re,0)};function he(K){L=K,j||(j=!0,ee())}function ue(K,Z){z=w(function(){K(i.unstable_now())},Z)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(K){K.callback=null},i.unstable_continueExecution=function(){T||P||(T=!0,he(F))},i.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<K?Math.floor(1e3/K):5},i.unstable_getCurrentPriorityLevel=function(){return S},i.unstable_getFirstCallbackNode=function(){return n(p)},i.unstable_next=function(K){switch(S){case 1:case 2:case 3:var Z=3;break;default:Z=S}var I=S;S=Z;try{return K()}finally{S=I}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(K,Z){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var I=S;S=K;try{return Z()}finally{S=I}},i.unstable_scheduleCallback=function(K,Z,I){var U=i.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?U+I:U):I=U,K){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=I+oe,K={id:y++,callback:Z,priorityLevel:K,startTime:I,expirationTime:oe,sortIndex:-1},I>U?(K.sortIndex=I,e(f,K),n(p)===null&&K===n(f)&&(b?(x(z),z=-1):b=!0,ue(M,I-U))):(K.sortIndex=oe,e(p,K),T||P||(T=!0,he(F))),K},i.unstable_shouldYield=H,i.unstable_wrapCallback=function(K){var Z=S;return function(){var I=S;S=Z;try{return K.apply(this,arguments)}finally{S=I}}}})(yu)),yu}var Sv;function gP(){return Sv||(Sv=1,mu.exports=hP()),mu.exports}var wv;function mP(){if(wv)return Mt;wv=1;var i=fs(),e=gP();function n(t){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+t,a=1;a<arguments.length;a++)o+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+t+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function l(t,o){c(t,o),c(t+"Capture",o)}function c(t,o){for(s[t]=o,t=0;t<o.length;t++)r.add(o[t])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,y={},v={};function S(t){return p.call(v,t)?!0:p.call(y,t)?!1:f.test(t)?v[t]=!0:(y[t]=!0,!1)}function P(t,o,a,d){if(a!==null&&a.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return d?!1:a!==null?!a.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function T(t,o,a,d){if(o===null||typeof o>"u"||P(t,o,a,d))return!0;if(d)return!1;if(a!==null)switch(a.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function b(t,o,a,d,h,m,C){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=d,this.attributeNamespace=h,this.mustUseProperty=a,this.propertyName=t,this.type=o,this.sanitizeURL=m,this.removeEmptyString=C}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){w[t]=new b(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var o=t[0];w[o]=new b(o,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){w[t]=new b(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){w[t]=new b(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){w[t]=new b(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){w[t]=new b(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){w[t]=new b(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){w[t]=new b(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){w[t]=new b(t,5,!1,t.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function O(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var o=t.replace(x,O);w[o]=new b(o,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var o=t.replace(x,O);w[o]=new b(o,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var o=t.replace(x,O);w[o]=new b(o,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){w[t]=new b(t,1,!1,t.toLowerCase(),null,!1,!1)}),w.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){w[t]=new b(t,1,!1,t.toLowerCase(),null,!0,!0)});function N(t,o,a,d){var h=w.hasOwnProperty(o)?w[o]:null;(h!==null?h.type!==0:d||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(T(o,a,h,d)&&(a=null),d||h===null?S(o)&&(a===null?t.removeAttribute(o):t.setAttribute(o,""+a)):h.mustUseProperty?t[h.propertyName]=a===null?h.type===3?!1:"":a:(o=h.attributeName,d=h.attributeNamespace,a===null?t.removeAttribute(o):(h=h.type,a=h===3||h===4&&a===!0?"":""+a,d?t.setAttributeNS(d,o,a):t.setAttribute(o,a))))}var M=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,F=Symbol.for("react.element"),j=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),H=Symbol.for("react.context"),re=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),ae=Symbol.for("react.memo"),he=Symbol.for("react.lazy"),ue=Symbol.for("react.offscreen"),K=Symbol.iterator;function Z(t){return t===null||typeof t!="object"?null:(t=K&&t[K]||t["@@iterator"],typeof t=="function"?t:null)}var I=Object.assign,U;function oe(t){if(U===void 0)try{throw Error()}catch(a){var o=a.stack.trim().match(/\n( *(at )?)/);U=o&&o[1]||""}return`
|
|
3
3
|
`+U+t}var ne=!1;function ie(t,o){if(!t||ne)return"";ne=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(G){var d=G}Reflect.construct(t,[],o)}else{try{o.call()}catch(G){d=G}t.call(o.prototype)}else{try{throw Error()}catch(G){d=G}t()}}catch(G){if(G&&d&&typeof G.stack=="string"){for(var h=G.stack.split(`
|
|
4
4
|
`),m=d.stack.split(`
|
|
@@ -18,4 +18,4 @@ Error generating stack: `+m.message+`
|
|
|
18
18
|
</svg>
|
|
19
19
|
`);function kg(){return typeof window>"u"?new URLSearchParams:new URLSearchParams(window.location.search)}function Pl(){if(typeof window>"u")return!1;if(kg().get(IG)==="1")return!0;try{return window.localStorage.getItem(RG)==="1"}catch{return!1}}function Pg(){return kg().get(NG)||"default"}function LG(i){const e=kg().get(jG);if(e==="en-US"||e==="zh-CN")return e;const n=i?.["X-TTMG-Docs-Lang"]||i?.["x-ttmg-docs-lang"];return n==="en-US"||n==="zh-CN"?n:"zh-CN"}function Tg(){return Pg()==="wasm.prepare"}function AG(){return Pg()==="upload.permission-restricted"}function MG(i){try{return new URL(i,typeof window>"u"?"http://localhost":window.location.origin).pathname}catch{return i.split("?")[0]}}function $G(i){const e=LG(i),n=Tg(),r=n?A0:L0;return{data:{schema:`snssdk1233://microapp?app_id=ttmg-doc-fixture&launch_from=devtool_docs&host=${Ew}&host_list=${encodeURIComponent(JSON.stringify([Ew]))}&port=3000&ws_port=2999`,nodeWsPort:4e3,nodeServerPort:3e3,nodeStaticBaseUrl:"http://127.0.0.1:3000",user:{user_id:"doc-user",email:"devtool-doc@example.com"},devToolVersion:"0.4.3",packages:r,engine:n?"unity":"cocos",clientKey:xh,checkResult:[],lang:e}}}function FG(){const i=Tg(),e=i?A0:L0,n={data:{name:i?"Unity Wasm Sample":"Coins Sort 20",client_key:xh,size:e.reduce((r,s)=>r+s.size,0),description:"A sample mini game used for DevTool documentation screenshots.",icon_url:`data:image/svg+xml;charset=utf-8,${xw}`,display_icon_url:`data:image/svg+xml;charset=utf-8,${xw}`,created_at:1728e6,privacy_policy_link:"https://example.com/privacy",terms_of_service_link:"https://example.com/terms",request_allowed_domains:["https://api.example.com","https://assets.example.com"],sandbox_info:{sandbox_id:"doc-sandbox"},app_id:"ttmg-doc-fixture",packages:e,update_time:1728e6,scopes:["user.info.basic","im.share"]}};return AG()&&(n.error={errorCode:403,errorMsg:"The current account does not have permission for this game.",clientKey:xh}),n}function zG({url:i,method:e,headers:n}){if(!Pl())return null;const r=MG(i),s=e.toUpperCase();return s==="GET"&&r==="/game/config"?$G(n):s==="GET"&&r==="/game/detail"?FG():s==="GET"&&r==="/game/wasm-split-config"&&Tg()?{code:0,data:{enableWasmCollect:!1,enableWasmSplit:!1}}:r==="/game/config-fillback"?{isSuccess:!0,data:{}}:null}const qG=6e5,BG={error:{errorCode:-1,errorMsg:"Request failed"},isSuccess:!1,msg:"Request failed"},GG={error:{errorCode:-1,errorMsg:"Request timeout"},isSuccess:!1,msg:"Request timeout"};function Ki(i){const{url:e,method:n="GET",data:r=void 0,headers:s={},timeout:l=qG}=i;let c=e;const u={method:n,headers:{"Content-Type":"application/json",...s}};if(n.toUpperCase()==="GET"&&r){const v=new URLSearchParams(r).toString();c+=(c.includes("?")?"&":"?")+v}else r&&(u.body=JSON.stringify(r));const p=zG({url:c,method:n,headers:s});if(p)return Promise.resolve(p);const f=new AbortController,y=setTimeout(()=>f.abort(),l);return u.signal=f.signal,fetch(c,u).then(async v=>{if(!v.ok)return{error:{errorCode:-1,errorMsg:v.statusText},isSuccess:!1,msg:v.statusText};const S=v.headers.get("content-type");if(S&&S.includes("application/json"))try{const P=await v.text();return P.trim()?JSON.parse(P):{isSuccess:!0,data:{}}}catch(P){throw new Error(`Failed to parse JSON response: ${P instanceof Error?P.message:"Unknown error"}`)}else return v.text()}).catch(v=>v instanceof DOMException&&v.name==="AbortError"?GG:BG).finally(()=>{clearTimeout(y)})}const Jo={allowed_domains:[],client_key_type:2,stage:2,description:"TTMG Dev Game",entity:"",icon_big_url:"",icon_url:"",minis_category:"mini_game",minis_status:1,minis_tech_type:0,minis_type:2,scopes:["user.info.open_id","user.info.basic"],tos_url:"",update_time:Date.now(),status_code:0,status_msg:"",name:"TikTok Mini Game"};async function WG(i){const{scopes:e,update_time:n,display_icon_url:r,request_allowed_domains:s,name:l,terms_of_service_link:c,privacy_policy_link:u,description:p}=i||Jo,f=I0(),y={...Jo,tos_url:c,privacy_url:u,name:l||Jo.name,icon_url:r||Jo.icon_url,icon_big_url:r||Jo.icon_url,client_key:Pe.get("clientKey"),minis_url:`https://minis-${Pe.get("clientKey")}-vdebug-minigame.tiktok-minis.us/`,package_config:JSON.stringify({packages:Pe.get("packages")}),allowed_domains:s||[],status_code:0,status_msg:"",update_time:n,description:p,scopes:e};console.log(`🚀 ${D("startToSendMetaToClient")}`,y);const v=await Ki({url:`${f}/game/meta`,method:"POST",data:y,headers:{"Content-Type":"application/json"}});return console.log(`✅ ${D("sendMetaToClientSuccess")}`),v}async function Dw(){const i=document.getElementById(_g);return new Promise(e=>{i.onload=()=>{i.onload=null,e(i)},i.contentWindow?.location.reload()})}const M0="debugMode";function Eg(i){return(i||"").trim().replace(/^v/i,"")}function UG(){const i=[Wa,Ua];try{const e=JSON.parse(localStorage.getItem(R0)||"[]");if(e.length){const n=e.filter(r=>r.id!==Ua.id).filter(r=>r.id!==Wa.id);return[Wa,...n,Ua]}else return i}catch{return i}}function HG(i){try{localStorage.setItem(R0,JSON.stringify(i))}catch(e){console.error("Failed to save launch options:",e)}}function VG(i){try{localStorage.setItem(j0,JSON.stringify(i))}catch(e){console.error("Failed to save debug setting:",e)}}function KG(){const i={enableAdMock:!1,enableIAPMock:!1,enableDomainCheck:!0,enableVConsole:!1,enableDevInfoPanel:!0},e={enableAdMock:!1,enableIAPMock:!1,enableDomainCheck:!0,enableVConsole:!0,enableDevInfoPanel:!0},r=$0()===qn.browserDebug;try{const s=localStorage.getItem(j0);if(s){const l=JSON.parse(s);return r?{...l,enableVConsole:!1}:l}}catch(s){console.error("Failed to get debug setting:",s)}return r?i:e}function $0(){try{return F0()??qn.browserDebug}catch(i){return console.error("Failed to get debug mode:",i),qn.browserDebug}}function F0(){try{const i=localStorage.getItem(M0);return i&&Object.values(qn).includes(i)?i:null}catch(i){return console.error("Failed to get stored debug mode:",i),null}}function z0(i){try{localStorage.setItem(M0,i)}catch(e){console.error("Failed to save debug mode:",e)}}function QG(){try{return Eg(localStorage.getItem(N0))}catch(i){return console.error("Failed to get changelog last seen version:",i),""}}function YG(i){const e=Eg(i);if(e)try{localStorage.setItem(N0,e)}catch(n){console.error("Failed to save changelog last seen version:",n)}}function XG(i){const e=Eg(i);if(!e)return!1;const n=QG();return n?e!==n:!0}function ZG(){const i={header:"font-weight:700;font-size:16px",subtitle:"font-weight:600;font-size:12px",desc:"font-size:12px",supportVersion:"font-size:12px; background:#FFE4B5;padding:1px 6px;border-radius:3px; color:#8B4513",tagBrowser:"background:#4F8BFF;color:#fff;border-radius:3px;padding:1px 6px",tagClient:"background:#22C55E;color:#fff;border-radius:3px;padding:1px 6px",bulletKey:"font-weight:600",bulletVal:"font-size:12px",tip:"font-size:12px;font-style:italic"},e={browserRemoteDebugDesc:D("browserRemoteDebugDesc"),clientRealPreviewDesc:D("clientRealPreviewDesc"),scanTips:D("debug.scan.tips"),browser:{title:D("debug.mode.browser.title"),points:{logic:D("debug.mode.browser.point.logic"),devtools:D("debug.mode.browser.point.devtools"),preview:D("debug.mode.browser.point.preview")}},client:{title:D("debug.mode.client.title"),supportVersion:D("debug.mode.client.supportVersion"),points:{logic:D("debug.mode.client.point.logic"),vconsole:D("debug.mode.client.point.vconsole"),preview:D("debug.mode.client.point.preview")}},customTip:D("debug.mode.custom.tip")};console.log("%c%s",i.header,`📌 ${D("debug.guide.header")}`),console.log("%c%s",i.desc,e.scanTips),console.group("%c%s %cBROWSER",i.subtitle,e.browser.title,i.tagBrowser),console.log("%c• %c%s",i.bulletKey,i.bulletVal,e.browser.points.logic),console.log("%c• %c%s",i.bulletKey,i.bulletVal,e.browser.points.devtools),console.log("%c• %c%s",i.bulletKey,i.bulletVal,e.browser.points.preview),console.groupEnd(),console.group("%c%s %cDEVICE",i.subtitle,e.client.title,i.tagClient),console.log("%c%s",i.supportVersion,e.client.supportVersion),console.log("%c• %c%s",i.bulletKey,i.bulletVal,e.client.points.logic),console.log("%c• %c%s",i.bulletKey,i.bulletVal,e.client.points.vconsole),console.log("%c• %c%s",i.bulletKey,i.bulletVal,e.client.points.preview),console.groupEnd(),console.log("%c💡 %s",i.tip,e.customTip)}const JG="ttmg.";function eW(i){return i===""||i==="1"||i==="true"}function q0(i){const e=JG+i;try{const n=new URLSearchParams(window.location.search);if(n.has(i)){const r=eW(n.get(i));try{r?sessionStorage.setItem(e,"1"):sessionStorage.removeItem(e)}catch{}return r}}catch{}try{return sessionStorage.getItem(e)==="1"}catch{return!1}}const tW=q0("enableExperiment"),nW=q0("enableLocalDev");function ZH(){return tW}function JH(){return nW}function ah({baseSchema:i,option:e,debugMode:n}){if(e){const{scene:r,pkgName:s,queries:l}=e;let u=`${i}&debugMode=${n}&_tiktok_minis_params=${encodeURIComponent(JSON.stringify({enter_from:r,ttmg_init_module:s}))}`;if(l){const p=xG(l);p&&Object.keys(p).forEach(f=>{u+=`&${f}=${encodeURIComponent(p[f])}`})}return u}else return i}const rW=-1001;function xg(i){return!!(i?.user_id||i?.email)}function Dg(i){const{errorCode:e,user:n}=i;return e===rW||e===0?"networkProxy":e?e===404?"notFound":e===403?"noPermission":e===401?xg(n)?"loginExpired":"notLoggedIn":"unknown":"ok"}function iW(i){const{clientKey:e,errorMsg:n}=i,r=Dg(i);return r==="notFound"?D("getDevGameDetailNotFound",{clientKey:e}):r==="noPermission"?D("gameDetailNoPermission",{clientKey:e}):r==="loginExpired"?D("gameLoginExpired",{clientKey:e}):r==="networkProxy"?D("gameDetailNetworkProxyBlocked",{clientKey:e}):r==="notLoggedIn"?D("gameDetailNotLogin",{clientKey:e}):n||""}const B0="tt-theme";function oW(){try{const i=window.localStorage.getItem(B0);if(i==="light"||i==="dark")return i}catch{}return null}function sW(i){try{window.localStorage.setItem(B0,i)}catch{}}function aW(){const i=oW();return i||"light"}function G0(i){if(typeof document>"u")return;const e=document.documentElement,n=document.body;e.setAttribute("data-theme",i),n&&(n.setAttribute("data-theme",i),n.setAttribute("theme-mode",i))}function Ow(i){G0(i),sW(i)}function lW(){return typeof document>"u"?"light":document.documentElement.getAttribute("data-theme")||"light"}function cW(){const i=aW();return G0(i),i}const uW={devToolVersion:"",engine:"unknown",isConnected:!1,hasSetup:!1,showManualBindIP:!1,debugMode:$0(),schema:"",devSchema:"",gameDetail:null,user:null,feature:{upload:!0,loginStatus:!0,debugSetting:!0,launchMode:!0,sidebar:{enable:!0,info:!1,launch:!1,setting:!1,log:!1,code:!1}},launchOptions:UG(),selectedLaunchOption:Wa,loading:{visible:!0,text:D("loading")},error:{text:""},message:{type:"info",title:D("disConnectionStatusTitle"),desc:D("disConnectionStatusDesc")},debugSetting:KG(),packages:[]};function dW(i,e){switch(e.type){case"SHOW_LOADING":return{...i,loading:{visible:!0,text:e.payload??D("loading")}};case"HIDE_LOADING":return{...i,loading:{...i.loading,visible:!1}};case"SET_MESSAGE":return{...i,message:e.payload};case"SET_IS_CONNECTED":return{...i,isConnected:e.payload};case"SET_SCHEMA":return{...i,schema:e.payload,devSchema:ah({baseSchema:e.payload,option:i.selectedLaunchOption,debugMode:i.debugMode})};case"CLEAR_MESSAGE":return{...i,message:{type:"info",title:"",desc:""}};case"SET_USER":return{...i,user:e.payload};case"SET_LAUNCH_OPTIONS":return HG(e.payload),{...i,launchOptions:e.payload};case"SET_SELECTED_LAUNCH_OPTION":return{...i,selectedLaunchOption:e.payload,devSchema:ah({baseSchema:i.schema,option:e.payload,debugMode:i.debugMode})};case"SET_PACKAGES":return{...i,packages:e.payload};case"SET_DEBUG_SETTING":return VG(e.payload),{...i,debugSetting:e.payload};case"SET_GAME_DETAIL":return{...i,gameDetail:e.payload};case"SET_HAS_SETUP":return{...i,hasSetup:e.payload};case"SET_ERROR":return{...i,error:e.payload};case"SET_DEV_TOOL_VERSION":return{...i,devToolVersion:e.payload};case"SET_DEBUG_MODE":return{...i,debugMode:e.payload,devSchema:ah({baseSchema:i.schema,option:i.selectedLaunchOption,debugMode:e.payload})};case"SET_SHOW_MANUAL_BIND_IP":return{...i,showManualBindIP:e.payload};case"SET_ENGINE":return{...i,engine:e.payload};default:return i}}const pW=({children:i})=>{const[e,n]=E.useReducer(dW,uW),r=E.useCallback(j=>{n({type:"SET_IS_CONNECTED",payload:j})},[]),s=E.useCallback(j=>{n({type:"SHOW_LOADING",payload:j})},[]),l=E.useCallback(()=>{setTimeout(()=>{n({type:"HIDE_LOADING"})},500)},[]),c=E.useCallback(j=>{n({type:"SET_MESSAGE",payload:j})},[]),u=E.useCallback(()=>{n({type:"CLEAR_MESSAGE"})},[]),p=E.useCallback(j=>{n({type:"SET_SCHEMA",payload:j})},[]),f=E.useCallback(j=>{n({type:"SET_USER",payload:j})},[]),y=E.useCallback(j=>{n({type:"SET_LAUNCH_OPTIONS",payload:j})},[]),v=E.useCallback(j=>{n({type:"SET_SELECTED_LAUNCH_OPTION",payload:j})},[]),S=E.useCallback(j=>{n({type:"SET_DEBUG_SETTING",payload:j})},[]),P=E.useCallback(j=>{n({type:"SET_PACKAGES",payload:j})},[]),T=E.useCallback(j=>{n({type:"SET_GAME_DETAIL",payload:j})},[]),b=E.useCallback(j=>{n({type:"SET_HAS_SETUP",payload:j})},[]),w=E.useCallback(j=>{n({type:"SET_ERROR",payload:j})},[]),x=E.useCallback(j=>{n({type:"SET_DEV_TOOL_VERSION",payload:j})},[]),O=E.useCallback(j=>{n({type:"SET_DEBUG_MODE",payload:j})},[]),N=E.useCallback(j=>{n({type:"SET_SHOW_MANUAL_BIND_IP",payload:j})},[]),M=E.useCallback(j=>{n({type:"SET_ENGINE",payload:j})},[]),F=E.useMemo(()=>({state:e,showLoading:s,hideLoading:l,setIsConnected:r,setSchema:p,setMessage:c,clearMessage:u,setUser:f,setLaunchOptions:y,setSelectedLaunchOption:v,setDebugSetting:S,setPackages:P,setGameDetail:T,setHasSetup:b,setError:w,setDevToolVersion:x,setDebugMode:O,setShowManualBindIP:N,setEngine:M}),[e,s,l,r,p,c,u,f,y,v,S,P,T,b,w,x,O,N,M]);return k.jsx(Cg.Provider,{value:F,children:i})};var Iw="popstate";function Rw(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function fW(i={}){function e(r,s){let l=s.state?.masked,{pathname:c,search:u,hash:p}=l||r.location;return Dh("",{pathname:c,search:u,hash:p},s.state&&s.state.usr||null,s.state&&s.state.key||"default",l?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,s){return typeof s=="string"?s:ps(s)}return gW(e,n,null,i)}function He(i,e){if(i===!1||i===null||typeof i>"u")throw new Error(e)}function kn(i,e){if(!i){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function hW(){return Math.random().toString(36).substring(2,10)}function Nw(i,e){return{usr:i.state,key:i.key,idx:e,masked:i.unstable_mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function Dh(i,e,n=null,r,s){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof e=="string"?to(e):e,state:n,key:e&&e.key||r||hW(),unstable_mask:s}}function ps({pathname:i="/",search:e="",hash:n=""}){return e&&e!=="?"&&(i+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(i+=n.charAt(0)==="#"?n:"#"+n),i}function to(i){let e={};if(i){let n=i.indexOf("#");n>=0&&(e.hash=i.substring(n),i=i.substring(0,n));let r=i.indexOf("?");r>=0&&(e.search=i.substring(r),i=i.substring(0,r)),i&&(e.pathname=i)}return e}function gW(i,e,n,r={}){let{window:s=document.defaultView,v5Compat:l=!1}=r,c=s.history,u="POP",p=null,f=y();f==null&&(f=0,c.replaceState({...c.state,idx:f},""));function y(){return(c.state||{idx:null}).idx}function v(){u="POP";let w=y(),x=w==null?null:w-f;f=w,p&&p({action:u,location:b.location,delta:x})}function S(w,x){u="PUSH";let O=Rw(w)?w:Dh(b.location,w,x);f=y()+1;let N=Nw(O,f),M=b.createHref(O.unstable_mask||O);try{c.pushState(N,"",M)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;s.location.assign(M)}l&&p&&p({action:u,location:b.location,delta:1})}function P(w,x){u="REPLACE";let O=Rw(w)?w:Dh(b.location,w,x);f=y();let N=Nw(O,f),M=b.createHref(O.unstable_mask||O);c.replaceState(N,"",M),l&&p&&p({action:u,location:b.location,delta:0})}function T(w){return mW(w)}let b={get action(){return u},get location(){return i(s,c)},listen(w){if(p)throw new Error("A history only accepts one active listener");return s.addEventListener(Iw,v),p=w,()=>{s.removeEventListener(Iw,v),p=null}},createHref(w){return e(s,w)},createURL:T,encodeLocation(w){let x=T(w);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:S,replace:P,go(w){return c.go(w)}};return b}function mW(i,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),He(n,"No window.location.(origin|href) available to create URL");let r=typeof i=="string"?i:ps(i);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function W0(i,e,n="/"){return yW(i,e,n,!1)}function yW(i,e,n,r){let s=typeof e=="string"?to(e):e,l=ir(s.pathname||"/",n);if(l==null)return null;let c=U0(i);vW(c);let u=null;for(let p=0;u==null&&p<c.length;++p){let f=DW(l);u=EW(c[p],f,r)}return u}function U0(i,e=[],n=[],r="",s=!1){let l=(c,u,p=s,f)=>{let y={relativePath:f===void 0?c.path||"":f,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(r)&&p)return;He(y.relativePath.startsWith(r),`Absolute route path "${y.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(r.length)}let v=Fn([r,y.relativePath]),S=n.concat(y);c.children&&c.children.length>0&&(He(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),U0(c.children,e,S,v,p)),!(c.path==null&&!c.index)&&e.push({path:v,score:PW(v,c.index),routesMeta:S})};return i.forEach((c,u)=>{if(c.path===""||!c.path?.includes("?"))l(c,u);else for(let p of H0(c.path))l(c,u,!0,p)}),e}function H0(i){let e=i.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return s?[l,""]:[l];let c=H0(r.join("/")),u=[];return u.push(...c.map(p=>p===""?l:[l,p].join("/"))),s&&u.push(...c),u.map(p=>i.startsWith("/")&&p===""?"/":p)}function vW(i){i.sort((e,n)=>e.score!==n.score?n.score-e.score:TW(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var bW=/^:[\w-]+$/,SW=3,wW=2,CW=1,_W=10,kW=-2,jw=i=>i==="*";function PW(i,e){let n=i.split("/"),r=n.length;return n.some(jw)&&(r+=kW),e&&(r+=wW),n.filter(s=>!jw(s)).reduce((s,l)=>s+(bW.test(l)?SW:l===""?CW:_W),r)}function TW(i,e){return i.length===e.length&&i.slice(0,-1).every((r,s)=>r===e[s])?i[i.length-1]-e[e.length-1]:0}function EW(i,e,n=!1){let{routesMeta:r}=i,s={},l="/",c=[];for(let u=0;u<r.length;++u){let p=r[u],f=u===r.length-1,y=l==="/"?e:e.slice(l.length)||"/",v=Ja({path:p.relativePath,caseSensitive:p.caseSensitive,end:f},y),S=p.route;if(!v&&f&&n&&!r[r.length-1].route.index&&(v=Ja({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},y)),!v)return null;Object.assign(s,v.params),c.push({params:s,pathname:Fn([l,v.pathname]),pathnameBase:NW(Fn([l,v.pathnameBase])),route:S}),v.pathnameBase!=="/"&&(l=Fn([l,v.pathnameBase]))}return c}function Ja(i,e){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[n,r]=xW(i.path,i.caseSensitive,i.end),s=e.match(n);if(!s)return null;let l=s[0],c=l.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((f,{paramName:y,isOptional:v},S)=>{if(y==="*"){let T=u[S]||"";c=l.slice(0,l.length-T.length).replace(/(.)\/+$/,"$1")}const P=u[S];return v&&!P?f[y]=void 0:f[y]=(P||"").replace(/%2F/g,"/"),f},{}),pathname:l,pathnameBase:c,pattern:i}}function xW(i,e=!1,n=!0){kn(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let r=[],s="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,p,f,y)=>{if(r.push({paramName:u,isOptional:p!=null}),p){let v=y.charAt(f+c.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(r.push({paramName:"*"}),s+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":i!==""&&i!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function DW(i){try{return i.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return kn(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),i}}function ir(i,e){if(e==="/")return i;if(!i.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=i.charAt(n);return r&&r!=="/"?null:i.slice(n)||"/"}var OW=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function IW(i,e="/"){let{pathname:n,search:r="",hash:s=""}=typeof i=="string"?to(i):i,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=Lw(n.substring(1),"/"):l=Lw(n,e)):l=e,{pathname:l,search:jW(r),hash:LW(s)}}function Lw(i,e){let n=e.replace(/\/+$/,"").split("/");return i.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function lh(i,e,n,r){return`Cannot include a '${i}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function RW(i){return i.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Og(i){let e=RW(i);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function Tl(i,e,n,r=!1){let s;typeof i=="string"?s=to(i):(s={...i},He(!s.pathname||!s.pathname.includes("?"),lh("?","pathname","search",s)),He(!s.pathname||!s.pathname.includes("#"),lh("#","pathname","hash",s)),He(!s.search||!s.search.includes("#"),lh("#","search","hash",s)));let l=i===""||s.pathname==="",c=l?"/":s.pathname,u;if(c==null)u=n;else{let v=e.length-1;if(!r&&c.startsWith("..")){let S=c.split("/");for(;S[0]==="..";)S.shift(),v-=1;s.pathname=S.join("/")}u=v>=0?e[v]:"/"}let p=IW(s,u),f=c&&c!=="/"&&c.endsWith("/"),y=(l||c===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(f||y)&&(p.pathname+="/"),p}var Fn=i=>i.join("/").replace(/\/\/+/g,"/"),NW=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),jW=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,LW=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,AW=class{constructor(i,e,n,r=!1){this.status=i,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function MW(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function $W(i){return i.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var V0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function K0(i,e){let n=i;if(typeof n!="string"||!OW.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(V0)try{let l=new URL(window.location.href),c=n.startsWith("//")?new URL(l.protocol+n):new URL(n),u=ir(c.pathname,e);c.origin===l.origin&&u!=null?n=u+c.search+c.hash:s=!0}catch{kn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Q0=["POST","PUT","PATCH","DELETE"];new Set(Q0);var FW=["GET",...Q0];new Set(FW);var no=E.createContext(null);no.displayName="DataRouter";var El=E.createContext(null);El.displayName="DataRouterState";var zW=E.createContext(!1),Y0=E.createContext({isTransitioning:!1});Y0.displayName="ViewTransition";var qW=E.createContext(new Map);qW.displayName="Fetchers";var BW=E.createContext(null);BW.displayName="Await";var Zt=E.createContext(null);Zt.displayName="Navigation";var Cs=E.createContext(null);Cs.displayName="Location";var En=E.createContext({outlet:null,matches:[],isDataRoute:!1});En.displayName="Route";var Ig=E.createContext(null);Ig.displayName="RouteError";var X0="REACT_ROUTER_ERROR",GW="REDIRECT",WW="ROUTE_ERROR_RESPONSE";function UW(i){if(i.startsWith(`${X0}:${GW}:{`))try{let e=JSON.parse(i.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function HW(i){if(i.startsWith(`${X0}:${WW}:{`))try{let e=JSON.parse(i.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new AW(e.status,e.statusText,e.data)}catch{}}function VW(i,{relative:e}={}){He(ro(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=E.useContext(Zt),{hash:s,pathname:l,search:c}=ks(i,{relative:e}),u=l;return n!=="/"&&(u=l==="/"?n:Fn([n,l])),r.createHref({pathname:u,search:c,hash:s})}function ro(){return E.useContext(Cs)!=null}function sr(){return He(ro(),"useLocation() may be used only in the context of a <Router> component."),E.useContext(Cs).location}var Z0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function J0(i){E.useContext(Zt).static||E.useLayoutEffect(i)}function _s(){let{isDataRoute:i}=E.useContext(En);return i?sU():KW()}function KW(){He(ro(),"useNavigate() may be used only in the context of a <Router> component.");let i=E.useContext(no),{basename:e,navigator:n}=E.useContext(Zt),{matches:r}=E.useContext(En),{pathname:s}=sr(),l=JSON.stringify(Og(r)),c=E.useRef(!1);return J0(()=>{c.current=!0}),E.useCallback((p,f={})=>{if(kn(c.current,Z0),!c.current)return;if(typeof p=="number"){n.go(p);return}let y=Tl(p,JSON.parse(l),s,f.relative==="path");i==null&&e!=="/"&&(y.pathname=y.pathname==="/"?e:Fn([e,y.pathname])),(f.replace?n.replace:n.push)(y,f.state,f)},[e,n,l,s,i])}E.createContext(null);function eV(){let{matches:i}=E.useContext(En),e=i[i.length-1];return e?e.params:{}}function ks(i,{relative:e}={}){let{matches:n}=E.useContext(En),{pathname:r}=sr(),s=JSON.stringify(Og(n));return E.useMemo(()=>Tl(i,JSON.parse(s),r,e==="path"),[i,s,r,e])}function QW(i,e){return e_(i,e)}function e_(i,e,n){He(ro(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=E.useContext(Zt),{matches:s}=E.useContext(En),l=s[s.length-1],c=l?l.params:{},u=l?l.pathname:"/",p=l?l.pathnameBase:"/",f=l&&l.route;{let w=f&&f.path||"";n_(u,!f||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
20
20
|
|
|
21
|
-
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let y=sr(),v;if(e){let w=typeof e=="string"?to(e):e;He(p==="/"||w.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${w.pathname}" was given in the \`location\` prop.`),v=w}else v=y;let S=v.pathname||"/",P=S;if(p!=="/"){let w=p.replace(/^\//,"").split("/");P="/"+S.replace(/^\//,"").split("/").slice(w.length).join("/")}let T=W0(i,{pathname:P});kn(f||T!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),kn(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let b=eU(T&&T.map(w=>Object.assign({},w,{params:Object.assign({},c,w.params),pathname:Fn([p,r.encodeLocation?r.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?p:Fn([p,r.encodeLocation?r.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),s,n);return e&&b?E.createElement(Cs.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},b):b}function YW(){let i=oU(),e=MW(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),n=i instanceof Error?i.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},l={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",i),c=E.createElement(E.Fragment,null,E.createElement("p",null,"💿 Hey developer 👋"),E.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",E.createElement("code",{style:l},"ErrorBoundary")," or"," ",E.createElement("code",{style:l},"errorElement")," prop on your route.")),E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},e),n?E.createElement("pre",{style:s},n):null,c)}var XW=E.createElement(YW,null),t_=class extends E.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,e){return e.location!==i.location||e.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:e.error,location:e.location,revalidation:i.revalidation||e.revalidation}}componentDidCatch(i,e){this.props.onError?this.props.onError(i,e):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const n=HW(i.digest);n&&(i=n)}let e=i!==void 0?E.createElement(En.Provider,{value:this.props.routeContext},E.createElement(Ig.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?E.createElement(ZW,{error:i},e):e}};t_.contextType=zW;var ch=new WeakMap;function ZW({children:i,error:e}){let{basename:n}=E.useContext(Zt);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=UW(e.digest);if(r){let s=ch.get(e);if(s)throw s;let l=K0(r.location,n);if(V0&&!ch.get(e))if(l.isExternal||r.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:r.replace}));throw ch.set(e,c),c}return E.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return i}function JW({routeContext:i,match:e,children:n}){let r=E.useContext(no);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),E.createElement(En.Provider,{value:i},n)}function eU(i,e=[],n){let r=n?.state;if(i==null){if(!r)return null;if(r.errors)i=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)i=r.matches;else return null}let s=i,l=r?.errors;if(l!=null){let y=s.findIndex(v=>v.route.id&&l?.[v.route.id]!==void 0);He(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,y+1))}let c=!1,u=-1;if(n&&r){c=r.renderFallback;for(let y=0;y<s.length;y++){let v=s[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(u=y),v.route.id){let{loaderData:S,errors:P}=r,T=v.route.loader&&!S.hasOwnProperty(v.route.id)&&(!P||P[v.route.id]===void 0);if(v.route.lazy||T){n.isStatic&&(c=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let p=n?.onError,f=r&&p?(y,v)=>{p(y,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:$W(r.matches),errorInfo:v})}:void 0;return s.reduceRight((y,v,S)=>{let P,T=!1,b=null,w=null;r&&(P=l&&v.route.id?l[v.route.id]:void 0,b=v.route.errorElement||XW,c&&(u<0&&S===0?(n_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,w=null):u===S&&(T=!0,w=v.route.hydrateFallbackElement||null)));let x=e.concat(s.slice(0,S+1)),O=()=>{let N;return P?N=b:T?N=w:v.route.Component?N=E.createElement(v.route.Component,null):v.route.element?N=v.route.element:N=y,E.createElement(JW,{match:v,routeContext:{outlet:y,matches:x,isDataRoute:r!=null},children:N})};return r&&(v.route.ErrorBoundary||v.route.errorElement||S===0)?E.createElement(t_,{location:r.location,revalidation:r.revalidation,component:b,error:P,children:O(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:f}):O()},null)}function Rg(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tU(i){let e=E.useContext(no);return He(e,Rg(i)),e}function nU(i){let e=E.useContext(El);return He(e,Rg(i)),e}function rU(i){let e=E.useContext(En);return He(e,Rg(i)),e}function Ng(i){let e=rU(i),n=e.matches[e.matches.length-1];return He(n.route.id,`${i} can only be used on routes that contain a unique "id"`),n.route.id}function iU(){return Ng("useRouteId")}function oU(){let i=E.useContext(Ig),e=nU("useRouteError"),n=Ng("useRouteError");return i!==void 0?i:e.errors?.[n]}function sU(){let{router:i}=tU("useNavigate"),e=Ng("useNavigate"),n=E.useRef(!1);return J0(()=>{n.current=!0}),E.useCallback(async(s,l={})=>{kn(n.current,Z0),n.current&&(typeof s=="number"?await i.navigate(s):await i.navigate(s,{fromRouteId:e,...l}))},[i,e])}var Aw={};function n_(i,e,n){!e&&!Aw[i]&&(Aw[i]=!0,kn(!1,n))}E.memo(aU);function aU({routes:i,future:e,state:n,isStatic:r,onError:s}){return e_(i,void 0,{state:n,isStatic:r,onError:s})}function uh({to:i,replace:e,state:n,relative:r}){He(ro(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=E.useContext(Zt);kn(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=E.useContext(En),{pathname:c}=sr(),u=_s(),p=Tl(i,Og(l),c,r==="path"),f=JSON.stringify(p);return E.useEffect(()=>{u(JSON.parse(f),{replace:e,state:n,relative:r})},[u,f,r,e,n]),null}function st(i){He(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function lU({basename:i="/",children:e=null,location:n,navigationType:r="POP",navigator:s,static:l=!1,unstable_useTransitions:c}){He(!ro(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=i.replace(/^\/*/,"/"),p=E.useMemo(()=>({basename:u,navigator:s,static:l,unstable_useTransitions:c,future:{}}),[u,s,l,c]);typeof n=="string"&&(n=to(n));let{pathname:f="/",search:y="",hash:v="",state:S=null,key:P="default",unstable_mask:T}=n,b=E.useMemo(()=>{let w=ir(f,u);return w==null?null:{location:{pathname:w,search:y,hash:v,state:S,key:P,unstable_mask:T},navigationType:r}},[u,f,y,v,S,P,r,T]);return kn(b!=null,`<Router basename="${u}"> is not able to match the URL "${f}${y}${v}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:E.createElement(Zt.Provider,{value:p},E.createElement(Cs.Provider,{children:e,value:b}))}function cU({children:i,location:e}){return QW(Oh(i),e)}function Oh(i,e=[]){let n=[];return E.Children.forEach(i,(r,s)=>{if(!E.isValidElement(r))return;let l=[...e,s];if(r.type===E.Fragment){n.push.apply(n,Oh(r.props.children,l));return}He(r.type===st,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),He(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=Oh(r.props.children,l)),n.push(c)}),n}var Ha="get",Va="application/x-www-form-urlencoded";function xl(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function uU(i){return xl(i)&&i.tagName.toLowerCase()==="button"}function dU(i){return xl(i)&&i.tagName.toLowerCase()==="form"}function pU(i){return xl(i)&&i.tagName.toLowerCase()==="input"}function fU(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function hU(i,e){return i.button===0&&(!e||e==="_self")&&!fU(i)}var Fa=null;function gU(){if(Fa===null)try{new FormData(document.createElement("form"),0),Fa=!1}catch{Fa=!0}return Fa}var mU=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function dh(i){return i!=null&&!mU.has(i)?(kn(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Va}"`),null):i}function yU(i,e){let n,r,s,l,c;if(dU(i)){let u=i.getAttribute("action");r=u?ir(u,e):null,n=i.getAttribute("method")||Ha,s=dh(i.getAttribute("enctype"))||Va,l=new FormData(i)}else if(uU(i)||pU(i)&&(i.type==="submit"||i.type==="image")){let u=i.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=i.getAttribute("formaction")||u.getAttribute("action");if(r=p?ir(p,e):null,n=i.getAttribute("formmethod")||u.getAttribute("method")||Ha,s=dh(i.getAttribute("formenctype"))||dh(u.getAttribute("enctype"))||Va,l=new FormData(u,i),!gU()){let{name:f,type:y,value:v}=i;if(y==="image"){let S=f?`${f}.`:"";l.append(`${S}x`,"0"),l.append(`${S}y`,"0")}else f&&l.append(f,v)}}else{if(xl(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ha,r=null,s=Va,c=i}return l&&s==="text/plain"&&(c=l,l=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function jg(i,e){if(i===!1||i===null||typeof i>"u")throw new Error(e)}function vU(i,e,n,r){let s=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:e&&ir(s.pathname,e)==="/"?s.pathname=`${e.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function bU(i,e){if(i.id in e)return e[i.id];try{let n=await import(i.module);return e[i.id]=n,n}catch(n){return console.error(`Error loading route module \`${i.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function SU(i){return i==null?!1:i.href==null?i.rel==="preload"&&typeof i.imageSrcSet=="string"&&typeof i.imageSizes=="string":typeof i.rel=="string"&&typeof i.href=="string"}async function wU(i,e,n){let r=await Promise.all(i.map(async s=>{let l=e.routes[s.route.id];if(l){let c=await bU(l,n);return c.links?c.links():[]}return[]}));return PU(r.flat(1).filter(SU).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Mw(i,e,n,r,s,l){let c=(p,f)=>n[f]?p.route.id!==n[f].route.id:!0,u=(p,f)=>n[f].pathname!==p.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==p.params["*"];return l==="assets"?e.filter((p,f)=>c(p,f)||u(p,f)):l==="data"?e.filter((p,f)=>{let y=r.routes[p.route.id];if(!y||!y.hasLoader)return!1;if(c(p,f)||u(p,f))return!0;if(p.route.shouldRevalidate){let v=p.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(i,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function CU(i,e,{includeHydrateFallback:n}={}){return _U(i.map(r=>{let s=e.routes[r.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function _U(i){return[...new Set(i)]}function kU(i){let e={},n=Object.keys(i).sort();for(let r of n)e[r]=i[r];return e}function PU(i,e){let n=new Set;return new Set(e),i.reduce((r,s)=>{let l=JSON.stringify(kU(s));return n.has(l)||(n.add(l),r.push({key:l,link:s})),r},[])}function r_(){let i=E.useContext(no);return jg(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function TU(){let i=E.useContext(El);return jg(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var Lg=E.createContext(void 0);Lg.displayName="FrameworkContext";function i_(){let i=E.useContext(Lg);return jg(i,"You must render this element inside a <HydratedRouter> element"),i}function EU(i,e){let n=E.useContext(Lg),[r,s]=E.useState(!1),[l,c]=E.useState(!1),{onFocus:u,onBlur:p,onMouseEnter:f,onMouseLeave:y,onTouchStart:v}=e,S=E.useRef(null);E.useEffect(()=>{if(i==="render"&&c(!0),i==="viewport"){let b=x=>{x.forEach(O=>{c(O.isIntersecting)})},w=new IntersectionObserver(b,{threshold:.5});return S.current&&w.observe(S.current),()=>{w.disconnect()}}},[i]),E.useEffect(()=>{if(r){let b=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(b)}}},[r]);let P=()=>{s(!0)},T=()=>{s(!1),c(!1)};return n?i!=="intent"?[l,S,{}]:[l,S,{onFocus:es(u,P),onBlur:es(p,T),onMouseEnter:es(f,P),onMouseLeave:es(y,T),onTouchStart:es(v,P)}]:[!1,S,{}]}function es(i,e){return n=>{i&&i(n),n.defaultPrevented||e(n)}}function xU({page:i,...e}){let{router:n}=r_(),r=E.useMemo(()=>W0(n.routes,i,n.basename),[n.routes,i,n.basename]);return r?E.createElement(OU,{page:i,matches:r,...e}):null}function DU(i){let{manifest:e,routeModules:n}=i_(),[r,s]=E.useState([]);return E.useEffect(()=>{let l=!1;return wU(i,e,n).then(c=>{l||s(c)}),()=>{l=!0}},[i,e,n]),r}function OU({page:i,matches:e,...n}){let r=sr(),{future:s,manifest:l,routeModules:c}=i_(),{basename:u}=r_(),{loaderData:p,matches:f}=TU(),y=E.useMemo(()=>Mw(i,e,f,l,r,"data"),[i,e,f,l,r]),v=E.useMemo(()=>Mw(i,e,f,l,r,"assets"),[i,e,f,l,r]),S=E.useMemo(()=>{if(i===r.pathname+r.search+r.hash)return[];let b=new Set,w=!1;if(e.forEach(O=>{let N=l.routes[O.route.id];!N||!N.hasLoader||(!y.some(M=>M.route.id===O.route.id)&&O.route.id in p&&c[O.route.id]?.shouldRevalidate||N.hasClientLoader?w=!0:b.add(O.route.id))}),b.size===0)return[];let x=vU(i,u,s.unstable_trailingSlashAwareDataRequests,"data");return w&&b.size>0&&x.searchParams.set("_routes",e.filter(O=>b.has(O.route.id)).map(O=>O.route.id).join(",")),[x.pathname+x.search]},[u,s.unstable_trailingSlashAwareDataRequests,p,r,l,y,e,i,c]),P=E.useMemo(()=>CU(v,l),[v,l]),T=DU(v);return E.createElement(E.Fragment,null,S.map(b=>E.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),P.map(b=>E.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),T.map(({key:b,link:w})=>E.createElement("link",{key:b,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function IU(...i){return e=>{i.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var RU=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{RU&&(window.__reactRouterVersion="7.13.1")}catch{}function NU({basename:i,children:e,unstable_useTransitions:n,window:r}){let s=E.useRef();s.current==null&&(s.current=fW({window:r,v5Compat:!0}));let l=s.current,[c,u]=E.useState({action:l.action,location:l.location}),p=E.useCallback(f=>{n===!1?u(f):E.startTransition(()=>u(f))},[n]);return E.useLayoutEffect(()=>l.listen(p),[l,p]),E.createElement(lU,{basename:i,children:e,location:c.location,navigationType:c.action,navigator:l,unstable_useTransitions:n})}var o_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,s_=E.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:s,reloadDocument:l,replace:c,unstable_mask:u,state:p,target:f,to:y,preventScrollReset:v,viewTransition:S,unstable_defaultShouldRevalidate:P,...T},b){let{basename:w,navigator:x,unstable_useTransitions:O}=E.useContext(Zt),N=typeof y=="string"&&o_.test(y),M=K0(y,w);y=M.to;let F=VW(y,{relative:s}),j=sr(),L=null;if(u){let ae=Tl(u,[],j.unstable_mask?j.unstable_mask.pathname:"/",!0);w!=="/"&&(ae.pathname=ae.pathname==="/"?w:Fn([w,ae.pathname])),L=x.createHref(ae)}let[z,W,V]=EU(r,T),H=MU(y,{replace:c,unstable_mask:u,state:p,target:f,preventScrollReset:v,relative:s,viewTransition:S,unstable_defaultShouldRevalidate:P,unstable_useTransitions:O});function re(ae){e&&e(ae),ae.defaultPrevented||H(ae)}let ee=!(M.isExternal||l),se=E.createElement("a",{...T,...V,href:(ee?L:void 0)||M.absoluteURL||F,onClick:ee?re:e,ref:IU(b,W),target:f,"data-discover":!N&&n==="render"?"true":void 0});return z&&!N?E.createElement(E.Fragment,null,se,E.createElement(xU,{page:F})):se});s_.displayName="Link";var jU=E.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:s=!1,style:l,to:c,viewTransition:u,children:p,...f},y){let v=ks(c,{relative:f.relative}),S=sr(),P=E.useContext(El),{navigator:T,basename:b}=E.useContext(Zt),w=P!=null&&BU(v)&&u===!0,x=T.encodeLocation?T.encodeLocation(v).pathname:v.pathname,O=S.pathname,N=P&&P.navigation&&P.navigation.location?P.navigation.location.pathname:null;n||(O=O.toLowerCase(),N=N?N.toLowerCase():null,x=x.toLowerCase()),N&&b&&(N=ir(N,b)||N);const M=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let F=O===x||!s&&O.startsWith(x)&&O.charAt(M)==="/",j=N!=null&&(N===x||!s&&N.startsWith(x)&&N.charAt(x.length)==="/"),L={isActive:F,isPending:j,isTransitioning:w},z=F?e:void 0,W;typeof r=="function"?W=r(L):W=[r,F?"active":null,j?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let V=typeof l=="function"?l(L):l;return E.createElement(s_,{...f,"aria-current":z,className:W,ref:y,style:V,to:c,viewTransition:u},typeof p=="function"?p(L):p)});jU.displayName="NavLink";var LU=E.forwardRef(({discover:i="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:s,state:l,method:c=Ha,action:u,onSubmit:p,relative:f,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:S,...P},T)=>{let{unstable_useTransitions:b}=E.useContext(Zt),w=zU(),x=qU(u,{relative:f}),O=c.toLowerCase()==="get"?"get":"post",N=typeof u=="string"&&o_.test(u),M=F=>{if(p&&p(F),F.defaultPrevented)return;F.preventDefault();let j=F.nativeEvent.submitter,L=j?.getAttribute("formmethod")||c,z=()=>w(j||F.currentTarget,{fetcherKey:e,method:L,navigate:n,replace:s,state:l,relative:f,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:S});b&&n!==!1?E.startTransition(()=>z()):z()};return E.createElement("form",{ref:T,method:O,action:x,onSubmit:r?p:M,...P,"data-discover":!N&&i==="render"?"true":void 0})});LU.displayName="Form";function AU(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function a_(i){let e=E.useContext(no);return He(e,AU(i)),e}function MU(i,{target:e,replace:n,unstable_mask:r,state:s,preventScrollReset:l,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:p,unstable_useTransitions:f}={}){let y=_s(),v=sr(),S=ks(i,{relative:c});return E.useCallback(P=>{if(hU(P,e)){P.preventDefault();let T=n!==void 0?n:ps(v)===ps(S),b=()=>y(i,{replace:T,unstable_mask:r,state:s,preventScrollReset:l,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:p});f?E.startTransition(()=>b()):b()}},[v,y,S,n,r,s,e,i,l,c,u,p,f])}var $U=0,FU=()=>`__${String(++$U)}__`;function zU(){let{router:i}=a_("useSubmit"),{basename:e}=E.useContext(Zt),n=iU(),r=i.fetch,s=i.navigate;return E.useCallback(async(l,c={})=>{let{action:u,method:p,encType:f,formData:y,body:v}=yU(l,e);if(c.navigate===!1){let S=c.fetcherKey||FU();await r(S,n,c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:v,formMethod:c.method||p,formEncType:c.encType||f,flushSync:c.flushSync})}else await s(c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:v,formMethod:c.method||p,formEncType:c.encType||f,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[r,s,e,n])}function qU(i,{relative:e}={}){let{basename:n}=E.useContext(Zt),r=E.useContext(En);He(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),l={...ks(i||".",{relative:e})},c=sr();if(i==null){l.search=c.search;let u=new URLSearchParams(l.search),p=u.getAll("index");if(p.some(y=>y==="")){u.delete("index"),p.filter(v=>v).forEach(v=>u.append("index",v));let y=u.toString();l.search=y?`?${y}`:""}}return(!i||i===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Fn([n,l.pathname])),ps(l)}function BU(i,{relative:e}={}){let n=E.useContext(Y0);He(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=a_("useViewTransitionState"),s=ks(i,{relative:e});if(!n.isTransitioning)return!1;let l=ir(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=ir(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ja(s.pathname,c)!=null||Ja(s.pathname,l)!=null}var GU=Object.defineProperty,$w=Object.getOwnPropertySymbols,WU=Object.prototype.hasOwnProperty,UU=Object.prototype.propertyIsEnumerable,Fw=(i,e,n)=>e in i?GU(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n,HU=(i,e)=>{for(var n in e||(e={}))WU.call(e,n)&&Fw(i,n,e[n]);if($w)for(var n of $w(e))UU.call(e,n)&&Fw(i,n,e[n]);return i};function VU(i){return E.createElement("svg",HU({width:200,height:200,viewBox:"0 0 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,"aria-hidden":!0},i),E.createElement("rect",{width:200,height:200,fill:"transparent"}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M64.09 64.86V8.56L5.76 78.94h44.26v20.3h14.07v-20.3h8.82V64.86h-8.82Zm110.18 0V8.56L124.1 69.08c.7-3.74 1.07-7.7 1.07-11.76 0-11-2.7-21.1-7.25-28.55-4.5-7.4-11.13-12.63-19-12.63-7.88 0-14.5 5.23-19.01 12.63-4.54 7.45-7.25 17.55-7.25 28.55s2.7 21.1 7.25 28.55c4.5 7.4 11.13 12.62 19 12.62 7.88 0 14.5-5.23 19.01-12.62a44.09 44.09 0 0 0 3.4-6.93h38.86v20.3h14.08v-20.3h8.81V64.86h-8.81Zm-138.57 0L50.02 47.6v17.26H35.7Zm124.5 0h-14.32L160.2 47.6v17.26Zm-49.1-7.54c0 8.84-2.2 16.32-5.19 21.22-3.08 5.08-5.87 5.87-6.98 5.87-1.12 0-3.9-.8-7-5.87-2.98-4.9-5.19-12.38-5.19-21.22 0-8.85 2.21-16.33 5.2-21.23 3.09-5.07 5.87-5.87 6.98-5.87 1.12 0 3.9.8 7 5.87 2.98 4.9 5.19 12.38 5.19 21.23Z",fill:"var(--semi-color-primary-light-default)"}),E.createElement("path",{d:"M178.34 186.57c-1.85 2.2-6.66 1.02-8.13.24a2.46 2.46 0 0 1-.34-.22c-1.94.22-14.94-.5-15.12-.46-6.12 1.43-14.06 1.03-15.2 1-1.36-.05-4.53-1.33-5.75-5.08-1.2-3.67 0-7.12 2.16-13.37l.13-.38-1.43 2.83c-7.37 14.43-11.05 19.7-17.43 20.14-6.38.45-34.34-.09-41.09-.78-6.75-.7-9.42-1.68-9.35-2.83.05-.92 2.98-2.2 4.44-2.72-5.88-1.57-20.16-5.97-30.18-10.98-12.52-6.26-25.14-15.8-21.91-28.92 3.22-13.13 15.76-16.8 25.59-17.38 2.75-.16 5.14-.1 7.16.07 3.76.33 6.21 1.06 7.2 1.53-1.12-6.37-3.33-19.34-3.33-20.21 0-1.1-3.02-10.67-3.64-14.35-.1-.55-1.11-5.6 3.64-5.02 4.75.57 12.4 18.2 15.88 28.7a401.55 401.55 0 0 0 11.15-9.87c.84-1.02 9.36-9.75 14.87-13.84a60.09 60.09 0 0 1 33-11.76c16.29-.81 34.49 2.36 40.9 11.91 6.4 9.55 6.1 34.44 6.44 48.71.35 14.27.84 27.64 2.11 29.76 1.27 2.12 6.45 5.02 9.77 7.14 3.33 2.11 4.45 3.9 4.36 4.2-.1.3-.4.58-2.24 1.08.34.47.12 1.38-2.12 1.6-4.7.48-8.64-.74-11.54-.74Z",fill:"white"}),E.createElement("path",{d:"M192 185.71c-1.6-2.3-9.7-5.34-15.04-5.75-5.34-.41-6.45.53-7.4 1.85-1 1.37-1.05 3.72.3 4.78m22.14-.88c.34.47.12 1.38-2.12 1.6-4.7.48-8.64-.74-11.54-.74-1.85 2.2-6.66 1.02-8.13.24a2.46 2.46 0 0 1-.34-.22m22.13-.88c1.84-.5 2.15-.78 2.24-1.08.09-.3-1.03-2.09-4.36-4.2-3.32-2.12-8.5-5.02-9.77-7.14-1.27-2.12-1.76-15.49-2.1-29.76-.36-14.27-.06-39.16-6.46-48.7-6.4-9.56-24.6-12.73-40.89-11.92a60.09 60.09 0 0 0-33 11.76c-5.5 4.09-14.03 12.82-14.87 13.84-.37.46-5.43 4.9-11.15 9.87-3.49-10.5-11.13-28.13-15.88-28.7-4.75-.58-3.73 4.47-3.64 5.02.62 3.68 3.64 13.26 3.64 14.35 0 .87 2.21 13.84 3.32 20.2-.98-.46-3.43-1.2-7.19-1.52m19.34 57.21c-5.88-1.57-20.16-5.97-30.18-10.98-12.52-6.26-25.14-15.8-21.91-28.92 3.22-13.13 15.76-16.8 25.59-17.38 2.75-.16 5.14-.1 7.16.07m19.34 57.21c-1.46.52-4.39 1.8-4.44 2.72-.07 1.15 2.6 2.14 9.35 2.83 6.75.7 34.71 1.23 41.09.78 6.38-.44 10.06-5.71 17.43-20.14l1.43-2.83m-64.86 16.64c5.89-2.49 12.35-6.32 16.49-10.11 5.07-4.65 9.55-13.46 9.96-14.28l.82-1.56m43.43 4.15c-.47-3-1.21-7.33.37-14.67 1.47-6.81 6.6-15.3 6.65-11.03.05 4-6.05 17.35-12.86 30.86m0 0c-2.25 6.5-3.51 10-2.3 13.75 1.23 3.75 4.4 5.03 5.76 5.07 1.14.04 9.08.44 15.2-.99m0 0a19.5 19.5 0 0 0 3.27-1.03c6.09-2.63 10.92-8.55 13.53-24.26 2.62-15.71 1.5-42.36-10.29-50.78-11.78-8.41-21.32-6.07-34.03 5.8-5.34 4.98-11.86 14.52-17.42 23.52m44.94 46.75c.18-.04 13.19.68 15.12.46m-60.06-47.2c-.8-3.66-1.44-7.16-1.94-10.43m1.94 10.42c-1.24 2-2.43 3.98-3.55 5.87m.32-30.9c0 3.75.41 8.8 1.3 14.61m0 0c-2.32 2.46-7.78 7.15-13.67 11.55m-42.32-12.78s1.24 7.12 3.87 11.42a29.93 29.93 0 0 0 6.61 7.8m36.13 12.04c-6.87-3.1-17.87-6.8-22.51-8.27m22.51 8.27a394.7 394.7 0 0 1 7.76-13.74M76 150.72c.39-.06.78-.14 1.17-.23 3.97-.93 10.76-5.29 17.05-9.98m-18.22 10.2c-4.7.8-9.36-.34-13.62-3.76m0 0c-3.29-.85-11.28-2.39-12.86-2.41m56.75.71c-2.32-.94-9-3.55-12.05-4.74",stroke:"#515151"}),E.createElement("path",{d:"m77.74 73.31 23.73 43.2-1.7 2.5-22.73 9.55-24.58-44.48 21.9-10.77h3.38Z",fill:"#E6E8EA"}),E.createElement("path",{d:"M74.35 73.31h3.4l23.72 43.2-1.7 2.5m-25.42-45.7-21.9 10.77 24.59 44.48L99.78 119m-25.43-45.7 25.43 45.7",stroke:"#515151"}),E.createElement("path",{d:"M83.9 116.95c.96 1.97-4.91 4.57-8.32 6.18-1.33.63-2.1.98-2.7 1.2.9 3.3 1.24 8.14-4.48 9.82-5.73 1.69-15.07-1.02-18-9.6-2.95-8.6.01-19.97 9.05-27.04 5.67-4.42 15.01-5.77 19.42-4.05 2.15.82 1.38 2.71-.56 4.44a58.1 58.1 0 0 1-4.53 3.58c.4-.01.8-.02 1.23 0 4.13.06 7.26 1.11 7.42 3.14.07.94-.8 2.13-1.95 3.45-.62.71-1.28 1.34-1.95 1.88 2.8-.22 5.94 1.05 2.9 4.2-.41.43-.85.83-1.29 1.2 1.73.02 3.24.56 3.75 1.6Z",fill:"white"}),E.createElement("path",{d:"M69.73 125.1c1.65-.34 2.2-.4 3.14-.76m0 0c.6-.23 1.38-.58 2.7-1.21 3.42-1.6 9.3-4.21 8.32-6.17-.86-1.76-4.53-2.09-7.33-.97-2.84 1.13-3.58 2.24-3.46 2.56.12.31 4.75-.69 8.34-4.4 3.4-3.54-.96-4.7-3.9-4.06-2.26.5-6.4 2.06-6.16 2.85.16.5 5.33-.54 9.1-4.87 1.14-1.32 2.02-2.51 1.95-3.45-.16-2.03-3.3-3.08-7.42-3.15-8.83-.16-11.56 4.78-11.16 5.1 1.1.92 9.36-4.15 14.46-8.67 1.94-1.73 2.71-3.62.56-4.44-4.4-1.72-13.75-.37-19.42 4.05-9.04 7.07-12 18.44-9.06 27.03 2.94 8.6 12.28 11.3 18 9.61 5.73-1.68 5.4-6.53 4.48-9.81Z",stroke:"#515151"}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M106.48 120.15c-.2 1.56-.53 3.98-1.2 6.51-.68 2.53-1.71 5.16-3.3 7.14l.2.19 5.67-4.97-1.1-8.87h-.27Zm31.09 45.32-.25-.1-11.3 21.27h11.92l-.43-.26c-3.5-2.07-4.07-5.79-3.46-9.77.52-3.4 1.9-6.95 3-9.77l.52-1.37Zm-85.81-37.9-.24.13a55.3 55.3 0 0 0 1.65 6.39l.01.04.05.03c1.63.84 4.4 1.85 7.45 2.14 3.05.3 6.39-.12 9.1-2.15l-.12-.24c-3.14 1.2-11.14 1.63-17.9-6.33Z",fill:"#515151"}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m133.54 82.83.02-.16h-.16c-1.82.1-5.84.39-9.87.96-2.02.28-4.04.64-5.79 1.08-1.74.43-3.23.95-4.18 1.58l-.06.04v.07c-.04 1.8.13 3.69.65 5.35a7.28 7.28 0 0 0 2.8 4.05c2.81 1.86 6.69 1.62 9.98-.58 3.3-2.2 6.04-6.37 6.61-12.4Z",fill:"#515151"}),E.createElement("path",{d:"M126.66 84.73a9.79 9.79 0 0 1-9.7 9.87 9.79 9.79 0 0 1-9.7-9.87 9.79 9.79 0 0 1 9.7-9.87c5.35 0 9.7 4.41 9.7 9.87Z",fill:"white",stroke:"#515151"}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M109.41 70.6c.66.25 1.25.47 1.9.26.52-.18.83-.7 1.18-1.3.75-1.27 1.73-2.93 5.56-2.56 3.86.38 4.6 2.17 5.1 3.43.21.5.38.9.69 1.12.48.32.84.33 1.26.35.55.02 1.2.05 2.37.75 1.41.85 2.49 5.65.23 9.93l.26.43c-.45 2.15-3.05 4.37-3.05 4.14 0-3.04 0-4.75-2.92-7.43-4.26 1.6-10.89 1.13-13.94.14-4-1.28-5.98-6.81-2.53-9 1.72-1.1 2.88-.65 3.9-.26Z",fill:"#515151"}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M116.7 81.6a.41.41 0 1 0-.74.4c.2.39.47.74.9.95.41.2.93.25 1.58.17a.41.41 0 1 0-.1-.82c-.58.07-.9.01-1.12-.09-.2-.1-.36-.28-.53-.6Zm-6.57 4.22a1.07 1.07 0 0 0 1-1.13 1.06 1.06 0 0 0-1.1-1.02c-.59.03-1.03.54-1 1.13.02.6.52 1.05 1.1 1.02Zm6.82.73a1.07 1.07 0 0 0 1-1.13 1.06 1.06 0 0 0-1.1-1.01c-.58.02-1.03.53-1 1.12.03.6.52 1.05 1.1 1.02Z",fill:"#515151"}),E.createElement("ellipse",{cx:127.42,cy:86.0081,rx:2.47934,ry:2.47934,fill:"white",stroke:"#515151"}),E.createElement("circle",{r:4.67102,transform:"matrix(0.707106 0.707108 -0.707106 0.707108 75.0508 75.7794)",fill:"var(--semi-color-primary)",stroke:"var(--semi-color-primary)",strokeWidth:3}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M77.9 72.97a1.1 1.1 0 0 0-1.57 0l-1.26 1.27-1.31-1.3a1.1 1.1 0 1 0-1.57 1.56l1.31 1.3-1.3 1.31a1.1 1.1 0 0 0 1.56 1.57l1.3-1.3 1.27 1.26a1.1 1.1 0 1 0 1.57-1.57l-1.26-1.26 1.26-1.27a1.1 1.1 0 0 0 0-1.57Z",fill:"white"}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M99.41 49.11a32.26 32.26 0 0 0-19-9.84 2.14 2.14 0 0 0-2.42 2.02c-.07 1.2.82 2.2 1.97 2.37a27.86 27.86 0 0 1 16.13 8.36c.83.87 2.24.99 3.17.15.88-.79.99-2.17.15-3.06Zm-35.8-8.52a32.5 32.5 0 0 0-18.74 15.73 2.14 2.14 0 0 0 1.01 2.93c1.11.52 2.4.02 2.96-1.02a28.08 28.08 0 0 1 15.96-13.4 2.28 2.28 0 0 0 1.53-2.72 2.14 2.14 0 0 0-2.72-1.52Zm27.75 15.78c-3.02-3.14-7-5.38-11.53-6.22a2.11 2.11 0 0 0-2.47 2 2.33 2.33 0 0 0 1.9 2.38c3.41.69 6.43 2.37 8.75 4.72.85.85 2.26 1 3.2.15.87-.78 1-2.15.15-3.03Zm-24.64-4.65a21.63 21.63 0 0 0-11.66 9.8 2.1 2.1 0 0 0 .99 2.94c1.12.52 2.4.01 2.98-1 2-3.45 5.17-6.11 8.91-7.5 1.1-.4 1.81-1.56 1.5-2.75a2.1 2.1 0 0 0-2.72-1.5Zm16.63 11.95a10.69 10.69 0 0 0-4-2.47c-1.35-.47-2.56.62-2.63 1.9-.07 1.14.73 2.04 1.65 2.44.56.25 1.07.56 1.52.94.89.74 2.33 1 3.32.11.82-.74 1-2.07.14-2.92Zm-14.28-.76c-1.82.83-3.39 2.16-4.5 3.83-.73 1.08-.16 2.42.9 2.92 1.14.53 2.38-.02 3.05-.88a6.35 6.35 0 0 1 1.93-1.63c.95-.52 1.68-1.63 1.37-2.83-.3-1.15-1.54-1.95-2.75-1.4Z",fill:"var(--semi-color-primary)"}))}var KU=VU;function QU(){return document.getElementById(_g)?.contentWindow}class YU{ws;connectTimeoutTimer;isTimeout=!1;init(e){this.connectTimeoutTimer&&(clearTimeout(this.connectTimeoutTimer),this.connectTimeoutTimer=void 0),this.ws&&(this.ws.close(),this.ws=void 0),this.isTimeout=!1;const n=`ws://${e.clientHost}:${e.clientWsPort||e.clientHttpPort-1}`;console.info(`⌛️ ${D("startConnectClientWS",{wsURL:n})}`);const r=new WebSocket(n);this.connectTimeoutTimer=setTimeout(()=>{r.readyState!==WebSocket.OPEN&&(this.isTimeout=!0,r.close(),console.error(`${D("clientConnectTimeout")||"客户端连接超时"}`),Ee.emit("connectionChange",{node:Pe.get("isNodeWSConnected"),client:!1,from:"client",reason:"timeout"}),Dw())},5e3),r.onclose=()=>{this.connectTimeoutTimer&&(clearTimeout(this.connectTimeoutTimer),this.connectTimeoutTimer=void 0),this.isTimeout||(console.error(`${D("clientServerDisconnected")}`),Ee.emit("connectionChange",{node:Pe.get("isNodeWSConnected"),client:!1,from:"client",reason:"close"}),Dw())},r.onerror=()=>{if(this.connectTimeoutTimer&&(clearTimeout(this.connectTimeoutTimer),this.connectTimeoutTimer=void 0),!this.isTimeout){const s=D("clientServerStartError");Ee.emit("connectionChange",{node:Pe.get("isNodeWSConnected"),client:!1,from:"client",reason:"error"}),console.error(s)}},this.ws=r,r.onopen=()=>{this.connectTimeoutTimer&&(clearTimeout(this.connectTimeoutTimer),this.connectTimeoutTimer=void 0),this.isTimeout||(console.log(`✅ ${D("clientConnectedSuccess")}`),Ee.emit("connectionChange",{node:Pe.get("isNodeWSConnected"),client:!0,from:"client",reason:"open"}),r.send(JSON.stringify({stage:"connecting",status:"success",message:"Browser connected to Client Server Successfully"})))},r.onmessage=function(s){try{const l=JSON.parse(s.data),c=QU();switch(l?.method){case"subscribeHandler":c?.__DEV__?.subscribeHandler?.(l?.payload?.event,l?.payload?.data);break;case"invokeHandler":c?.__DEV__?.invokeHandler?.(l?.payload?.callbackId,l?.payload?.data);break;case"predownloadSubpackage":case"reportScene":l?.payload&&typeof l.payload=="object"&&Ee.emit(l.method,l.payload);break;default:break}}catch(l){console.error(l)}}}send(e){this.ws?.readyState===WebSocket.OPEN&&(e.from="browser",this.ws?.send(JSON.stringify(e)))}close(){this.connectTimeoutTimer&&(clearTimeout(this.connectTimeoutTimer),this.connectTimeoutTimer=void 0),this.ws?.close(),this.ws=void 0}}const Ps=new YU,XU={start:{msgKey:"uploadGameStart"},success:{msgKey:"uploadGameSuccess",handle:i=>{const{packages:e,clientKey:n}=i||{};Pe.setMultiple({packages:e,clientKey:n,isResourcesReady:!0}),Ee.emit("setupStatusChange",{isScriptsReady:Pe.get("isScriptsReady"),isResourcesReady:!0})}},process:{msgKey:"uploadProcess"},error:{msgKey:"uploadError",handle:i=>{const{msg:e}=i||{};Pe.set("isResourcesReady",!1),Ee.emit("setupStatusChange",{isScriptsReady:Pe.get("isScriptsReady"),isResourcesReady:!1,isResourcesFailed:!0})}},restart:{msgKey:"uploadGameRestart"}};function ZU(i){const{status:e,payload:n}=i,r=XU[e];if(!r){console.warn(`Unknown upload status: ${e}`);return}const s=D(r.msgKey);Ee.emit("uploadGame",{status:e,msg:s,progress:n?.progress}),r.handle&&r.handle(n)}class JU{ws;retryTimer;retryAttempt=0;reconnectEnabled=!1;nodeWsPort;retryDelays=[300,700,1500,3e3,5e3];init(){return this.close(),this.nodeWsPort=Pe.get("nodeWsPort"),this.reconnectEnabled=!0,this.retryAttempt=0,this.connect(),!0}connect(){if(!this.reconnectEnabled||!this.nodeWsPort)return;console.info(`⌛️ ${D("nodeServerStartConnect")}`);let e=!1;const n=new WebSocket(`ws://localhost:${this.nodeWsPort}`);this.ws=n,n.onclose=()=>{this.ws===n&&(this.ws=void 0),console.error(`❌ ${D("nodeServerDisconnect")}`),Ee.emit("connectionChange",{node:!1,client:Pe.get("isClientWSConnected"),from:"node",reason:e?"error":"close"}),this.scheduleReconnect()},n.onerror=()=>{e=!0;const r=D("nodeServerStartError");console.error(r)},n.onopen=()=>{if(this.ws!==n||!this.reconnectEnabled){n.close();return}this.retryAttempt=0,console.log(`✅ ${D("nodeServerConnectedSuccess")}`),Ee.emit("connectionChange",{node:!0,client:Pe.get("isClientWSConnected"),from:"node",reason:"open"}),n.send(JSON.stringify({event:"connected",method:"connected",from:"browser"}))},n.onmessage=r=>{if(r.data){let s;try{s=JSON.parse(r.data)}catch{Qt.warn("Node WS received an invalid message",r.data);return}switch(s.method){case"uploadStatus":{ZU(s);break}case"compilationStatus":{Ee.emit("compilationStatus",s.payload);break}case"unitySplitStatus":{Ee.emit("unitySplitStatus",s.payload);break}case"resourceChange":{Qt.info("Node WS resourceChange",s?.payload),Ee.emit("resourceChange",{});break}case"scanQRCodeSuccess":case"clientDebugInfo":{this.connectClient(s.payload);break}case"scanQRCodeFailed":{const{msg:c}=s.payload;Ee.emit("scanQRCode",{status:"failed",msg:c});break}}}}}connectClient(e){const{clientWsPort:n,clientHost:r,clientHttpPort:s}=e||{};if(!n||!r){Qt.warn("Node WS client info is incomplete",e);return}Pe.setMultiple({clientHost:r,clientWsPort:n,clientHttpPort:s}),Ps.init({clientWsPort:n,clientHost:r,clientHttpPort:s}),Ee.emit("scanQRCode",{status:"success"})}scheduleReconnect(){if(!this.reconnectEnabled||this.retryTimer||this.retryAttempt>=this.retryDelays.length)return;const e=this.retryDelays[this.retryAttempt];this.retryAttempt+=1,this.retryTimer=setTimeout(()=>{this.retryTimer=void 0,this.connect()},e)}send(e){if(e.from="browser",this.ws?.readyState!==WebSocket.OPEN){Qt.warn("Node WS is not ready, message skipped",e);return}this.ws.send(JSON.stringify(e))}close(){this.reconnectEnabled=!1,this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=void 0),this.retryAttempt=0,this.ws?.close(),this.ws=void 0}}const Hi=new JU,e9=["krypton.js","ttmg-core.js"];async function zw(i){try{const e=I0();console.log(`⌛️ ${D("startDebug")}`),console.log(`⌛️ ${D("initClientEnv")}`);const n=await Ki({url:`${e}/game/cwd`,method:"POST",data:{command:"start"}});if(console.log(`✅ ${D("initClientEnvSuccess")}`),Ps.send({method:"setDebugSettings",payload:i.debugSetting}),i.debugMode==="clientPreview"||i.debugMode==="clientDebug")Pe.set("isScriptsReady",!0),Hi.send({method:"startUpload"});else{console.log(`⌛️ ${D("startInitJSDevEnv")}`);const s=document.getElementById(_g).contentWindow;s.__DEV__={isEnable:!0,server:e,nodeStaticBaseUrl:Pe.get("nodeStaticBaseUrl")},console.log(`✅ ${D("initJSDevEnvSuccess")}`);const l=await t9(s,e9,e),c=Object.values(l).some(u=>!u);Pe.set("isScriptsReady",Object.values(l).every(u=>u)),Ee.emit("setupStatusChange",{isScriptsReady:Pe.get("isScriptsReady"),isResourcesReady:Pe.get("isResourcesReady"),isScriptsFailed:c}),c||(console.log(`✅ ${D("setDevScriptsSuccess")}`),Hi.send({method:"startUpload"}))}}catch(e){console.log(`❌ ${D("setDevEnvFailed")}`,e?.message??e)}}async function t9(i,e,n){const r={};for(const s of e)try{console.log(`⏳ ${D("startLoadDevScripts")}: ${s}`);const l=await fetch(`${n}/game/scripts/${s}`);if(!l.ok){console.error(`${D("loadDevScriptsFailed")}: ${s}`),r[s]=!1;continue}const c=await l.text();if(!c){console.error(`${D("loadDevScriptsEmpty")}: ${s}`),r[s]=!1;continue}console.log(`✅ ${D("loadDevScriptsSuccess")}: ${s}`);const u=i.document.createElement("script");u.id=s,u.type="text/javascript",u.text=c,i.document.body.appendChild(u),r[s]=!0,console.log(`✅ ${D("loadDevScriptsInitSuccess")}: ${s}`)}catch(l){console.error(`${D("loadDevScriptsFailed")}: ${s}`,l),r[s]=!1}return r}function n9(){const i=()=>typeof document<"u"?document.hidden:!1,[e,n]=E.useState(i);return E.useEffect(()=>{const r=()=>{n(document.hidden),Ps.send({method:"sendPageVisibility",payload:{isHidden:document.hidden}})};return document.addEventListener("visibilitychange",r),()=>{document.removeEventListener("visibilitychange",r)}},[]),e}function r9(){const[i,e]=E.useState([]),n=E.useRef([]),r=E.useRef([]),s=E.useRef([]),l=E.useRef([]),c=E.useRef([]),u=E.useCallback(()=>{const T=[...c.current,...n.current,...r.current,...s.current,...l.current],b=new Map;T.forEach(w=>{const x=w?.text?.trim();if(!x)return;const O=b.get(x);if(!O){b.set(x,{title:w.title,text:x,required:w.required,detail:w.detail});return}!O.required&&w.required&&b.set(x,{title:O.title??w.title,text:x,required:!0,detail:O.detail??w.detail})}),e(Array.from(b.values()))},[]),p=E.useCallback(T=>{const b=[],w=!T?.terms_of_service_link?.trim(),x=!T?.privacy_policy_link?.trim();return w&&x?(b.push({text:D("policyDependencyTermsPrivacyRequired"),required:!0}),b):(w&&b.push({text:D("policyDependencyTermsRequired"),required:!0}),x&&b.push({text:D("policyDependencyPrivacyRequired"),required:!0}),b)},[]),f=E.useCallback(T=>{const b=[],w=!T?.name?.trim(),x=!T?.display_icon_url?.trim()&&!T?.icon_url?.trim(),O=!T?.description?.trim();return w&&b.push(D("topBasicInfoNameField")),x&&b.push(D("topBasicInfoIconField")),O&&b.push(D("topBasicInfoDescriptionField")),b.length===0?[]:[{text:D("topBasicInfoMissing",{fields:b.join(D("topBasicInfoFieldJoiner"))}),required:!1}]},[]),y=E.useCallback(T=>xg(T)?[]:[{text:D("topLoginStatusWarning"),required:!1}],[]),v=E.useCallback(T=>{r.current=p(T),s.current=f(T),u()},[f,p,u]),S=E.useCallback(({currentUser:T,checkResult:b=[]})=>{l.current=y(T),n.current=b.filter(w=>w?.passed===!1).map(w=>({text:w.msg,required:w.required===!0,detail:w.detail})),u()},[y,u]),P=E.useCallback(T=>{c.current=T,u()},[u]);return{topErrorItems:i,updateGameDetailTopErrors:v,updateConfigTopErrors:S,updateGameDetailAccessErrors:P}}const qw="https://developers.tiktok.com/",i9="https://bytedance.larkoffice.com/wiki/PeIawT4M4ia9R8kYyLMcjwHknOg";function o9(i){const e=Dg({errorCode:i.errorCode,user:i.user});if(e==="noPermission")return{link:qw,text:D("topErrorCtaApplyPermission")};if(e==="networkProxy")return{link:i9,text:D("projectInfo.error.openProxyDoc")};if(e==="notFound"||e==="unknown")return{link:qw,text:D("topErrorCtaOpenPortal")}}function s9(i){const e=Dg({errorCode:i.errorCode,user:i.user});if(e==="networkProxy")return D("topErrorTitleNetworkProxy");if(e==="noPermission")return D("topErrorTitlePermission");if(e==="notLoggedIn"||e==="loginExpired")return D("topErrorTitleLogin");if(e==="notFound")return D("topErrorTitleProjectNotFound")}function a9({onSuccess:i,updateGameDetailAccessErrors:e}){const{state:{user:n},hideLoading:r,setError:s,setGameDetail:l}=pn(),c=E.useRef(!1),u=E.useRef(!1),p=E.useCallback(f=>{if(c.current){u.current=!0;return}c.current=!0,Ki({url:"/game/detail",method:"GET"}).then(y=>{if(y.error){r();const{errorCode:v,errorMsg:S}=y.error,P=iW({errorCode:v,errorMsg:S,clientKey:y.error.clientKey,user:f??n});l({client_key:y.error.clientKey,has_error:!0,error_msg:S,error_code:v}),s({text:""}),e(P?[{title:s9({errorCode:v,user:f??n}),text:P,required:!0,detail:o9({errorCode:v,user:f??n})}]:[]);return}s({text:""}),e([]),l(y.data),i(y.data),r()}).finally(()=>{c.current=!1,u.current&&(u.current=!1,p(f))})},[r,i,s,l,e,n]);return{fetchGameDetail:p}}function l9({fetchGameDetail:i,updateConfigTopErrors:e}){const{showLoading:n,hideLoading:r,setError:s,setSchema:l,setUser:c,setPackages:u,setDevToolVersion:p,setEngine:f,setDebugMode:y,setMessage:v}=pn(),[S,P]=E.useState(""),T=E.useRef(!1);return E.useEffect(()=>{T.current||(T.current=!0,n(),Ki({url:"/game/config",method:"GET"}).then(b=>{if(b.error){r(),s({visible:!0,text:D("getDevGameConfigFailed")+`: ${b.error.errorMsg}`}),P(D("getDevGameConfigFailed")),console.log(`❌ ${D("getDevGameConfigFailed")}: ${b.error.errorMsg}`);return}const{schema:w,nodeWsPort:x,user:O,packages:N,devToolVersion:M,clientKey:F,engine:j,nodeStaticBaseUrl:L,checkResult:z,lang:W}=b.data;if(TG(W),ZG(),console.log(`✅ ${D("getDevGameConfigSuccess")}`),W||Ki({url:"/game/config-fillback",method:"POST",data:{lang:navigator.language}}),l(w),Pe.setMultiple({nodeWsPort:x,email:O?.email,clientKey:F,nodeStaticBaseUrl:L}),c(O),p(M),u(N),f(j),Pl()&&v({type:"success",desc:D("nodeServerConnectedSuccess")}),!F0()){const V=j==="unity"?qn.clientPreview:qn.browserDebug;y(V),z0(V)}i(O),e({currentUser:O,checkResult:z}),r()}))},[i,r,p,f,y,s,u,l,c,v,n,e]),{isServerError:!!S,serverErrorMsg:S}}function c9({onResourceChange:i}){E.useEffect(()=>{const e=()=>{i()};return Ee.on("resourceChange",e),()=>{Ee.off("resourceChange",e)}},[i])}function u9(){const[i,e]=E.useState(()=>lW());E.useEffect(()=>{const s=l=>{if(l.key!=="tt-theme")return;const c=l.newValue;(c==="light"||c==="dark")&&(Ow(c),e(c))};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},[]);const n=E.useCallback(s=>{Ow(s),e(s)},[]),r=E.useCallback(()=>{n(i==="dark"?"light":"dark")},[i,n]);return{theme:i,setTheme:n,toggle:r}}const d9="modulepreload",p9=function(i){return"/"+i},Bw={},lt=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let p=function(f){return Promise.all(f.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=c?.nonce||c?.getAttribute("nonce");s=p(n.map(f=>{if(f=p9(f),f in Bw)return;Bw[f]=!0;const y=f.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${v}`))return;const S=document.createElement("link");if(S.rel=y?"stylesheet":d9,y||(S.as="script"),S.crossOrigin="",S.href=f,u&&S.setAttribute("nonce",u),document.head.appendChild(S),y)return new Promise((P,T)=>{S.addEventListener("load",P),S.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${f}`)))})}))}function l(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return s.then(c=>{for(const u of c||[])u.status==="rejected"&&l(u.reason);return e().catch(l)})},l_=()=>{const{state:{loading:i}}=pn();return i.visible?k.jsx("div",{className:"loading-container",children:k.jsxs("div",{className:"loading-content",children:[k.jsx(Ar,{size:"large"}),k.jsx("div",{className:"loading-text",children:i.text})]})}):null},f9=({size:i=24,color:e="#000",style:n,className:r})=>k.jsx("div",{style:{display:"flex",alignItems:"center",position:"relative"},children:k.jsxs("svg",{fill:"currentColor",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",width:i,height:i,children:[k.jsx("path",{d:"M37.86 17.82c.14.24.14.67.14 1.53v9.5c0 1.14 0 1.72-.2 2.26-.16.49-.43.96-.77 1.34-.37.44-.87.73-1.86 1.3l-7.84 4.53c-.74.43-1.11.64-1.4.64a.66.66 0 0 1-.58-.34c-.14-.24-.14-.67-.14-1.53v-9.5c0-1.14 0-1.71.2-2.26.16-.48.43-.95.76-1.34.38-.44.88-.73 1.87-1.3l7.84-4.52c.74-.43 1.11-.65 1.4-.64.25 0 .45.12.58.33Z"}),k.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m27.54 1.99 7 3.93 6.89 4a7.23 7.23 0 0 1 3.59 6.2l.06 7.88-.06 7.88a7.23 7.23 0 0 1-3.6 6.2l-6.88 4-7 3.93a7.23 7.23 0 0 1-7.08 0l-7-3.93-6.9-4a7.23 7.23 0 0 1-3.58-6.2L2.9 24l.07-7.88a7.23 7.23 0 0 1 3.59-6.2l6.89-4 7-3.93a7.23 7.23 0 0 1 7.08 0Zm-2.07 3.67 6.98 3.92 6.86 3.99a3.01 3.01 0 0 1 1.5 2.58l.06 7.85-.07 7.85c0 1.06-.57 2.04-1.5 2.58l-6.85 4-6.98 3.9c-.91.52-2.03.52-2.95 0l-6.97-3.9-6.86-4a3.01 3.01 0 0 1-1.5-2.58L7.13 24l.06-7.85c.01-1.06.58-2.04 1.5-2.58l6.86-4 6.97-3.9a3.01 3.01 0 0 1 2.95 0Z"})]})}),h9=()=>k.jsxs("div",{className:"logo-container",children:[k.jsx(f9,{size:24}),k.jsx("div",{className:"logo-title",children:D("title")})]});function Gw(i){return D(i==="ok"?"connectStatusConnected":i==="fail"?"connectStatusFailed":"connectStatusDisconnected")}function ts(i){return i==="ok"?"var(--tt-success-text)":i==="fail"?"var(--tt-error-text)":"var(--tt-text-faint)"}function g9(){return Pl()?["subpackage.collecting","subpackage.ready","subpackage.success"].includes(Pg()):!1}const m9=()=>{const{state:{schema:i,isConnected:e},setIsConnected:n,setMessage:r}=pn(),s=e||g9(),[l,c]=E.useState("off"),[u,p]=E.useState("off"),[f,y]=E.useState("off"),v={node:{bg:"var(--tt-info-bg)",stroke:"var(--tt-info-border)",text:"var(--tt-info-text)"},browser:{bg:"var(--tt-success-bg)",stroke:"var(--tt-success-border)",text:"var(--tt-success-text)"},client:{bg:"var(--tt-accent-soft)",stroke:"var(--tt-accent-strong)",text:"var(--tt-accent-text)"}},S=E.useMemo(()=>{const{nodeWsPort:N,clientHost:M,clientHttpPort:F,clientWsPort:j}=Pe.getMultiple(["nodeWsPort","clientHost","clientHttpPort","clientWsPort"]);let L="",z="";try{if(i){const W=new URL(i);L=(W.searchParams.get("host")||"").trim(),z=(W.searchParams.get("port")||"").trim()}}catch{}return{nodeWsPort:N,clientHost:M,clientHttpPort:F,clientWsPort:j,schemaHost:L,schemaPort:z}},[l,u,f,i]),P=N=>{const{client:M,node:F,reason:j}=N||{};Qt.info("connectionChange",M,F),Pe.get("isNodeWSConnected")===F&&(M||r({type:"danger",desc:D("clientServerStartError")})),Pe.get("isClientWSConnected")===M&&(F||r({type:"danger",desc:D("nodeServerStartError")})),Pe.get("isClientWSConnected")&&!M&&(Pe.setMultiple({isClientWSConnected:!1,isResourcesReady:!1,isScriptsReady:!1}),r({type:"danger",desc:D("clientDisconnected")})),Pe.get("isNodeWSConnected")&&!F&&(Pe.setMultiple({isNodeWSConnected:!1,isResourcesReady:!1,isScriptsReady:!1}),r({type:"danger",title:D("serverDisconnected"),desc:D("nodeDisconnected")})),!Pe.get("isClientWSConnected")&&M&&(Pe.set("isClientWSConnected",!0),r({type:"success",desc:D("clientConnectedSuccess")})),!Pe.get("isNodeWSConnected")&&F&&(Pe.set("isNodeWSConnected",!0),r({type:"success",desc:D("nodeServerConnectedSuccess")})),typeof F=="boolean"&&(c(F?"ok":j==="error"||j==="timeout"?"fail":"off"),F||y("off")),typeof M=="boolean"&&p(M?"ok":j==="error"||j==="timeout"?"fail":"off"),n(!!M&&!!F)},T=N=>{if(N?.status==="success"){y("ok");return}if(N?.status==="failed"){y("fail");return}N?.status==="start"&&y("off")};E.useEffect(()=>(Ee.on("connectionChange",P),Ee.on("scanQRCode",T),()=>{Ee.off("connectionChange",P),Ee.off("scanQRCode",T)}),[n]);const b=k.jsxs("div",{children:[k.jsxs("div",{children:[D("connectStatusNode"),": ",Gw(l)]}),k.jsxs("div",{children:[D("connectStatusDebugPage"),": ",window.location.origin]}),S.nodeWsPort?k.jsxs("div",{children:["WS: ws://localhost:",S.nodeWsPort]}):null,k.jsxs("div",{children:["HTTP: ",window.location.origin]}),S.schemaHost&&S.schemaPort?k.jsxs("div",{children:[D("scanQRCode"),":ws://",S.schemaHost,":",S.schemaPort]}):null]}),w=k.jsx("div",{children:k.jsxs("div",{children:[D("connectStatusBrowser"),": ",D("connectStatusConnected")]})}),x=k.jsxs("div",{children:[k.jsxs("div",{children:[D("connectStatusClient"),": ",Gw(u)]}),S.clientHost?k.jsxs("div",{children:[S.clientHost,S.clientHttpPort?` http:${S.clientHttpPort}`:"",S.clientWsPort?` ws:${S.clientWsPort}`:""]}):null]}),O=k.jsxs("div",{className:"conn-graph-wrap",children:[k.jsx("div",{className:"conn-graph",children:k.jsx("svg",{className:"conn-graph-svg",width:"340",height:"220",viewBox:"0 0 360 240",children:(()=>{const N={x:180,y:44},M={x:70,y:206},F={x:290,y:206},j=14,L=26,z=4,W=5,V=8,H={x:(N.x+M.x+F.x)/3,y:(N.y+M.y+F.y)/3},re=(Z,I)=>({x:I.x-Z.x,y:I.y-Z.y}),ee=Z=>Math.hypot(Z.x,Z.y)||1,se=Z=>{const I=ee(Z);return{x:Z.x/I,y:Z.y/I}},ae=Z=>({x:-Z.y,y:Z.x}),he=(Z,I,U=1)=>({x:Z.x+I.x*U,y:Z.y+I.y*U}),ue=(Z,I,U)=>{const oe=re(Z,I),ne=se(oe),ie=se(ae(oe)),_e=U.offset||0,ye=he(he(Z,ne,L),ie,_e),ve=he(he(I,ne,-L),ie,_e),Ce=typeof U.t=="number"?Math.min(.9,Math.max(.1,U.t)):.5,be={x:ye.x+(ve.x-ye.x)*Ce,y:ye.y+(ve.y-ye.y)*Ce},gt=he(Z,ne,L),kt=he(I,ne,-L),ar={x:gt.x+(kt.x-gt.x)*Ce,y:gt.y+(kt.y-gt.y)*Ce},xn=U.markMode||"byLineOffset",Dn=re(ar,H),Jt=Dn.x*ie.x+Dn.y*ie.y>0?{x:-ie.x,y:-ie.y}:ie,xe=U.labelSide==="inner"?-1:1,zt=_e>=0?1:-1,Pt=xn==="byTriangleSide"?xe:zt,$e={w:360,h:240,pad:10};let Ie=he(be,Jt,V*Pt);(Ie.y>$e.h-$e.pad||Ie.y<$e.pad||Ie.x>$e.w-$e.pad||Ie.x<$e.pad)&&(Ie=he(be,Jt,-V*Pt));const rt=Ie.x<$e.w-60,ze={x:rt?Ie.x+W+z:Ie.x-W-z,y:Ie.y},Tt=rt?"start":"end",It=U.label.length*6+8,On=Tt==="start"?ze.x:ze.x-It,en=Tt==="start"?ze.x+It:ze.x;let Ze=Tt,Et=ze.x;return On<$e.pad&&en>$e.w-$e.pad?(Ze="start",Et=$e.pad):On<$e.pad?(Ze="start",Et=Ie.x+W+z):en>$e.w-$e.pad&&(Ze="end",Et=Ie.x-W-z),k.jsxs("g",{children:[k.jsx("line",{x1:ye.x,y1:ye.y,x2:ve.x,y2:ve.y,stroke:"var(--tt-border-strong)",strokeWidth:"2",strokeDasharray:U.dashed?"4 3":void 0}),k.jsx("circle",{cx:Ie.x,cy:Ie.y,r:W,fill:U.statusColor}),k.jsx("text",{x:Et,y:ze.y,fontSize:"10",fill:"var(--tt-text-dim)",dominantBaseline:"middle",textAnchor:Ze,paintOrder:"stroke",stroke:"var(--tt-bg-panel)",strokeWidth:"3",children:U.label})]})},K=(Z,I,U,oe)=>k.jsx(rr,{content:U,children:k.jsxs("g",{className:"conn-vertex",children:[k.jsx("rect",{x:Z.x-28,y:Z.y-14,width:56,height:22,rx:8,fill:oe.bg,stroke:oe.stroke}),k.jsx("text",{x:Z.x,y:Z.y-1,textAnchor:"middle",dominantBaseline:"middle",fontSize:"12",fill:oe.text,children:I})]})});return k.jsxs(k.Fragment,{children:[ue(M,N,{label:"ws",statusColor:ts(l),offset:-j/2,labelSide:"outer",markMode:"byLineOffset",t:.42}),ue(M,N,{label:"http",statusColor:ts(l),offset:j/2,labelSide:"inner",markMode:"byLineOffset",t:.58}),ue(N,F,{label:"ws",statusColor:ts(f),dashed:!0,offset:0,labelSide:"outer",markMode:"byTriangleSide",t:.55}),ue(M,F,{label:"ws",statusColor:ts(u),offset:-j/2,labelSide:"outer",markMode:"byLineOffset",t:.55}),ue(M,F,{label:"http",statusColor:ts(u),offset:j/2,labelSide:"inner",markMode:"byLineOffset",t:.45}),K(N,D("connectStatusNode"),b,v.node),K(M,D("connectStatusBrowser"),w,v.browser),K(F,D("connectStatusClient"),x,v.client)]})})()})}),k.jsxs("div",{className:"conn-legend",children:[k.jsx("div",{className:"conn-legend-title",children:D("connectStatusLegendTitle")}),k.jsxs("div",{className:"conn-legend-item",children:[k.jsx("div",{className:"conn-legend-name",children:k.jsx(un,{className:"conn-legend-tag-node",type:"ghost",size:"small",style:{marginRight:6},children:D("connectStatusNode")})}),k.jsx("div",{className:"conn-legend-desc",children:D("connectStatusLegendNode")})]}),k.jsxs("div",{className:"conn-legend-item",children:[k.jsx("div",{className:"conn-legend-name",children:k.jsx(un,{color:"green",type:"ghost",size:"small",style:{marginRight:6},children:D("connectStatusBrowser")})}),k.jsx("div",{className:"conn-legend-desc",children:D("connectStatusLegendBrowser")})]}),k.jsxs("div",{className:"conn-legend-item",children:[k.jsx("div",{className:"conn-legend-name",children:k.jsx(un,{className:"conn-legend-tag-client",type:"ghost",size:"small",style:{marginRight:6},children:D("connectStatusClient")})}),k.jsx("div",{className:"conn-legend-desc",children:D("connectStatusLegendClient")})]}),k.jsxs("div",{className:"conn-legend-item",children:[k.jsxs("div",{className:"conn-legend-name",children:[k.jsx(un,{color:"grey",type:"ghost",size:"small",style:{marginRight:6},children:"WS"}),k.jsx(un,{color:"grey",type:"ghost",size:"small",children:"HTTP"})]}),k.jsx("div",{className:"conn-legend-desc",children:D("connectStatusLegendProto")})]})]})]});return k.jsx(zn,{content:O,trigger:"hover",showArrow:!1,children:k.jsxs("div",{className:"connect-status tt-header-chip"+(s?" connect-status-on":" connect-status-off"),role:"status","aria-label":D(s?"deviceConnected":"deviceDisconnected"),children:[k.jsx("span",{className:"connect-status-dot","aria-hidden":"true"}),k.jsx("span",{className:"connect-status-text",children:D(s?"deviceConnected":"deviceDisconnected")})]})})},y9=({version:i})=>{const e=_s(),{state:{devToolVersion:n}}=pn(),[r,s]=E.useState(!1);if(E.useEffect(()=>{s(XG(n))},[n]),!i)return null;const l=()=>{n&&(YG(n),s(!1)),e("/changelog")};return k.jsxs("button",{type:"button",onClick:l,className:"version-tag tt-header-chip"+(r?" version-tag-has-new":""),"aria-label":r?`${D("changelog")||"Changelog"} · ${D("changelogNewTag")||"NEW"}`:D("changelog")||"Changelog",title:r?D("changelogNewTag")||"NEW":void 0,children:[k.jsx("span",{className:"version-tag-text",children:i}),r&&k.jsx("span",{className:"version-tag-new",children:D("changelogNewTag")||"NEW"})]})};const c_=(...i)=>i.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();const v9=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const b9=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());const Ww=i=>{const e=b9(i);return e.charAt(0).toUpperCase()+e.slice(1)};var ph={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const S9=i=>{for(const e in i)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},w9=E.createContext({}),C9=()=>E.useContext(w9),_9=E.forwardRef(({color:i,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:l,iconNode:c,...u},p)=>{const{size:f=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:S="currentColor",className:P=""}=C9()??{},T=r??v?Number(n??y)*24/Number(e??f):n??y;return E.createElement("svg",{ref:p,...ph,width:e??f??ph.width,height:e??f??ph.height,stroke:i??S,strokeWidth:T,className:c_("lucide",P,s),...!l&&!S9(u)&&{"aria-hidden":"true"},...u},[...c.map(([b,w])=>E.createElement(b,w)),...Array.isArray(l)?l:[l]])});const Dl=(i,e)=>{const n=E.forwardRef(({className:r,...s},l)=>E.createElement(_9,{ref:l,iconNode:e,className:c_(`lucide-${v9(Ww(i))}`,`lucide-${i}`,r),...s}));return n.displayName=Ww(i),n};const k9=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],P9=Dl("arrow-left",k9);const T9=[["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"}]],E9=Dl("external-link",T9);const x9=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],D9=Dl("moon",x9);const O9=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],I9=Dl("sun",O9),R9=()=>{const{theme:i,toggle:e}=u9(),n=i==="dark",r=n?I9:D9,s=D(n?"themeToggleToLight":"themeToggleToDark");return k.jsx("button",{type:"button",onClick:e,className:"theme-toggle tt-header-chip","aria-label":s,title:s,children:k.jsx(r,{className:"theme-toggle-icon",size:14,strokeWidth:2})})},N9=E.lazy(()=>lt(()=>import("./index-DXDZCuG4.js"),__vite__mapDeps([0,1,2,3])).then(i=>({default:i.AccessDocs}))),j9=E.lazy(()=>lt(()=>import("./index-QNLvejKK.js"),__vite__mapDeps([4,1,2,5])).then(i=>({default:i.LangSwitcher})));E.lazy(()=>lt(()=>import("./index-DulANwbq.js"),__vite__mapDeps([6,7,8,9,10,11,12,13])).then(i=>({default:i.GameUploader})));const L9=E.lazy(()=>lt(()=>import("./index-Ba-JWe4X.js"),__vite__mapDeps([14,15])).then(i=>({default:i.LoginStatus}))),A9=E.lazy(()=>lt(()=>import("./index-DK4IvdRl.js"),__vite__mapDeps([16,17])).then(i=>({default:i.WasmCodeSplit}))),M9=()=>{const{state:{devToolVersion:i,engine:e}}=pn();return k.jsxs("div",{className:"header-wrapper",children:[k.jsxs("div",{className:"header-content",children:[k.jsxs("div",{className:"header-content-left",children:[k.jsx(h9,{}),k.jsx(y9,{version:i}),k.jsx(m9,{})]}),k.jsx("div",{className:"header-content-right",children:k.jsxs(Ss,{spacing:12,children:[k.jsx(E.Suspense,{fallback:null,children:k.jsx(N9,{})}),e==="unity"&&k.jsx(E.Suspense,{fallback:null,children:k.jsx(A9,{})}),k.jsx(E.Suspense,{fallback:null,children:k.jsx(j9,{})}),k.jsx(R9,{}),k.jsx(E.Suspense,{fallback:null,children:k.jsx(L9,{})})]})})]}),k.jsx(D2,{})]})},$9=({enabled:i=!0})=>(E.useEffect(()=>{if(!i){Hi.close();return}return Hi.init(),()=>{Hi.close()}},[i]),null),F9=E.lazy(()=>lt(()=>import("./index-DnnfZ7H_.js"),__vite__mapDeps([18,19,20,21])).then(i=>({default:i.Sidebar}))),z9=()=>k.jsx("div",{className:"sidebar-container",children:k.jsx(E.Suspense,{fallback:k.jsx("div",{className:"sidebar-loading-placeholder"}),children:k.jsx(F9,{})})}),q9=({title:i,subtitle:e,action:n,decoration:r=!0,className:s})=>k.jsxs("header",{className:Q("tt-page-hero",r&&"tt-page-hero-decorated",s),children:[k.jsxs("div",{className:"tt-page-hero-text",children:[k.jsx("h1",{className:"tt-page-hero-title",children:i}),e&&k.jsx("p",{className:"tt-page-hero-subtitle",children:e})]}),n&&k.jsx("div",{className:"tt-page-hero-action",children:n})]}),B9=({tone:i="neutral",withDot:e=!1,variant:n="solid",size:r="md",className:s,children:l})=>k.jsxs("span",{className:Q("tt-tag",`tt-tag-${i}`,`tt-tag-${n}`,`tt-tag-size-${r}`,s),children:[e&&k.jsx("span",{className:"tt-tag-dot","aria-hidden":"true"}),k.jsx("span",{className:"tt-tag-label",children:l})]}),u_=({href:i,iconSize:e=13,className:n="",children:r,target:s="_blank",rel:l="noopener noreferrer",...c})=>k.jsxs("a",{...c,className:`tt-document-link ${n}`.trim(),href:i,target:s,rel:l,children:[k.jsx("span",{className:"tt-document-link-label",children:r}),k.jsx(E9,{className:"tt-document-link-icon",size:e,strokeWidth:2,"aria-hidden":"true"})]}),G9=({items:i,fallbackErrorText:e})=>{const[n,r]=E.useState(!1),s=E.useMemo(()=>{const f=e?.trim();return f?[{text:f,required:!0},...i.filter(y=>y.text.trim()!==f)]:i},[e,i]);if(E.useEffect(()=>{r(!1)},[s]),s.length===0)return null;const l=f=>f.detail?.link?k.jsx(u_,{className:"app-error-cta",href:f.detail.link,children:f.detail.text||D("viewDoc")}):null,c=(f,y)=>{const v=f.required?Qh:Yh,S=f.required?"required":"suggested",P=f.title||(f.required?D("topErrorTitleRequired"):D("topErrorTitleSuggested"));return k.jsxs("div",{className:`app-error-row app-error-row-${S}`,role:f.required?"alert":"status",children:[k.jsx("span",{className:"app-error-row-accent","aria-hidden":"true"}),k.jsx("span",{className:"app-error-row-icon",children:k.jsx(v,{})}),k.jsxs("div",{className:"app-error-row-body",children:[k.jsx("div",{className:"app-error-row-title",children:P}),k.jsx("div",{className:"app-error-row-text",children:f.text})]}),l(f)]},`${f.text}-${S}-${y}`)};if(s.length===1)return k.jsx("div",{className:"app-error-banner",children:c(s[0],0)});const u=s.find(f=>f.required)??s[0],p=s.filter(f=>f!==u);return k.jsxs("div",{className:"app-error-banner app-error-banner-multi",children:[k.jsxs("div",{className:"app-error-multi-head",children:[c(u,0),k.jsx("button",{type:"button",className:"app-error-multi-toggle",onClick:()=>r(f=>!f),children:n?D("topErrorHideDetails"):D("topErrorMoreItems",{count:String(p.length)})})]}),n&&k.jsx("div",{className:"app-error-multi-body",children:p.map((f,y)=>c(f,y+1))})]})},W9=i=>Number.isFinite(i)?Math.max(0,Math.min(1,i??0)):0,U9=_.memo(()=>{const{setMessage:i,hideLoading:e,state:{gameDetail:n,debugSetting:r,isConnected:s,selectedLaunchOption:l,debugMode:c}}=pn();n9();const[u,p]=E.useState(""),f=T=>{if(!T.client||!T.node){Pe.set("hasSetup",!1);return}if(Pe.get("hasSetup"))return;Pe.set("hasSetup",!0),(async()=>(e(),i({type:"success",desc:D("setupDevEnv")}),await zw({debugSetting:r,debugMode:c})))()},y=E.useCallback(({status:T,msg:b,progress:w})=>{switch(T){case"start":const x=D("uploadProcess");i({type:"info",title:x,desc:D("uploadProcessDesc"),progress:0,intent:"uploading"}),console.log(x);break;case"success":i({type:"success",desc:D("uploadSuccess")}),console.log(`✅ ${D("uploadSuccess")}`);break;case"error":const O=`${D("uploadError")}: ${b}`;i({type:"danger",desc:O}),console.log(O);break;case"restart":break;case"process":const N=W9(w);`${D("uploadProcess")}${(N*100).toFixed(0)}`,i({type:"info",title:D("uploadProcess"),desc:D("uploadProcessDesc"),progress:N,intent:"uploading"});break}},[]),v=E.useCallback(({isScriptsReady:T,isResourcesReady:b,isScriptsFailed:w,isResourcesFailed:x})=>{T&&b?(Qt.info("scripts and resources are ready, send meta"),WG(n),i({type:"success",desc:D(c==="clientPreview"?"clientPreviewEnvSetupSuccess":"debugEnvSetupSuccess")})):w?i({type:"danger",desc:D("scriptsSetupFailed")}):x&&i({type:"danger",desc:D("resourcesSetupFailed")})},[n,l,c]),S=()=>{if(!s)return;const T=tr.warning({position:"top",duration:1e4,title:D("gameResourceUpdated"),id:u,onClose:()=>{p("")},content:k.jsxs(k.Fragment,{children:[k.jsx("p",{children:D("gameResourceChange")}),k.jsxs("div",{className:"banner-footer",children:[k.jsx(tt,{type:"tertiary",onClick:()=>{tr.close(T)},children:D("notUpload")}),k.jsx(tt,{style:{marginLeft:12},type:"warning",onClick:()=>{Qt.info("upload"),Qt.info("upload iframe onload, 开始重新初始化"),zw({debugSetting:r,debugMode:c}),tr.close(T)},children:D("uploadToClient")})]})]})});p(T)},P=E.useCallback(({status:T,errorMsg:b})=>{T==="start"?(i({type:"info",title:D("gameResourceCompilingTitle"),desc:D("gameResourceCompiling")}),console.warn(`⚠️ ${D("gameResourceCompiling")}`)):T==="end"&&(b?(i({type:"danger",desc:b}),console.error(`❌ ${b}`)):(i({type:"success",title:D("gameResourceCompileSuccessTitle"),desc:D("gameResourceCompileSuccess")}),console.log(`✅ ${D("gameResourceCompileSuccess")}`)))},[]);return E.useEffect(()=>(Ee.on("connectionChange",f),Ee.on("compilationStatus",P),Ee.on("resourceChange",S),Ee.on("uploadGame",y),Ee.on("setupStatusChange",v),()=>{Ee.off("compilationStatus",P),Ee.off("resourceChange",S),Ee.off("setupStatusChange",v),Ee.off("uploadGame",y),Ee.off("connectionChange",f)}),[f,P,S,v,y]),null});var Gi={},fh,Uw;function d_(){return Uw||(Uw=1,fh={L:1,M:0,Q:3,H:2}),fh}var hh,Hw;function p_(){return Hw||(Hw=1,hh={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),hh}var gh,Vw;function H9(){if(Vw)return gh;Vw=1;var i=p_();function e(n){this.mode=i.MODE_8BIT_BYTE,this.data=n}return e.prototype={getLength:function(n){return this.data.length},write:function(n){for(var r=0;r<this.data.length;r++)n.put(this.data.charCodeAt(r),8)}},gh=e,gh}var mh,Kw;function V9(){if(Kw)return mh;Kw=1;var i=d_();function e(n,r){this.totalCount=n,this.dataCount=r}return e.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e.getRSBlocks=function(n,r){var s=e.getRsBlockTable(n,r);if(s==null)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+r);for(var l=s.length/3,c=new Array,u=0;u<l;u++)for(var p=s[u*3+0],f=s[u*3+1],y=s[u*3+2],v=0;v<p;v++)c.push(new e(f,y));return c},e.getRsBlockTable=function(n,r){switch(r){case i.L:return e.RS_BLOCK_TABLE[(n-1)*4+0];case i.M:return e.RS_BLOCK_TABLE[(n-1)*4+1];case i.Q:return e.RS_BLOCK_TABLE[(n-1)*4+2];case i.H:return e.RS_BLOCK_TABLE[(n-1)*4+3];default:return}},mh=e,mh}var yh,Qw;function K9(){if(Qw)return yh;Qw=1;function i(){this.buffer=new Array,this.length=0}return i.prototype={get:function(e){var n=Math.floor(e/8);return(this.buffer[n]>>>7-e%8&1)==1},put:function(e,n){for(var r=0;r<n;r++)this.putBit((e>>>n-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),e&&(this.buffer[n]|=128>>>this.length%8),this.length++}},yh=i,yh}var vh,Yw;function f_(){if(Yw)return vh;Yw=1;for(var i={glog:function(n){if(n<1)throw new Error("glog("+n+")");return i.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return i.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},e=0;e<8;e++)i.EXP_TABLE[e]=1<<e;for(var e=8;e<256;e++)i.EXP_TABLE[e]=i.EXP_TABLE[e-4]^i.EXP_TABLE[e-5]^i.EXP_TABLE[e-6]^i.EXP_TABLE[e-8];for(var e=0;e<255;e++)i.LOG_TABLE[i.EXP_TABLE[e]]=e;return vh=i,vh}var bh,Xw;function h_(){if(Xw)return bh;Xw=1;var i=f_();function e(n,r){if(n.length==null)throw new Error(n.length+"/"+r);for(var s=0;s<n.length&&n[s]==0;)s++;this.num=new Array(n.length-s+r);for(var l=0;l<n.length-s;l++)this.num[l]=n[l+s]}return e.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var r=new Array(this.getLength()+n.getLength()-1),s=0;s<this.getLength();s++)for(var l=0;l<n.getLength();l++)r[s+l]^=i.gexp(i.glog(this.get(s))+i.glog(n.get(l)));return new e(r,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var r=i.glog(this.get(0))-i.glog(n.get(0)),s=new Array(this.getLength()),l=0;l<this.getLength();l++)s[l]=this.get(l);for(var l=0;l<n.getLength();l++)s[l]^=i.gexp(i.glog(n.get(l))+r);return new e(s,0).mod(n)}},bh=e,bh}var Sh,Zw;function Q9(){if(Zw)return Sh;Zw=1;var i=p_(),e=h_(),n=f_(),r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(l){for(var c=l<<10;s.getBCHDigit(c)-s.getBCHDigit(s.G15)>=0;)c^=s.G15<<s.getBCHDigit(c)-s.getBCHDigit(s.G15);return(l<<10|c)^s.G15_MASK},getBCHTypeNumber:function(l){for(var c=l<<12;s.getBCHDigit(c)-s.getBCHDigit(s.G18)>=0;)c^=s.G18<<s.getBCHDigit(c)-s.getBCHDigit(s.G18);return l<<12|c},getBCHDigit:function(l){for(var c=0;l!=0;)c++,l>>>=1;return c},getPatternPosition:function(l){return s.PATTERN_POSITION_TABLE[l-1]},getMask:function(l,c,u){switch(l){case r.PATTERN000:return(c+u)%2==0;case r.PATTERN001:return c%2==0;case r.PATTERN010:return u%3==0;case r.PATTERN011:return(c+u)%3==0;case r.PATTERN100:return(Math.floor(c/2)+Math.floor(u/3))%2==0;case r.PATTERN101:return c*u%2+c*u%3==0;case r.PATTERN110:return(c*u%2+c*u%3)%2==0;case r.PATTERN111:return(c*u%3+(c+u)%2)%2==0;default:throw new Error("bad maskPattern:"+l)}},getErrorCorrectPolynomial:function(l){for(var c=new e([1],0),u=0;u<l;u++)c=c.multiply(new e([1,n.gexp(u)],0));return c},getLengthInBits:function(l,c){if(1<=c&&c<10)switch(l){case i.MODE_NUMBER:return 10;case i.MODE_ALPHA_NUM:return 9;case i.MODE_8BIT_BYTE:return 8;case i.MODE_KANJI:return 8;default:throw new Error("mode:"+l)}else if(c<27)switch(l){case i.MODE_NUMBER:return 12;case i.MODE_ALPHA_NUM:return 11;case i.MODE_8BIT_BYTE:return 16;case i.MODE_KANJI:return 10;default:throw new Error("mode:"+l)}else if(c<41)switch(l){case i.MODE_NUMBER:return 14;case i.MODE_ALPHA_NUM:return 13;case i.MODE_8BIT_BYTE:return 16;case i.MODE_KANJI:return 12;default:throw new Error("mode:"+l)}else throw new Error("type:"+c)},getLostPoint:function(l){for(var c=l.getModuleCount(),u=0,p=0;p<c;p++)for(var f=0;f<c;f++){for(var y=0,v=l.isDark(p,f),S=-1;S<=1;S++)if(!(p+S<0||c<=p+S))for(var P=-1;P<=1;P++)f+P<0||c<=f+P||S==0&&P==0||v==l.isDark(p+S,f+P)&&y++;y>5&&(u+=3+y-5)}for(var p=0;p<c-1;p++)for(var f=0;f<c-1;f++){var T=0;l.isDark(p,f)&&T++,l.isDark(p+1,f)&&T++,l.isDark(p,f+1)&&T++,l.isDark(p+1,f+1)&&T++,(T==0||T==4)&&(u+=3)}for(var p=0;p<c;p++)for(var f=0;f<c-6;f++)l.isDark(p,f)&&!l.isDark(p,f+1)&&l.isDark(p,f+2)&&l.isDark(p,f+3)&&l.isDark(p,f+4)&&!l.isDark(p,f+5)&&l.isDark(p,f+6)&&(u+=40);for(var f=0;f<c;f++)for(var p=0;p<c-6;p++)l.isDark(p,f)&&!l.isDark(p+1,f)&&l.isDark(p+2,f)&&l.isDark(p+3,f)&&l.isDark(p+4,f)&&!l.isDark(p+5,f)&&l.isDark(p+6,f)&&(u+=40);for(var b=0,f=0;f<c;f++)for(var p=0;p<c;p++)l.isDark(p,f)&&b++;var w=Math.abs(100*b/c/c-50)/5;return u+=w*10,u}};return Sh=s,Sh}var wh,Jw;function Y9(){if(Jw)return wh;Jw=1;var i=H9(),e=V9(),n=K9(),r=Q9(),s=h_();function l(u,p){this.typeNumber=u,this.errorCorrectLevel=p,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var c=l.prototype;return c.addData=function(u){var p=new i(u);this.dataList.push(p),this.dataCache=null},c.isDark=function(u,p){if(u<0||this.moduleCount<=u||p<0||this.moduleCount<=p)throw new Error(u+","+p);return this.modules[u][p]},c.getModuleCount=function(){return this.moduleCount},c.make=function(){if(this.typeNumber<1){var u=1;for(u=1;u<40;u++){for(var p=e.getRSBlocks(u,this.errorCorrectLevel),f=new n,y=0,v=0;v<p.length;v++)y+=p[v].dataCount;for(var v=0;v<this.dataList.length;v++){var S=this.dataList[v];f.put(S.mode,4),f.put(S.getLength(),r.getLengthInBits(S.mode,u)),S.write(f)}if(f.getLengthInBits()<=y*8)break}this.typeNumber=u}this.makeImpl(!1,this.getBestMaskPattern())},c.makeImpl=function(u,p){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var f=0;f<this.moduleCount;f++){this.modules[f]=new Array(this.moduleCount);for(var y=0;y<this.moduleCount;y++)this.modules[f][y]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(u,p),this.typeNumber>=7&&this.setupTypeNumber(u),this.dataCache==null&&(this.dataCache=l.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,p)},c.setupPositionProbePattern=function(u,p){for(var f=-1;f<=7;f++)if(!(u+f<=-1||this.moduleCount<=u+f))for(var y=-1;y<=7;y++)p+y<=-1||this.moduleCount<=p+y||(0<=f&&f<=6&&(y==0||y==6)||0<=y&&y<=6&&(f==0||f==6)||2<=f&&f<=4&&2<=y&&y<=4?this.modules[u+f][p+y]=!0:this.modules[u+f][p+y]=!1)},c.getBestMaskPattern=function(){for(var u=0,p=0,f=0;f<8;f++){this.makeImpl(!0,f);var y=r.getLostPoint(this);(f==0||u>y)&&(u=y,p=f)}return p},c.createMovieClip=function(u,p,f){var y=u.createEmptyMovieClip(p,f),v=1;this.make();for(var S=0;S<this.modules.length;S++)for(var P=S*v,T=0;T<this.modules[S].length;T++){var b=T*v,w=this.modules[S][T];w&&(y.beginFill(0,100),y.moveTo(b,P),y.lineTo(b+v,P),y.lineTo(b+v,P+v),y.lineTo(b,P+v),y.endFill())}return y},c.setupTimingPattern=function(){for(var u=8;u<this.moduleCount-8;u++)this.modules[u][6]==null&&(this.modules[u][6]=u%2==0);for(var p=8;p<this.moduleCount-8;p++)this.modules[6][p]==null&&(this.modules[6][p]=p%2==0)},c.setupPositionAdjustPattern=function(){for(var u=r.getPatternPosition(this.typeNumber),p=0;p<u.length;p++)for(var f=0;f<u.length;f++){var y=u[p],v=u[f];if(this.modules[y][v]==null)for(var S=-2;S<=2;S++)for(var P=-2;P<=2;P++)S==-2||S==2||P==-2||P==2||S==0&&P==0?this.modules[y+S][v+P]=!0:this.modules[y+S][v+P]=!1}},c.setupTypeNumber=function(u){for(var p=r.getBCHTypeNumber(this.typeNumber),f=0;f<18;f++){var y=!u&&(p>>f&1)==1;this.modules[Math.floor(f/3)][f%3+this.moduleCount-8-3]=y}for(var f=0;f<18;f++){var y=!u&&(p>>f&1)==1;this.modules[f%3+this.moduleCount-8-3][Math.floor(f/3)]=y}},c.setupTypeInfo=function(u,p){for(var f=this.errorCorrectLevel<<3|p,y=r.getBCHTypeInfo(f),v=0;v<15;v++){var S=!u&&(y>>v&1)==1;v<6?this.modules[v][8]=S:v<8?this.modules[v+1][8]=S:this.modules[this.moduleCount-15+v][8]=S}for(var v=0;v<15;v++){var S=!u&&(y>>v&1)==1;v<8?this.modules[8][this.moduleCount-v-1]=S:v<9?this.modules[8][15-v-1+1]=S:this.modules[8][15-v-1]=S}this.modules[this.moduleCount-8][8]=!u},c.mapData=function(u,p){for(var f=-1,y=this.moduleCount-1,v=7,S=0,P=this.moduleCount-1;P>0;P-=2)for(P==6&&P--;;){for(var T=0;T<2;T++)if(this.modules[y][P-T]==null){var b=!1;S<u.length&&(b=(u[S]>>>v&1)==1);var w=r.getMask(p,y,P-T);w&&(b=!b),this.modules[y][P-T]=b,v--,v==-1&&(S++,v=7)}if(y+=f,y<0||this.moduleCount<=y){y-=f,f=-f;break}}},l.PAD0=236,l.PAD1=17,l.createData=function(u,p,f){for(var y=e.getRSBlocks(u,p),v=new n,S=0;S<f.length;S++){var P=f[S];v.put(P.mode,4),v.put(P.getLength(),r.getLengthInBits(P.mode,u)),P.write(v)}for(var T=0,S=0;S<y.length;S++)T+=y[S].dataCount;if(v.getLengthInBits()>T*8)throw new Error("code length overflow. ("+v.getLengthInBits()+">"+T*8+")");for(v.getLengthInBits()+4<=T*8&&v.put(0,4);v.getLengthInBits()%8!=0;)v.putBit(!1);for(;!(v.getLengthInBits()>=T*8||(v.put(l.PAD0,8),v.getLengthInBits()>=T*8));)v.put(l.PAD1,8);return l.createBytes(v,y)},l.createBytes=function(u,p){for(var f=0,y=0,v=0,S=new Array(p.length),P=new Array(p.length),T=0;T<p.length;T++){var b=p[T].dataCount,w=p[T].totalCount-b;y=Math.max(y,b),v=Math.max(v,w),S[T]=new Array(b);for(var x=0;x<S[T].length;x++)S[T][x]=255&u.buffer[x+f];f+=b;var O=r.getErrorCorrectPolynomial(w),N=new s(S[T],O.getLength()-1),M=N.mod(O);P[T]=new Array(O.getLength()-1);for(var x=0;x<P[T].length;x++){var F=x+M.getLength()-P[T].length;P[T][x]=F>=0?M.get(F):0}}for(var j=0,x=0;x<p.length;x++)j+=p[x].totalCount;for(var L=new Array(j),z=0,x=0;x<y;x++)for(var T=0;T<p.length;T++)x<S[T].length&&(L[z++]=S[T][x]);for(var x=0;x<v;x++)for(var T=0;T<p.length;T++)x<P[T].length&&(L[z++]=P[T][x]);return L},wh=l,wh}var za={},eC;function X9(){if(eC)return za;eC=1,Object.defineProperty(za,"__esModule",{value:!0});var i=Object.assign||function(f){for(var y=1;y<arguments.length;y++){var v=arguments[y];for(var S in v)Object.prototype.hasOwnProperty.call(v,S)&&(f[S]=v[S])}return f},e=Ah(),n=l(e),r=fs(),s=l(r);function l(f){return f&&f.__esModule?f:{default:f}}function c(f,y){var v={};for(var S in f)y.indexOf(S)>=0||Object.prototype.hasOwnProperty.call(f,S)&&(v[S]=f[S]);return v}var u={bgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,bgD:n.default.string.isRequired,fgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,fgD:n.default.string.isRequired,size:n.default.number.isRequired,title:n.default.string,viewBoxSize:n.default.number.isRequired,xmlns:n.default.string},p=(0,r.forwardRef)(function(f,y){var v=f.bgColor,S=f.bgD,P=f.fgD,T=f.fgColor,b=f.size,w=f.title,x=f.viewBoxSize,O=f.xmlns,N=O===void 0?"http://www.w3.org/2000/svg":O,M=c(f,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return s.default.createElement("svg",i({},M,{height:b,ref:y,viewBox:"0 0 "+x+" "+x,width:b,xmlns:N}),w?s.default.createElement("title",null,w):null,s.default.createElement("path",{d:S,fill:v}),s.default.createElement("path",{d:P,fill:T}))});return p.displayName="QRCodeSvg",p.propTypes=u,za.default=p,za}var tC;function Z9(){if(tC)return Gi;tC=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.QRCode=void 0;var i=Object.assign||function(b){for(var w=1;w<arguments.length;w++){var x=arguments[w];for(var O in x)Object.prototype.hasOwnProperty.call(x,O)&&(b[O]=x[O])}return b},e=Ah(),n=v(e),r=d_(),s=v(r),l=Y9(),c=v(l),u=fs(),p=v(u),f=X9(),y=v(f);function v(b){return b&&b.__esModule?b:{default:b}}function S(b,w){var x={};for(var O in b)w.indexOf(O)>=0||Object.prototype.hasOwnProperty.call(b,O)&&(x[O]=b[O]);return x}var P={bgColor:n.default.oneOfType([n.default.object,n.default.string]),fgColor:n.default.oneOfType([n.default.object,n.default.string]),level:n.default.string,size:n.default.number,value:n.default.string.isRequired},T=(0,u.forwardRef)(function(b,w){var x=b.bgColor,O=x===void 0?"#FFFFFF":x,N=b.fgColor,M=N===void 0?"#000000":N,F=b.level,j=F===void 0?"L":F,L=b.size,z=L===void 0?256:L,W=b.value,V=S(b,["bgColor","fgColor","level","size","value"]),H=new c.default(-1,s.default[j]);H.addData(W),H.make();var re=H.modules;return p.default.createElement(y.default,i({},V,{bgColor:O,bgD:re.map(function(ee,se){return ee.map(function(ae,he){return ae?"":"M "+he+" "+se+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:M,fgD:re.map(function(ee,se){return ee.map(function(ae,he){return ae?"M "+he+" "+se+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:w,size:z,viewBoxSize:re.length}))});return Gi.QRCode=T,T.displayName="QRCode",T.propTypes=P,Gi.default=T,Gi}var J9=Z9();const nC=Ye(J9),eH=i=>{const e=_s(),{isConnected:n}=i,{state:{devSchema:r,schema:s,launchOptions:l,selectedLaunchOption:c,debugMode:u,debugSetting:p,user:f},setShowManualBindIP:y,setSelectedLaunchOption:v,setDebugMode:S}=pn(),[P,T]=E.useState(!1),b=xg(f),w=!p.enableDomainCheck,x=u===qn.clientPreview,O=c?.pkgType==="independent"?D("independentPackage"):D("mainPackage"),N=c?.id==="normal"?D("normalLaunchMode"):c?.name||D("normalLaunchMode"),M=D(x?"clientPreviewMode":"browserDebugMode"),F=`${N} · ${O}${c?.scene?` · ${c.scene}`:""}`,j=[{key:"domain-check",label:D("homeSession.option.domainCheck"),status:D(w?"homeSession.status.off":"homeSession.status.on"),tone:w?"warn":"accent"},{key:"v-console",label:D("homeSession.option.vConsole"),status:p.enableVConsole?D("homeSession.status.on"):D("homeSession.status.off"),tone:p.enableVConsole?"accent":"neutral"},{key:"dev-panel",label:D("homeSession.option.devPanel"),status:p.enableDevInfoPanel?D("homeSession.status.on"):D("homeSession.status.off"),tone:p.enableDevInfoPanel?"accent":"neutral"}],L=E.useMemo(()=>{try{if(!r)return null;const H=new URL(r),re=(H.searchParams.get("host")||"").trim(),ee=H.searchParams.get("host_list")||"";let se=[];if(ee)try{const ue=JSON.parse(ee);se=Array.isArray(ue)?ue.filter(K=>typeof K=="string"):[]}catch{return null}const ae=ue=>{const K=ue.trim().toLowerCase();return!["","127.0.0.1","localhost","0.0.0.0","::","::1","undefined","null"].includes(K)};return ae(re)||Array.isArray(se)&&se.some(ae)?null:{host:re,hostList:se}}catch{return null}},[r]),z=H=>{H.status==="success"&&T(!1),H.status==="failed"&&T(!1),H.status==="start"&&T(!0)},W=H=>{S(H),z0(H)};E.useEffect(()=>(Ee.on("scanQRCode",z),()=>{Ee.off("scanQRCode",z)}),[]);const V=H=>{if(H==="created")v({...Ua,name:""}),e("/launch_mode");else{const re=l.find(ee=>ee.id===H);re&&v(re)}};return n?k.jsx("div",{className:"qr-code-container-connected",children:k.jsxs("div",{className:"qr-code-connected-content",children:[k.jsx("div",{className:"qr-code-tile qr-code-tile-connected",children:k.jsx(nC,{className:"qr-code-connected",size:150,value:s,bgColor:"transparent",fgColor:"#0e0f13"})}),k.jsxs("div",{className:"qr-code-connected-info",children:[k.jsx("div",{className:"qr-code-connected-desc-title",children:D("scanQRCodeChange")}),k.jsx("div",{className:"qr-code-connected-desc",children:D("scanQRCodeDesc")})]}),k.jsxs("div",{className:"qr-code-session-panel",children:[k.jsx("div",{className:"qr-code-session-header",children:k.jsx("span",{children:D("homeSession.title")})}),k.jsxs("div",{className:"qr-code-session-grid",children:[k.jsxs("div",{className:"qr-code-session-item",children:[k.jsx("span",{children:D("homeSession.modeLabel")}),k.jsx("strong",{children:M})]}),k.jsxs("div",{className:"qr-code-session-item",children:[k.jsx("span",{children:D("homeSession.entryLabel")}),k.jsx("strong",{children:F})]})]}),k.jsxs("div",{className:"qr-code-session-options",children:[k.jsx("div",{className:"qr-code-session-options-heading",children:k.jsx("span",{children:D("devOptions")})}),k.jsx("div",{className:"qr-code-session-option-list",children:j.map(H=>k.jsxs("div",{className:"qr-code-session-option",children:[k.jsx("span",{className:"qr-code-session-option-label",children:H.label}),k.jsx(B9,{tone:H.tone,size:"sm",children:H.status})]},H.key))})]})]})]})}):k.jsxs("div",{className:"qr-code-container-disconnected",children:[k.jsx("div",{className:"qr-code-select-container",children:k.jsx(Mr,{className:"qr-code-launch-select",value:c?.id,onChange:V,placeholder:D("selectLaunchMode"),style:{width:"216px"},optionList:l.map(H=>({label:H.id==="normal"?D("normalLaunchMode"):H.id==="created"?D("createdLaunchMode"):H.name,value:H.id}))})}),k.jsxs("div",{className:"qr-code-content",children:[L?k.jsxs("div",{className:"qr-code-network-hint",role:"status",children:[k.jsxs("div",{className:"qr-code-network-hint-main",children:[k.jsx("span",{className:"qr-code-network-hint-icon","aria-hidden":"true",children:k.jsx(Zh,{})}),k.jsxs("div",{className:"qr-code-network-hint-copy",children:[k.jsx(Qe.Text,{strong:!0,children:D("networkNoLanIPTitle")}),k.jsx(Qe.Text,{type:"tertiary",children:D("networkNoLanIPDesc")})]})]}),k.jsx(tt,{className:"qr-code-network-hint-action",size:"small",theme:"light",type:"tertiary",onClick:()=>y(!0),children:D("networkNoLanIPAction")})]}):null,L?null:k.jsxs("div",{className:"qr-code-schema",children:[k.jsx("div",{className:"qr-code-tile",children:k.jsx(nC,{size:256,value:r,bgColor:"transparent",fgColor:"#0e0f13"})}),k.jsxs(ug,{className:"qr-code-mode-switches",children:[k.jsx(tt,{className:`qr-code-mode-button ${u==="browserDebug"?"is-active":""}`,theme:"borderless",type:"tertiary",size:"small",onClick:()=>W("browserDebug"),children:D("browserDebugMode")}),k.jsx(tt,{className:`qr-code-mode-button ${u==="clientPreview"?"is-active":""}`,onClick:()=>W("clientPreview"),theme:"borderless",type:"tertiary",size:"small",children:D("clientPreviewMode")})]}),P&&k.jsxs("div",{className:"qr-code-spin",children:[k.jsx(Ar,{size:"large"}),k.jsx("div",{className:"qr-code-text",children:D("scanning")})]})]}),k.jsxs("div",{className:"qr-code-side-panel",children:[k.jsxs("div",{className:"qr-code-diagnostics-card",children:[k.jsx("div",{className:"qr-code-diagnostics-card-copy",children:k.jsx(Qe.Text,{children:D("netDiagEntryDesc")})}),k.jsx(tt,{className:"qr-code-diagnostics-entry",theme:"light",size:"small",onClick:()=>e("/network_diagnostics"),children:D("netDiagEntryAction")})]}),b?null:k.jsxs("div",{className:"qr-code-login-guide",children:[k.jsxs("div",{className:"qr-code-login-guide-copy",children:[k.jsx(Qe.Text,{strong:!0,children:D("basicDebugGuide.entryTitle")}),k.jsx(Qe.Text,{children:D("basicDebugGuide.entryDesc")})]}),k.jsx(tt,{theme:"light",onClick:()=>e("/basic_debug_guide"),children:D("basicDebugGuide.entryAction")})]})]})]})]})},tH=[{key:"domain-check",labelKey:"debugSettingDomainCheck",descriptionKey:"devOptionsDomainCheckDesc",getChecked:i=>!i.enableDomainCheck,getNextSetting:(i,e)=>({...i,enableDomainCheck:!e})},{key:"ad-mock",labelKey:"debugSettingAdMock",descriptionKey:"debugSettingAdMockDesc",getChecked:i=>i.enableAdMock,getNextSetting:(i,e)=>({...i,enableAdMock:e})},{key:"iap-mock",labelKey:"debugSettingIAPMock",descriptionKey:"debugSettingIAPMockDesc",getChecked:i=>i.enableIAPMock,getNextSetting:(i,e)=>({...i,enableIAPMock:e})},{key:"dev-info-panel",labelKey:"debugSettingDevInfoPanel",descriptionKey:"debugSettingEnableDevInfoPanelDesc",getChecked:i=>i.enableDevInfoPanel,getNextSetting:(i,e)=>({...i,enableDevInfoPanel:e})},{key:"vconsole",labelKey:"debugSettingVConsole",descriptionKey:"debugSettingEnableVconsoleDesc",isAvailable:i=>i!==qn.browserDebug,getChecked:i=>i.enableVConsole,getNextSetting:(i,e)=>({...i,enableVConsole:e})}];function nH({debugMode:i,debugSetting:e,onChange:n}){return tH.filter(r=>!r.isAvailable||r.isAvailable(i)).map(r=>({key:r.key,checked:r.getChecked(e),label:D(r.labelKey),description:D(r.descriptionKey),onChange:s=>n(r.getNextSetting(e,s))}))}const rH=()=>{const{state:{debugSetting:i,debugMode:e},setDebugSetting:n}=pn(),r=c=>{n(c)},s=()=>{Ps.send({method:"setDebugSettings",payload:i})};E.useEffect(()=>(Ee.on("connectionChange",s),()=>{Ee.off("connectionChange",s)}),[s]);const l=nH({debugMode:e,debugSetting:i,onChange:r});return k.jsx("div",{className:"debug-setting-card",children:k.jsxs(Sl,{style:{width:"100%"},children:[k.jsx("div",{className:"debug-setting-head",children:k.jsx(Qe.Text,{style:{fontWeight:"bold",fontSize:16},children:D("devOptions")})}),k.jsx("div",{className:"debug-setting-row",children:l.map(c=>k.jsxs("div",{className:"debug-setting-item",children:[k.jsxs("div",{className:"debug-setting-item-head",children:[k.jsx(wg,{className:"debug-setting-switch",checked:c.checked,onChange:c.onChange}),k.jsx(Qe.Text,{className:"debug-setting-item-title",children:c.label})]}),k.jsx(Qe.Text,{className:"debug-setting-item-desc",type:"tertiary",children:c.description})]},c.key))})]})})};function g_(){return{ip:Pe.get("clientHost")||localStorage.getItem("clientHost")||"",port:Pe.get("clientHttpPort")||localStorage.getItem("clientHttpPort")||"",wsPort:Pe.get("clientWsPort")||localStorage.getItem("clientWsPort")||""}}function tV(i=g_()){return!!(String(i.ip||"").trim()&&String(i.port||"").trim()&&String(i.wsPort||"").trim())}function iH(i){const{ip:e,port:n,wsPort:r}=i;Pe.setMultiple({clientHost:e,clientWsPort:r,clientHttpPort:n}),Hi.send({method:"manualConnect",payload:{clientHost:e,clientWsPort:r,clientHttpPort:n}}),Ps.init({clientWsPort:r,clientHost:e,clientHttpPort:n}),localStorage.setItem("clientHost",e),localStorage.setItem("clientWsPort",r),localStorage.setItem("clientHttpPort",n)}function rC(i){const e=String(i.ip||""),n=String(i.port||""),r=String(i.wsPort||"");Pe.setMultiple({clientHost:e,clientWsPort:r,clientHttpPort:n}),localStorage.setItem("clientHost",e),localStorage.setItem("clientWsPort",r),localStorage.setItem("clientHttpPort",n)}const m_=i=>{const{onClose:e,onSuccess:n,onValuesChange:r,onConnectResult:s,getFormApi:l,layout:c="default"}=i,[u,p]=E.useState(!1),[f,y]=E.useState({}),v=(L,z=3e3)=>new Promise(W=>{let V=!1;const H=setTimeout(()=>{if(!V){V=!0;try{re?.close()}catch{}W({ok:!1,message:D("connectivityTimeout")})}},z);let re=null;try{re=new WebSocket(L),re.onopen=()=>{if(!V){V=!0,clearTimeout(H);try{re?.close()}catch{}W({ok:!0,message:D("connectivityOK")})}},re.onerror=()=>{V||(V=!0,clearTimeout(H),W({ok:!1,message:D("connectivityFailed")}))}}catch{clearTimeout(H),W({ok:!1,message:D("connectivityFailed")})}}),S=async L=>{if(!j(L)){s?.({ok:!1,message:D("connectivityMissingParams")});return}p(!0),iH(L);const{ip:z,wsPort:W}=L,V=await v(`ws://${z}:${W}`);s?.(V),V.ok&&n?.(),p(!1)},P=E.useMemo(()=>g_(),[]),[T,b]=E.useState(P),w=E.useRef(P),x=E.useRef(null),O=E.useRef(null),N=E.useRef(null),M=L=>{const z={...w.current,...L};w.current=z,b(z),y(W=>({...W,...L.ip!==void 0?{ip:void 0}:{},...L.port!==void 0?{port:void 0}:{},...L.wsPort!==void 0?{wsPort:void 0}:{}})),r?.(z),rC(z)},F=()=>{const L=x.current?.querySelector("input")?.value,z=O.current?.querySelector("input")?.value,W=N.current?.querySelector("input")?.value,V={ip:String(L||""),port:String(z||""),wsPort:String(W||"")};(V.ip!==w.current.ip||V.port!==w.current.port||V.wsPort!==w.current.wsPort)&&M(V)};E.useEffect(()=>{w.current=P,b(P),r?.(P),rC(P)},[P]),E.useEffect(()=>{const L=[0,80,300,800].map(z=>window.setTimeout(()=>F(),z));return()=>{L.forEach(z=>window.clearTimeout(z))}},[]),E.useEffect(()=>{l?.({getValues:()=>w.current,submitForm:()=>S(w.current)})},[l]);const j=L=>{const z={};return String(L.ip||"").trim()||(z.ip=D("debug.guide.manualBindIPInvalid")),String(L.port||"").trim()||(z.port=D("invalidPort")),String(L.wsPort||"").trim()||(z.wsPort=D("invalidPort")),y(z),Object.keys(z).length===0};return k.jsxs("div",{className:`manual-connection-form manual-connection-form-${c}`,children:[c==="default"?k.jsx("div",{className:"manual-connection-tip",children:D("manualConnectDialogDesc")}):null,k.jsxs("div",{className:"manual-connection-grid",children:[k.jsxs("div",{className:"manual-connection-field",children:[k.jsxs("div",{className:"manual-connection-label",children:[k.jsx(Qe.Text,{strong:!0,children:"Client IP "}),k.jsx(Qe.Text,{type:"danger",children:"*"})]}),k.jsx("div",{ref:x,children:k.jsx(ss,{value:T.ip,onChange:L=>M({ip:String(L||"")}),onBlur:F,placeholder:"192.168.x.x"})}),f.ip?k.jsx(Qe.Text,{type:"danger",children:f.ip}):null]}),k.jsxs("div",{className:"manual-connection-field",children:[k.jsxs("div",{className:"manual-connection-label",children:[k.jsx(Qe.Text,{strong:!0,children:"Port 1(HTTP 端口) "}),k.jsx(Qe.Text,{type:"danger",children:"*"})]}),k.jsx("div",{ref:O,children:k.jsx(ss,{value:T.port,onChange:L=>M({port:String(L||"")}),onBlur:F,placeholder:"3000"})}),f.port?k.jsx(Qe.Text,{type:"danger",children:f.port}):null]}),k.jsxs("div",{className:"manual-connection-field",children:[k.jsxs("div",{className:"manual-connection-label",children:[k.jsx(Qe.Text,{strong:!0,children:"Port 2(WS 端口) "}),k.jsx(Qe.Text,{type:"danger",children:"*"})]}),k.jsx("div",{ref:N,children:k.jsx(ss,{value:T.wsPort,onChange:L=>M({wsPort:String(L||"")}),onBlur:F,placeholder:"2999"})}),f.wsPort?k.jsx(Qe.Text,{type:"danger",children:f.wsPort}):null]})]}),e?k.jsxs("div",{className:"manual-connection-footer",children:[k.jsx(tt,{type:"tertiary",onClick:()=>e(),disabled:u,children:D("cancel")}),k.jsx(tt,{type:"primary",theme:"solid",onClick:()=>S(w.current),loading:u,children:D("manualConnectConfirm")})]}):null]})},oH=()=>{const{state:{showManualBindIP:i},setShowManualBindIP:e}=pn();return k.jsx($t,{className:"manual-connection-modal",width:520,title:D("manualBindClientDebugServiceTitle"),visible:i,showCancel:!1,onCancel:()=>e(!1),showOk:!1,footer:null,children:k.jsx(m_,{onClose:()=>e(!1),onSuccess:()=>e(!1)})})},sH=()=>{const{state:{isConnected:i,message:e}}=E.useContext(Cg),n=e?.intent==="uploading",r=Math.max(0,Math.min(100,Math.round((e?.progress??0)*100))),s=!!e?.title;return k.jsxs("div",{"data-doc-shot":"start-debug-qr-idle",className:`home-container ${i?"home-container-connected":""}`,children:[k.jsx(q9,{title:D(i?"homeHeroTitleConnected":"homeHeroTitle"),subtitle:D(i?"homeHeroSubtitleConnected":"homeHeroSubtitle")}),k.jsxs("div",{className:Q("home-status-banner",`home-status-banner-${e?.type??"info"}`,{"home-status-banner-uploading":n}),"aria-live":"polite",children:[k.jsx("span",{className:"home-status-dot"}),k.jsxs("div",{className:"home-status-copy",children:[e?.title?k.jsx("div",{className:"home-status-title",children:e.title}):null,e?.desc?k.jsx("div",{className:Q("home-status-desc",{"home-status-desc-standalone":!s}),children:e.desc}):null]}),n?k.jsxs("div",{className:"home-status-progress-value",children:[r,"%"]}):null,n?k.jsx("div",{className:"home-status-progress-track",children:k.jsx("span",{className:"home-status-progress-fill",style:{width:`${r}%`}})}):null]}),k.jsx(eH,{isConnected:i}),!i&&k.jsx(rH,{})]})},aH="https://bytedance.larkoffice.com/wiki/WvifwWjGri7bTzkPbqKcqVi5ntc";function lH(i){try{return i?(new URL(i).searchParams.get("port")||"").trim():""}catch{return""}}function cH(i,e){return i?i.ok?"success":i.code==="status"?"warning":"error":e?"running":"idle"}function uH(i){return D(i==="success"?"connectivityOK":i==="warning"?"netDiagStatusWarning":i==="error"?"connectivityNotOK":i==="running"?"netDiagStatusRunning":"netDiagStatusIdle")}function dH(i,e){return i?i.ok?D("netDiagCheckReachableDetail"):i.msg||D("connectivityFailed"):D(e?"netDiagCheckRunningDetail":"netDiagCheckIdleDetail")}function pH({hasChecked:i,running:e,nodeHttp:n,nodeWs:r,clientHttp:s,clientWs:l,hasClientEndpoint:c}){return e?{kind:"running",title:D("netDiagSummaryRunningTitle"),desc:D("netDiagSummaryRunningDesc"),suggestions:[D("netDiagSummaryRunningHint")]}:i?c?n&&!n.ok?{kind:"node-service",title:D("netDiagSummaryNodeTitle"),desc:D("netDiagSummaryNodeDesc"),suggestions:[D("netDiagSuggestNodeDesc"),D("netDiagSuggestNodeRestart")]}:r&&!r.ok?{kind:"node-service",title:D("netDiagSummaryNodeTitle"),desc:D("netDiagSummaryNodeWsDesc"),suggestions:[D("netDiagSuggestNodeDesc")]}:s?.ok&&l&&!l.ok?{kind:"client-ws-failed",title:D("netDiagSummaryClientWsTitle"),desc:D("netDiagSummaryClientWsDesc"),suggestions:[D("netDiagSuggestClientDebugService"),D("netDiagSuggestWsBlocked"),D("netDiagSuggestPhoneProxyFallback")]}:s&&!s.ok&&l&&!l.ok?{kind:"client-both-failed",title:D("netDiagSummaryClientBothTitle"),desc:D("netDiagSummaryClientBothDesc"),suggestions:[D("netDiagSuggestClientDebugService"),D("netDiagSuggestLanAndProxy"),D("netDiagSuggestPhoneProxyFallback")]}:n?.ok&&r?.ok&&s?.ok&&l?.ok?{kind:"healthy",title:D("netDiagSummaryHealthyTitle"),desc:D("netDiagSummaryHealthyDesc"),suggestions:[D("netDiagSuggestOkDesc")]}:{kind:"partial",title:D("netDiagSummaryPartialTitle"),desc:D("netDiagSummaryPartialDesc"),suggestions:[D("netDiagSummaryPartialHint")]}:{kind:"missing-client",title:D("netDiagSummaryMissingClientTitle"),desc:D("netDiagSummaryMissingClientDesc"),suggestions:[D("netDiagSuggestNoClientDesc")]}:c?{kind:"idle",title:D("netDiagSummaryIdleTitle"),desc:D("netDiagSummaryIdleDesc"),suggestions:[D("netDiagSummaryIdleHint")]}:{kind:"missing-client",title:D("netDiagSummaryMissingClientTitle"),desc:D("netDiagSummaryMissingClientDesc"),suggestions:[D("netDiagSuggestNoClientDesc")]}}const iC=(i,e=3e3)=>new Promise(n=>{let r=!1;const s=setTimeout(()=>{if(!r){r=!0;try{l?.close()}catch{}n({ok:!1,code:"timeout",msg:D("connectivityTimeout")})}},e);let l=null;try{l=new WebSocket(i),l.onopen=()=>{if(!r){r=!0,clearTimeout(s);try{l?.close()}catch{}n({ok:!0,code:"ok"})}},l.onerror=()=>{r||(r=!0,clearTimeout(s),n({ok:!1,code:"error",msg:D("connectivityFailed")}))}}catch{clearTimeout(s),n({ok:!1,code:"error",msg:D("connectivityFailed")})}}),oC=async i=>{try{const e=new AbortController,n=setTimeout(()=>e.abort(),3e3),r=await fetch(i,{method:"GET",cache:"no-store",signal:e.signal});return clearTimeout(n),r.ok?{ok:!0,code:"ok"}:{ok:!1,code:"status",msg:`${r.status} ${r.statusText}`}}catch(e){return e instanceof DOMException&&e.name==="AbortError"?{ok:!1,code:"timeout",msg:D("connectivityTimeout")}:{ok:!1,code:"error",msg:D("connectivityFailed")}}},fH=()=>{const i=_s(),{state:{devSchema:e,schema:n}}=pn(),r=E.useRef(0),[s,l]=E.useState(!1),[c,u]=E.useState(!1),[p,f]=E.useState(!0),[y,v]=E.useState(!1),[S,P]=E.useState(!1),[T,b]=E.useState(),[w,x]=E.useState(),[O,N]=E.useState(),[M,F]=E.useState(),[j,L]=E.useState(!1),[z,W]=E.useState(null),[V,H]=E.useState(()=>({ip:String(Pe.get("clientHost")||localStorage.getItem("clientHost")||""),port:String(Pe.get("clientHttpPort")||localStorage.getItem("clientHttpPort")||""),wsPort:String(Pe.get("clientWsPort")||localStorage.getItem("clientWsPort")||"")})),re=E.useMemo(()=>({ip:String(V.ip||""),port:String(V.port||""),wsPort:String(V.wsPort||"")}),[V]),ee=E.useCallback(ne=>{H(ne)},[]),se=E.useMemo(()=>{const{nodeWsPort:ne,clientHost:ie,clientHttpPort:_e,clientWsPort:ye}=Pe.getMultiple(["nodeWsPort","clientHost","clientHttpPort","clientWsPort"]);let ve="";try{n&&(ve=(new URL(n).searchParams.get("host")||"").trim())}catch{}return{schemaHost:ve,httpPort:lH(n),nodeWsPort:ne,clientHost:ie,clientHttpPort:_e,clientWsPort:ye}},[e,n]),ae=String(re.ip||se.clientHost||"").trim(),he=String(re.port||se.clientHttpPort||"").trim(),ue=String(re.wsPort||se.clientWsPort||"").trim(),K=E.useCallback(async()=>{L(!0),l(!0),b(void 0),x(void 0),N(void 0),F(void 0);const ne=await oC("/game/config");b(ne);const ie=se.nodeWsPort;x(ie?await iC(`ws://localhost:${ie}`):{ok:!1,code:"error",msg:D("connectivityMissingParams")}),N(ae&&he?await oC(`http://${ae}:${he}/game/scripts/krypton.js`):{ok:!1,code:"error",msg:D("netDiagMissingClientHttp")}),F(ae&&ue?await iC(`ws://${ae}:${ue}`):{ok:!1,code:"error",msg:D("netDiagMissingClientWs")}),P(!0),l(!1)},[se.nodeWsPort,ae,he,ue]);E.useEffect(()=>{K()},[K]);const Z=E.useMemo(()=>[{key:"node-http",title:D("netDiagCheckNodeHttp"),target:"/game/config",item:T},{key:"node-ws",title:D("netDiagCheckNodeWs"),target:se.nodeWsPort?`ws://localhost:${se.nodeWsPort}`:"-",item:w},{key:"client-http",title:D("netDiagCheckClientHttp"),target:ae&&he?`http://${ae}:${he}`:"-",item:O},{key:"client-ws",title:D("netDiagCheckClientWs"),target:ae&&ue?`ws://${ae}:${ue}`:"-",item:M}],[O,M,se.nodeWsPort,T,w,ae,he,ue]),I=E.useMemo(()=>pH({hasChecked:j,running:s,nodeHttp:T,nodeWs:w,clientHttp:O,clientWs:M,hasClientEndpoint:!!(ae&&he&&ue)}),[O,M,j,T,w,ae,he,ue,s]),U=I.suggestions,oe=E.useCallback(()=>{r.current=window.scrollY,W(null),v(!0)},[]);return E.useEffect(()=>{if(!y)return;const ne=()=>{window.scrollTo({top:r.current,left:0})},ie=window.requestAnimationFrame(ne),_e=window.setTimeout(ne,80);return()=>{window.cancelAnimationFrame(ie),window.clearTimeout(_e)}},[y]),k.jsxs("div",{className:"check-network-container",children:[k.jsxs("div",{className:"check-network-hero",children:[k.jsx("div",{className:"check-network-back",children:k.jsxs("button",{type:"button",className:"check-network-back-link",onClick:()=>i("/"),children:[k.jsx(P9,{size:14,strokeWidth:2}),k.jsx("span",{children:D("back")})]})}),k.jsx("div",{className:"check-network-hero-head",children:k.jsxs("div",{className:"check-network-hero-copy",children:[k.jsx("div",{className:"check-network-hero-title",children:D("netDiagTitle")}),k.jsx("div",{className:"check-network-hero-subtitle",children:D("netDiagSubtitle")})]})})]}),k.jsxs("section",{className:`check-network-section check-network-summary-result check-network-summary-result-${I.kind}`,children:[k.jsxs("div",{className:"check-network-section-headline",children:[k.jsx("div",{children:k.jsxs("div",{className:"check-network-title-row",children:[k.jsx("div",{className:"check-network-section-title",children:D("netDiagSummaryTitle")}),k.jsx(u_,{className:"check-network-title-link",href:aH,children:D("netDiagOpenTroubleshoot")})]})}),k.jsx(tt,{className:"check-network-section-toggle",theme:"borderless",onClick:()=>f(ne=>!ne),children:D(p?"netDiagCollapse":"netDiagExpand")})]}),p?k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"check-network-summary-main",children:[k.jsx("div",{className:"check-network-summary-eyebrow",children:D("netDiagGuideEyebrow")}),k.jsx("div",{className:"check-network-summary-result-title",children:I.title}),k.jsx("div",{className:"check-network-summary-result-desc",children:I.desc})]}),k.jsxs("div",{className:"check-network-guide-panel",children:[k.jsx("div",{className:"check-network-guide-label",children:D("netDiagGuideStepsTitle")}),k.jsx("div",{className:"check-network-suggestion-list",children:U.map((ne,ie)=>k.jsxs("div",{className:"check-network-suggestion-item",children:[k.jsx("span",{className:"check-network-suggestion-index",children:ie+1}),k.jsx("span",{className:"check-network-suggestion-text",children:ne})]},`${ne}_${ie}`))})]})]}):null]}),k.jsxs("section",{className:"check-network-section check-network-manual-entry",children:[k.jsxs("div",{className:"check-network-section-headline",children:[k.jsxs("div",{children:[k.jsx("div",{className:"check-network-section-title",children:D("netDiagManualBindEntry")}),k.jsx("div",{className:"check-network-suggest-desc",children:D("netDiagManualSectionDesc")})]}),k.jsxs("div",{className:"check-network-manual-entry-actions",children:[k.jsx(tt,{className:"check-network-recheck-action",theme:"borderless",loading:s,onClick:()=>{K()},children:D("netDiagRunAll")}),k.jsx(tt,{className:"check-network-next-step-action",theme:"solid",type:"primary",onClick:oe,children:D("netDiagActionManualConnect")})]})]}),z?k.jsx("div",{className:`check-network-inline-result ${z.ok?"success":"error"}`,children:z.ok?D("netDiagManualConnectResultSuccess"):`${D("netDiagManualConnectResultError")} ${z.message}`}):null]}),k.jsxs("section",{className:"check-network-section check-network-env-section",children:[k.jsxs("div",{className:"check-network-section-headline",children:[k.jsxs("div",{children:[k.jsx("div",{className:"check-network-section-title",children:D("netDiagEnvTitle")}),k.jsx("div",{className:"check-network-suggest-desc",children:D("netDiagEnvSectionDesc")})]}),k.jsx(tt,{className:"check-network-section-toggle",theme:"borderless",onClick:()=>u(ne=>!ne),children:D(c?"netDiagCollapse":"netDiagExpand")})]}),c?k.jsxs("div",{className:"check-network-summary-grid",children:[k.jsxs("div",{className:"check-network-summary-card",children:[k.jsx("div",{className:"check-network-summary-title",children:D("netDiagComputerGroup")}),k.jsxs("div",{className:"check-network-kv",children:[k.jsx("span",{children:D("netDiagEnvIP")}),k.jsx("span",{children:se.schemaHost||"-"})]}),k.jsxs("div",{className:"check-network-kv",children:[k.jsx("span",{children:D("netDiagEnvWsPort")}),k.jsx("span",{children:se.nodeWsPort||"-"})]}),k.jsxs("div",{className:"check-network-kv",children:[k.jsx("span",{children:D("netDiagEnvHttpPort")}),k.jsx("span",{children:se.httpPort||"-"})]})]}),k.jsxs("div",{className:"check-network-summary-card",children:[k.jsx("div",{className:"check-network-summary-title",children:D("netDiagClientGroup")}),k.jsxs("div",{className:"check-network-kv",children:[k.jsx("span",{children:"IP"}),k.jsx("span",{children:ae||"-"})]}),k.jsxs("div",{className:"check-network-kv",children:[k.jsx("span",{children:D("netDiagEnvWsPort")}),k.jsx("span",{children:ue||"-"})]}),k.jsxs("div",{className:"check-network-kv",children:[k.jsx("span",{children:D("netDiagEnvHttpPort")}),k.jsx("span",{children:he||"-"})]})]})]}):null]}),k.jsxs("section",{className:"check-network-section check-network-check-section",children:[k.jsxs("div",{className:"check-network-section-headline",children:[k.jsxs("div",{children:[k.jsx("div",{className:"check-network-section-title",children:D("netDiagChecksTitle")}),k.jsx("div",{className:"check-network-suggest-desc",children:D("netDiagCheckSectionDesc")})]}),k.jsx(tt,{className:"check-network-section-toggle",theme:"borderless",onClick:()=>P(ne=>!ne),children:D(S?"netDiagCollapse":"netDiagExpand")})]}),S?k.jsx("div",{className:"check-network-checks",children:Z.map(ne=>{const ie=cH(ne.item,s&&j);return k.jsxs("div",{className:`check-network-check-card check-network-check-${ie}`,children:[k.jsxs("div",{className:"check-network-check-main",children:[k.jsxs("div",{className:"check-network-check-title-row",children:[k.jsx("span",{className:"check-network-check-dot"}),k.jsx("span",{className:"check-network-check-title",children:ne.title})]}),k.jsxs("div",{className:"check-network-check-meta",children:[k.jsx("span",{className:"check-network-check-target",children:ne.target}),k.jsx("span",{className:"check-network-check-detail",children:dH(ne.item,s&&j)})]})]}),k.jsx("span",{className:`check-network-check-badge check-network-check-badge-${ie}`,children:uH(ie)})]},ne.key)})}):null]}),k.jsxs($t,{className:"manual-connection-modal check-network-manual-modal",width:560,title:D("manualBindClientDebugServiceTitle"),visible:y,showCancel:!1,showOk:!1,footer:null,onCancel:()=>v(!1),children:[k.jsx(m_,{onClose:()=>v(!1),onSuccess:()=>v(!1),onValuesChange:ee,onConnectResult:ne=>{W(ne),K()}}),z&&!z.ok?k.jsx("div",{className:"check-network-inline-result error",children:`${D("netDiagManualConnectResultError")} ${z.message}`}):null]})]})},hH=E.lazy(()=>lt(()=>import("./index-BxokHznc.js"),__vite__mapDeps([22,23,24,25,26,27,28,29])).then(i=>({default:i.ProjectDetail}))),gH=E.lazy(()=>lt(()=>import("./index-CUuX90R9.js"),__vite__mapDeps([30,10,11])).then(i=>({default:i.DebugSetting}))),mH=E.lazy(()=>lt(()=>import("./index-Clq0hTDI.js"),__vite__mapDeps([31,32,33,7,8,9,10,11,12,34])).then(i=>({default:i.LaunchMode}))),yH=E.lazy(()=>lt(()=>import("./index-odEI7YQF.js"),__vite__mapDeps([35,26,27,7,8,9,10,11,12,25,36])).then(i=>({default:i.CheckCode}))),vH=E.lazy(()=>lt(()=>import("./index-BFFsJ47B.js"),__vite__mapDeps([37,26,27,38])).then(i=>({default:i.BasicDebugGuide}))),bH=E.lazy(()=>lt(()=>import("./index-CzXMNZL3.js"),__vite__mapDeps([39,26,27,23,24,40,41])).then(i=>({default:i.ChangeLog}))),SH=E.lazy(()=>lt(()=>import("./index-Dohibgdp.js"),__vite__mapDeps([42,23,43,24,44,45,46,19])).then(i=>({default:i.IntegrationAssistant}))),wH=E.lazy(()=>lt(()=>import("./Detail-rVxbEDgh.js"),__vite__mapDeps([47,48,49,23,24,26,27,32,33,7,8,9,10,11,12,44,45,50,40])).then(i=>({default:i.IntegrationAssistantDetail}))),CH=E.lazy(()=>lt(()=>import("./MonetizationMode-B20TAE9o.js"),__vite__mapDeps([51,48,49,23,24,43,44,45,46,19])).then(i=>({default:i.IntegrationAssistantMonetizationMode}))),_H=E.lazy(()=>lt(()=>import("./index-BjQlJrX7.js"),__vite__mapDeps([52,53])).then(i=>({default:i.ManualConnect}))),kH=E.lazy(()=>lt(()=>import("./index-O_L1tU2b.js"),__vite__mapDeps([54,23,24,55,8,9,56,7,10,11,12,50,40,57,17])).then(i=>({default:i.WasmCodeSplit}))),PH=E.lazy(()=>lt(()=>import("./index-BnOeYQAd.js"),__vite__mapDeps([58,24,20,46,59])).then(i=>({default:i.Performance}))),TH=E.lazy(()=>lt(()=>import("./index-aSl6Wdrp.js"),__vite__mapDeps([60,23,24,55,8,9,56,28,61])).then(i=>({default:i.SubpackageCollect}))),EH=()=>k.jsx("div",{className:"routes-container",children:k.jsx(E.Suspense,{fallback:k.jsx(l_,{}),children:k.jsxs(cU,{children:[k.jsx(st,{path:"/",element:k.jsx(sH,{})}),k.jsx(st,{path:"/integration_assistant",element:k.jsx(SH,{})}),k.jsx(st,{path:"/integration_assistant/mode/:modeKey",element:k.jsx(CH,{})}),k.jsx(st,{path:"/integration_assistant/:capabilityKey",element:k.jsx(wH,{})}),k.jsx(st,{path:"/project_overview",element:k.jsx(hH,{})}),k.jsx(st,{path:"/project_detail",element:k.jsx(uh,{to:"/project_overview",replace:!0})}),k.jsx(st,{path:"/basic_debug_guide",element:k.jsx(vH,{})}),k.jsx(st,{path:"/debug_setting",element:k.jsx(gH,{})}),k.jsx(st,{path:"/launch_mode",element:k.jsx(mH,{})}),k.jsx(st,{path:"/upload_publish",element:k.jsx(yH,{})}),k.jsx(st,{path:"/version_upload",element:k.jsx(uh,{to:"/upload_publish",replace:!0})}),k.jsx(st,{path:"/precheck_code",element:k.jsx(uh,{to:"/upload_publish",replace:!0})}),k.jsx(st,{path:"/network_diagnostics",element:k.jsx(fH,{})}),k.jsx(st,{path:"/manual_connect",element:k.jsx(_H,{})}),k.jsx(st,{path:"/changelog",element:k.jsx(bH,{})}),k.jsx(st,{path:"/wasm_split",element:k.jsx(kH,{})}),k.jsx(st,{path:"/performance",element:k.jsx(PH,{})}),k.jsx(st,{path:"/subpackage_collect",element:k.jsx(TH,{})})]})})});function xH(){const{state:{loading:i,error:e,user:n}}=pn(),{topErrorItems:r,updateGameDetailTopErrors:s,updateConfigTopErrors:l,updateGameDetailAccessErrors:c}=r9(),{fetchGameDetail:u}=a9({onSuccess:s,updateGameDetailAccessErrors:c}),{isServerError:p,serverErrorMsg:f}=l9({fetchGameDetail:u,updateConfigTopErrors:l}),y=Pl();return c9({onResourceChange:u}),E.useEffect(()=>{const v=async S=>{if(S.status!=="update_wasm_split_config_done")return;const P=await Ki({url:"/game/config",method:"GET"});P.error||l({currentUser:n,checkResult:P.data?.checkResult})};return Ee.on("unitySplitStatus",v),()=>{Ee.off("unitySplitStatus",v)}},[l,n]),p&&!i.visible?k.jsxs("div",{className:"server-error-container",children:[k.jsx(KU,{}),k.jsx("div",{className:"server-error-text",children:f})]}):k.jsxs(NU,{children:[k.jsx(G9,{items:r,fallbackErrorText:e.text}),k.jsx($9,{enabled:!y&&!i.visible&&!p}),k.jsx(U9,{}),k.jsx(oH,{}),k.jsxs("div",{className:"main-layout",children:[k.jsx(M9,{}),k.jsxs("div",{className:"content-wrapper",children:[k.jsx(z9,{}),k.jsx(EH,{})]})]}),k.jsx(l_,{})]})}cW();vP.createRoot(document.getElementById("root")).render(k.jsx(fg,{children:k.jsx(pW,{children:k.jsx(xH,{})})}));export{Nr as $,P9 as A,tt as B,Sl as C,u_ as D,Xh as E,Kt as F,hi as G,Bn as H,aD as I,g as J,or as K,Lr as L,me as M,Wa as N,Yh as O,q9 as P,nC as Q,_ as R,Ss as S,Qe as T,jr as U,yi as V,Qh as W,ZH as X,JH as Y,m_ as Z,Te as _,un as a,ST as a$,Mn as a0,Ka as a1,Jn as a2,us as a3,ah as a4,rr as a5,Ee as a6,ug as a7,Pl as a8,Pg as a9,Cx as aA,wx as aB,Ch as aC,ZS as aD,kx as aE,zf as aF,Wo as aG,Uo as aH,Sx as aI,_h as aJ,JS as aK,dT as aL,at as aM,os as aN,Or as aO,lg as aP,di as aQ,cs as aR,_n as aS,ZC as aT,ss as aU,dE as aV,nT as aW,Nh as aX,fl as aY,IO as aZ,Yi as a_,g_ as aa,tV as ab,iH as ac,$t as ad,Lh as ae,sr as af,Xt as ag,TG as ah,Wi as ai,NH as aj,jH as ak,Ir as al,FH as am,MH as an,ml as ao,$H as ap,RH as aq,AH as ar,LH as as,UC as at,oi as au,tr as av,Ye as aw,rT as ax,dn as ay,Kh as az,B9 as b,Db as b$,Bh as b0,Xi as b1,GT as b2,cl as b3,jO as b4,vE as b5,EC as b6,wC as b7,cC as b8,YE as b9,VP as bA,QP as bB,yC as bC,zC as bD,KC as bE,$r as bF,Tn as bG,dl as bH,qh as bI,OT as bJ,gl as bK,vl as bL,Ya as bM,er as bN,RT as bO,qE as bP,Mh as bQ,NE as bR,YP as bS,_P as bT,xO as bU,zE as bV,fE as bW,BT as bX,ai as bY,IH as bZ,HE as b_,sl as ba,ul as bb,Yt as bc,Gh as bd,SC as be,jh as bf,SE as bg,el as bh,Wh as bi,tE as bj,bP as bk,DE as bl,AC as bm,RO as bn,NO as bo,MC as bp,Zn as bq,bT as br,WH as bs,eg as bt,WO as bu,fT as bv,hl as bw,rg as bx,WC as by,gE as bz,Dl as c,CC as c0,BD as c1,GD as c2,Ui as c3,LD as c4,VH as c5,KP as c6,tD as c7,tx as c8,Xa as c9,lI as ca,SD as cb,qH as cc,wg as cd,BH as ce,GH as cf,Vi as cg,Ki as d,Ar as e,iW as f,Dg as g,_s as h,D as i,k as j,xg as k,Zh as l,HC as m,Mr as n,Eh as o,zn as p,eV as q,E as r,YG as s,Oe as t,pn as u,XH as v,Ft as w,yw as x,_t as y,Q as z};
|
|
21
|
+
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let y=sr(),v;if(e){let w=typeof e=="string"?to(e):e;He(p==="/"||w.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${w.pathname}" was given in the \`location\` prop.`),v=w}else v=y;let S=v.pathname||"/",P=S;if(p!=="/"){let w=p.replace(/^\//,"").split("/");P="/"+S.replace(/^\//,"").split("/").slice(w.length).join("/")}let T=W0(i,{pathname:P});kn(f||T!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),kn(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let b=eU(T&&T.map(w=>Object.assign({},w,{params:Object.assign({},c,w.params),pathname:Fn([p,r.encodeLocation?r.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?p:Fn([p,r.encodeLocation?r.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),s,n);return e&&b?E.createElement(Cs.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},b):b}function YW(){let i=oU(),e=MW(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),n=i instanceof Error?i.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},l={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",i),c=E.createElement(E.Fragment,null,E.createElement("p",null,"💿 Hey developer 👋"),E.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",E.createElement("code",{style:l},"ErrorBoundary")," or"," ",E.createElement("code",{style:l},"errorElement")," prop on your route.")),E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},e),n?E.createElement("pre",{style:s},n):null,c)}var XW=E.createElement(YW,null),t_=class extends E.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,e){return e.location!==i.location||e.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:e.error,location:e.location,revalidation:i.revalidation||e.revalidation}}componentDidCatch(i,e){this.props.onError?this.props.onError(i,e):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const n=HW(i.digest);n&&(i=n)}let e=i!==void 0?E.createElement(En.Provider,{value:this.props.routeContext},E.createElement(Ig.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?E.createElement(ZW,{error:i},e):e}};t_.contextType=zW;var ch=new WeakMap;function ZW({children:i,error:e}){let{basename:n}=E.useContext(Zt);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=UW(e.digest);if(r){let s=ch.get(e);if(s)throw s;let l=K0(r.location,n);if(V0&&!ch.get(e))if(l.isExternal||r.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:r.replace}));throw ch.set(e,c),c}return E.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return i}function JW({routeContext:i,match:e,children:n}){let r=E.useContext(no);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),E.createElement(En.Provider,{value:i},n)}function eU(i,e=[],n){let r=n?.state;if(i==null){if(!r)return null;if(r.errors)i=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)i=r.matches;else return null}let s=i,l=r?.errors;if(l!=null){let y=s.findIndex(v=>v.route.id&&l?.[v.route.id]!==void 0);He(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,y+1))}let c=!1,u=-1;if(n&&r){c=r.renderFallback;for(let y=0;y<s.length;y++){let v=s[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(u=y),v.route.id){let{loaderData:S,errors:P}=r,T=v.route.loader&&!S.hasOwnProperty(v.route.id)&&(!P||P[v.route.id]===void 0);if(v.route.lazy||T){n.isStatic&&(c=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let p=n?.onError,f=r&&p?(y,v)=>{p(y,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:$W(r.matches),errorInfo:v})}:void 0;return s.reduceRight((y,v,S)=>{let P,T=!1,b=null,w=null;r&&(P=l&&v.route.id?l[v.route.id]:void 0,b=v.route.errorElement||XW,c&&(u<0&&S===0?(n_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,w=null):u===S&&(T=!0,w=v.route.hydrateFallbackElement||null)));let x=e.concat(s.slice(0,S+1)),O=()=>{let N;return P?N=b:T?N=w:v.route.Component?N=E.createElement(v.route.Component,null):v.route.element?N=v.route.element:N=y,E.createElement(JW,{match:v,routeContext:{outlet:y,matches:x,isDataRoute:r!=null},children:N})};return r&&(v.route.ErrorBoundary||v.route.errorElement||S===0)?E.createElement(t_,{location:r.location,revalidation:r.revalidation,component:b,error:P,children:O(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:f}):O()},null)}function Rg(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tU(i){let e=E.useContext(no);return He(e,Rg(i)),e}function nU(i){let e=E.useContext(El);return He(e,Rg(i)),e}function rU(i){let e=E.useContext(En);return He(e,Rg(i)),e}function Ng(i){let e=rU(i),n=e.matches[e.matches.length-1];return He(n.route.id,`${i} can only be used on routes that contain a unique "id"`),n.route.id}function iU(){return Ng("useRouteId")}function oU(){let i=E.useContext(Ig),e=nU("useRouteError"),n=Ng("useRouteError");return i!==void 0?i:e.errors?.[n]}function sU(){let{router:i}=tU("useNavigate"),e=Ng("useNavigate"),n=E.useRef(!1);return J0(()=>{n.current=!0}),E.useCallback(async(s,l={})=>{kn(n.current,Z0),n.current&&(typeof s=="number"?await i.navigate(s):await i.navigate(s,{fromRouteId:e,...l}))},[i,e])}var Aw={};function n_(i,e,n){!e&&!Aw[i]&&(Aw[i]=!0,kn(!1,n))}E.memo(aU);function aU({routes:i,future:e,state:n,isStatic:r,onError:s}){return e_(i,void 0,{state:n,isStatic:r,onError:s})}function uh({to:i,replace:e,state:n,relative:r}){He(ro(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=E.useContext(Zt);kn(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=E.useContext(En),{pathname:c}=sr(),u=_s(),p=Tl(i,Og(l),c,r==="path"),f=JSON.stringify(p);return E.useEffect(()=>{u(JSON.parse(f),{replace:e,state:n,relative:r})},[u,f,r,e,n]),null}function st(i){He(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function lU({basename:i="/",children:e=null,location:n,navigationType:r="POP",navigator:s,static:l=!1,unstable_useTransitions:c}){He(!ro(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=i.replace(/^\/*/,"/"),p=E.useMemo(()=>({basename:u,navigator:s,static:l,unstable_useTransitions:c,future:{}}),[u,s,l,c]);typeof n=="string"&&(n=to(n));let{pathname:f="/",search:y="",hash:v="",state:S=null,key:P="default",unstable_mask:T}=n,b=E.useMemo(()=>{let w=ir(f,u);return w==null?null:{location:{pathname:w,search:y,hash:v,state:S,key:P,unstable_mask:T},navigationType:r}},[u,f,y,v,S,P,r,T]);return kn(b!=null,`<Router basename="${u}"> is not able to match the URL "${f}${y}${v}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:E.createElement(Zt.Provider,{value:p},E.createElement(Cs.Provider,{children:e,value:b}))}function cU({children:i,location:e}){return QW(Oh(i),e)}function Oh(i,e=[]){let n=[];return E.Children.forEach(i,(r,s)=>{if(!E.isValidElement(r))return;let l=[...e,s];if(r.type===E.Fragment){n.push.apply(n,Oh(r.props.children,l));return}He(r.type===st,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),He(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=Oh(r.props.children,l)),n.push(c)}),n}var Ha="get",Va="application/x-www-form-urlencoded";function xl(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function uU(i){return xl(i)&&i.tagName.toLowerCase()==="button"}function dU(i){return xl(i)&&i.tagName.toLowerCase()==="form"}function pU(i){return xl(i)&&i.tagName.toLowerCase()==="input"}function fU(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function hU(i,e){return i.button===0&&(!e||e==="_self")&&!fU(i)}var Fa=null;function gU(){if(Fa===null)try{new FormData(document.createElement("form"),0),Fa=!1}catch{Fa=!0}return Fa}var mU=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function dh(i){return i!=null&&!mU.has(i)?(kn(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Va}"`),null):i}function yU(i,e){let n,r,s,l,c;if(dU(i)){let u=i.getAttribute("action");r=u?ir(u,e):null,n=i.getAttribute("method")||Ha,s=dh(i.getAttribute("enctype"))||Va,l=new FormData(i)}else if(uU(i)||pU(i)&&(i.type==="submit"||i.type==="image")){let u=i.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=i.getAttribute("formaction")||u.getAttribute("action");if(r=p?ir(p,e):null,n=i.getAttribute("formmethod")||u.getAttribute("method")||Ha,s=dh(i.getAttribute("formenctype"))||dh(u.getAttribute("enctype"))||Va,l=new FormData(u,i),!gU()){let{name:f,type:y,value:v}=i;if(y==="image"){let S=f?`${f}.`:"";l.append(`${S}x`,"0"),l.append(`${S}y`,"0")}else f&&l.append(f,v)}}else{if(xl(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ha,r=null,s=Va,c=i}return l&&s==="text/plain"&&(c=l,l=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function jg(i,e){if(i===!1||i===null||typeof i>"u")throw new Error(e)}function vU(i,e,n,r){let s=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:e&&ir(s.pathname,e)==="/"?s.pathname=`${e.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function bU(i,e){if(i.id in e)return e[i.id];try{let n=await import(i.module);return e[i.id]=n,n}catch(n){return console.error(`Error loading route module \`${i.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function SU(i){return i==null?!1:i.href==null?i.rel==="preload"&&typeof i.imageSrcSet=="string"&&typeof i.imageSizes=="string":typeof i.rel=="string"&&typeof i.href=="string"}async function wU(i,e,n){let r=await Promise.all(i.map(async s=>{let l=e.routes[s.route.id];if(l){let c=await bU(l,n);return c.links?c.links():[]}return[]}));return PU(r.flat(1).filter(SU).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Mw(i,e,n,r,s,l){let c=(p,f)=>n[f]?p.route.id!==n[f].route.id:!0,u=(p,f)=>n[f].pathname!==p.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==p.params["*"];return l==="assets"?e.filter((p,f)=>c(p,f)||u(p,f)):l==="data"?e.filter((p,f)=>{let y=r.routes[p.route.id];if(!y||!y.hasLoader)return!1;if(c(p,f)||u(p,f))return!0;if(p.route.shouldRevalidate){let v=p.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(i,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function CU(i,e,{includeHydrateFallback:n}={}){return _U(i.map(r=>{let s=e.routes[r.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function _U(i){return[...new Set(i)]}function kU(i){let e={},n=Object.keys(i).sort();for(let r of n)e[r]=i[r];return e}function PU(i,e){let n=new Set;return new Set(e),i.reduce((r,s)=>{let l=JSON.stringify(kU(s));return n.has(l)||(n.add(l),r.push({key:l,link:s})),r},[])}function r_(){let i=E.useContext(no);return jg(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function TU(){let i=E.useContext(El);return jg(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var Lg=E.createContext(void 0);Lg.displayName="FrameworkContext";function i_(){let i=E.useContext(Lg);return jg(i,"You must render this element inside a <HydratedRouter> element"),i}function EU(i,e){let n=E.useContext(Lg),[r,s]=E.useState(!1),[l,c]=E.useState(!1),{onFocus:u,onBlur:p,onMouseEnter:f,onMouseLeave:y,onTouchStart:v}=e,S=E.useRef(null);E.useEffect(()=>{if(i==="render"&&c(!0),i==="viewport"){let b=x=>{x.forEach(O=>{c(O.isIntersecting)})},w=new IntersectionObserver(b,{threshold:.5});return S.current&&w.observe(S.current),()=>{w.disconnect()}}},[i]),E.useEffect(()=>{if(r){let b=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(b)}}},[r]);let P=()=>{s(!0)},T=()=>{s(!1),c(!1)};return n?i!=="intent"?[l,S,{}]:[l,S,{onFocus:es(u,P),onBlur:es(p,T),onMouseEnter:es(f,P),onMouseLeave:es(y,T),onTouchStart:es(v,P)}]:[!1,S,{}]}function es(i,e){return n=>{i&&i(n),n.defaultPrevented||e(n)}}function xU({page:i,...e}){let{router:n}=r_(),r=E.useMemo(()=>W0(n.routes,i,n.basename),[n.routes,i,n.basename]);return r?E.createElement(OU,{page:i,matches:r,...e}):null}function DU(i){let{manifest:e,routeModules:n}=i_(),[r,s]=E.useState([]);return E.useEffect(()=>{let l=!1;return wU(i,e,n).then(c=>{l||s(c)}),()=>{l=!0}},[i,e,n]),r}function OU({page:i,matches:e,...n}){let r=sr(),{future:s,manifest:l,routeModules:c}=i_(),{basename:u}=r_(),{loaderData:p,matches:f}=TU(),y=E.useMemo(()=>Mw(i,e,f,l,r,"data"),[i,e,f,l,r]),v=E.useMemo(()=>Mw(i,e,f,l,r,"assets"),[i,e,f,l,r]),S=E.useMemo(()=>{if(i===r.pathname+r.search+r.hash)return[];let b=new Set,w=!1;if(e.forEach(O=>{let N=l.routes[O.route.id];!N||!N.hasLoader||(!y.some(M=>M.route.id===O.route.id)&&O.route.id in p&&c[O.route.id]?.shouldRevalidate||N.hasClientLoader?w=!0:b.add(O.route.id))}),b.size===0)return[];let x=vU(i,u,s.unstable_trailingSlashAwareDataRequests,"data");return w&&b.size>0&&x.searchParams.set("_routes",e.filter(O=>b.has(O.route.id)).map(O=>O.route.id).join(",")),[x.pathname+x.search]},[u,s.unstable_trailingSlashAwareDataRequests,p,r,l,y,e,i,c]),P=E.useMemo(()=>CU(v,l),[v,l]),T=DU(v);return E.createElement(E.Fragment,null,S.map(b=>E.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),P.map(b=>E.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),T.map(({key:b,link:w})=>E.createElement("link",{key:b,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function IU(...i){return e=>{i.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var RU=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{RU&&(window.__reactRouterVersion="7.13.1")}catch{}function NU({basename:i,children:e,unstable_useTransitions:n,window:r}){let s=E.useRef();s.current==null&&(s.current=fW({window:r,v5Compat:!0}));let l=s.current,[c,u]=E.useState({action:l.action,location:l.location}),p=E.useCallback(f=>{n===!1?u(f):E.startTransition(()=>u(f))},[n]);return E.useLayoutEffect(()=>l.listen(p),[l,p]),E.createElement(lU,{basename:i,children:e,location:c.location,navigationType:c.action,navigator:l,unstable_useTransitions:n})}var o_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,s_=E.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:s,reloadDocument:l,replace:c,unstable_mask:u,state:p,target:f,to:y,preventScrollReset:v,viewTransition:S,unstable_defaultShouldRevalidate:P,...T},b){let{basename:w,navigator:x,unstable_useTransitions:O}=E.useContext(Zt),N=typeof y=="string"&&o_.test(y),M=K0(y,w);y=M.to;let F=VW(y,{relative:s}),j=sr(),L=null;if(u){let ae=Tl(u,[],j.unstable_mask?j.unstable_mask.pathname:"/",!0);w!=="/"&&(ae.pathname=ae.pathname==="/"?w:Fn([w,ae.pathname])),L=x.createHref(ae)}let[z,W,V]=EU(r,T),H=MU(y,{replace:c,unstable_mask:u,state:p,target:f,preventScrollReset:v,relative:s,viewTransition:S,unstable_defaultShouldRevalidate:P,unstable_useTransitions:O});function re(ae){e&&e(ae),ae.defaultPrevented||H(ae)}let ee=!(M.isExternal||l),se=E.createElement("a",{...T,...V,href:(ee?L:void 0)||M.absoluteURL||F,onClick:ee?re:e,ref:IU(b,W),target:f,"data-discover":!N&&n==="render"?"true":void 0});return z&&!N?E.createElement(E.Fragment,null,se,E.createElement(xU,{page:F})):se});s_.displayName="Link";var jU=E.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:s=!1,style:l,to:c,viewTransition:u,children:p,...f},y){let v=ks(c,{relative:f.relative}),S=sr(),P=E.useContext(El),{navigator:T,basename:b}=E.useContext(Zt),w=P!=null&&BU(v)&&u===!0,x=T.encodeLocation?T.encodeLocation(v).pathname:v.pathname,O=S.pathname,N=P&&P.navigation&&P.navigation.location?P.navigation.location.pathname:null;n||(O=O.toLowerCase(),N=N?N.toLowerCase():null,x=x.toLowerCase()),N&&b&&(N=ir(N,b)||N);const M=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let F=O===x||!s&&O.startsWith(x)&&O.charAt(M)==="/",j=N!=null&&(N===x||!s&&N.startsWith(x)&&N.charAt(x.length)==="/"),L={isActive:F,isPending:j,isTransitioning:w},z=F?e:void 0,W;typeof r=="function"?W=r(L):W=[r,F?"active":null,j?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let V=typeof l=="function"?l(L):l;return E.createElement(s_,{...f,"aria-current":z,className:W,ref:y,style:V,to:c,viewTransition:u},typeof p=="function"?p(L):p)});jU.displayName="NavLink";var LU=E.forwardRef(({discover:i="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:s,state:l,method:c=Ha,action:u,onSubmit:p,relative:f,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:S,...P},T)=>{let{unstable_useTransitions:b}=E.useContext(Zt),w=zU(),x=qU(u,{relative:f}),O=c.toLowerCase()==="get"?"get":"post",N=typeof u=="string"&&o_.test(u),M=F=>{if(p&&p(F),F.defaultPrevented)return;F.preventDefault();let j=F.nativeEvent.submitter,L=j?.getAttribute("formmethod")||c,z=()=>w(j||F.currentTarget,{fetcherKey:e,method:L,navigate:n,replace:s,state:l,relative:f,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:S});b&&n!==!1?E.startTransition(()=>z()):z()};return E.createElement("form",{ref:T,method:O,action:x,onSubmit:r?p:M,...P,"data-discover":!N&&i==="render"?"true":void 0})});LU.displayName="Form";function AU(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function a_(i){let e=E.useContext(no);return He(e,AU(i)),e}function MU(i,{target:e,replace:n,unstable_mask:r,state:s,preventScrollReset:l,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:p,unstable_useTransitions:f}={}){let y=_s(),v=sr(),S=ks(i,{relative:c});return E.useCallback(P=>{if(hU(P,e)){P.preventDefault();let T=n!==void 0?n:ps(v)===ps(S),b=()=>y(i,{replace:T,unstable_mask:r,state:s,preventScrollReset:l,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:p});f?E.startTransition(()=>b()):b()}},[v,y,S,n,r,s,e,i,l,c,u,p,f])}var $U=0,FU=()=>`__${String(++$U)}__`;function zU(){let{router:i}=a_("useSubmit"),{basename:e}=E.useContext(Zt),n=iU(),r=i.fetch,s=i.navigate;return E.useCallback(async(l,c={})=>{let{action:u,method:p,encType:f,formData:y,body:v}=yU(l,e);if(c.navigate===!1){let S=c.fetcherKey||FU();await r(S,n,c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:v,formMethod:c.method||p,formEncType:c.encType||f,flushSync:c.flushSync})}else await s(c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:v,formMethod:c.method||p,formEncType:c.encType||f,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[r,s,e,n])}function qU(i,{relative:e}={}){let{basename:n}=E.useContext(Zt),r=E.useContext(En);He(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),l={...ks(i||".",{relative:e})},c=sr();if(i==null){l.search=c.search;let u=new URLSearchParams(l.search),p=u.getAll("index");if(p.some(y=>y==="")){u.delete("index"),p.filter(v=>v).forEach(v=>u.append("index",v));let y=u.toString();l.search=y?`?${y}`:""}}return(!i||i===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Fn([n,l.pathname])),ps(l)}function BU(i,{relative:e}={}){let n=E.useContext(Y0);He(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=a_("useViewTransitionState"),s=ks(i,{relative:e});if(!n.isTransitioning)return!1;let l=ir(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=ir(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ja(s.pathname,c)!=null||Ja(s.pathname,l)!=null}var GU=Object.defineProperty,$w=Object.getOwnPropertySymbols,WU=Object.prototype.hasOwnProperty,UU=Object.prototype.propertyIsEnumerable,Fw=(i,e,n)=>e in i?GU(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n,HU=(i,e)=>{for(var n in e||(e={}))WU.call(e,n)&&Fw(i,n,e[n]);if($w)for(var n of $w(e))UU.call(e,n)&&Fw(i,n,e[n]);return i};function VU(i){return E.createElement("svg",HU({width:200,height:200,viewBox:"0 0 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,"aria-hidden":!0},i),E.createElement("rect",{width:200,height:200,fill:"transparent"}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M64.09 64.86V8.56L5.76 78.94h44.26v20.3h14.07v-20.3h8.82V64.86h-8.82Zm110.18 0V8.56L124.1 69.08c.7-3.74 1.07-7.7 1.07-11.76 0-11-2.7-21.1-7.25-28.55-4.5-7.4-11.13-12.63-19-12.63-7.88 0-14.5 5.23-19.01 12.63-4.54 7.45-7.25 17.55-7.25 28.55s2.7 21.1 7.25 28.55c4.5 7.4 11.13 12.62 19 12.62 7.88 0 14.5-5.23 19.01-12.62a44.09 44.09 0 0 0 3.4-6.93h38.86v20.3h14.08v-20.3h8.81V64.86h-8.81Zm-138.57 0L50.02 47.6v17.26H35.7Zm124.5 0h-14.32L160.2 47.6v17.26Zm-49.1-7.54c0 8.84-2.2 16.32-5.19 21.22-3.08 5.08-5.87 5.87-6.98 5.87-1.12 0-3.9-.8-7-5.87-2.98-4.9-5.19-12.38-5.19-21.22 0-8.85 2.21-16.33 5.2-21.23 3.09-5.07 5.87-5.87 6.98-5.87 1.12 0 3.9.8 7 5.87 2.98 4.9 5.19 12.38 5.19 21.23Z",fill:"var(--semi-color-primary-light-default)"}),E.createElement("path",{d:"M178.34 186.57c-1.85 2.2-6.66 1.02-8.13.24a2.46 2.46 0 0 1-.34-.22c-1.94.22-14.94-.5-15.12-.46-6.12 1.43-14.06 1.03-15.2 1-1.36-.05-4.53-1.33-5.75-5.08-1.2-3.67 0-7.12 2.16-13.37l.13-.38-1.43 2.83c-7.37 14.43-11.05 19.7-17.43 20.14-6.38.45-34.34-.09-41.09-.78-6.75-.7-9.42-1.68-9.35-2.83.05-.92 2.98-2.2 4.44-2.72-5.88-1.57-20.16-5.97-30.18-10.98-12.52-6.26-25.14-15.8-21.91-28.92 3.22-13.13 15.76-16.8 25.59-17.38 2.75-.16 5.14-.1 7.16.07 3.76.33 6.21 1.06 7.2 1.53-1.12-6.37-3.33-19.34-3.33-20.21 0-1.1-3.02-10.67-3.64-14.35-.1-.55-1.11-5.6 3.64-5.02 4.75.57 12.4 18.2 15.88 28.7a401.55 401.55 0 0 0 11.15-9.87c.84-1.02 9.36-9.75 14.87-13.84a60.09 60.09 0 0 1 33-11.76c16.29-.81 34.49 2.36 40.9 11.91 6.4 9.55 6.1 34.44 6.44 48.71.35 14.27.84 27.64 2.11 29.76 1.27 2.12 6.45 5.02 9.77 7.14 3.33 2.11 4.45 3.9 4.36 4.2-.1.3-.4.58-2.24 1.08.34.47.12 1.38-2.12 1.6-4.7.48-8.64-.74-11.54-.74Z",fill:"white"}),E.createElement("path",{d:"M192 185.71c-1.6-2.3-9.7-5.34-15.04-5.75-5.34-.41-6.45.53-7.4 1.85-1 1.37-1.05 3.72.3 4.78m22.14-.88c.34.47.12 1.38-2.12 1.6-4.7.48-8.64-.74-11.54-.74-1.85 2.2-6.66 1.02-8.13.24a2.46 2.46 0 0 1-.34-.22m22.13-.88c1.84-.5 2.15-.78 2.24-1.08.09-.3-1.03-2.09-4.36-4.2-3.32-2.12-8.5-5.02-9.77-7.14-1.27-2.12-1.76-15.49-2.1-29.76-.36-14.27-.06-39.16-6.46-48.7-6.4-9.56-24.6-12.73-40.89-11.92a60.09 60.09 0 0 0-33 11.76c-5.5 4.09-14.03 12.82-14.87 13.84-.37.46-5.43 4.9-11.15 9.87-3.49-10.5-11.13-28.13-15.88-28.7-4.75-.58-3.73 4.47-3.64 5.02.62 3.68 3.64 13.26 3.64 14.35 0 .87 2.21 13.84 3.32 20.2-.98-.46-3.43-1.2-7.19-1.52m19.34 57.21c-5.88-1.57-20.16-5.97-30.18-10.98-12.52-6.26-25.14-15.8-21.91-28.92 3.22-13.13 15.76-16.8 25.59-17.38 2.75-.16 5.14-.1 7.16.07m19.34 57.21c-1.46.52-4.39 1.8-4.44 2.72-.07 1.15 2.6 2.14 9.35 2.83 6.75.7 34.71 1.23 41.09.78 6.38-.44 10.06-5.71 17.43-20.14l1.43-2.83m-64.86 16.64c5.89-2.49 12.35-6.32 16.49-10.11 5.07-4.65 9.55-13.46 9.96-14.28l.82-1.56m43.43 4.15c-.47-3-1.21-7.33.37-14.67 1.47-6.81 6.6-15.3 6.65-11.03.05 4-6.05 17.35-12.86 30.86m0 0c-2.25 6.5-3.51 10-2.3 13.75 1.23 3.75 4.4 5.03 5.76 5.07 1.14.04 9.08.44 15.2-.99m0 0a19.5 19.5 0 0 0 3.27-1.03c6.09-2.63 10.92-8.55 13.53-24.26 2.62-15.71 1.5-42.36-10.29-50.78-11.78-8.41-21.32-6.07-34.03 5.8-5.34 4.98-11.86 14.52-17.42 23.52m44.94 46.75c.18-.04 13.19.68 15.12.46m-60.06-47.2c-.8-3.66-1.44-7.16-1.94-10.43m1.94 10.42c-1.24 2-2.43 3.98-3.55 5.87m.32-30.9c0 3.75.41 8.8 1.3 14.61m0 0c-2.32 2.46-7.78 7.15-13.67 11.55m-42.32-12.78s1.24 7.12 3.87 11.42a29.93 29.93 0 0 0 6.61 7.8m36.13 12.04c-6.87-3.1-17.87-6.8-22.51-8.27m22.51 8.27a394.7 394.7 0 0 1 7.76-13.74M76 150.72c.39-.06.78-.14 1.17-.23 3.97-.93 10.76-5.29 17.05-9.98m-18.22 10.2c-4.7.8-9.36-.34-13.62-3.76m0 0c-3.29-.85-11.28-2.39-12.86-2.41m56.75.71c-2.32-.94-9-3.55-12.05-4.74",stroke:"#515151"}),E.createElement("path",{d:"m77.74 73.31 23.73 43.2-1.7 2.5-22.73 9.55-24.58-44.48 21.9-10.77h3.38Z",fill:"#E6E8EA"}),E.createElement("path",{d:"M74.35 73.31h3.4l23.72 43.2-1.7 2.5m-25.42-45.7-21.9 10.77 24.59 44.48L99.78 119m-25.43-45.7 25.43 45.7",stroke:"#515151"}),E.createElement("path",{d:"M83.9 116.95c.96 1.97-4.91 4.57-8.32 6.18-1.33.63-2.1.98-2.7 1.2.9 3.3 1.24 8.14-4.48 9.82-5.73 1.69-15.07-1.02-18-9.6-2.95-8.6.01-19.97 9.05-27.04 5.67-4.42 15.01-5.77 19.42-4.05 2.15.82 1.38 2.71-.56 4.44a58.1 58.1 0 0 1-4.53 3.58c.4-.01.8-.02 1.23 0 4.13.06 7.26 1.11 7.42 3.14.07.94-.8 2.13-1.95 3.45-.62.71-1.28 1.34-1.95 1.88 2.8-.22 5.94 1.05 2.9 4.2-.41.43-.85.83-1.29 1.2 1.73.02 3.24.56 3.75 1.6Z",fill:"white"}),E.createElement("path",{d:"M69.73 125.1c1.65-.34 2.2-.4 3.14-.76m0 0c.6-.23 1.38-.58 2.7-1.21 3.42-1.6 9.3-4.21 8.32-6.17-.86-1.76-4.53-2.09-7.33-.97-2.84 1.13-3.58 2.24-3.46 2.56.12.31 4.75-.69 8.34-4.4 3.4-3.54-.96-4.7-3.9-4.06-2.26.5-6.4 2.06-6.16 2.85.16.5 5.33-.54 9.1-4.87 1.14-1.32 2.02-2.51 1.95-3.45-.16-2.03-3.3-3.08-7.42-3.15-8.83-.16-11.56 4.78-11.16 5.1 1.1.92 9.36-4.15 14.46-8.67 1.94-1.73 2.71-3.62.56-4.44-4.4-1.72-13.75-.37-19.42 4.05-9.04 7.07-12 18.44-9.06 27.03 2.94 8.6 12.28 11.3 18 9.61 5.73-1.68 5.4-6.53 4.48-9.81Z",stroke:"#515151"}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M106.48 120.15c-.2 1.56-.53 3.98-1.2 6.51-.68 2.53-1.71 5.16-3.3 7.14l.2.19 5.67-4.97-1.1-8.87h-.27Zm31.09 45.32-.25-.1-11.3 21.27h11.92l-.43-.26c-3.5-2.07-4.07-5.79-3.46-9.77.52-3.4 1.9-6.95 3-9.77l.52-1.37Zm-85.81-37.9-.24.13a55.3 55.3 0 0 0 1.65 6.39l.01.04.05.03c1.63.84 4.4 1.85 7.45 2.14 3.05.3 6.39-.12 9.1-2.15l-.12-.24c-3.14 1.2-11.14 1.63-17.9-6.33Z",fill:"#515151"}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m133.54 82.83.02-.16h-.16c-1.82.1-5.84.39-9.87.96-2.02.28-4.04.64-5.79 1.08-1.74.43-3.23.95-4.18 1.58l-.06.04v.07c-.04 1.8.13 3.69.65 5.35a7.28 7.28 0 0 0 2.8 4.05c2.81 1.86 6.69 1.62 9.98-.58 3.3-2.2 6.04-6.37 6.61-12.4Z",fill:"#515151"}),E.createElement("path",{d:"M126.66 84.73a9.79 9.79 0 0 1-9.7 9.87 9.79 9.79 0 0 1-9.7-9.87 9.79 9.79 0 0 1 9.7-9.87c5.35 0 9.7 4.41 9.7 9.87Z",fill:"white",stroke:"#515151"}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M109.41 70.6c.66.25 1.25.47 1.9.26.52-.18.83-.7 1.18-1.3.75-1.27 1.73-2.93 5.56-2.56 3.86.38 4.6 2.17 5.1 3.43.21.5.38.9.69 1.12.48.32.84.33 1.26.35.55.02 1.2.05 2.37.75 1.41.85 2.49 5.65.23 9.93l.26.43c-.45 2.15-3.05 4.37-3.05 4.14 0-3.04 0-4.75-2.92-7.43-4.26 1.6-10.89 1.13-13.94.14-4-1.28-5.98-6.81-2.53-9 1.72-1.1 2.88-.65 3.9-.26Z",fill:"#515151"}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M116.7 81.6a.41.41 0 1 0-.74.4c.2.39.47.74.9.95.41.2.93.25 1.58.17a.41.41 0 1 0-.1-.82c-.58.07-.9.01-1.12-.09-.2-.1-.36-.28-.53-.6Zm-6.57 4.22a1.07 1.07 0 0 0 1-1.13 1.06 1.06 0 0 0-1.1-1.02c-.59.03-1.03.54-1 1.13.02.6.52 1.05 1.1 1.02Zm6.82.73a1.07 1.07 0 0 0 1-1.13 1.06 1.06 0 0 0-1.1-1.01c-.58.02-1.03.53-1 1.12.03.6.52 1.05 1.1 1.02Z",fill:"#515151"}),E.createElement("ellipse",{cx:127.42,cy:86.0081,rx:2.47934,ry:2.47934,fill:"white",stroke:"#515151"}),E.createElement("circle",{r:4.67102,transform:"matrix(0.707106 0.707108 -0.707106 0.707108 75.0508 75.7794)",fill:"var(--semi-color-primary)",stroke:"var(--semi-color-primary)",strokeWidth:3}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M77.9 72.97a1.1 1.1 0 0 0-1.57 0l-1.26 1.27-1.31-1.3a1.1 1.1 0 1 0-1.57 1.56l1.31 1.3-1.3 1.31a1.1 1.1 0 0 0 1.56 1.57l1.3-1.3 1.27 1.26a1.1 1.1 0 1 0 1.57-1.57l-1.26-1.26 1.26-1.27a1.1 1.1 0 0 0 0-1.57Z",fill:"white"}),E.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M99.41 49.11a32.26 32.26 0 0 0-19-9.84 2.14 2.14 0 0 0-2.42 2.02c-.07 1.2.82 2.2 1.97 2.37a27.86 27.86 0 0 1 16.13 8.36c.83.87 2.24.99 3.17.15.88-.79.99-2.17.15-3.06Zm-35.8-8.52a32.5 32.5 0 0 0-18.74 15.73 2.14 2.14 0 0 0 1.01 2.93c1.11.52 2.4.02 2.96-1.02a28.08 28.08 0 0 1 15.96-13.4 2.28 2.28 0 0 0 1.53-2.72 2.14 2.14 0 0 0-2.72-1.52Zm27.75 15.78c-3.02-3.14-7-5.38-11.53-6.22a2.11 2.11 0 0 0-2.47 2 2.33 2.33 0 0 0 1.9 2.38c3.41.69 6.43 2.37 8.75 4.72.85.85 2.26 1 3.2.15.87-.78 1-2.15.15-3.03Zm-24.64-4.65a21.63 21.63 0 0 0-11.66 9.8 2.1 2.1 0 0 0 .99 2.94c1.12.52 2.4.01 2.98-1 2-3.45 5.17-6.11 8.91-7.5 1.1-.4 1.81-1.56 1.5-2.75a2.1 2.1 0 0 0-2.72-1.5Zm16.63 11.95a10.69 10.69 0 0 0-4-2.47c-1.35-.47-2.56.62-2.63 1.9-.07 1.14.73 2.04 1.65 2.44.56.25 1.07.56 1.52.94.89.74 2.33 1 3.32.11.82-.74 1-2.07.14-2.92Zm-14.28-.76c-1.82.83-3.39 2.16-4.5 3.83-.73 1.08-.16 2.42.9 2.92 1.14.53 2.38-.02 3.05-.88a6.35 6.35 0 0 1 1.93-1.63c.95-.52 1.68-1.63 1.37-2.83-.3-1.15-1.54-1.95-2.75-1.4Z",fill:"var(--semi-color-primary)"}))}var KU=VU;function QU(){return document.getElementById(_g)?.contentWindow}class YU{ws;connectTimeoutTimer;isTimeout=!1;init(e){this.connectTimeoutTimer&&(clearTimeout(this.connectTimeoutTimer),this.connectTimeoutTimer=void 0),this.ws&&(this.ws.close(),this.ws=void 0),this.isTimeout=!1;const n=`ws://${e.clientHost}:${e.clientWsPort||e.clientHttpPort-1}`;console.info(`⌛️ ${D("startConnectClientWS",{wsURL:n})}`);const r=new WebSocket(n);this.connectTimeoutTimer=setTimeout(()=>{r.readyState!==WebSocket.OPEN&&(this.isTimeout=!0,r.close(),console.error(`${D("clientConnectTimeout")||"客户端连接超时"}`),Ee.emit("connectionChange",{node:Pe.get("isNodeWSConnected"),client:!1,from:"client",reason:"timeout"}),Dw())},5e3),r.onclose=()=>{this.connectTimeoutTimer&&(clearTimeout(this.connectTimeoutTimer),this.connectTimeoutTimer=void 0),this.isTimeout||(console.error(`${D("clientServerDisconnected")}`),Ee.emit("connectionChange",{node:Pe.get("isNodeWSConnected"),client:!1,from:"client",reason:"close"}),Dw())},r.onerror=()=>{if(this.connectTimeoutTimer&&(clearTimeout(this.connectTimeoutTimer),this.connectTimeoutTimer=void 0),!this.isTimeout){const s=D("clientServerStartError");Ee.emit("connectionChange",{node:Pe.get("isNodeWSConnected"),client:!1,from:"client",reason:"error"}),console.error(s)}},this.ws=r,r.onopen=()=>{this.connectTimeoutTimer&&(clearTimeout(this.connectTimeoutTimer),this.connectTimeoutTimer=void 0),this.isTimeout||(console.log(`✅ ${D("clientConnectedSuccess")}`),Ee.emit("connectionChange",{node:Pe.get("isNodeWSConnected"),client:!0,from:"client",reason:"open"}),r.send(JSON.stringify({stage:"connecting",status:"success",message:"Browser connected to Client Server Successfully"})))},r.onmessage=function(s){try{const l=JSON.parse(s.data),c=QU();switch(l?.method){case"subscribeHandler":c?.__DEV__?.subscribeHandler?.(l?.payload?.event,l?.payload?.data);break;case"invokeHandler":c?.__DEV__?.invokeHandler?.(l?.payload?.callbackId,l?.payload?.data);break;case"predownloadSubpackage":case"reportScene":l?.payload&&typeof l.payload=="object"&&(Ee.emit(l.method,l.payload),e.onRuntimeMessage?.({method:l.method,payload:l.payload}));break;default:break}}catch(l){console.error(l)}}}send(e){this.ws?.readyState===WebSocket.OPEN&&(e.from="browser",this.ws?.send(JSON.stringify(e)))}close(){this.connectTimeoutTimer&&(clearTimeout(this.connectTimeoutTimer),this.connectTimeoutTimer=void 0),this.ws?.close(),this.ws=void 0}}const Ps=new YU,XU={start:{msgKey:"uploadGameStart"},success:{msgKey:"uploadGameSuccess",handle:i=>{const{packages:e,clientKey:n}=i||{};Pe.setMultiple({packages:e,clientKey:n,isResourcesReady:!0}),Ee.emit("setupStatusChange",{isScriptsReady:Pe.get("isScriptsReady"),isResourcesReady:!0})}},process:{msgKey:"uploadProcess"},error:{msgKey:"uploadError",handle:i=>{const{msg:e}=i||{};Pe.set("isResourcesReady",!1),Ee.emit("setupStatusChange",{isScriptsReady:Pe.get("isScriptsReady"),isResourcesReady:!1,isResourcesFailed:!0})}},restart:{msgKey:"uploadGameRestart"}};function ZU(i){const{status:e,payload:n}=i,r=XU[e];if(!r){console.warn(`Unknown upload status: ${e}`);return}const s=D(r.msgKey);Ee.emit("uploadGame",{status:e,msg:s,progress:n?.progress}),r.handle&&r.handle(n)}class JU{ws;retryTimer;retryAttempt=0;reconnectEnabled=!1;nodeWsPort;retryDelays=[300,700,1500,3e3,5e3];init(){return this.close(),this.nodeWsPort=Pe.get("nodeWsPort"),this.reconnectEnabled=!0,this.retryAttempt=0,this.connect(),!0}connect(){if(!this.reconnectEnabled||!this.nodeWsPort)return;console.info(`⌛️ ${D("nodeServerStartConnect")}`);let e=!1;const n=new WebSocket(`ws://localhost:${this.nodeWsPort}`);this.ws=n,n.onclose=()=>{this.ws===n&&(this.ws=void 0),console.error(`❌ ${D("nodeServerDisconnect")}`),Ee.emit("connectionChange",{node:!1,client:Pe.get("isClientWSConnected"),from:"node",reason:e?"error":"close"}),this.scheduleReconnect()},n.onerror=()=>{e=!0;const r=D("nodeServerStartError");console.error(r)},n.onopen=()=>{if(this.ws!==n||!this.reconnectEnabled){n.close();return}this.retryAttempt=0,console.log(`✅ ${D("nodeServerConnectedSuccess")}`),Ee.emit("connectionChange",{node:!0,client:Pe.get("isClientWSConnected"),from:"node",reason:"open"}),n.send(JSON.stringify({event:"connected",method:"connected",from:"browser"}))},n.onmessage=r=>{if(r.data){let s;try{s=JSON.parse(r.data)}catch{Qt.warn("Node WS received an invalid message",r.data);return}switch(s.method){case"uploadStatus":{ZU(s);break}case"compilationStatus":{Ee.emit("compilationStatus",s.payload);break}case"unitySplitStatus":{Ee.emit("unitySplitStatus",s.payload);break}case"resourceChange":{Qt.info("Node WS resourceChange",s?.payload),Ee.emit("resourceChange",{});break}case"scanQRCodeSuccess":case"clientDebugInfo":{this.connectClient(s.payload);break}case"scanQRCodeFailed":{const{msg:c}=s.payload;Ee.emit("scanQRCode",{status:"failed",msg:c});break}}}}}connectClient(e){const{clientWsPort:n,clientHost:r,clientHttpPort:s}=e||{};if(!n||!r){Qt.warn("Node WS client info is incomplete",e);return}Pe.setMultiple({clientHost:r,clientWsPort:n,clientHttpPort:s}),Ps.init({clientWsPort:n,clientHost:r,clientHttpPort:s,onRuntimeMessage:l=>{this.send({method:"runtimeEvent",payload:l})}}),Ee.emit("scanQRCode",{status:"success"})}scheduleReconnect(){if(!this.reconnectEnabled||this.retryTimer||this.retryAttempt>=this.retryDelays.length)return;const e=this.retryDelays[this.retryAttempt];this.retryAttempt+=1,this.retryTimer=setTimeout(()=>{this.retryTimer=void 0,this.connect()},e)}send(e){if(e.from="browser",this.ws?.readyState!==WebSocket.OPEN){Qt.warn("Node WS is not ready, message skipped",e);return}this.ws.send(JSON.stringify(e))}close(){this.reconnectEnabled=!1,this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=void 0),this.retryAttempt=0,this.ws?.close(),this.ws=void 0}}const Hi=new JU,e9=["krypton.js","ttmg-core.js"];async function zw(i){try{const e=I0();console.log(`⌛️ ${D("startDebug")}`),console.log(`⌛️ ${D("initClientEnv")}`);const n=await Ki({url:`${e}/game/cwd`,method:"POST",data:{command:"start"}});if(console.log(`✅ ${D("initClientEnvSuccess")}`),Ps.send({method:"setDebugSettings",payload:i.debugSetting}),i.debugMode==="clientPreview"||i.debugMode==="clientDebug")Pe.set("isScriptsReady",!0),Hi.send({method:"startUpload"});else{console.log(`⌛️ ${D("startInitJSDevEnv")}`);const s=document.getElementById(_g).contentWindow;s.__DEV__={isEnable:!0,server:e,nodeStaticBaseUrl:Pe.get("nodeStaticBaseUrl")},console.log(`✅ ${D("initJSDevEnvSuccess")}`);const l=await t9(s,e9,e),c=Object.values(l).some(u=>!u);Pe.set("isScriptsReady",Object.values(l).every(u=>u)),Ee.emit("setupStatusChange",{isScriptsReady:Pe.get("isScriptsReady"),isResourcesReady:Pe.get("isResourcesReady"),isScriptsFailed:c}),c||(console.log(`✅ ${D("setDevScriptsSuccess")}`),Hi.send({method:"startUpload"}))}}catch(e){console.log(`❌ ${D("setDevEnvFailed")}`,e?.message??e)}}async function t9(i,e,n){const r={};for(const s of e)try{console.log(`⏳ ${D("startLoadDevScripts")}: ${s}`);const l=await fetch(`${n}/game/scripts/${s}`);if(!l.ok){console.error(`${D("loadDevScriptsFailed")}: ${s}`),r[s]=!1;continue}const c=await l.text();if(!c){console.error(`${D("loadDevScriptsEmpty")}: ${s}`),r[s]=!1;continue}console.log(`✅ ${D("loadDevScriptsSuccess")}: ${s}`);const u=i.document.createElement("script");u.id=s,u.type="text/javascript",u.text=c,i.document.body.appendChild(u),r[s]=!0,console.log(`✅ ${D("loadDevScriptsInitSuccess")}: ${s}`)}catch(l){console.error(`${D("loadDevScriptsFailed")}: ${s}`,l),r[s]=!1}return r}function n9(){const i=()=>typeof document<"u"?document.hidden:!1,[e,n]=E.useState(i);return E.useEffect(()=>{const r=()=>{n(document.hidden),Ps.send({method:"sendPageVisibility",payload:{isHidden:document.hidden}})};return document.addEventListener("visibilitychange",r),()=>{document.removeEventListener("visibilitychange",r)}},[]),e}function r9(){const[i,e]=E.useState([]),n=E.useRef([]),r=E.useRef([]),s=E.useRef([]),l=E.useRef([]),c=E.useRef([]),u=E.useCallback(()=>{const T=[...c.current,...n.current,...r.current,...s.current,...l.current],b=new Map;T.forEach(w=>{const x=w?.text?.trim();if(!x)return;const O=b.get(x);if(!O){b.set(x,{title:w.title,text:x,required:w.required,detail:w.detail});return}!O.required&&w.required&&b.set(x,{title:O.title??w.title,text:x,required:!0,detail:O.detail??w.detail})}),e(Array.from(b.values()))},[]),p=E.useCallback(T=>{const b=[],w=!T?.terms_of_service_link?.trim(),x=!T?.privacy_policy_link?.trim();return w&&x?(b.push({text:D("policyDependencyTermsPrivacyRequired"),required:!0}),b):(w&&b.push({text:D("policyDependencyTermsRequired"),required:!0}),x&&b.push({text:D("policyDependencyPrivacyRequired"),required:!0}),b)},[]),f=E.useCallback(T=>{const b=[],w=!T?.name?.trim(),x=!T?.display_icon_url?.trim()&&!T?.icon_url?.trim(),O=!T?.description?.trim();return w&&b.push(D("topBasicInfoNameField")),x&&b.push(D("topBasicInfoIconField")),O&&b.push(D("topBasicInfoDescriptionField")),b.length===0?[]:[{text:D("topBasicInfoMissing",{fields:b.join(D("topBasicInfoFieldJoiner"))}),required:!1}]},[]),y=E.useCallback(T=>xg(T)?[]:[{text:D("topLoginStatusWarning"),required:!1}],[]),v=E.useCallback(T=>{r.current=p(T),s.current=f(T),u()},[f,p,u]),S=E.useCallback(({currentUser:T,checkResult:b=[]})=>{l.current=y(T),n.current=b.filter(w=>w?.passed===!1).map(w=>({text:w.msg,required:w.required===!0,detail:w.detail})),u()},[y,u]),P=E.useCallback(T=>{c.current=T,u()},[u]);return{topErrorItems:i,updateGameDetailTopErrors:v,updateConfigTopErrors:S,updateGameDetailAccessErrors:P}}const qw="https://developers.tiktok.com/",i9="https://bytedance.larkoffice.com/wiki/PeIawT4M4ia9R8kYyLMcjwHknOg";function o9(i){const e=Dg({errorCode:i.errorCode,user:i.user});if(e==="noPermission")return{link:qw,text:D("topErrorCtaApplyPermission")};if(e==="networkProxy")return{link:i9,text:D("projectInfo.error.openProxyDoc")};if(e==="notFound"||e==="unknown")return{link:qw,text:D("topErrorCtaOpenPortal")}}function s9(i){const e=Dg({errorCode:i.errorCode,user:i.user});if(e==="networkProxy")return D("topErrorTitleNetworkProxy");if(e==="noPermission")return D("topErrorTitlePermission");if(e==="notLoggedIn"||e==="loginExpired")return D("topErrorTitleLogin");if(e==="notFound")return D("topErrorTitleProjectNotFound")}function a9({onSuccess:i,updateGameDetailAccessErrors:e}){const{state:{user:n},hideLoading:r,setError:s,setGameDetail:l}=pn(),c=E.useRef(!1),u=E.useRef(!1),p=E.useCallback(f=>{if(c.current){u.current=!0;return}c.current=!0,Ki({url:"/game/detail",method:"GET"}).then(y=>{if(y.error){r();const{errorCode:v,errorMsg:S}=y.error,P=iW({errorCode:v,errorMsg:S,clientKey:y.error.clientKey,user:f??n});l({client_key:y.error.clientKey,has_error:!0,error_msg:S,error_code:v}),s({text:""}),e(P?[{title:s9({errorCode:v,user:f??n}),text:P,required:!0,detail:o9({errorCode:v,user:f??n})}]:[]);return}s({text:""}),e([]),l(y.data),i(y.data),r()}).finally(()=>{c.current=!1,u.current&&(u.current=!1,p(f))})},[r,i,s,l,e,n]);return{fetchGameDetail:p}}function l9({fetchGameDetail:i,updateConfigTopErrors:e}){const{showLoading:n,hideLoading:r,setError:s,setSchema:l,setUser:c,setPackages:u,setDevToolVersion:p,setEngine:f,setDebugMode:y,setMessage:v}=pn(),[S,P]=E.useState(""),T=E.useRef(!1);return E.useEffect(()=>{T.current||(T.current=!0,n(),Ki({url:"/game/config",method:"GET"}).then(b=>{if(b.error){r(),s({visible:!0,text:D("getDevGameConfigFailed")+`: ${b.error.errorMsg}`}),P(D("getDevGameConfigFailed")),console.log(`❌ ${D("getDevGameConfigFailed")}: ${b.error.errorMsg}`);return}const{schema:w,nodeWsPort:x,user:O,packages:N,devToolVersion:M,clientKey:F,engine:j,nodeStaticBaseUrl:L,checkResult:z,lang:W}=b.data;if(TG(W),ZG(),console.log(`✅ ${D("getDevGameConfigSuccess")}`),W||Ki({url:"/game/config-fillback",method:"POST",data:{lang:navigator.language}}),l(w),Pe.setMultiple({nodeWsPort:x,email:O?.email,clientKey:F,nodeStaticBaseUrl:L}),c(O),p(M),u(N),f(j),Pl()&&v({type:"success",desc:D("nodeServerConnectedSuccess")}),!F0()){const V=j==="unity"?qn.clientPreview:qn.browserDebug;y(V),z0(V)}i(O),e({currentUser:O,checkResult:z}),r()}))},[i,r,p,f,y,s,u,l,c,v,n,e]),{isServerError:!!S,serverErrorMsg:S}}function c9({onResourceChange:i}){E.useEffect(()=>{const e=()=>{i()};return Ee.on("resourceChange",e),()=>{Ee.off("resourceChange",e)}},[i])}function u9(){const[i,e]=E.useState(()=>lW());E.useEffect(()=>{const s=l=>{if(l.key!=="tt-theme")return;const c=l.newValue;(c==="light"||c==="dark")&&(Ow(c),e(c))};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},[]);const n=E.useCallback(s=>{Ow(s),e(s)},[]),r=E.useCallback(()=>{n(i==="dark"?"light":"dark")},[i,n]);return{theme:i,setTheme:n,toggle:r}}const d9="modulepreload",p9=function(i){return"/"+i},Bw={},lt=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let p=function(f){return Promise.all(f.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=c?.nonce||c?.getAttribute("nonce");s=p(n.map(f=>{if(f=p9(f),f in Bw)return;Bw[f]=!0;const y=f.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${v}`))return;const S=document.createElement("link");if(S.rel=y?"stylesheet":d9,y||(S.as="script"),S.crossOrigin="",S.href=f,u&&S.setAttribute("nonce",u),document.head.appendChild(S),y)return new Promise((P,T)=>{S.addEventListener("load",P),S.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${f}`)))})}))}function l(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return s.then(c=>{for(const u of c||[])u.status==="rejected"&&l(u.reason);return e().catch(l)})},l_=()=>{const{state:{loading:i}}=pn();return i.visible?k.jsx("div",{className:"loading-container",children:k.jsxs("div",{className:"loading-content",children:[k.jsx(Ar,{size:"large"}),k.jsx("div",{className:"loading-text",children:i.text})]})}):null},f9=({size:i=24,color:e="#000",style:n,className:r})=>k.jsx("div",{style:{display:"flex",alignItems:"center",position:"relative"},children:k.jsxs("svg",{fill:"currentColor",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",width:i,height:i,children:[k.jsx("path",{d:"M37.86 17.82c.14.24.14.67.14 1.53v9.5c0 1.14 0 1.72-.2 2.26-.16.49-.43.96-.77 1.34-.37.44-.87.73-1.86 1.3l-7.84 4.53c-.74.43-1.11.64-1.4.64a.66.66 0 0 1-.58-.34c-.14-.24-.14-.67-.14-1.53v-9.5c0-1.14 0-1.71.2-2.26.16-.48.43-.95.76-1.34.38-.44.88-.73 1.87-1.3l7.84-4.52c.74-.43 1.11-.65 1.4-.64.25 0 .45.12.58.33Z"}),k.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m27.54 1.99 7 3.93 6.89 4a7.23 7.23 0 0 1 3.59 6.2l.06 7.88-.06 7.88a7.23 7.23 0 0 1-3.6 6.2l-6.88 4-7 3.93a7.23 7.23 0 0 1-7.08 0l-7-3.93-6.9-4a7.23 7.23 0 0 1-3.58-6.2L2.9 24l.07-7.88a7.23 7.23 0 0 1 3.59-6.2l6.89-4 7-3.93a7.23 7.23 0 0 1 7.08 0Zm-2.07 3.67 6.98 3.92 6.86 3.99a3.01 3.01 0 0 1 1.5 2.58l.06 7.85-.07 7.85c0 1.06-.57 2.04-1.5 2.58l-6.85 4-6.98 3.9c-.91.52-2.03.52-2.95 0l-6.97-3.9-6.86-4a3.01 3.01 0 0 1-1.5-2.58L7.13 24l.06-7.85c.01-1.06.58-2.04 1.5-2.58l6.86-4 6.97-3.9a3.01 3.01 0 0 1 2.95 0Z"})]})}),h9=()=>k.jsxs("div",{className:"logo-container",children:[k.jsx(f9,{size:24}),k.jsx("div",{className:"logo-title",children:D("title")})]});function Gw(i){return D(i==="ok"?"connectStatusConnected":i==="fail"?"connectStatusFailed":"connectStatusDisconnected")}function ts(i){return i==="ok"?"var(--tt-success-text)":i==="fail"?"var(--tt-error-text)":"var(--tt-text-faint)"}function g9(){return Pl()?["subpackage.collecting","subpackage.ready","subpackage.success"].includes(Pg()):!1}const m9=()=>{const{state:{schema:i,isConnected:e},setIsConnected:n,setMessage:r}=pn(),s=e||g9(),[l,c]=E.useState("off"),[u,p]=E.useState("off"),[f,y]=E.useState("off"),v={node:{bg:"var(--tt-info-bg)",stroke:"var(--tt-info-border)",text:"var(--tt-info-text)"},browser:{bg:"var(--tt-success-bg)",stroke:"var(--tt-success-border)",text:"var(--tt-success-text)"},client:{bg:"var(--tt-accent-soft)",stroke:"var(--tt-accent-strong)",text:"var(--tt-accent-text)"}},S=E.useMemo(()=>{const{nodeWsPort:N,clientHost:M,clientHttpPort:F,clientWsPort:j}=Pe.getMultiple(["nodeWsPort","clientHost","clientHttpPort","clientWsPort"]);let L="",z="";try{if(i){const W=new URL(i);L=(W.searchParams.get("host")||"").trim(),z=(W.searchParams.get("port")||"").trim()}}catch{}return{nodeWsPort:N,clientHost:M,clientHttpPort:F,clientWsPort:j,schemaHost:L,schemaPort:z}},[l,u,f,i]),P=N=>{const{client:M,node:F,reason:j}=N||{};Qt.info("connectionChange",M,F),Pe.get("isNodeWSConnected")===F&&(M||r({type:"danger",desc:D("clientServerStartError")})),Pe.get("isClientWSConnected")===M&&(F||r({type:"danger",desc:D("nodeServerStartError")})),Pe.get("isClientWSConnected")&&!M&&(Pe.setMultiple({isClientWSConnected:!1,isResourcesReady:!1,isScriptsReady:!1}),r({type:"danger",desc:D("clientDisconnected")})),Pe.get("isNodeWSConnected")&&!F&&(Pe.setMultiple({isNodeWSConnected:!1,isResourcesReady:!1,isScriptsReady:!1}),r({type:"danger",title:D("serverDisconnected"),desc:D("nodeDisconnected")})),!Pe.get("isClientWSConnected")&&M&&(Pe.set("isClientWSConnected",!0),r({type:"success",desc:D("clientConnectedSuccess")})),!Pe.get("isNodeWSConnected")&&F&&(Pe.set("isNodeWSConnected",!0),r({type:"success",desc:D("nodeServerConnectedSuccess")})),typeof F=="boolean"&&(c(F?"ok":j==="error"||j==="timeout"?"fail":"off"),F||y("off")),typeof M=="boolean"&&p(M?"ok":j==="error"||j==="timeout"?"fail":"off"),n(!!M&&!!F)},T=N=>{if(N?.status==="success"){y("ok");return}if(N?.status==="failed"){y("fail");return}N?.status==="start"&&y("off")};E.useEffect(()=>(Ee.on("connectionChange",P),Ee.on("scanQRCode",T),()=>{Ee.off("connectionChange",P),Ee.off("scanQRCode",T)}),[n]);const b=k.jsxs("div",{children:[k.jsxs("div",{children:[D("connectStatusNode"),": ",Gw(l)]}),k.jsxs("div",{children:[D("connectStatusDebugPage"),": ",window.location.origin]}),S.nodeWsPort?k.jsxs("div",{children:["WS: ws://localhost:",S.nodeWsPort]}):null,k.jsxs("div",{children:["HTTP: ",window.location.origin]}),S.schemaHost&&S.schemaPort?k.jsxs("div",{children:[D("scanQRCode"),":ws://",S.schemaHost,":",S.schemaPort]}):null]}),w=k.jsx("div",{children:k.jsxs("div",{children:[D("connectStatusBrowser"),": ",D("connectStatusConnected")]})}),x=k.jsxs("div",{children:[k.jsxs("div",{children:[D("connectStatusClient"),": ",Gw(u)]}),S.clientHost?k.jsxs("div",{children:[S.clientHost,S.clientHttpPort?` http:${S.clientHttpPort}`:"",S.clientWsPort?` ws:${S.clientWsPort}`:""]}):null]}),O=k.jsxs("div",{className:"conn-graph-wrap",children:[k.jsx("div",{className:"conn-graph",children:k.jsx("svg",{className:"conn-graph-svg",width:"340",height:"220",viewBox:"0 0 360 240",children:(()=>{const N={x:180,y:44},M={x:70,y:206},F={x:290,y:206},j=14,L=26,z=4,W=5,V=8,H={x:(N.x+M.x+F.x)/3,y:(N.y+M.y+F.y)/3},re=(Z,I)=>({x:I.x-Z.x,y:I.y-Z.y}),ee=Z=>Math.hypot(Z.x,Z.y)||1,se=Z=>{const I=ee(Z);return{x:Z.x/I,y:Z.y/I}},ae=Z=>({x:-Z.y,y:Z.x}),he=(Z,I,U=1)=>({x:Z.x+I.x*U,y:Z.y+I.y*U}),ue=(Z,I,U)=>{const oe=re(Z,I),ne=se(oe),ie=se(ae(oe)),_e=U.offset||0,ye=he(he(Z,ne,L),ie,_e),ve=he(he(I,ne,-L),ie,_e),Ce=typeof U.t=="number"?Math.min(.9,Math.max(.1,U.t)):.5,be={x:ye.x+(ve.x-ye.x)*Ce,y:ye.y+(ve.y-ye.y)*Ce},gt=he(Z,ne,L),kt=he(I,ne,-L),ar={x:gt.x+(kt.x-gt.x)*Ce,y:gt.y+(kt.y-gt.y)*Ce},xn=U.markMode||"byLineOffset",Dn=re(ar,H),Jt=Dn.x*ie.x+Dn.y*ie.y>0?{x:-ie.x,y:-ie.y}:ie,xe=U.labelSide==="inner"?-1:1,zt=_e>=0?1:-1,Pt=xn==="byTriangleSide"?xe:zt,$e={w:360,h:240,pad:10};let Ie=he(be,Jt,V*Pt);(Ie.y>$e.h-$e.pad||Ie.y<$e.pad||Ie.x>$e.w-$e.pad||Ie.x<$e.pad)&&(Ie=he(be,Jt,-V*Pt));const rt=Ie.x<$e.w-60,ze={x:rt?Ie.x+W+z:Ie.x-W-z,y:Ie.y},Tt=rt?"start":"end",It=U.label.length*6+8,On=Tt==="start"?ze.x:ze.x-It,en=Tt==="start"?ze.x+It:ze.x;let Ze=Tt,Et=ze.x;return On<$e.pad&&en>$e.w-$e.pad?(Ze="start",Et=$e.pad):On<$e.pad?(Ze="start",Et=Ie.x+W+z):en>$e.w-$e.pad&&(Ze="end",Et=Ie.x-W-z),k.jsxs("g",{children:[k.jsx("line",{x1:ye.x,y1:ye.y,x2:ve.x,y2:ve.y,stroke:"var(--tt-border-strong)",strokeWidth:"2",strokeDasharray:U.dashed?"4 3":void 0}),k.jsx("circle",{cx:Ie.x,cy:Ie.y,r:W,fill:U.statusColor}),k.jsx("text",{x:Et,y:ze.y,fontSize:"10",fill:"var(--tt-text-dim)",dominantBaseline:"middle",textAnchor:Ze,paintOrder:"stroke",stroke:"var(--tt-bg-panel)",strokeWidth:"3",children:U.label})]})},K=(Z,I,U,oe)=>k.jsx(rr,{content:U,children:k.jsxs("g",{className:"conn-vertex",children:[k.jsx("rect",{x:Z.x-28,y:Z.y-14,width:56,height:22,rx:8,fill:oe.bg,stroke:oe.stroke}),k.jsx("text",{x:Z.x,y:Z.y-1,textAnchor:"middle",dominantBaseline:"middle",fontSize:"12",fill:oe.text,children:I})]})});return k.jsxs(k.Fragment,{children:[ue(M,N,{label:"ws",statusColor:ts(l),offset:-j/2,labelSide:"outer",markMode:"byLineOffset",t:.42}),ue(M,N,{label:"http",statusColor:ts(l),offset:j/2,labelSide:"inner",markMode:"byLineOffset",t:.58}),ue(N,F,{label:"ws",statusColor:ts(f),dashed:!0,offset:0,labelSide:"outer",markMode:"byTriangleSide",t:.55}),ue(M,F,{label:"ws",statusColor:ts(u),offset:-j/2,labelSide:"outer",markMode:"byLineOffset",t:.55}),ue(M,F,{label:"http",statusColor:ts(u),offset:j/2,labelSide:"inner",markMode:"byLineOffset",t:.45}),K(N,D("connectStatusNode"),b,v.node),K(M,D("connectStatusBrowser"),w,v.browser),K(F,D("connectStatusClient"),x,v.client)]})})()})}),k.jsxs("div",{className:"conn-legend",children:[k.jsx("div",{className:"conn-legend-title",children:D("connectStatusLegendTitle")}),k.jsxs("div",{className:"conn-legend-item",children:[k.jsx("div",{className:"conn-legend-name",children:k.jsx(un,{className:"conn-legend-tag-node",type:"ghost",size:"small",style:{marginRight:6},children:D("connectStatusNode")})}),k.jsx("div",{className:"conn-legend-desc",children:D("connectStatusLegendNode")})]}),k.jsxs("div",{className:"conn-legend-item",children:[k.jsx("div",{className:"conn-legend-name",children:k.jsx(un,{color:"green",type:"ghost",size:"small",style:{marginRight:6},children:D("connectStatusBrowser")})}),k.jsx("div",{className:"conn-legend-desc",children:D("connectStatusLegendBrowser")})]}),k.jsxs("div",{className:"conn-legend-item",children:[k.jsx("div",{className:"conn-legend-name",children:k.jsx(un,{className:"conn-legend-tag-client",type:"ghost",size:"small",style:{marginRight:6},children:D("connectStatusClient")})}),k.jsx("div",{className:"conn-legend-desc",children:D("connectStatusLegendClient")})]}),k.jsxs("div",{className:"conn-legend-item",children:[k.jsxs("div",{className:"conn-legend-name",children:[k.jsx(un,{color:"grey",type:"ghost",size:"small",style:{marginRight:6},children:"WS"}),k.jsx(un,{color:"grey",type:"ghost",size:"small",children:"HTTP"})]}),k.jsx("div",{className:"conn-legend-desc",children:D("connectStatusLegendProto")})]})]})]});return k.jsx(zn,{content:O,trigger:"hover",showArrow:!1,children:k.jsxs("div",{className:"connect-status tt-header-chip"+(s?" connect-status-on":" connect-status-off"),role:"status","aria-label":D(s?"deviceConnected":"deviceDisconnected"),children:[k.jsx("span",{className:"connect-status-dot","aria-hidden":"true"}),k.jsx("span",{className:"connect-status-text",children:D(s?"deviceConnected":"deviceDisconnected")})]})})},y9=({version:i})=>{const e=_s(),{state:{devToolVersion:n}}=pn(),[r,s]=E.useState(!1);if(E.useEffect(()=>{s(XG(n))},[n]),!i)return null;const l=()=>{n&&(YG(n),s(!1)),e("/changelog")};return k.jsxs("button",{type:"button",onClick:l,className:"version-tag tt-header-chip"+(r?" version-tag-has-new":""),"aria-label":r?`${D("changelog")||"Changelog"} · ${D("changelogNewTag")||"NEW"}`:D("changelog")||"Changelog",title:r?D("changelogNewTag")||"NEW":void 0,children:[k.jsx("span",{className:"version-tag-text",children:i}),r&&k.jsx("span",{className:"version-tag-new",children:D("changelogNewTag")||"NEW"})]})};const c_=(...i)=>i.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();const v9=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const b9=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());const Ww=i=>{const e=b9(i);return e.charAt(0).toUpperCase()+e.slice(1)};var ph={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const S9=i=>{for(const e in i)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},w9=E.createContext({}),C9=()=>E.useContext(w9),_9=E.forwardRef(({color:i,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:l,iconNode:c,...u},p)=>{const{size:f=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:S="currentColor",className:P=""}=C9()??{},T=r??v?Number(n??y)*24/Number(e??f):n??y;return E.createElement("svg",{ref:p,...ph,width:e??f??ph.width,height:e??f??ph.height,stroke:i??S,strokeWidth:T,className:c_("lucide",P,s),...!l&&!S9(u)&&{"aria-hidden":"true"},...u},[...c.map(([b,w])=>E.createElement(b,w)),...Array.isArray(l)?l:[l]])});const Dl=(i,e)=>{const n=E.forwardRef(({className:r,...s},l)=>E.createElement(_9,{ref:l,iconNode:e,className:c_(`lucide-${v9(Ww(i))}`,`lucide-${i}`,r),...s}));return n.displayName=Ww(i),n};const k9=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],P9=Dl("arrow-left",k9);const T9=[["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"}]],E9=Dl("external-link",T9);const x9=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],D9=Dl("moon",x9);const O9=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],I9=Dl("sun",O9),R9=()=>{const{theme:i,toggle:e}=u9(),n=i==="dark",r=n?I9:D9,s=D(n?"themeToggleToLight":"themeToggleToDark");return k.jsx("button",{type:"button",onClick:e,className:"theme-toggle tt-header-chip","aria-label":s,title:s,children:k.jsx(r,{className:"theme-toggle-icon",size:14,strokeWidth:2})})},N9=E.lazy(()=>lt(()=>import("./index-BrOFdVbv.js"),__vite__mapDeps([0,1,2,3])).then(i=>({default:i.AccessDocs}))),j9=E.lazy(()=>lt(()=>import("./index-FVHabbDB.js"),__vite__mapDeps([4,1,2,5])).then(i=>({default:i.LangSwitcher})));E.lazy(()=>lt(()=>import("./index-CsiIrLKY.js"),__vite__mapDeps([6,7,8,9,10,11,12,13])).then(i=>({default:i.GameUploader})));const L9=E.lazy(()=>lt(()=>import("./index-Csmg5oyu.js"),__vite__mapDeps([14,15])).then(i=>({default:i.LoginStatus}))),A9=E.lazy(()=>lt(()=>import("./index-B6hY5GdS.js"),__vite__mapDeps([16,17])).then(i=>({default:i.WasmCodeSplit}))),M9=()=>{const{state:{devToolVersion:i,engine:e}}=pn();return k.jsxs("div",{className:"header-wrapper",children:[k.jsxs("div",{className:"header-content",children:[k.jsxs("div",{className:"header-content-left",children:[k.jsx(h9,{}),k.jsx(y9,{version:i}),k.jsx(m9,{})]}),k.jsx("div",{className:"header-content-right",children:k.jsxs(Ss,{spacing:12,children:[k.jsx(E.Suspense,{fallback:null,children:k.jsx(N9,{})}),e==="unity"&&k.jsx(E.Suspense,{fallback:null,children:k.jsx(A9,{})}),k.jsx(E.Suspense,{fallback:null,children:k.jsx(j9,{})}),k.jsx(R9,{}),k.jsx(E.Suspense,{fallback:null,children:k.jsx(L9,{})})]})})]}),k.jsx(D2,{})]})},$9=({enabled:i=!0})=>(E.useEffect(()=>{if(!i){Hi.close();return}return Hi.init(),()=>{Hi.close()}},[i]),null),F9=E.lazy(()=>lt(()=>import("./index-DDecPuod.js"),__vite__mapDeps([18,19,20,21])).then(i=>({default:i.Sidebar}))),z9=()=>k.jsx("div",{className:"sidebar-container",children:k.jsx(E.Suspense,{fallback:k.jsx("div",{className:"sidebar-loading-placeholder"}),children:k.jsx(F9,{})})}),q9=({title:i,subtitle:e,action:n,decoration:r=!0,className:s})=>k.jsxs("header",{className:Q("tt-page-hero",r&&"tt-page-hero-decorated",s),children:[k.jsxs("div",{className:"tt-page-hero-text",children:[k.jsx("h1",{className:"tt-page-hero-title",children:i}),e&&k.jsx("p",{className:"tt-page-hero-subtitle",children:e})]}),n&&k.jsx("div",{className:"tt-page-hero-action",children:n})]}),B9=({tone:i="neutral",withDot:e=!1,variant:n="solid",size:r="md",className:s,children:l})=>k.jsxs("span",{className:Q("tt-tag",`tt-tag-${i}`,`tt-tag-${n}`,`tt-tag-size-${r}`,s),children:[e&&k.jsx("span",{className:"tt-tag-dot","aria-hidden":"true"}),k.jsx("span",{className:"tt-tag-label",children:l})]}),u_=({href:i,iconSize:e=13,className:n="",children:r,target:s="_blank",rel:l="noopener noreferrer",...c})=>k.jsxs("a",{...c,className:`tt-document-link ${n}`.trim(),href:i,target:s,rel:l,children:[k.jsx("span",{className:"tt-document-link-label",children:r}),k.jsx(E9,{className:"tt-document-link-icon",size:e,strokeWidth:2,"aria-hidden":"true"})]}),G9=({items:i,fallbackErrorText:e})=>{const[n,r]=E.useState(!1),s=E.useMemo(()=>{const f=e?.trim();return f?[{text:f,required:!0},...i.filter(y=>y.text.trim()!==f)]:i},[e,i]);if(E.useEffect(()=>{r(!1)},[s]),s.length===0)return null;const l=f=>f.detail?.link?k.jsx(u_,{className:"app-error-cta",href:f.detail.link,children:f.detail.text||D("viewDoc")}):null,c=(f,y)=>{const v=f.required?Qh:Yh,S=f.required?"required":"suggested",P=f.title||(f.required?D("topErrorTitleRequired"):D("topErrorTitleSuggested"));return k.jsxs("div",{className:`app-error-row app-error-row-${S}`,role:f.required?"alert":"status",children:[k.jsx("span",{className:"app-error-row-accent","aria-hidden":"true"}),k.jsx("span",{className:"app-error-row-icon",children:k.jsx(v,{})}),k.jsxs("div",{className:"app-error-row-body",children:[k.jsx("div",{className:"app-error-row-title",children:P}),k.jsx("div",{className:"app-error-row-text",children:f.text})]}),l(f)]},`${f.text}-${S}-${y}`)};if(s.length===1)return k.jsx("div",{className:"app-error-banner",children:c(s[0],0)});const u=s.find(f=>f.required)??s[0],p=s.filter(f=>f!==u);return k.jsxs("div",{className:"app-error-banner app-error-banner-multi",children:[k.jsxs("div",{className:"app-error-multi-head",children:[c(u,0),k.jsx("button",{type:"button",className:"app-error-multi-toggle",onClick:()=>r(f=>!f),children:n?D("topErrorHideDetails"):D("topErrorMoreItems",{count:String(p.length)})})]}),n&&k.jsx("div",{className:"app-error-multi-body",children:p.map((f,y)=>c(f,y+1))})]})},W9=i=>Number.isFinite(i)?Math.max(0,Math.min(1,i??0)):0,U9=_.memo(()=>{const{setMessage:i,hideLoading:e,state:{gameDetail:n,debugSetting:r,isConnected:s,selectedLaunchOption:l,debugMode:c}}=pn();n9();const[u,p]=E.useState(""),f=T=>{if(!T.client||!T.node){Pe.set("hasSetup",!1);return}if(Pe.get("hasSetup"))return;Pe.set("hasSetup",!0),(async()=>(e(),i({type:"success",desc:D("setupDevEnv")}),await zw({debugSetting:r,debugMode:c})))()},y=E.useCallback(({status:T,msg:b,progress:w})=>{switch(T){case"start":const x=D("uploadProcess");i({type:"info",title:x,desc:D("uploadProcessDesc"),progress:0,intent:"uploading"}),console.log(x);break;case"success":i({type:"success",desc:D("uploadSuccess")}),console.log(`✅ ${D("uploadSuccess")}`);break;case"error":const O=`${D("uploadError")}: ${b}`;i({type:"danger",desc:O}),console.log(O);break;case"restart":break;case"process":const N=W9(w);`${D("uploadProcess")}${(N*100).toFixed(0)}`,i({type:"info",title:D("uploadProcess"),desc:D("uploadProcessDesc"),progress:N,intent:"uploading"});break}},[]),v=E.useCallback(({isScriptsReady:T,isResourcesReady:b,isScriptsFailed:w,isResourcesFailed:x})=>{T&&b?(Qt.info("scripts and resources are ready, send meta"),WG(n),i({type:"success",desc:D(c==="clientPreview"?"clientPreviewEnvSetupSuccess":"debugEnvSetupSuccess")})):w?i({type:"danger",desc:D("scriptsSetupFailed")}):x&&i({type:"danger",desc:D("resourcesSetupFailed")})},[n,l,c]),S=()=>{if(!s)return;const T=tr.warning({position:"top",duration:1e4,title:D("gameResourceUpdated"),id:u,onClose:()=>{p("")},content:k.jsxs(k.Fragment,{children:[k.jsx("p",{children:D("gameResourceChange")}),k.jsxs("div",{className:"banner-footer",children:[k.jsx(tt,{type:"tertiary",onClick:()=>{tr.close(T)},children:D("notUpload")}),k.jsx(tt,{style:{marginLeft:12},type:"warning",onClick:()=>{Qt.info("upload"),Qt.info("upload iframe onload, 开始重新初始化"),zw({debugSetting:r,debugMode:c}),tr.close(T)},children:D("uploadToClient")})]})]})});p(T)},P=E.useCallback(({status:T,errorMsg:b})=>{T==="start"?(i({type:"info",title:D("gameResourceCompilingTitle"),desc:D("gameResourceCompiling")}),console.warn(`⚠️ ${D("gameResourceCompiling")}`)):T==="end"&&(b?(i({type:"danger",desc:b}),console.error(`❌ ${b}`)):(i({type:"success",title:D("gameResourceCompileSuccessTitle"),desc:D("gameResourceCompileSuccess")}),console.log(`✅ ${D("gameResourceCompileSuccess")}`)))},[]);return E.useEffect(()=>(Ee.on("connectionChange",f),Ee.on("compilationStatus",P),Ee.on("resourceChange",S),Ee.on("uploadGame",y),Ee.on("setupStatusChange",v),()=>{Ee.off("compilationStatus",P),Ee.off("resourceChange",S),Ee.off("setupStatusChange",v),Ee.off("uploadGame",y),Ee.off("connectionChange",f)}),[f,P,S,v,y]),null});var Gi={},fh,Uw;function d_(){return Uw||(Uw=1,fh={L:1,M:0,Q:3,H:2}),fh}var hh,Hw;function p_(){return Hw||(Hw=1,hh={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),hh}var gh,Vw;function H9(){if(Vw)return gh;Vw=1;var i=p_();function e(n){this.mode=i.MODE_8BIT_BYTE,this.data=n}return e.prototype={getLength:function(n){return this.data.length},write:function(n){for(var r=0;r<this.data.length;r++)n.put(this.data.charCodeAt(r),8)}},gh=e,gh}var mh,Kw;function V9(){if(Kw)return mh;Kw=1;var i=d_();function e(n,r){this.totalCount=n,this.dataCount=r}return e.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e.getRSBlocks=function(n,r){var s=e.getRsBlockTable(n,r);if(s==null)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+r);for(var l=s.length/3,c=new Array,u=0;u<l;u++)for(var p=s[u*3+0],f=s[u*3+1],y=s[u*3+2],v=0;v<p;v++)c.push(new e(f,y));return c},e.getRsBlockTable=function(n,r){switch(r){case i.L:return e.RS_BLOCK_TABLE[(n-1)*4+0];case i.M:return e.RS_BLOCK_TABLE[(n-1)*4+1];case i.Q:return e.RS_BLOCK_TABLE[(n-1)*4+2];case i.H:return e.RS_BLOCK_TABLE[(n-1)*4+3];default:return}},mh=e,mh}var yh,Qw;function K9(){if(Qw)return yh;Qw=1;function i(){this.buffer=new Array,this.length=0}return i.prototype={get:function(e){var n=Math.floor(e/8);return(this.buffer[n]>>>7-e%8&1)==1},put:function(e,n){for(var r=0;r<n;r++)this.putBit((e>>>n-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),e&&(this.buffer[n]|=128>>>this.length%8),this.length++}},yh=i,yh}var vh,Yw;function f_(){if(Yw)return vh;Yw=1;for(var i={glog:function(n){if(n<1)throw new Error("glog("+n+")");return i.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return i.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},e=0;e<8;e++)i.EXP_TABLE[e]=1<<e;for(var e=8;e<256;e++)i.EXP_TABLE[e]=i.EXP_TABLE[e-4]^i.EXP_TABLE[e-5]^i.EXP_TABLE[e-6]^i.EXP_TABLE[e-8];for(var e=0;e<255;e++)i.LOG_TABLE[i.EXP_TABLE[e]]=e;return vh=i,vh}var bh,Xw;function h_(){if(Xw)return bh;Xw=1;var i=f_();function e(n,r){if(n.length==null)throw new Error(n.length+"/"+r);for(var s=0;s<n.length&&n[s]==0;)s++;this.num=new Array(n.length-s+r);for(var l=0;l<n.length-s;l++)this.num[l]=n[l+s]}return e.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var r=new Array(this.getLength()+n.getLength()-1),s=0;s<this.getLength();s++)for(var l=0;l<n.getLength();l++)r[s+l]^=i.gexp(i.glog(this.get(s))+i.glog(n.get(l)));return new e(r,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var r=i.glog(this.get(0))-i.glog(n.get(0)),s=new Array(this.getLength()),l=0;l<this.getLength();l++)s[l]=this.get(l);for(var l=0;l<n.getLength();l++)s[l]^=i.gexp(i.glog(n.get(l))+r);return new e(s,0).mod(n)}},bh=e,bh}var Sh,Zw;function Q9(){if(Zw)return Sh;Zw=1;var i=p_(),e=h_(),n=f_(),r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(l){for(var c=l<<10;s.getBCHDigit(c)-s.getBCHDigit(s.G15)>=0;)c^=s.G15<<s.getBCHDigit(c)-s.getBCHDigit(s.G15);return(l<<10|c)^s.G15_MASK},getBCHTypeNumber:function(l){for(var c=l<<12;s.getBCHDigit(c)-s.getBCHDigit(s.G18)>=0;)c^=s.G18<<s.getBCHDigit(c)-s.getBCHDigit(s.G18);return l<<12|c},getBCHDigit:function(l){for(var c=0;l!=0;)c++,l>>>=1;return c},getPatternPosition:function(l){return s.PATTERN_POSITION_TABLE[l-1]},getMask:function(l,c,u){switch(l){case r.PATTERN000:return(c+u)%2==0;case r.PATTERN001:return c%2==0;case r.PATTERN010:return u%3==0;case r.PATTERN011:return(c+u)%3==0;case r.PATTERN100:return(Math.floor(c/2)+Math.floor(u/3))%2==0;case r.PATTERN101:return c*u%2+c*u%3==0;case r.PATTERN110:return(c*u%2+c*u%3)%2==0;case r.PATTERN111:return(c*u%3+(c+u)%2)%2==0;default:throw new Error("bad maskPattern:"+l)}},getErrorCorrectPolynomial:function(l){for(var c=new e([1],0),u=0;u<l;u++)c=c.multiply(new e([1,n.gexp(u)],0));return c},getLengthInBits:function(l,c){if(1<=c&&c<10)switch(l){case i.MODE_NUMBER:return 10;case i.MODE_ALPHA_NUM:return 9;case i.MODE_8BIT_BYTE:return 8;case i.MODE_KANJI:return 8;default:throw new Error("mode:"+l)}else if(c<27)switch(l){case i.MODE_NUMBER:return 12;case i.MODE_ALPHA_NUM:return 11;case i.MODE_8BIT_BYTE:return 16;case i.MODE_KANJI:return 10;default:throw new Error("mode:"+l)}else if(c<41)switch(l){case i.MODE_NUMBER:return 14;case i.MODE_ALPHA_NUM:return 13;case i.MODE_8BIT_BYTE:return 16;case i.MODE_KANJI:return 12;default:throw new Error("mode:"+l)}else throw new Error("type:"+c)},getLostPoint:function(l){for(var c=l.getModuleCount(),u=0,p=0;p<c;p++)for(var f=0;f<c;f++){for(var y=0,v=l.isDark(p,f),S=-1;S<=1;S++)if(!(p+S<0||c<=p+S))for(var P=-1;P<=1;P++)f+P<0||c<=f+P||S==0&&P==0||v==l.isDark(p+S,f+P)&&y++;y>5&&(u+=3+y-5)}for(var p=0;p<c-1;p++)for(var f=0;f<c-1;f++){var T=0;l.isDark(p,f)&&T++,l.isDark(p+1,f)&&T++,l.isDark(p,f+1)&&T++,l.isDark(p+1,f+1)&&T++,(T==0||T==4)&&(u+=3)}for(var p=0;p<c;p++)for(var f=0;f<c-6;f++)l.isDark(p,f)&&!l.isDark(p,f+1)&&l.isDark(p,f+2)&&l.isDark(p,f+3)&&l.isDark(p,f+4)&&!l.isDark(p,f+5)&&l.isDark(p,f+6)&&(u+=40);for(var f=0;f<c;f++)for(var p=0;p<c-6;p++)l.isDark(p,f)&&!l.isDark(p+1,f)&&l.isDark(p+2,f)&&l.isDark(p+3,f)&&l.isDark(p+4,f)&&!l.isDark(p+5,f)&&l.isDark(p+6,f)&&(u+=40);for(var b=0,f=0;f<c;f++)for(var p=0;p<c;p++)l.isDark(p,f)&&b++;var w=Math.abs(100*b/c/c-50)/5;return u+=w*10,u}};return Sh=s,Sh}var wh,Jw;function Y9(){if(Jw)return wh;Jw=1;var i=H9(),e=V9(),n=K9(),r=Q9(),s=h_();function l(u,p){this.typeNumber=u,this.errorCorrectLevel=p,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var c=l.prototype;return c.addData=function(u){var p=new i(u);this.dataList.push(p),this.dataCache=null},c.isDark=function(u,p){if(u<0||this.moduleCount<=u||p<0||this.moduleCount<=p)throw new Error(u+","+p);return this.modules[u][p]},c.getModuleCount=function(){return this.moduleCount},c.make=function(){if(this.typeNumber<1){var u=1;for(u=1;u<40;u++){for(var p=e.getRSBlocks(u,this.errorCorrectLevel),f=new n,y=0,v=0;v<p.length;v++)y+=p[v].dataCount;for(var v=0;v<this.dataList.length;v++){var S=this.dataList[v];f.put(S.mode,4),f.put(S.getLength(),r.getLengthInBits(S.mode,u)),S.write(f)}if(f.getLengthInBits()<=y*8)break}this.typeNumber=u}this.makeImpl(!1,this.getBestMaskPattern())},c.makeImpl=function(u,p){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var f=0;f<this.moduleCount;f++){this.modules[f]=new Array(this.moduleCount);for(var y=0;y<this.moduleCount;y++)this.modules[f][y]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(u,p),this.typeNumber>=7&&this.setupTypeNumber(u),this.dataCache==null&&(this.dataCache=l.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,p)},c.setupPositionProbePattern=function(u,p){for(var f=-1;f<=7;f++)if(!(u+f<=-1||this.moduleCount<=u+f))for(var y=-1;y<=7;y++)p+y<=-1||this.moduleCount<=p+y||(0<=f&&f<=6&&(y==0||y==6)||0<=y&&y<=6&&(f==0||f==6)||2<=f&&f<=4&&2<=y&&y<=4?this.modules[u+f][p+y]=!0:this.modules[u+f][p+y]=!1)},c.getBestMaskPattern=function(){for(var u=0,p=0,f=0;f<8;f++){this.makeImpl(!0,f);var y=r.getLostPoint(this);(f==0||u>y)&&(u=y,p=f)}return p},c.createMovieClip=function(u,p,f){var y=u.createEmptyMovieClip(p,f),v=1;this.make();for(var S=0;S<this.modules.length;S++)for(var P=S*v,T=0;T<this.modules[S].length;T++){var b=T*v,w=this.modules[S][T];w&&(y.beginFill(0,100),y.moveTo(b,P),y.lineTo(b+v,P),y.lineTo(b+v,P+v),y.lineTo(b,P+v),y.endFill())}return y},c.setupTimingPattern=function(){for(var u=8;u<this.moduleCount-8;u++)this.modules[u][6]==null&&(this.modules[u][6]=u%2==0);for(var p=8;p<this.moduleCount-8;p++)this.modules[6][p]==null&&(this.modules[6][p]=p%2==0)},c.setupPositionAdjustPattern=function(){for(var u=r.getPatternPosition(this.typeNumber),p=0;p<u.length;p++)for(var f=0;f<u.length;f++){var y=u[p],v=u[f];if(this.modules[y][v]==null)for(var S=-2;S<=2;S++)for(var P=-2;P<=2;P++)S==-2||S==2||P==-2||P==2||S==0&&P==0?this.modules[y+S][v+P]=!0:this.modules[y+S][v+P]=!1}},c.setupTypeNumber=function(u){for(var p=r.getBCHTypeNumber(this.typeNumber),f=0;f<18;f++){var y=!u&&(p>>f&1)==1;this.modules[Math.floor(f/3)][f%3+this.moduleCount-8-3]=y}for(var f=0;f<18;f++){var y=!u&&(p>>f&1)==1;this.modules[f%3+this.moduleCount-8-3][Math.floor(f/3)]=y}},c.setupTypeInfo=function(u,p){for(var f=this.errorCorrectLevel<<3|p,y=r.getBCHTypeInfo(f),v=0;v<15;v++){var S=!u&&(y>>v&1)==1;v<6?this.modules[v][8]=S:v<8?this.modules[v+1][8]=S:this.modules[this.moduleCount-15+v][8]=S}for(var v=0;v<15;v++){var S=!u&&(y>>v&1)==1;v<8?this.modules[8][this.moduleCount-v-1]=S:v<9?this.modules[8][15-v-1+1]=S:this.modules[8][15-v-1]=S}this.modules[this.moduleCount-8][8]=!u},c.mapData=function(u,p){for(var f=-1,y=this.moduleCount-1,v=7,S=0,P=this.moduleCount-1;P>0;P-=2)for(P==6&&P--;;){for(var T=0;T<2;T++)if(this.modules[y][P-T]==null){var b=!1;S<u.length&&(b=(u[S]>>>v&1)==1);var w=r.getMask(p,y,P-T);w&&(b=!b),this.modules[y][P-T]=b,v--,v==-1&&(S++,v=7)}if(y+=f,y<0||this.moduleCount<=y){y-=f,f=-f;break}}},l.PAD0=236,l.PAD1=17,l.createData=function(u,p,f){for(var y=e.getRSBlocks(u,p),v=new n,S=0;S<f.length;S++){var P=f[S];v.put(P.mode,4),v.put(P.getLength(),r.getLengthInBits(P.mode,u)),P.write(v)}for(var T=0,S=0;S<y.length;S++)T+=y[S].dataCount;if(v.getLengthInBits()>T*8)throw new Error("code length overflow. ("+v.getLengthInBits()+">"+T*8+")");for(v.getLengthInBits()+4<=T*8&&v.put(0,4);v.getLengthInBits()%8!=0;)v.putBit(!1);for(;!(v.getLengthInBits()>=T*8||(v.put(l.PAD0,8),v.getLengthInBits()>=T*8));)v.put(l.PAD1,8);return l.createBytes(v,y)},l.createBytes=function(u,p){for(var f=0,y=0,v=0,S=new Array(p.length),P=new Array(p.length),T=0;T<p.length;T++){var b=p[T].dataCount,w=p[T].totalCount-b;y=Math.max(y,b),v=Math.max(v,w),S[T]=new Array(b);for(var x=0;x<S[T].length;x++)S[T][x]=255&u.buffer[x+f];f+=b;var O=r.getErrorCorrectPolynomial(w),N=new s(S[T],O.getLength()-1),M=N.mod(O);P[T]=new Array(O.getLength()-1);for(var x=0;x<P[T].length;x++){var F=x+M.getLength()-P[T].length;P[T][x]=F>=0?M.get(F):0}}for(var j=0,x=0;x<p.length;x++)j+=p[x].totalCount;for(var L=new Array(j),z=0,x=0;x<y;x++)for(var T=0;T<p.length;T++)x<S[T].length&&(L[z++]=S[T][x]);for(var x=0;x<v;x++)for(var T=0;T<p.length;T++)x<P[T].length&&(L[z++]=P[T][x]);return L},wh=l,wh}var za={},eC;function X9(){if(eC)return za;eC=1,Object.defineProperty(za,"__esModule",{value:!0});var i=Object.assign||function(f){for(var y=1;y<arguments.length;y++){var v=arguments[y];for(var S in v)Object.prototype.hasOwnProperty.call(v,S)&&(f[S]=v[S])}return f},e=Ah(),n=l(e),r=fs(),s=l(r);function l(f){return f&&f.__esModule?f:{default:f}}function c(f,y){var v={};for(var S in f)y.indexOf(S)>=0||Object.prototype.hasOwnProperty.call(f,S)&&(v[S]=f[S]);return v}var u={bgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,bgD:n.default.string.isRequired,fgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,fgD:n.default.string.isRequired,size:n.default.number.isRequired,title:n.default.string,viewBoxSize:n.default.number.isRequired,xmlns:n.default.string},p=(0,r.forwardRef)(function(f,y){var v=f.bgColor,S=f.bgD,P=f.fgD,T=f.fgColor,b=f.size,w=f.title,x=f.viewBoxSize,O=f.xmlns,N=O===void 0?"http://www.w3.org/2000/svg":O,M=c(f,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return s.default.createElement("svg",i({},M,{height:b,ref:y,viewBox:"0 0 "+x+" "+x,width:b,xmlns:N}),w?s.default.createElement("title",null,w):null,s.default.createElement("path",{d:S,fill:v}),s.default.createElement("path",{d:P,fill:T}))});return p.displayName="QRCodeSvg",p.propTypes=u,za.default=p,za}var tC;function Z9(){if(tC)return Gi;tC=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.QRCode=void 0;var i=Object.assign||function(b){for(var w=1;w<arguments.length;w++){var x=arguments[w];for(var O in x)Object.prototype.hasOwnProperty.call(x,O)&&(b[O]=x[O])}return b},e=Ah(),n=v(e),r=d_(),s=v(r),l=Y9(),c=v(l),u=fs(),p=v(u),f=X9(),y=v(f);function v(b){return b&&b.__esModule?b:{default:b}}function S(b,w){var x={};for(var O in b)w.indexOf(O)>=0||Object.prototype.hasOwnProperty.call(b,O)&&(x[O]=b[O]);return x}var P={bgColor:n.default.oneOfType([n.default.object,n.default.string]),fgColor:n.default.oneOfType([n.default.object,n.default.string]),level:n.default.string,size:n.default.number,value:n.default.string.isRequired},T=(0,u.forwardRef)(function(b,w){var x=b.bgColor,O=x===void 0?"#FFFFFF":x,N=b.fgColor,M=N===void 0?"#000000":N,F=b.level,j=F===void 0?"L":F,L=b.size,z=L===void 0?256:L,W=b.value,V=S(b,["bgColor","fgColor","level","size","value"]),H=new c.default(-1,s.default[j]);H.addData(W),H.make();var re=H.modules;return p.default.createElement(y.default,i({},V,{bgColor:O,bgD:re.map(function(ee,se){return ee.map(function(ae,he){return ae?"":"M "+he+" "+se+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:M,fgD:re.map(function(ee,se){return ee.map(function(ae,he){return ae?"M "+he+" "+se+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:w,size:z,viewBoxSize:re.length}))});return Gi.QRCode=T,T.displayName="QRCode",T.propTypes=P,Gi.default=T,Gi}var J9=Z9();const nC=Ye(J9),eH=i=>{const e=_s(),{isConnected:n}=i,{state:{devSchema:r,schema:s,launchOptions:l,selectedLaunchOption:c,debugMode:u,debugSetting:p,user:f},setShowManualBindIP:y,setSelectedLaunchOption:v,setDebugMode:S}=pn(),[P,T]=E.useState(!1),b=xg(f),w=!p.enableDomainCheck,x=u===qn.clientPreview,O=c?.pkgType==="independent"?D("independentPackage"):D("mainPackage"),N=c?.id==="normal"?D("normalLaunchMode"):c?.name||D("normalLaunchMode"),M=D(x?"clientPreviewMode":"browserDebugMode"),F=`${N} · ${O}${c?.scene?` · ${c.scene}`:""}`,j=[{key:"domain-check",label:D("homeSession.option.domainCheck"),status:D(w?"homeSession.status.off":"homeSession.status.on"),tone:w?"warn":"accent"},{key:"v-console",label:D("homeSession.option.vConsole"),status:p.enableVConsole?D("homeSession.status.on"):D("homeSession.status.off"),tone:p.enableVConsole?"accent":"neutral"},{key:"dev-panel",label:D("homeSession.option.devPanel"),status:p.enableDevInfoPanel?D("homeSession.status.on"):D("homeSession.status.off"),tone:p.enableDevInfoPanel?"accent":"neutral"}],L=E.useMemo(()=>{try{if(!r)return null;const H=new URL(r),re=(H.searchParams.get("host")||"").trim(),ee=H.searchParams.get("host_list")||"";let se=[];if(ee)try{const ue=JSON.parse(ee);se=Array.isArray(ue)?ue.filter(K=>typeof K=="string"):[]}catch{return null}const ae=ue=>{const K=ue.trim().toLowerCase();return!["","127.0.0.1","localhost","0.0.0.0","::","::1","undefined","null"].includes(K)};return ae(re)||Array.isArray(se)&&se.some(ae)?null:{host:re,hostList:se}}catch{return null}},[r]),z=H=>{H.status==="success"&&T(!1),H.status==="failed"&&T(!1),H.status==="start"&&T(!0)},W=H=>{S(H),z0(H)};E.useEffect(()=>(Ee.on("scanQRCode",z),()=>{Ee.off("scanQRCode",z)}),[]);const V=H=>{if(H==="created")v({...Ua,name:""}),e("/launch_mode");else{const re=l.find(ee=>ee.id===H);re&&v(re)}};return n?k.jsx("div",{className:"qr-code-container-connected",children:k.jsxs("div",{className:"qr-code-connected-content",children:[k.jsx("div",{className:"qr-code-tile qr-code-tile-connected",children:k.jsx(nC,{className:"qr-code-connected",size:150,value:s,bgColor:"transparent",fgColor:"#0e0f13"})}),k.jsxs("div",{className:"qr-code-connected-info",children:[k.jsx("div",{className:"qr-code-connected-desc-title",children:D("scanQRCodeChange")}),k.jsx("div",{className:"qr-code-connected-desc",children:D("scanQRCodeDesc")})]}),k.jsxs("div",{className:"qr-code-session-panel",children:[k.jsx("div",{className:"qr-code-session-header",children:k.jsx("span",{children:D("homeSession.title")})}),k.jsxs("div",{className:"qr-code-session-grid",children:[k.jsxs("div",{className:"qr-code-session-item",children:[k.jsx("span",{children:D("homeSession.modeLabel")}),k.jsx("strong",{children:M})]}),k.jsxs("div",{className:"qr-code-session-item",children:[k.jsx("span",{children:D("homeSession.entryLabel")}),k.jsx("strong",{children:F})]})]}),k.jsxs("div",{className:"qr-code-session-options",children:[k.jsx("div",{className:"qr-code-session-options-heading",children:k.jsx("span",{children:D("devOptions")})}),k.jsx("div",{className:"qr-code-session-option-list",children:j.map(H=>k.jsxs("div",{className:"qr-code-session-option",children:[k.jsx("span",{className:"qr-code-session-option-label",children:H.label}),k.jsx(B9,{tone:H.tone,size:"sm",children:H.status})]},H.key))})]})]})]})}):k.jsxs("div",{className:"qr-code-container-disconnected",children:[k.jsx("div",{className:"qr-code-select-container",children:k.jsx(Mr,{className:"qr-code-launch-select",value:c?.id,onChange:V,placeholder:D("selectLaunchMode"),style:{width:"216px"},optionList:l.map(H=>({label:H.id==="normal"?D("normalLaunchMode"):H.id==="created"?D("createdLaunchMode"):H.name,value:H.id}))})}),k.jsxs("div",{className:"qr-code-content",children:[L?k.jsxs("div",{className:"qr-code-network-hint",role:"status",children:[k.jsxs("div",{className:"qr-code-network-hint-main",children:[k.jsx("span",{className:"qr-code-network-hint-icon","aria-hidden":"true",children:k.jsx(Zh,{})}),k.jsxs("div",{className:"qr-code-network-hint-copy",children:[k.jsx(Qe.Text,{strong:!0,children:D("networkNoLanIPTitle")}),k.jsx(Qe.Text,{type:"tertiary",children:D("networkNoLanIPDesc")})]})]}),k.jsx(tt,{className:"qr-code-network-hint-action",size:"small",theme:"light",type:"tertiary",onClick:()=>y(!0),children:D("networkNoLanIPAction")})]}):null,L?null:k.jsxs("div",{className:"qr-code-schema",children:[k.jsx("div",{className:"qr-code-tile",children:k.jsx(nC,{size:256,value:r,bgColor:"transparent",fgColor:"#0e0f13"})}),k.jsxs(ug,{className:"qr-code-mode-switches",children:[k.jsx(tt,{className:`qr-code-mode-button ${u==="browserDebug"?"is-active":""}`,theme:"borderless",type:"tertiary",size:"small",onClick:()=>W("browserDebug"),children:D("browserDebugMode")}),k.jsx(tt,{className:`qr-code-mode-button ${u==="clientPreview"?"is-active":""}`,onClick:()=>W("clientPreview"),theme:"borderless",type:"tertiary",size:"small",children:D("clientPreviewMode")})]}),P&&k.jsxs("div",{className:"qr-code-spin",children:[k.jsx(Ar,{size:"large"}),k.jsx("div",{className:"qr-code-text",children:D("scanning")})]})]}),k.jsxs("div",{className:"qr-code-side-panel",children:[k.jsxs("div",{className:"qr-code-diagnostics-card",children:[k.jsx("div",{className:"qr-code-diagnostics-card-copy",children:k.jsx(Qe.Text,{children:D("netDiagEntryDesc")})}),k.jsx(tt,{className:"qr-code-diagnostics-entry",theme:"light",size:"small",onClick:()=>e("/network_diagnostics"),children:D("netDiagEntryAction")})]}),b?null:k.jsxs("div",{className:"qr-code-login-guide",children:[k.jsxs("div",{className:"qr-code-login-guide-copy",children:[k.jsx(Qe.Text,{strong:!0,children:D("basicDebugGuide.entryTitle")}),k.jsx(Qe.Text,{children:D("basicDebugGuide.entryDesc")})]}),k.jsx(tt,{theme:"light",onClick:()=>e("/basic_debug_guide"),children:D("basicDebugGuide.entryAction")})]})]})]})]})},tH=[{key:"domain-check",labelKey:"debugSettingDomainCheck",descriptionKey:"devOptionsDomainCheckDesc",getChecked:i=>!i.enableDomainCheck,getNextSetting:(i,e)=>({...i,enableDomainCheck:!e})},{key:"ad-mock",labelKey:"debugSettingAdMock",descriptionKey:"debugSettingAdMockDesc",getChecked:i=>i.enableAdMock,getNextSetting:(i,e)=>({...i,enableAdMock:e})},{key:"iap-mock",labelKey:"debugSettingIAPMock",descriptionKey:"debugSettingIAPMockDesc",getChecked:i=>i.enableIAPMock,getNextSetting:(i,e)=>({...i,enableIAPMock:e})},{key:"dev-info-panel",labelKey:"debugSettingDevInfoPanel",descriptionKey:"debugSettingEnableDevInfoPanelDesc",getChecked:i=>i.enableDevInfoPanel,getNextSetting:(i,e)=>({...i,enableDevInfoPanel:e})},{key:"vconsole",labelKey:"debugSettingVConsole",descriptionKey:"debugSettingEnableVconsoleDesc",isAvailable:i=>i!==qn.browserDebug,getChecked:i=>i.enableVConsole,getNextSetting:(i,e)=>({...i,enableVConsole:e})}];function nH({debugMode:i,debugSetting:e,onChange:n}){return tH.filter(r=>!r.isAvailable||r.isAvailable(i)).map(r=>({key:r.key,checked:r.getChecked(e),label:D(r.labelKey),description:D(r.descriptionKey),onChange:s=>n(r.getNextSetting(e,s))}))}const rH=()=>{const{state:{debugSetting:i,debugMode:e},setDebugSetting:n}=pn(),r=c=>{n(c)},s=()=>{Ps.send({method:"setDebugSettings",payload:i})};E.useEffect(()=>(Ee.on("connectionChange",s),()=>{Ee.off("connectionChange",s)}),[s]);const l=nH({debugMode:e,debugSetting:i,onChange:r});return k.jsx("div",{className:"debug-setting-card",children:k.jsxs(Sl,{style:{width:"100%"},children:[k.jsx("div",{className:"debug-setting-head",children:k.jsx(Qe.Text,{style:{fontWeight:"bold",fontSize:16},children:D("devOptions")})}),k.jsx("div",{className:"debug-setting-row",children:l.map(c=>k.jsxs("div",{className:"debug-setting-item",children:[k.jsxs("div",{className:"debug-setting-item-head",children:[k.jsx(wg,{className:"debug-setting-switch",checked:c.checked,onChange:c.onChange}),k.jsx(Qe.Text,{className:"debug-setting-item-title",children:c.label})]}),k.jsx(Qe.Text,{className:"debug-setting-item-desc",type:"tertiary",children:c.description})]},c.key))})]})})};function g_(){return{ip:Pe.get("clientHost")||localStorage.getItem("clientHost")||"",port:Pe.get("clientHttpPort")||localStorage.getItem("clientHttpPort")||"",wsPort:Pe.get("clientWsPort")||localStorage.getItem("clientWsPort")||""}}function tV(i=g_()){return!!(String(i.ip||"").trim()&&String(i.port||"").trim()&&String(i.wsPort||"").trim())}function iH(i){const{ip:e,port:n,wsPort:r}=i;Pe.setMultiple({clientHost:e,clientWsPort:r,clientHttpPort:n}),Hi.send({method:"manualConnect",payload:{clientHost:e,clientWsPort:r,clientHttpPort:n}}),Ps.init({clientWsPort:r,clientHost:e,clientHttpPort:n}),localStorage.setItem("clientHost",e),localStorage.setItem("clientWsPort",r),localStorage.setItem("clientHttpPort",n)}function rC(i){const e=String(i.ip||""),n=String(i.port||""),r=String(i.wsPort||"");Pe.setMultiple({clientHost:e,clientWsPort:r,clientHttpPort:n}),localStorage.setItem("clientHost",e),localStorage.setItem("clientWsPort",r),localStorage.setItem("clientHttpPort",n)}const m_=i=>{const{onClose:e,onSuccess:n,onValuesChange:r,onConnectResult:s,getFormApi:l,layout:c="default"}=i,[u,p]=E.useState(!1),[f,y]=E.useState({}),v=(L,z=3e3)=>new Promise(W=>{let V=!1;const H=setTimeout(()=>{if(!V){V=!0;try{re?.close()}catch{}W({ok:!1,message:D("connectivityTimeout")})}},z);let re=null;try{re=new WebSocket(L),re.onopen=()=>{if(!V){V=!0,clearTimeout(H);try{re?.close()}catch{}W({ok:!0,message:D("connectivityOK")})}},re.onerror=()=>{V||(V=!0,clearTimeout(H),W({ok:!1,message:D("connectivityFailed")}))}}catch{clearTimeout(H),W({ok:!1,message:D("connectivityFailed")})}}),S=async L=>{if(!j(L)){s?.({ok:!1,message:D("connectivityMissingParams")});return}p(!0),iH(L);const{ip:z,wsPort:W}=L,V=await v(`ws://${z}:${W}`);s?.(V),V.ok&&n?.(),p(!1)},P=E.useMemo(()=>g_(),[]),[T,b]=E.useState(P),w=E.useRef(P),x=E.useRef(null),O=E.useRef(null),N=E.useRef(null),M=L=>{const z={...w.current,...L};w.current=z,b(z),y(W=>({...W,...L.ip!==void 0?{ip:void 0}:{},...L.port!==void 0?{port:void 0}:{},...L.wsPort!==void 0?{wsPort:void 0}:{}})),r?.(z),rC(z)},F=()=>{const L=x.current?.querySelector("input")?.value,z=O.current?.querySelector("input")?.value,W=N.current?.querySelector("input")?.value,V={ip:String(L||""),port:String(z||""),wsPort:String(W||"")};(V.ip!==w.current.ip||V.port!==w.current.port||V.wsPort!==w.current.wsPort)&&M(V)};E.useEffect(()=>{w.current=P,b(P),r?.(P),rC(P)},[P]),E.useEffect(()=>{const L=[0,80,300,800].map(z=>window.setTimeout(()=>F(),z));return()=>{L.forEach(z=>window.clearTimeout(z))}},[]),E.useEffect(()=>{l?.({getValues:()=>w.current,submitForm:()=>S(w.current)})},[l]);const j=L=>{const z={};return String(L.ip||"").trim()||(z.ip=D("debug.guide.manualBindIPInvalid")),String(L.port||"").trim()||(z.port=D("invalidPort")),String(L.wsPort||"").trim()||(z.wsPort=D("invalidPort")),y(z),Object.keys(z).length===0};return k.jsxs("div",{className:`manual-connection-form manual-connection-form-${c}`,children:[c==="default"?k.jsx("div",{className:"manual-connection-tip",children:D("manualConnectDialogDesc")}):null,k.jsxs("div",{className:"manual-connection-grid",children:[k.jsxs("div",{className:"manual-connection-field",children:[k.jsxs("div",{className:"manual-connection-label",children:[k.jsx(Qe.Text,{strong:!0,children:"Client IP "}),k.jsx(Qe.Text,{type:"danger",children:"*"})]}),k.jsx("div",{ref:x,children:k.jsx(ss,{value:T.ip,onChange:L=>M({ip:String(L||"")}),onBlur:F,placeholder:"192.168.x.x"})}),f.ip?k.jsx(Qe.Text,{type:"danger",children:f.ip}):null]}),k.jsxs("div",{className:"manual-connection-field",children:[k.jsxs("div",{className:"manual-connection-label",children:[k.jsx(Qe.Text,{strong:!0,children:"Port 1(HTTP 端口) "}),k.jsx(Qe.Text,{type:"danger",children:"*"})]}),k.jsx("div",{ref:O,children:k.jsx(ss,{value:T.port,onChange:L=>M({port:String(L||"")}),onBlur:F,placeholder:"3000"})}),f.port?k.jsx(Qe.Text,{type:"danger",children:f.port}):null]}),k.jsxs("div",{className:"manual-connection-field",children:[k.jsxs("div",{className:"manual-connection-label",children:[k.jsx(Qe.Text,{strong:!0,children:"Port 2(WS 端口) "}),k.jsx(Qe.Text,{type:"danger",children:"*"})]}),k.jsx("div",{ref:N,children:k.jsx(ss,{value:T.wsPort,onChange:L=>M({wsPort:String(L||"")}),onBlur:F,placeholder:"2999"})}),f.wsPort?k.jsx(Qe.Text,{type:"danger",children:f.wsPort}):null]})]}),e?k.jsxs("div",{className:"manual-connection-footer",children:[k.jsx(tt,{type:"tertiary",onClick:()=>e(),disabled:u,children:D("cancel")}),k.jsx(tt,{type:"primary",theme:"solid",onClick:()=>S(w.current),loading:u,children:D("manualConnectConfirm")})]}):null]})},oH=()=>{const{state:{showManualBindIP:i},setShowManualBindIP:e}=pn();return k.jsx($t,{className:"manual-connection-modal",width:520,title:D("manualBindClientDebugServiceTitle"),visible:i,showCancel:!1,onCancel:()=>e(!1),showOk:!1,footer:null,children:k.jsx(m_,{onClose:()=>e(!1),onSuccess:()=>e(!1)})})},sH=()=>{const{state:{isConnected:i,message:e}}=E.useContext(Cg),n=e?.intent==="uploading",r=Math.max(0,Math.min(100,Math.round((e?.progress??0)*100))),s=!!e?.title;return k.jsxs("div",{"data-doc-shot":"start-debug-qr-idle",className:`home-container ${i?"home-container-connected":""}`,children:[k.jsx(q9,{title:D(i?"homeHeroTitleConnected":"homeHeroTitle"),subtitle:D(i?"homeHeroSubtitleConnected":"homeHeroSubtitle")}),k.jsxs("div",{className:Q("home-status-banner",`home-status-banner-${e?.type??"info"}`,{"home-status-banner-uploading":n}),"aria-live":"polite",children:[k.jsx("span",{className:"home-status-dot"}),k.jsxs("div",{className:"home-status-copy",children:[e?.title?k.jsx("div",{className:"home-status-title",children:e.title}):null,e?.desc?k.jsx("div",{className:Q("home-status-desc",{"home-status-desc-standalone":!s}),children:e.desc}):null]}),n?k.jsxs("div",{className:"home-status-progress-value",children:[r,"%"]}):null,n?k.jsx("div",{className:"home-status-progress-track",children:k.jsx("span",{className:"home-status-progress-fill",style:{width:`${r}%`}})}):null]}),k.jsx(eH,{isConnected:i}),!i&&k.jsx(rH,{})]})},aH="https://bytedance.larkoffice.com/wiki/WvifwWjGri7bTzkPbqKcqVi5ntc";function lH(i){try{return i?(new URL(i).searchParams.get("port")||"").trim():""}catch{return""}}function cH(i,e){return i?i.ok?"success":i.code==="status"?"warning":"error":e?"running":"idle"}function uH(i){return D(i==="success"?"connectivityOK":i==="warning"?"netDiagStatusWarning":i==="error"?"connectivityNotOK":i==="running"?"netDiagStatusRunning":"netDiagStatusIdle")}function dH(i,e){return i?i.ok?D("netDiagCheckReachableDetail"):i.msg||D("connectivityFailed"):D(e?"netDiagCheckRunningDetail":"netDiagCheckIdleDetail")}function pH({hasChecked:i,running:e,nodeHttp:n,nodeWs:r,clientHttp:s,clientWs:l,hasClientEndpoint:c}){return e?{kind:"running",title:D("netDiagSummaryRunningTitle"),desc:D("netDiagSummaryRunningDesc"),suggestions:[D("netDiagSummaryRunningHint")]}:i?c?n&&!n.ok?{kind:"node-service",title:D("netDiagSummaryNodeTitle"),desc:D("netDiagSummaryNodeDesc"),suggestions:[D("netDiagSuggestNodeDesc"),D("netDiagSuggestNodeRestart")]}:r&&!r.ok?{kind:"node-service",title:D("netDiagSummaryNodeTitle"),desc:D("netDiagSummaryNodeWsDesc"),suggestions:[D("netDiagSuggestNodeDesc")]}:s?.ok&&l&&!l.ok?{kind:"client-ws-failed",title:D("netDiagSummaryClientWsTitle"),desc:D("netDiagSummaryClientWsDesc"),suggestions:[D("netDiagSuggestClientDebugService"),D("netDiagSuggestWsBlocked"),D("netDiagSuggestPhoneProxyFallback")]}:s&&!s.ok&&l&&!l.ok?{kind:"client-both-failed",title:D("netDiagSummaryClientBothTitle"),desc:D("netDiagSummaryClientBothDesc"),suggestions:[D("netDiagSuggestClientDebugService"),D("netDiagSuggestLanAndProxy"),D("netDiagSuggestPhoneProxyFallback")]}:n?.ok&&r?.ok&&s?.ok&&l?.ok?{kind:"healthy",title:D("netDiagSummaryHealthyTitle"),desc:D("netDiagSummaryHealthyDesc"),suggestions:[D("netDiagSuggestOkDesc")]}:{kind:"partial",title:D("netDiagSummaryPartialTitle"),desc:D("netDiagSummaryPartialDesc"),suggestions:[D("netDiagSummaryPartialHint")]}:{kind:"missing-client",title:D("netDiagSummaryMissingClientTitle"),desc:D("netDiagSummaryMissingClientDesc"),suggestions:[D("netDiagSuggestNoClientDesc")]}:c?{kind:"idle",title:D("netDiagSummaryIdleTitle"),desc:D("netDiagSummaryIdleDesc"),suggestions:[D("netDiagSummaryIdleHint")]}:{kind:"missing-client",title:D("netDiagSummaryMissingClientTitle"),desc:D("netDiagSummaryMissingClientDesc"),suggestions:[D("netDiagSuggestNoClientDesc")]}}const iC=(i,e=3e3)=>new Promise(n=>{let r=!1;const s=setTimeout(()=>{if(!r){r=!0;try{l?.close()}catch{}n({ok:!1,code:"timeout",msg:D("connectivityTimeout")})}},e);let l=null;try{l=new WebSocket(i),l.onopen=()=>{if(!r){r=!0,clearTimeout(s);try{l?.close()}catch{}n({ok:!0,code:"ok"})}},l.onerror=()=>{r||(r=!0,clearTimeout(s),n({ok:!1,code:"error",msg:D("connectivityFailed")}))}}catch{clearTimeout(s),n({ok:!1,code:"error",msg:D("connectivityFailed")})}}),oC=async i=>{try{const e=new AbortController,n=setTimeout(()=>e.abort(),3e3),r=await fetch(i,{method:"GET",cache:"no-store",signal:e.signal});return clearTimeout(n),r.ok?{ok:!0,code:"ok"}:{ok:!1,code:"status",msg:`${r.status} ${r.statusText}`}}catch(e){return e instanceof DOMException&&e.name==="AbortError"?{ok:!1,code:"timeout",msg:D("connectivityTimeout")}:{ok:!1,code:"error",msg:D("connectivityFailed")}}},fH=()=>{const i=_s(),{state:{devSchema:e,schema:n}}=pn(),r=E.useRef(0),[s,l]=E.useState(!1),[c,u]=E.useState(!1),[p,f]=E.useState(!0),[y,v]=E.useState(!1),[S,P]=E.useState(!1),[T,b]=E.useState(),[w,x]=E.useState(),[O,N]=E.useState(),[M,F]=E.useState(),[j,L]=E.useState(!1),[z,W]=E.useState(null),[V,H]=E.useState(()=>({ip:String(Pe.get("clientHost")||localStorage.getItem("clientHost")||""),port:String(Pe.get("clientHttpPort")||localStorage.getItem("clientHttpPort")||""),wsPort:String(Pe.get("clientWsPort")||localStorage.getItem("clientWsPort")||"")})),re=E.useMemo(()=>({ip:String(V.ip||""),port:String(V.port||""),wsPort:String(V.wsPort||"")}),[V]),ee=E.useCallback(ne=>{H(ne)},[]),se=E.useMemo(()=>{const{nodeWsPort:ne,clientHost:ie,clientHttpPort:_e,clientWsPort:ye}=Pe.getMultiple(["nodeWsPort","clientHost","clientHttpPort","clientWsPort"]);let ve="";try{n&&(ve=(new URL(n).searchParams.get("host")||"").trim())}catch{}return{schemaHost:ve,httpPort:lH(n),nodeWsPort:ne,clientHost:ie,clientHttpPort:_e,clientWsPort:ye}},[e,n]),ae=String(re.ip||se.clientHost||"").trim(),he=String(re.port||se.clientHttpPort||"").trim(),ue=String(re.wsPort||se.clientWsPort||"").trim(),K=E.useCallback(async()=>{L(!0),l(!0),b(void 0),x(void 0),N(void 0),F(void 0);const ne=await oC("/game/config");b(ne);const ie=se.nodeWsPort;x(ie?await iC(`ws://localhost:${ie}`):{ok:!1,code:"error",msg:D("connectivityMissingParams")}),N(ae&&he?await oC(`http://${ae}:${he}/game/scripts/krypton.js`):{ok:!1,code:"error",msg:D("netDiagMissingClientHttp")}),F(ae&&ue?await iC(`ws://${ae}:${ue}`):{ok:!1,code:"error",msg:D("netDiagMissingClientWs")}),P(!0),l(!1)},[se.nodeWsPort,ae,he,ue]);E.useEffect(()=>{K()},[K]);const Z=E.useMemo(()=>[{key:"node-http",title:D("netDiagCheckNodeHttp"),target:"/game/config",item:T},{key:"node-ws",title:D("netDiagCheckNodeWs"),target:se.nodeWsPort?`ws://localhost:${se.nodeWsPort}`:"-",item:w},{key:"client-http",title:D("netDiagCheckClientHttp"),target:ae&&he?`http://${ae}:${he}`:"-",item:O},{key:"client-ws",title:D("netDiagCheckClientWs"),target:ae&&ue?`ws://${ae}:${ue}`:"-",item:M}],[O,M,se.nodeWsPort,T,w,ae,he,ue]),I=E.useMemo(()=>pH({hasChecked:j,running:s,nodeHttp:T,nodeWs:w,clientHttp:O,clientWs:M,hasClientEndpoint:!!(ae&&he&&ue)}),[O,M,j,T,w,ae,he,ue,s]),U=I.suggestions,oe=E.useCallback(()=>{r.current=window.scrollY,W(null),v(!0)},[]);return E.useEffect(()=>{if(!y)return;const ne=()=>{window.scrollTo({top:r.current,left:0})},ie=window.requestAnimationFrame(ne),_e=window.setTimeout(ne,80);return()=>{window.cancelAnimationFrame(ie),window.clearTimeout(_e)}},[y]),k.jsxs("div",{className:"check-network-container",children:[k.jsxs("div",{className:"check-network-hero",children:[k.jsx("div",{className:"check-network-back",children:k.jsxs("button",{type:"button",className:"check-network-back-link",onClick:()=>i("/"),children:[k.jsx(P9,{size:14,strokeWidth:2}),k.jsx("span",{children:D("back")})]})}),k.jsx("div",{className:"check-network-hero-head",children:k.jsxs("div",{className:"check-network-hero-copy",children:[k.jsx("div",{className:"check-network-hero-title",children:D("netDiagTitle")}),k.jsx("div",{className:"check-network-hero-subtitle",children:D("netDiagSubtitle")})]})})]}),k.jsxs("section",{className:`check-network-section check-network-summary-result check-network-summary-result-${I.kind}`,children:[k.jsxs("div",{className:"check-network-section-headline",children:[k.jsx("div",{children:k.jsxs("div",{className:"check-network-title-row",children:[k.jsx("div",{className:"check-network-section-title",children:D("netDiagSummaryTitle")}),k.jsx(u_,{className:"check-network-title-link",href:aH,children:D("netDiagOpenTroubleshoot")})]})}),k.jsx(tt,{className:"check-network-section-toggle",theme:"borderless",onClick:()=>f(ne=>!ne),children:D(p?"netDiagCollapse":"netDiagExpand")})]}),p?k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"check-network-summary-main",children:[k.jsx("div",{className:"check-network-summary-eyebrow",children:D("netDiagGuideEyebrow")}),k.jsx("div",{className:"check-network-summary-result-title",children:I.title}),k.jsx("div",{className:"check-network-summary-result-desc",children:I.desc})]}),k.jsxs("div",{className:"check-network-guide-panel",children:[k.jsx("div",{className:"check-network-guide-label",children:D("netDiagGuideStepsTitle")}),k.jsx("div",{className:"check-network-suggestion-list",children:U.map((ne,ie)=>k.jsxs("div",{className:"check-network-suggestion-item",children:[k.jsx("span",{className:"check-network-suggestion-index",children:ie+1}),k.jsx("span",{className:"check-network-suggestion-text",children:ne})]},`${ne}_${ie}`))})]})]}):null]}),k.jsxs("section",{className:"check-network-section check-network-manual-entry",children:[k.jsxs("div",{className:"check-network-section-headline",children:[k.jsxs("div",{children:[k.jsx("div",{className:"check-network-section-title",children:D("netDiagManualBindEntry")}),k.jsx("div",{className:"check-network-suggest-desc",children:D("netDiagManualSectionDesc")})]}),k.jsxs("div",{className:"check-network-manual-entry-actions",children:[k.jsx(tt,{className:"check-network-recheck-action",theme:"borderless",loading:s,onClick:()=>{K()},children:D("netDiagRunAll")}),k.jsx(tt,{className:"check-network-next-step-action",theme:"solid",type:"primary",onClick:oe,children:D("netDiagActionManualConnect")})]})]}),z?k.jsx("div",{className:`check-network-inline-result ${z.ok?"success":"error"}`,children:z.ok?D("netDiagManualConnectResultSuccess"):`${D("netDiagManualConnectResultError")} ${z.message}`}):null]}),k.jsxs("section",{className:"check-network-section check-network-env-section",children:[k.jsxs("div",{className:"check-network-section-headline",children:[k.jsxs("div",{children:[k.jsx("div",{className:"check-network-section-title",children:D("netDiagEnvTitle")}),k.jsx("div",{className:"check-network-suggest-desc",children:D("netDiagEnvSectionDesc")})]}),k.jsx(tt,{className:"check-network-section-toggle",theme:"borderless",onClick:()=>u(ne=>!ne),children:D(c?"netDiagCollapse":"netDiagExpand")})]}),c?k.jsxs("div",{className:"check-network-summary-grid",children:[k.jsxs("div",{className:"check-network-summary-card",children:[k.jsx("div",{className:"check-network-summary-title",children:D("netDiagComputerGroup")}),k.jsxs("div",{className:"check-network-kv",children:[k.jsx("span",{children:D("netDiagEnvIP")}),k.jsx("span",{children:se.schemaHost||"-"})]}),k.jsxs("div",{className:"check-network-kv",children:[k.jsx("span",{children:D("netDiagEnvWsPort")}),k.jsx("span",{children:se.nodeWsPort||"-"})]}),k.jsxs("div",{className:"check-network-kv",children:[k.jsx("span",{children:D("netDiagEnvHttpPort")}),k.jsx("span",{children:se.httpPort||"-"})]})]}),k.jsxs("div",{className:"check-network-summary-card",children:[k.jsx("div",{className:"check-network-summary-title",children:D("netDiagClientGroup")}),k.jsxs("div",{className:"check-network-kv",children:[k.jsx("span",{children:"IP"}),k.jsx("span",{children:ae||"-"})]}),k.jsxs("div",{className:"check-network-kv",children:[k.jsx("span",{children:D("netDiagEnvWsPort")}),k.jsx("span",{children:ue||"-"})]}),k.jsxs("div",{className:"check-network-kv",children:[k.jsx("span",{children:D("netDiagEnvHttpPort")}),k.jsx("span",{children:he||"-"})]})]})]}):null]}),k.jsxs("section",{className:"check-network-section check-network-check-section",children:[k.jsxs("div",{className:"check-network-section-headline",children:[k.jsxs("div",{children:[k.jsx("div",{className:"check-network-section-title",children:D("netDiagChecksTitle")}),k.jsx("div",{className:"check-network-suggest-desc",children:D("netDiagCheckSectionDesc")})]}),k.jsx(tt,{className:"check-network-section-toggle",theme:"borderless",onClick:()=>P(ne=>!ne),children:D(S?"netDiagCollapse":"netDiagExpand")})]}),S?k.jsx("div",{className:"check-network-checks",children:Z.map(ne=>{const ie=cH(ne.item,s&&j);return k.jsxs("div",{className:`check-network-check-card check-network-check-${ie}`,children:[k.jsxs("div",{className:"check-network-check-main",children:[k.jsxs("div",{className:"check-network-check-title-row",children:[k.jsx("span",{className:"check-network-check-dot"}),k.jsx("span",{className:"check-network-check-title",children:ne.title})]}),k.jsxs("div",{className:"check-network-check-meta",children:[k.jsx("span",{className:"check-network-check-target",children:ne.target}),k.jsx("span",{className:"check-network-check-detail",children:dH(ne.item,s&&j)})]})]}),k.jsx("span",{className:`check-network-check-badge check-network-check-badge-${ie}`,children:uH(ie)})]},ne.key)})}):null]}),k.jsxs($t,{className:"manual-connection-modal check-network-manual-modal",width:560,title:D("manualBindClientDebugServiceTitle"),visible:y,showCancel:!1,showOk:!1,footer:null,onCancel:()=>v(!1),children:[k.jsx(m_,{onClose:()=>v(!1),onSuccess:()=>v(!1),onValuesChange:ee,onConnectResult:ne=>{W(ne),K()}}),z&&!z.ok?k.jsx("div",{className:"check-network-inline-result error",children:`${D("netDiagManualConnectResultError")} ${z.message}`}):null]})]})},hH=E.lazy(()=>lt(()=>import("./index-Q0GC8Irj.js"),__vite__mapDeps([22,23,24,25,26,27,28,29])).then(i=>({default:i.ProjectDetail}))),gH=E.lazy(()=>lt(()=>import("./index-CLKKui8G.js"),__vite__mapDeps([30,10,11])).then(i=>({default:i.DebugSetting}))),mH=E.lazy(()=>lt(()=>import("./index-DDy4PkWT.js"),__vite__mapDeps([31,32,33,7,8,9,10,11,12,34])).then(i=>({default:i.LaunchMode}))),yH=E.lazy(()=>lt(()=>import("./index-BY3eQmfP.js"),__vite__mapDeps([35,26,27,7,8,9,10,11,12,25,36])).then(i=>({default:i.CheckCode}))),vH=E.lazy(()=>lt(()=>import("./index-rLkONFpx.js"),__vite__mapDeps([37,26,27,38])).then(i=>({default:i.BasicDebugGuide}))),bH=E.lazy(()=>lt(()=>import("./index-M8jf-YAZ.js"),__vite__mapDeps([39,26,27,23,24,40,41])).then(i=>({default:i.ChangeLog}))),SH=E.lazy(()=>lt(()=>import("./index-Cb4Ja0tZ.js"),__vite__mapDeps([42,23,43,24,44,45,46,19])).then(i=>({default:i.IntegrationAssistant}))),wH=E.lazy(()=>lt(()=>import("./Detail-CELZZ-4h.js"),__vite__mapDeps([47,48,49,23,24,26,27,32,33,7,8,9,10,11,12,44,45,50,40])).then(i=>({default:i.IntegrationAssistantDetail}))),CH=E.lazy(()=>lt(()=>import("./MonetizationMode-C7DNqium.js"),__vite__mapDeps([51,48,49,23,24,43,44,45,46,19])).then(i=>({default:i.IntegrationAssistantMonetizationMode}))),_H=E.lazy(()=>lt(()=>import("./index-BLWgpW64.js"),__vite__mapDeps([52,53])).then(i=>({default:i.ManualConnect}))),kH=E.lazy(()=>lt(()=>import("./index-mjEeEQcC.js"),__vite__mapDeps([54,23,24,55,8,9,56,7,10,11,12,50,40,57,17])).then(i=>({default:i.WasmCodeSplit}))),PH=E.lazy(()=>lt(()=>import("./index-BwrZjkCc.js"),__vite__mapDeps([58,24,20,46,59])).then(i=>({default:i.Performance}))),TH=E.lazy(()=>lt(()=>import("./index-CgXOkYrX.js"),__vite__mapDeps([60,23,24,55,8,9,56,28,61])).then(i=>({default:i.SubpackageCollect}))),EH=()=>k.jsx("div",{className:"routes-container",children:k.jsx(E.Suspense,{fallback:k.jsx(l_,{}),children:k.jsxs(cU,{children:[k.jsx(st,{path:"/",element:k.jsx(sH,{})}),k.jsx(st,{path:"/integration_assistant",element:k.jsx(SH,{})}),k.jsx(st,{path:"/integration_assistant/mode/:modeKey",element:k.jsx(CH,{})}),k.jsx(st,{path:"/integration_assistant/:capabilityKey",element:k.jsx(wH,{})}),k.jsx(st,{path:"/project_overview",element:k.jsx(hH,{})}),k.jsx(st,{path:"/project_detail",element:k.jsx(uh,{to:"/project_overview",replace:!0})}),k.jsx(st,{path:"/basic_debug_guide",element:k.jsx(vH,{})}),k.jsx(st,{path:"/debug_setting",element:k.jsx(gH,{})}),k.jsx(st,{path:"/launch_mode",element:k.jsx(mH,{})}),k.jsx(st,{path:"/upload_publish",element:k.jsx(yH,{})}),k.jsx(st,{path:"/version_upload",element:k.jsx(uh,{to:"/upload_publish",replace:!0})}),k.jsx(st,{path:"/precheck_code",element:k.jsx(uh,{to:"/upload_publish",replace:!0})}),k.jsx(st,{path:"/network_diagnostics",element:k.jsx(fH,{})}),k.jsx(st,{path:"/manual_connect",element:k.jsx(_H,{})}),k.jsx(st,{path:"/changelog",element:k.jsx(bH,{})}),k.jsx(st,{path:"/wasm_split",element:k.jsx(kH,{})}),k.jsx(st,{path:"/performance",element:k.jsx(PH,{})}),k.jsx(st,{path:"/subpackage_collect",element:k.jsx(TH,{})})]})})});function xH(){const{state:{loading:i,error:e,user:n}}=pn(),{topErrorItems:r,updateGameDetailTopErrors:s,updateConfigTopErrors:l,updateGameDetailAccessErrors:c}=r9(),{fetchGameDetail:u}=a9({onSuccess:s,updateGameDetailAccessErrors:c}),{isServerError:p,serverErrorMsg:f}=l9({fetchGameDetail:u,updateConfigTopErrors:l}),y=Pl();return c9({onResourceChange:u}),E.useEffect(()=>{const v=async S=>{if(S.status!=="update_wasm_split_config_done")return;const P=await Ki({url:"/game/config",method:"GET"});P.error||l({currentUser:n,checkResult:P.data?.checkResult})};return Ee.on("unitySplitStatus",v),()=>{Ee.off("unitySplitStatus",v)}},[l,n]),p&&!i.visible?k.jsxs("div",{className:"server-error-container",children:[k.jsx(KU,{}),k.jsx("div",{className:"server-error-text",children:f})]}):k.jsxs(NU,{children:[k.jsx(G9,{items:r,fallbackErrorText:e.text}),k.jsx($9,{enabled:!y&&!i.visible&&!p}),k.jsx(U9,{}),k.jsx(oH,{}),k.jsxs("div",{className:"main-layout",children:[k.jsx(M9,{}),k.jsxs("div",{className:"content-wrapper",children:[k.jsx(z9,{}),k.jsx(EH,{})]})]}),k.jsx(l_,{})]})}cW();vP.createRoot(document.getElementById("root")).render(k.jsx(fg,{children:k.jsx(pW,{children:k.jsx(xH,{})})}));export{Nr as $,P9 as A,tt as B,Sl as C,u_ as D,Xh as E,Kt as F,hi as G,Bn as H,aD as I,g as J,or as K,Lr as L,me as M,Wa as N,Yh as O,q9 as P,nC as Q,_ as R,Ss as S,Qe as T,jr as U,yi as V,Qh as W,ZH as X,JH as Y,m_ as Z,Te as _,un as a,ST as a$,Mn as a0,Ka as a1,Jn as a2,us as a3,ah as a4,rr as a5,Ee as a6,ug as a7,Pl as a8,Pg as a9,Cx as aA,wx as aB,Ch as aC,ZS as aD,kx as aE,zf as aF,Wo as aG,Uo as aH,Sx as aI,_h as aJ,JS as aK,dT as aL,at as aM,os as aN,Or as aO,lg as aP,di as aQ,cs as aR,_n as aS,ZC as aT,ss as aU,dE as aV,nT as aW,Nh as aX,fl as aY,IO as aZ,Yi as a_,g_ as aa,tV as ab,iH as ac,$t as ad,Lh as ae,sr as af,Xt as ag,TG as ah,Wi as ai,NH as aj,jH as ak,Ir as al,FH as am,MH as an,ml as ao,$H as ap,RH as aq,AH as ar,LH as as,UC as at,oi as au,tr as av,Ye as aw,rT as ax,dn as ay,Kh as az,B9 as b,Db as b$,Bh as b0,Xi as b1,GT as b2,cl as b3,jO as b4,vE as b5,EC as b6,wC as b7,cC as b8,YE as b9,VP as bA,QP as bB,yC as bC,zC as bD,KC as bE,$r as bF,Tn as bG,dl as bH,qh as bI,OT as bJ,gl as bK,vl as bL,Ya as bM,er as bN,RT as bO,qE as bP,Mh as bQ,NE as bR,YP as bS,_P as bT,xO as bU,zE as bV,fE as bW,BT as bX,ai as bY,IH as bZ,HE as b_,sl as ba,ul as bb,Yt as bc,Gh as bd,SC as be,jh as bf,SE as bg,el as bh,Wh as bi,tE as bj,bP as bk,DE as bl,AC as bm,RO as bn,NO as bo,MC as bp,Zn as bq,bT as br,WH as bs,eg as bt,WO as bu,fT as bv,hl as bw,rg as bx,WC as by,gE as bz,Dl as c,CC as c0,BD as c1,GD as c2,Ui as c3,LD as c4,VH as c5,KP as c6,tD as c7,tx as c8,Xa as c9,lI as ca,SD as cb,qH as cc,wg as cd,BH as ce,GH as cf,Vi as cg,Ki as d,Ar as e,iW as f,Dg as g,_s as h,D as i,k as j,xg as k,Zh as l,HC as m,Mr as n,Eh as o,zn as p,eV as q,E as r,YG as s,Oe as t,pn as u,XH as v,Ft as w,yw as x,_t as y,Q as z};
|