@raydiculousx/ts-sdk 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +55 -0
  3. package/NOTICE +14 -0
  4. package/README.md +91 -3
  5. package/dist/THIRD_PARTY_NOTICES.txt +466 -0
  6. package/dist/host/src/bootstrap/client.d.ts +37 -0
  7. package/dist/host/src/bootstrap/client.js +215 -0
  8. package/dist/host/src/bootstrap/host.d.ts +79 -0
  9. package/dist/host/src/bootstrap/host.js +214 -0
  10. package/dist/host/src/bootstrap/protocol.d.ts +20 -0
  11. package/dist/host/src/bootstrap/protocol.js +72 -0
  12. package/dist/host/src/dev.d.ts +30 -0
  13. package/dist/host/src/dev.js +20 -0
  14. package/dist/host/src/entry/app.d.ts +10 -0
  15. package/dist/host/src/entry/app.js +9 -0
  16. package/dist/host/src/entry/auto.d.ts +16 -0
  17. package/dist/host/src/entry/auto.js +18747 -0
  18. package/dist/host/src/standalone/account-api.d.ts +32 -0
  19. package/dist/host/src/standalone/account-api.js +176 -0
  20. package/dist/host/src/standalone/connection-slot.d.ts +12 -0
  21. package/dist/host/src/standalone/connection-slot.js +28 -0
  22. package/dist/host/src/standalone/device-picker.d.ts +6 -0
  23. package/dist/host/src/standalone/device-picker.js +19 -0
  24. package/dist/host/src/standalone/locale.d.ts +4 -0
  25. package/dist/host/src/standalone/locale.js +35 -0
  26. package/dist/host/src/standalone/mount-host.d.ts +155 -0
  27. package/dist/host/src/standalone/mount-host.js +396 -0
  28. package/dist/host/src/standalone/mount-surface.d.ts +12 -0
  29. package/dist/host/src/standalone/mount-surface.js +69 -0
  30. package/dist/host/src/standalone/robot-setup.d.ts +61 -0
  31. package/dist/host/src/standalone/robot-setup.js +160 -0
  32. package/dist/lib/client/action-ownership.d.ts +31 -0
  33. package/dist/lib/client/action-ownership.js +182 -0
  34. package/dist/lib/client/direct.d.ts +149 -0
  35. package/dist/lib/client/direct.js +560 -0
  36. package/dist/lib/client/raydiculousx.d.ts +541 -0
  37. package/dist/lib/client/raydiculousx.js +694 -0
  38. package/dist/lib/client/runtime.d.ts +165 -0
  39. package/dist/lib/client/runtime.js +1 -0
  40. package/dist/lib/core/index.d.ts +16 -0
  41. package/dist/lib/core/index.js +9 -0
  42. package/dist/lib/core/rpc/command-channel.d.ts +345 -0
  43. package/dist/lib/core/rpc/command-channel.js +697 -0
  44. package/dist/lib/core/rpc/commands.d.ts +354 -0
  45. package/dist/lib/core/rpc/commands.js +134 -0
  46. package/dist/lib/core/rpc/request-policy.d.ts +29 -0
  47. package/dist/lib/core/rpc/request-policy.js +35 -0
  48. package/dist/lib/core/rpc/robot-api.d.ts +184 -0
  49. package/dist/lib/core/rpc/robot-api.js +34 -0
  50. package/dist/lib/core/signaling/ice-servers.d.ts +10 -0
  51. package/dist/lib/core/signaling/ice-servers.js +58 -0
  52. package/dist/lib/core/signaling/peer-negotiator.d.ts +164 -0
  53. package/dist/lib/core/signaling/peer-negotiator.js +366 -0
  54. package/dist/lib/core/signaling/signaling-client.d.ts +204 -0
  55. package/dist/lib/core/signaling/signaling-client.js +473 -0
  56. package/dist/lib/core/signaling/signaling-contract.d.ts +164 -0
  57. package/dist/lib/core/signaling/signaling-contract.js +35 -0
  58. package/dist/lib/core/signaling/signaling.d.ts +172 -0
  59. package/dist/lib/core/signaling/signaling.js +381 -0
  60. package/dist/lib/media/attach-video.d.ts +3 -0
  61. package/dist/lib/media/attach-video.js +243 -0
  62. package/dist/lib/media/direct-audio.d.ts +36 -0
  63. package/dist/lib/media/direct-audio.js +94 -0
  64. package/dist/lib/media/index.d.ts +5 -0
  65. package/dist/lib/media/index.js +3 -0
  66. package/dist/lib/media/pcm-types.d.ts +33 -0
  67. package/dist/lib/media/pcm-types.js +1 -0
  68. package/dist/lib/media/robot-audio.d.ts +64 -0
  69. package/dist/lib/media/robot-audio.js +82 -0
  70. package/dist/lib/media/robot-pcm-output.d.ts +16 -0
  71. package/dist/lib/media/robot-pcm-output.js +101 -0
  72. package/dist/lib/robot/action-upload.d.ts +32 -0
  73. package/dist/lib/robot/action-upload.js +143 -0
  74. package/dist/lib/robot/robot-commands.d.ts +148 -0
  75. package/dist/lib/robot/robot-commands.js +164 -0
  76. package/dist/lib/robot/robot-responses.d.ts +42 -0
  77. package/dist/lib/robot/robot-responses.js +226 -0
  78. package/dist/lib/robot/robot-tof.d.ts +61 -0
  79. package/dist/lib/robot/robot-tof.js +25 -0
  80. package/dist/lib/robot/robot-types.d.ts +293 -0
  81. package/dist/lib/robot/robot-types.js +17 -0
  82. package/dist/lib/shared/errors.d.ts +57 -0
  83. package/dist/lib/shared/errors.js +45 -0
  84. package/dist/lib/shared/events.d.ts +11 -0
  85. package/dist/lib/shared/events.js +40 -0
  86. package/dist/lib/shared/types.d.ts +26 -0
  87. package/dist/lib/shared/types.js +1 -0
  88. package/dist/lib/shared/validation.d.ts +29 -0
  89. package/dist/lib/shared/validation.js +87 -0
  90. package/dist/lib/version.d.ts +2 -0
  91. package/dist/lib/version.js +3 -0
  92. package/dist/raydiculousx-sdk.d.ts +26 -0
  93. package/dist/raydiculousx-sdk.js +17 -0
  94. package/docs/API.md +1106 -0
  95. package/docs/DIRECT_APPS.md +83 -0
  96. package/docs/HOST_HANDOFF.md +59 -0
  97. package/docs/HOST_PROTOCOL.md +43 -0
  98. package/docs/RELEASING.md +33 -0
  99. package/docs/assets/raydiculousx-mark.png +0 -0
  100. package/examples/README.md +10 -0
  101. package/examples/application-template/README.md +60 -0
  102. package/examples/application-template/index.html +12 -0
  103. package/examples/application-template/package.json +21 -0
  104. package/examples/application-template/src/app.config.ts +8 -0
  105. package/examples/application-template/src/app.ts +81 -0
  106. package/examples/application-template/src/dispatch.ts +29 -0
  107. package/examples/application-template/src/embed.ts +39 -0
  108. package/examples/application-template/src/env.d.ts +10 -0
  109. package/examples/application-template/src/host-origin.ts +9 -0
  110. package/examples/application-template/src/locale.ts +90 -0
  111. package/examples/application-template/src/styles.css +31 -0
  112. package/examples/application-template/tsconfig.json +24 -0
  113. package/examples/application-template/vite.config.mjs +16 -0
  114. package/examples/sdk-diagnostics/README.md +199 -0
  115. package/examples/sdk-diagnostics/assets/THIRD_PARTY_NOTICES.txt +567 -0
  116. package/examples/sdk-diagnostics/assets/auto-CnsixhmH.js +9 -0
  117. package/examples/sdk-diagnostics/assets/console-BjvPHSNK.css +1 -0
  118. package/examples/sdk-diagnostics/assets/console-BrwFsb65.js +9 -0
  119. package/examples/sdk-diagnostics/assets/favicon-BZQEit-G.ico +0 -0
  120. package/examples/sdk-diagnostics/assets/index-DXSJUMrS.js +2 -0
  121. package/examples/sdk-diagnostics/assets/messages-C1UCo5nT.js +1 -0
  122. package/examples/sdk-diagnostics/assets/robot-x3-D4wBvBN8.webp +0 -0
  123. package/examples/sdk-diagnostics/assets/styles-D3TrErcf.css +1 -0
  124. package/examples/sdk-diagnostics/index.html +15 -0
  125. package/host/README.md +34 -0
  126. package/package.json +80 -4
@@ -0,0 +1,9 @@
1
+ import{w as zE,g as LE,d as kE,s as UE}from"./messages-C1UCo5nT.js";function IE(n,o){for(var r=0;r<o.length;r++){const a=o[r];if(typeof a!="string"&&!Array.isArray(a)){for(const u in a)if(u!=="default"&&!(u in n)){const f=Object.getOwnPropertyDescriptor(a,u);f&&Object.defineProperty(n,u,f.get?f:{enumerable:!0,get:()=>a[u]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}function HE(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Hh={exports:{}},Ss={};var xb;function BE(){if(xb)return Ss;xb=1;var n=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function r(a,u,f){var d=null;if(f!==void 0&&(d=""+f),u.key!==void 0&&(d=""+u.key),"key"in u){f={};for(var p in u)p!=="key"&&(f[p]=u[p])}else f=u;return u=f.ref,{$$typeof:n,type:a,key:d,ref:u!==void 0?u:null,props:f}}return Ss.Fragment=o,Ss.jsx=r,Ss.jsxs=r,Ss}var Eb;function VE(){return Eb||(Eb=1,Hh.exports=BE()),Hh.exports}var v=VE(),Bh={exports:{}},Xe={};var Tb;function qE(){if(Tb)return Xe;Tb=1;var n=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),w=Symbol.for("react.view_transition"),R=Symbol.iterator;function M(N){return N===null||typeof N!="object"?null:(N=R&&N[R]||N["@@iterator"],typeof N=="function"?N:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,A={};function _(N,I,Q){this.props=N,this.context=I,this.refs=A,this.updater=Q||x}_.prototype.isReactComponent={},_.prototype.setState=function(N,I){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,I,"setState")},_.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function L(){}L.prototype=_.prototype;function E(N,I,Q){this.props=N,this.context=I,this.refs=A,this.updater=Q||x}var j=E.prototype=new L;j.constructor=E,T(j,_.prototype),j.isPureReactComponent=!0;var O=Array.isArray;function D(){}var z={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function B(N,I,Q){var $=Q.ref;return{$$typeof:n,type:N,key:I,ref:$!==void 0?$:null,props:Q}}function V(N,I){return B(N.type,I,N.props)}function G(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function P(N){var I={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(Q){return I[Q]})}var Y=/\/+/g;function te(N,I){return typeof N=="object"&&N!==null&&N.key!=null?P(""+N.key):I.toString(36)}function U(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(D,D):(N.status="pending",N.then(function(I){N.status==="pending"&&(N.status="fulfilled",N.value=I)},function(I){N.status==="pending"&&(N.status="rejected",N.reason=I)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function H(N,I,Q,$,ce){var ie=typeof N;(ie==="undefined"||ie==="boolean")&&(N=null);var de=!1;if(N===null)de=!0;else switch(ie){case"bigint":case"string":case"number":de=!0;break;case"object":switch(N.$$typeof){case n:case o:de=!0;break;case y:return de=N._init,H(de(N._payload),I,Q,$,ce)}}if(de)return ce=ce(N),de=$===""?"."+te(N,0):$,O(ce)?(Q="",de!=null&&(Q=de.replace(Y,"$&/")+"/"),H(ce,I,Q,"",function(Re){return Re})):ce!=null&&(G(ce)&&(ce=V(ce,Q+(ce.key==null||N&&N.key===ce.key?"":(""+ce.key).replace(Y,"$&/")+"/")+de)),I.push(ce)),1;de=0;var me=$===""?".":$+":";if(O(N))for(var ae=0;ae<N.length;ae++)$=N[ae],ie=me+te($,ae),de+=H($,I,Q,ie,ce);else if(ae=M(N),typeof ae=="function")for(N=ae.call(N),ae=0;!($=N.next()).done;)$=$.value,ie=me+te($,ae++),de+=H($,I,Q,ie,ce);else if(ie==="object"){if(typeof N.then=="function")return H(U(N),I,Q,$,ce);throw I=String(N),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return de}function X(N,I,Q){if(N==null)return N;var $=[],ce=0;return H(N,$,"","",function(ie){return I.call(Q,ie,ce++)}),$}function J(N){if(N._status===-1){var I=N._result,Q=I();Q.then(function($){(N._status===0||N._status===-1)&&(N._status=1,N._result=$,Q.status===void 0&&(Q.status="fulfilled",Q.value=$))},function($){(N._status===0||N._status===-1)&&(N._status=2,N._result=$,Q.status===void 0&&(Q.status="rejected",Q.reason=$))}),N._status===-1&&(N._status=0,N._result=Q)}if(N._status===1)return N._result.default;throw N._result}var K=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)};function ye(N){var I=z.T,Q={};Q.types=I!==null?I.types:null,z.T=Q;try{var $=N(),ce=z.S;ce!==null&&ce(Q,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(D,K)}catch(ie){K(ie)}finally{I!==null&&Q.types!==null&&(I.types=Q.types),z.T=I}}function fe(N){var I=z.T;if(I!==null){var Q=I.types;Q===null?I.types=[N]:Q.indexOf(N)===-1&&Q.push(N)}else ye(fe.bind(null,N))}var se={map:X,forEach:function(N,I,Q){X(N,function(){I.apply(this,arguments)},Q)},count:function(N){var I=0;return X(N,function(){I++}),I},toArray:function(N){return X(N,function(I){return I})||[]},only:function(N){if(!G(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Xe.Activity=g,Xe.Children=se,Xe.Component=_,Xe.Fragment=r,Xe.Profiler=u,Xe.PureComponent=E,Xe.StrictMode=a,Xe.Suspense=h,Xe.ViewTransition=w,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return z.H.useMemoCache(N)}},Xe.addTransitionType=fe,Xe.cache=function(N){return function(){return N.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(N,I,Q){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var $=T({},N.props),ce=N.key;if(I!=null)for(ie in I.key!==void 0&&(ce=""+I.key),I)!q.call(I,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&I.ref===void 0||($[ie]=I[ie]);var ie=arguments.length-2;if(ie===1)$.children=Q;else if(1<ie){for(var de=Array(ie),me=0;me<ie;me++)de[me]=arguments[me+2];$.children=de}return B(N.type,ce,$)},Xe.createContext=function(N){return N={$$typeof:d,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:f,_context:N},N},Xe.createElement=function(N,I,Q){var $,ce={},ie=null;if(I!=null)for($ in I.key!==void 0&&(ie=""+I.key),I)q.call(I,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(ce[$]=I[$]);var de=arguments.length-2;if(de===1)ce.children=Q;else if(1<de){for(var me=Array(de),ae=0;ae<de;ae++)me[ae]=arguments[ae+2];ce.children=me}if(N&&N.defaultProps)for($ in de=N.defaultProps,de)ce[$]===void 0&&(ce[$]=de[$]);return B(N,ie,ce)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(N){return{$$typeof:p,render:N}},Xe.isValidElement=G,Xe.lazy=function(N){return{$$typeof:y,_payload:{_status:-1,_result:N},_init:J}},Xe.memo=function(N,I){return{$$typeof:b,type:N,compare:I===void 0?null:I}},Xe.startTransition=ye,Xe.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},Xe.use=function(N){return z.H.use(N)},Xe.useActionState=function(N,I,Q){return z.H.useActionState(N,I,Q)},Xe.useCallback=function(N,I){return z.H.useCallback(N,I)},Xe.useContext=function(N){return z.H.useContext(N)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(N,I){return z.H.useDeferredValue(N,I)},Xe.useEffect=function(N,I){return z.H.useEffect(N,I)},Xe.useEffectEvent=function(N){return z.H.useEffectEvent(N)},Xe.useId=function(){return z.H.useId()},Xe.useImperativeHandle=function(N,I,Q){return z.H.useImperativeHandle(N,I,Q)},Xe.useInsertionEffect=function(N,I){return z.H.useInsertionEffect(N,I)},Xe.useLayoutEffect=function(N,I){return z.H.useLayoutEffect(N,I)},Xe.useMemo=function(N,I){return z.H.useMemo(N,I)},Xe.useOptimistic=function(N,I){return z.H.useOptimistic(N,I)},Xe.useReducer=function(N,I,Q){return z.H.useReducer(N,I,Q)},Xe.useRef=function(N){return z.H.useRef(N)},Xe.useState=function(N){return z.H.useState(N)},Xe.useSyncExternalStore=function(N,I,Q){return z.H.useSyncExternalStore(N,I,Q)},Xe.useTransition=function(){return z.H.useTransition()},Xe.version="19.3.1",Xe}var Ab;function Bs(){return Ab||(Ab=1,Bh.exports=qE()),Bh.exports}var S=Bs();const YE=HE(S),FE=IE({__proto__:null,default:YE},[S]);function ai(){const n=S.useSyncExternalStore(zE,LE);return{locale:n,t:kE.bind(null,n)}}var Vh={exports:{}},ws={},qh={exports:{}},Yh={};var Rb;function GE(){return Rb||(Rb=1,(function(n){function o(U,H){var X=U.length;U.push(H);e:for(;0<X;){var J=X-1>>>1,K=U[J];if(0<u(K,H))U[J]=H,U[X]=K,X=J;else break e}}function r(U){return U.length===0?null:U[0]}function a(U){if(U.length===0)return null;var H=U[0],X=U.pop();if(X!==H){U[0]=X;e:for(var J=0,K=U.length,ye=K>>>1;J<ye;){var fe=2*(J+1)-1,se=U[fe],N=fe+1,I=U[N];if(0>u(se,X))N<K&&0>u(I,se)?(U[J]=I,U[N]=X,J=N):(U[J]=se,U[fe]=X,J=fe);else if(N<K&&0>u(I,X))U[J]=I,U[N]=X,J=N;else break e}}return H}function u(U,H){var X=U.sortIndex-H.sortIndex;return X!==0?X:U.id-H.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var d=Date,p=d.now();n.unstable_now=function(){return d.now()-p}}var h=[],b=[],y=1,g=null,w=3,R=!1,M=!1,x=!1,T=!1,A=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function E(U){for(var H=r(b);H!==null;){if(H.callback===null)a(b);else if(H.startTime<=U)a(b),H.sortIndex=H.expirationTime,o(h,H);else break;H=r(b)}}function j(U){if(x=!1,E(U),!M)if(r(h)!==null)M=!0,O||(O=!0,G());else{var H=r(b);H!==null&&te(j,H.startTime-U)}}var O=!1,D=-1,z=5,q=-1;function B(){return T?!0:!(n.unstable_now()-q<z)}function V(){if(T=!1,O){var U=n.unstable_now();q=U;var H=!0;try{e:{M=!1,x&&(x=!1,_(D),D=-1),R=!0;var X=w;try{t:{for(E(U),g=r(h);g!==null&&!(g.expirationTime>U&&B());){var J=g.callback;if(typeof J=="function"){g.callback=null,w=g.priorityLevel;var K=J(g.expirationTime<=U);if(U=n.unstable_now(),typeof K=="function"){g.callback=K,E(U),H=!0;break t}g===r(h)&&a(h),E(U)}else a(h);g=r(h)}if(g!==null)H=!0;else{var ye=r(b);ye!==null&&te(j,ye.startTime-U),H=!1}}break e}finally{g=null,w=X,R=!1}H=void 0}}finally{H?G():O=!1}}}var G;if(typeof L=="function")G=function(){L(V)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,Y=P.port2;P.port1.onmessage=V,G=function(){Y.postMessage(null)}}else G=function(){A(V,0)};function te(U,H){D=A(function(){U(n.unstable_now())},H)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(U){U.callback=null},n.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<U?Math.floor(1e3/U):5},n.unstable_getCurrentPriorityLevel=function(){return w},n.unstable_next=function(U){switch(w){case 1:case 2:case 3:var H=3;break;default:H=w}var X=w;w=H;try{return U()}finally{w=X}},n.unstable_requestPaint=function(){T=!0},n.unstable_runWithPriority=function(U,H){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var X=w;w=U;try{return H()}finally{w=X}},n.unstable_scheduleCallback=function(U,H,X){var J=n.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?J+X:J):X=J,U){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=X+K,U={id:y++,callback:H,priorityLevel:U,startTime:X,expirationTime:K,sortIndex:-1},X>J?(U.sortIndex=X,o(b,U),r(h)===null&&U===r(b)&&(x?(_(D),D=-1):x=!0,te(j,X-J))):(U.sortIndex=K,o(h,U),M||R||(M=!0,O||(O=!0,G()))),U},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(U){var H=w;return function(){var X=w;w=H;try{return U.apply(this,arguments)}finally{w=X}}}})(Yh)),Yh}var Cb;function PE(){return Cb||(Cb=1,qh.exports=GE()),qh.exports}var Fh={exports:{}},zn={};var Ob;function XE(){if(Ob)return zn;Ob=1;var n=Bs();function o(y){var g="https://react.dev/errors/"+y;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)g+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+y+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(o(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},u=Symbol.for("react.portal"),f=Symbol.for("react.recoverable"),d=Symbol.for("react.optimistic_key");function p(y,g,w){var R=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:R==null?null:R===d?d:""+R,children:y,containerInfo:g,implementation:w}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(y,g){if(y==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return zn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,zn.browser=function(y){return{$$typeof:f,_reason:y}},zn.createPortal=function(y,g){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(o(299));return p(y,g,null,w)},zn.flushSync=function(y){var g=h.T,w=a.p;try{if(h.T=null,a.p=2,y)return y()}finally{h.T=g,a.p=w,a.d.f()}},zn.preconnect=function(y,g){typeof y=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,a.d.C(y,g))},zn.prefetchDNS=function(y){typeof y=="string"&&a.d.D(y)},zn.preinit=function(y,g){if(typeof y=="string"&&g&&typeof g.as=="string"){var w=g.as,R=b(w,g.crossOrigin),M=typeof g.integrity=="string"?g.integrity:void 0,x=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;w==="style"?a.d.S(y,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:R,integrity:M,fetchPriority:x}):w==="script"&&a.d.X(y,{crossOrigin:R,integrity:M,fetchPriority:x,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},zn.preinitModule=function(y,g){if(typeof y=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var w=b(g.as,g.crossOrigin);a.d.M(y,{crossOrigin:w,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}}else g==null&&a.d.M(y)},zn.preload=function(y,g){if(typeof y=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var w=g.as,R=b(w,g.crossOrigin);a.d.L(y,w,{crossOrigin:R,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},zn.preloadModule=function(y,g){if(typeof y=="string")if(g){var w=b(g.as,g.crossOrigin);a.d.m(y,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:w,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}else a.d.m(y)},zn.requestFormReset=function(y){a.d.r(y)},zn.unstable_batchedUpdates=function(y,g){return y(g)},zn.useFormState=function(y,g,w){return h.H.useFormState(y,g,w)},zn.useFormStatus=function(){return h.H.useHostTransitionStatus()},zn.version="19.3.1",zn}var Mb;function c2(){if(Mb)return Fh.exports;Mb=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(o){console.error(o)}}return n(),Fh.exports=XE(),Fh.exports}var Nb;function KE(){if(Nb)return ws;Nb=1;var n=PE(),o=Bs(),r=c2();function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){for(var t=e,i=t;i&&!i.alternate;)t=i,(t.flags&4098)!==0&&(e=t.return),i=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function d(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(f(e)!==e)throw Error(a(188))}function b(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(a(188));return t!==e?null:e}for(var i=e,l=t;;){var s=i.return;if(s===null)break;var c=s.alternate;if(c===null){if(l=s.return,l!==null){i=l;continue}break}if(s.child===c.child){for(c=s.child;c;){if(c===i)return h(s),e;if(c===l)return h(s),t;c=c.sibling}throw Error(a(188))}if(i.return!==l.return)i=s,l=c;else{for(var m=!1,C=s.child;C;){if(C===i){m=!0,i=s,l=c;break}if(C===l){m=!0,l=s,i=c;break}C=C.sibling}if(!m){for(C=c.child;C;){if(C===i){m=!0,i=c,l=s;break}if(C===l){m=!0,l=c,i=s;break}C=C.sibling}if(!m)throw Error(a(189))}}if(i.alternate!==l)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}function g(e,t,i,l,s,c){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&i(e,l,s,c)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&g(e.child,t,i,l,s,c))return!0;e=e.sibling}return!1}function w(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function R(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function M(e){var t=[null,null],i=w(e);return i===null||x(t,e,i.child,{foundSelf:!1}),t}function x(e,t,i,l){for(;i!==null;){if(i===t)l.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(l.foundSelf)return e[1]=i,!0;e[0]=i}else if((i.tag!==22||i.memoizedState===null)&&x(e,t,i.child,l))return!0;i=i.sibling}return!1}function T(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var A=null,_=null;function L(e,t,i){return e===i?!0:e===t?(A=e,!0):!1}function E(e,t,i){return e===i?(_=e,!1):e===t?(_!==null&&(A=e),!0):!1}function j(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function O(e,t,i){for(var l=0,s=e;s;s=i(s))l++;s=0;for(var c=t;c;c=i(c))s++;for(;0<l-s;)e=i(e),l--;for(;0<s-l;)t=i(t),s--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=i(e),t=i(t)}return null}var D=Object.assign,z=Symbol.for("react.element"),q=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),Y=Symbol.for("react.consumer"),te=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),ye=Symbol.for("react.activity"),fe=Symbol.for("react.legacy_hidden"),se=Symbol.for("react.memo_cache_sentinel"),N=Symbol.for("react.view_transition"),I=Symbol.for("react.recoverable"),Q=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=Q&&e[Q]||e["@@iterator"],typeof e=="function"?e:null)}var ce=Symbol.for("react.client.reference");function ie(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case P:return"Profiler";case G:return"StrictMode";case H:return"Suspense";case X:return"SuspenseList";case ye:return"Activity";case N:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case B:return"Portal";case te:return e.displayName||"Context";case Y:return(e._context.displayName||"Context")+".Consumer";case U:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return t=e.displayName||null,t!==null?t:ie(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var de=Array.isArray,me=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Re={pending:!1,data:null,method:null,action:null},we=[],Ce=-1;function je(e){return{current:e}}function Se(e){0>Ce||(e.current=we[Ce],we[Ce]=null,Ce--)}function Ne(e,t){Ce++,we[Ce]=e.current,e.current=t}var Ee=je(null),Ue=je(null),xe=je(null),Ie=je(null);function $e(e,t){switch(Ne(xe,t),Ne(Ue,e),Ne(Ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?_y(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_y(t),e=Dy(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Se(Ee),Ne(Ee,e)}function ft(){Se(Ee),Se(Ue),Se(xe)}function ue(e){var t=e.memoizedState;t!==null&&(ua._currentValue=t.memoizedState,Ne(Ie,e)),t=Ee.current;var i=Dy(t,e.type);t!==i&&(Ne(Ue,e),Ne(Ee,i))}function ge(e){Ue.current===e&&(Se(Ee),Se(Ue)),Ie.current===e&&(Se(Ie),ua._currentValue=Re)}var Fe,Ae;function Me(e){if(Fe===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Fe=t&&t[1]||"",Ae=-1<i.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Fe+e+Ae}var Ct=!1;function yt(e,t){if(!e||Ct)return"";Ct=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(Oe){var Z=Oe}Reflect.construct(e,[],pe)}else{try{pe.call()}catch(Oe){Z=Oe}pe=!1;try{var oe=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),pe=!0,new e}finally{pe&&(oe!==void 0?Object.defineProperty(e.prototype,"props",oe):delete e.prototype.props)}}}else{try{throw Error()}catch(Oe){Z=Oe}(pe=e())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(Oe){if(Oe&&Z&&typeof Oe.stack=="string")return[Oe.stack,Z.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=l.DetermineComponentFrameRoot(),m=c[0],C=c[1];if(m&&C){var k=m.split(`
4
+ `),ee=C.split(`
5
+ `);for(s=l=0;l<k.length&&!k[l].includes("DetermineComponentFrameRoot");)l++;for(;s<ee.length&&!ee[s].includes("DetermineComponentFrameRoot");)s++;if(l===k.length||s===ee.length)for(l=k.length-1,s=ee.length-1;1<=l&&0<=s&&k[l]!==ee[s];)s--;for(;1<=l&&0<=s;l--,s--)if(k[l]!==ee[s]){if(l!==1||s!==1)do if(l--,s--,0>s||k[l]!==ee[s]){var re=`
6
+ `+k[l].replace(" at new "," at ");return e.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",e.displayName)),re}while(1<=l&&0<=s);break}}}finally{Ct=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Me(i):""}function ut(e,t){switch(e.tag){case 26:case 27:case 5:return Me(e.type);case 16:return Me("Lazy");case 13:return e.child!==t&&t!==null?Me("Suspense Fallback"):Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return yt(e.type,!1);case 11:return yt(e.type.render,!1);case 1:return yt(e.type,!0);case 31:return Me("Activity");case 30:return Me("ViewTransition");default:return""}}function Dt(e){try{var t="",i=null;do t+=ut(e,i),i=e,e=e.return;while(e);return t}catch(l){return`
7
+ Error generating stack: `+l.message+`
8
+ `+l.stack}}var an=Object.prototype.hasOwnProperty,$n=n.unstable_scheduleCallback,kn=n.unstable_cancelCallback,sn=n.unstable_shouldYield,qn=n.unstable_requestPaint,Ot=n.unstable_now,Un=n.unstable_getCurrentPriorityLevel,Et=n.unstable_ImmediatePriority,mn=n.unstable_UserBlockingPriority,Vt=n.unstable_NormalPriority,Yn=n.unstable_LowPriority,si=n.unstable_IdlePriority,tt=n.log,on=n.unstable_setDisableYieldValue,Ft=null,dt=null;function vt(e){if(typeof tt=="function"&&on(e),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(Ft,e)}catch{}}var mt=Math.clz32?Math.clz32:bt,Fn=Math.log,Pe=Math.LN2;function bt(e){return e>>>=0,e===0?32:31-(Fn(e)/Pe|0)|0}var kt=256,Wt=262144,Qt=4194304;function bn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function vn(e,t,i){var l=e.pendingLanes;if(l===0)return 0;var s=0,c=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var C=l&134217727;return C!==0?(l=C&~c,l!==0?s=bn(l):(m&=C,m!==0?s=bn(m):i||(i=C&~e,i!==0&&(s=bn(i))))):(C=l&~c,C!==0?s=bn(C):m!==0?s=bn(m):i||(i=l&~e,i!==0&&(s=bn(i)))),s===0?0:t!==0&&t!==s&&(t&c)===0&&(c=s&-s,i=t&-t,c>=i||c===32&&(i&4194048)!==0)?t:s}function An(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ti(e,t){(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var l=31-mt(i),s=1<<l;t|=e[l],i&=~s}return t}function Bo(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Yi(){var e=Qt;return Qt<<=1,(Qt&62914560)===0&&(Qt=4194304),e}function wr(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function bo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xr(e,t,i,l,s,c){var m=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var C=e.entanglements,k=e.expirationTimes,ee=e.hiddenUpdates;for(i=m&~i;0<i;){var re=31-mt(i),pe=1<<re;C[re]=0,k[re]=-1;var Z=ee[re];if(Z!==null)for(ee[re]=null,re=0;re<Z.length;re++){var oe=Z[re];oe!==null&&(oe.lane&=-536870913)}i&=~pe}l!==0&&Fi(e,l,0),c!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=c&~(m&~t))}function Fi(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-mt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|i&261930}function Er(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-mt(i),s=1<<l;s&t|e[l]&t&&(e[l]|=t),i&=~s}}function Dl(e,t){var i=t&-t;return i=(i&42)!==0?1:Vo(i),(i&(e.suspendedLanes|t))!==0?0:i}function Vo(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ai(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ri(){var e=ae.p;return e!==0?e:(e=window.event,e===void 0?32:mb(e.type))}function jl(e,t){var i=ae.p;try{return ae.p=e,t()}finally{ae.p=i}}var ln=Math.random().toString(36).slice(2),Zt="__reactFiber$"+ln,Rn="__reactProps$"+ln,ci="__reactContainer$"+ln,Oa="__reactEvents$"+ln,Tr="__reactListeners$"+ln,Ar="__reactHandles$"+ln,qo="__reactResources$"+ln,zl="__reactMarker$"+ln,Rr="__reactLoad$"+ln;function Cr(e){delete e[Zt],delete e[Rn],delete e[Tr],delete e[Ar]}function Gi(e){var t;if(t=e[Zt])return t;for(var i=e.parentNode;i;){if(t=i[ci]||i[Zt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=Qy(e);e!==null;){if(i=e[Zt])return i;e=Qy(e)}return t}e=i,i=e.parentNode}return null}function Ll(e){if(e=e[Zt]||e[ci]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function le(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function be(e){var t=e[qo];return t||(t=e[qo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ve(e){e[zl]=!0}function He(e){e[Rr]=void 0}var Ke=new Set,Ge={};function We(e,t){Mt(e,t),Mt(e+"Capture",t)}function Mt(e,t){for(Ge[e]=t,e=0;e<t.length;e++)Ke.add(t[e])}var wt=RegExp("^[: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]*$"),qe={},Qe={};function gt(e){return an.call(Qe,e)?!0:an.call(qe,e)?!1:wt.test(e)?Qe[e]=!0:(qe[e]=!0,!1)}var Ve=!1;function gn(){var e=Ve;return Ve=!1,e}function Jt(e,t,i){if(gt(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,i)}}function ui(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,i)}}function cn(e,t,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,l)}}function un(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Or(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ma(e,t,i){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var s=l.get,c=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(m){i=""+m,c.call(this,m)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(m){i=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function vo(e){if(!e._valueTracker){var t=Or(e)?"checked":"value";e._valueTracker=Ma(e,t,""+e[t])}}function Mr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=Or(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}var Ys=/[\n"\\]/g;function qt(e){return e.replace(Ys,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function In(e,t,i,l,s,c,m,C){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+un(t)):e.value!==""+un(t)&&(e.value=""+un(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?m==="number"&&e.value==t?Nr(e,un(e.value)):Nr(e,un(t)):i!=null?Nr(e,un(i)):l!=null&&e.removeAttribute("value"),s==null&&c!=null&&(e.defaultChecked=!!c),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?e.name=""+un(C):e.removeAttribute("name")}function Yo(e,t,i,l,s,c,m,C){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||i!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){vo(e);return}i=i!=null?""+un(i):"",t=t!=null?""+un(t):i,C||t===e.value||(e.value=t),e.defaultValue=t}l=l??s,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=C?e.checked:!!l,e.defaultChecked=!!l,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),vo(e)}function Nr(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Wn(e,t,i,l){if(e=e.options,t){t={};for(var s=0;s<i.length;s++)t["$"+i[s]]=!0;for(i=0;i<e.length;i++)s=t.hasOwnProperty("$"+e[i].value),e[i].selected!==s&&(e[i].selected=s),s&&l&&(e[i].defaultSelected=!0)}else{for(i=""+un(i),t=null,s=0;s<e.length;s++){if(e[s].value===i){e[s].selected=!0,l&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function _r(e,t,i){if(t!=null&&(t=""+un(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+un(i):""}function fi(e,t,i,l){if(t==null){if(l!=null){if(i!=null)throw Error(a(92));if(de(l)){if(1<l.length)throw Error(a(93));l=l[0]}i=l}i==null&&(i=""),t=i}i=un(t),e.defaultValue=i,l=e.textContent,l===i&&l!==""&&l!==null&&(e.value=l),vo(e)}function Gn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Fo=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Na(e,t,i){var l=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,i):typeof i!="number"||i===0||Fo.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function di(e,t,i){if(t!=null&&typeof t!="object")throw Error(a(62));if(e=e.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",Ve=!0);for(var s in t)l=t[s],t.hasOwnProperty(s)&&i[s]!==l&&(Na(e,s,l),Ve=!0)}else for(var c in t)t.hasOwnProperty(c)&&Na(e,c,t[c])}function kl(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _a=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Da=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Cn(e){return Da.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Pn(){}var Ul=null;function Il(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ht=null,Sn=null;function Ci(e){var t=Ll(e);if(t&&(e=t.stateNode)){var i=e[Rn]||null;e:switch(e=t.stateNode,t.type){case"input":if(In(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+qt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var s=l[Rn]||null;if(!s)throw Error(a(90));In(l,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<i.length;t++)l=i[t],l.form===e.form&&Mr(l)}break e;case"textarea":_r(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Wn(e,!!i.multiple,t,!1)}}}var hi=!1;function Hl(e,t,i){if(hi)return e(t,i);hi=!0;try{var l=e(t);return l}finally{if(hi=!1,(ht!==null||Sn!==null)&&(Yc(),ht&&(t=ht,e=Sn,Sn=ht=null,Ci(t),e)))for(t=0;t<e.length;t++)Ci(e[t])}}function So(e,t){var i=e.stateNode;if(i===null)return null;var l=i[Rn]||null;if(l===null)return null;i=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(a(231,t,typeof i));return i}var On=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bl=!1;if(On)try{var ja={};Object.defineProperty(ja,"passive",{get:function(){Bl=!0}}),window.addEventListener("test",ja,ja),window.removeEventListener("test",ja,ja)}catch{Bl=!1}var Go=null,Ef=null,Fs=null;function Cm(){if(Fs)return Fs;var e,t=Ef,i=t.length,l,s="value"in Go?Go.value:Go.textContent,c=s.length;for(e=0;e<i&&t[e]===s[e];e++);var m=i-e;for(l=1;l<=m&&t[i-l]===s[c-l];l++);return Fs=s.slice(e,1<l?1-l:void 0)}function Gs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ps(){return!0}function Om(){return!1}function Xn(e){function t(i,l,s,c,m){this._reactName=i,this._targetInst=s,this.type=l,this.nativeEvent=c,this.target=m,this.currentTarget=null;for(var C in e)e.hasOwnProperty(C)&&(i=e[C],this[C]=i?i(c):c[C]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Ps:Om,this.isPropagationStopped=Om,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Ps)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ps)},persist:function(){},isPersistent:Ps}),t}var Po={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xs=Xn(Po),za=D({},Po,{view:0,detail:0}),lw=Xn(za),Tf,Af,La,Ks=D({},za,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==La&&(La&&e.type==="mousemove"?(Tf=e.screenX-La.screenX,Af=e.screenY-La.screenY):Af=Tf=0,La=e),Tf)},movementY:function(e){return"movementY"in e?e.movementY:Af}}),Mm=Xn(Ks),rw=D({},Ks,{dataTransfer:0}),aw=Xn(rw),sw=D({},za,{relatedTarget:0}),Rf=Xn(sw),cw=D({},Po,{animationName:0,elapsedTime:0,pseudoElement:0}),uw=Xn(cw),fw=D({},Po,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),dw=Xn(fw),hw=D({},Po,{data:0}),Nm=Xn(hw),pw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mw={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},gw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=gw[e])?!!t[e]:!1}function Cf(){return yw}var bw=D({},za,{key:function(e){if(e.key){var t=pw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Gs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?mw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cf,charCode:function(e){return e.type==="keypress"?Gs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Gs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vw=Xn(bw),Sw=D({},Ks,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_m=Xn(Sw),ww=D({},Po,{submitter:0}),xw=Xn(ww),Ew=D({},za,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cf}),Tw=Xn(Ew),Aw=D({},Po,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rw=Xn(Aw),Cw=D({},Ks,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ow=Xn(Cw),Mw=D({},Po,{newState:0,oldState:0,source:0}),Nw=Xn(Mw),_w=[9,13,27,32],Of=On&&"CompositionEvent"in window,ka=null;On&&"documentMode"in document&&(ka=document.documentMode);var Dw=On&&"TextEvent"in window&&!ka,Dm=On&&(!Of||ka&&8<ka&&11>=ka),jm=" ",zm=!1;function Lm(e,t){switch(e){case"keyup":return _w.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function km(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Dr=!1;function jw(e,t){switch(e){case"compositionend":return km(t);case"keypress":return t.which!==32?null:(zm=!0,jm);case"textInput":return e=t.data,e===jm&&zm?null:e;default:return null}}function zw(e,t){if(Dr)return e==="compositionend"||!Of&&Lm(e,t)?(e=Cm(),Fs=Ef=Go=null,Dr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Dm&&t.locale!=="ko"?null:t.data;default:return null}}var Lw={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Um(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lw[e.type]:t==="textarea"}function Im(e,t,i,l){ht?Sn?Sn.push(l):Sn=[l]:ht=l,t=Qc(t,"onChange"),0<t.length&&(i=new Xs("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var Ua=null,Ia=null;function kw(e){Ay(e,0)}function Qs(e){var t=le(e);if(Mr(t))return e}function Hm(e,t){if(e==="change")return t}var Bm=!1;if(On){var Mf;if(On){var Nf="oninput"in document;if(!Nf){var Vm=document.createElement("div");Vm.setAttribute("oninput","return;"),Nf=typeof Vm.oninput=="function"}Mf=Nf}else Mf=!1;Bm=Mf&&(!document.documentMode||9<document.documentMode)}function qm(){Ua&&(Ua.detachEvent("onpropertychange",Ym),Ia=Ua=null)}function Ym(e){if(e.propertyName==="value"&&Qs(Ia)){var t=[];Im(t,Ia,e,Il(e)),Hl(kw,t)}}function Uw(e,t,i){e==="focusin"?(qm(),Ua=t,Ia=i,Ua.attachEvent("onpropertychange",Ym)):e==="focusout"&&qm()}function Iw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qs(Ia)}function Hw(e,t){if(e==="click")return Qs(t)}function Bw(e,t){if(e==="input"||e==="change")return Qs(t)}function Vw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pi=typeof Object.is=="function"?Object.is:Vw;function Ha(e,t){if(pi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var s=i[l];if(!an.call(t,s)||!pi(e[s],t[s]))return!1}return!0}function _f(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Fm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gm(e,t){var i=Fm(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Fm(i)}}function Pm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=_f(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=_f(e.document)}return t}function Df(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var qw=On&&"documentMode"in document&&11>=document.documentMode,jr=null,jf=null,Ba=null,zf=!1;function Km(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;zf||jr==null||jr!==_f(l)||(l=jr,"selectionStart"in l&&Df(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ba&&Ha(Ba,l)||(Ba=l,l=Qc(jf,"onSelect"),0<l.length&&(t=new Xs("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=jr)))}function Vl(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var zr={animationend:Vl("Animation","AnimationEnd"),animationiteration:Vl("Animation","AnimationIteration"),animationstart:Vl("Animation","AnimationStart"),transitionrun:Vl("Transition","TransitionRun"),transitionstart:Vl("Transition","TransitionStart"),transitioncancel:Vl("Transition","TransitionCancel"),transitionend:Vl("Transition","TransitionEnd")},Lf={},Qm={};On&&(Qm=document.createElement("div").style,"AnimationEvent"in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),"TransitionEvent"in window||delete zr.transitionend.transition);function ql(e){if(Lf[e])return Lf[e];if(!zr[e])return e;var t=zr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Qm)return Lf[e]=t[i];return e}var Zm=ql("animationend"),Jm=ql("animationiteration"),$m=ql("animationstart"),Yw=ql("transitionrun"),Fw=ql("transitionstart"),Gw=ql("transitioncancel"),Wm=ql("transitionend"),e0=new Map,kf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");kf.push("scrollEnd");function Pi(e,t){e0.set(e,t),We(t,[e])}var Pw=0;function wo(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Zi.identifierPrefix;var i=Pw++;return e="_"+e+"t_"+i.toString(32)+"_",t.autoName=e}function t0(e){if(e==null||typeof e=="string")return e;var t=null,i=ea;if(i!==null)for(var l=0;l<i.length;l++){var s=e[i[l]];if(s!=null){if(s==="none")return"none";t=t==null?s:t+(" "+s)}}return t??e.default}function xo(e,t){return e=t0(e),t=t0(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Zs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Oi=[],Lr=0,Uf=0;function Js(){for(var e=Lr,t=Uf=Lr=0;t<e;){var i=Oi[t];Oi[t++]=null;var l=Oi[t];Oi[t++]=null;var s=Oi[t];Oi[t++]=null;var c=Oi[t];if(Oi[t++]=null,l!==null&&s!==null){var m=l.pending;m===null?s.next=s:(s.next=m.next,m.next=s),l.pending=s}c!==0&&n0(i,s,c)}}function $s(e,t,i,l){Oi[Lr++]=e,Oi[Lr++]=t,Oi[Lr++]=i,Oi[Lr++]=l,Uf|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function If(e,t,i,l){return $s(e,t,i,l),Ws(e)}function Yl(e,t){return $s(e,null,null,t),Ws(e)}function n0(e,t,i){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i);for(var s=!1,c=e.return;c!==null;)c.childLanes|=i,l=c.alternate,l!==null&&(l.childLanes|=i),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(s=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,s&&t!==null&&(s=31-mt(i),e=c.hiddenUpdates,l=e[s],l===null?e[s]=[t]:l.push(t),t.lane=i|536870912),c):null}function Ws(e){if(50<ss)throw ss=0,qc=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var kr={};function Xw(e,t,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ei(e,t,i,l){return new Xw(e,t,i,l)}function Hf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Eo(e,t){var i=e.alternate;return i===null?(i=ei(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&1206910976,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function i0(e,t){e.flags&=1206910978;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ec(e,t,i,l,s,c){var m=0;if(l=e,typeof l=="function")Hf(l)&&(m=1);else if(typeof l=="string")m=wE(e,i,Ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case ye:return e=ei(31,i,t,s),e.elementType=ye,e.lanes=c,e;case V:return Fl(i.children,s,c,t);case G:m=8,s|=24;break;case P:return e=ei(12,i,t,s|2),e.elementType=P,e.lanes=c,e;case H:return e=ei(13,i,t,s),e.elementType=H,e.lanes=c,e;case X:return e=ei(19,i,t,s),e.elementType=X,e.lanes=c,e;case fe:case N:return e=s|32,e=ei(30,i,t,e),e.elementType=N,e.lanes=c,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case te:m=10;break e;case Y:m=9;break e;case U:m=11;break e;case J:m=14;break e;case K:m=16,l=null;break e}m=29,i=Error(a(130,e===null?"null":typeof e,"")),l=null}return t=ei(m,i,t,s),t.elementType=e,t.type=l,t.lanes=c,t}function Fl(e,t,i,l){return e=ei(7,e,l,t),e.lanes=i,e}function Bf(e,t,i){return e=ei(6,e,null,t),e.lanes=i,e}function o0(e){var t=ei(18,null,null,0);return t.stateNode=e,t}function Vf(e,t,i){return t=ei(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var l0=new WeakMap;function Mi(e,t){if(typeof e=="object"&&e!==null){var i=l0.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Dt(t)},l0.set(e,t),t)}return{value:e,source:t,stack:Dt(t)}}var Ur=[],Ir=0,tc=null,Va=0,Ni=[],_i=0,Xo=null,to=1,no="";function To(e,t){Ur[Ir++]=Va,Ur[Ir++]=tc,tc=e,Va=t}function r0(e,t,i){Ni[_i++]=to,Ni[_i++]=no,Ni[_i++]=Xo,Xo=e;var l=to;e=no;var s=32-mt(l)-1;l&=~(1<<s),i+=1;var c=32-mt(t)+s;if(30<c){var m=s-s%5;c=(l&(1<<m)-1).toString(32),l>>=m,s-=m,to=1<<32-mt(t)+s|i<<s|l,no=c+e}else to=1<<c|i<<s|l,no=e}function nc(e){e.return!==null&&(To(e,1),r0(e,1,0))}function qf(e){for(;e===tc;)tc=Ur[--Ir],Ur[Ir]=null,Va=Ur[--Ir],Ur[Ir]=null;for(;e===Xo;)Xo=Ni[--_i],Ni[_i]=null,no=Ni[--_i],Ni[_i]=null,to=Ni[--_i],Ni[_i]=null}function a0(e,t){Ni[_i++]=to,Ni[_i++]=no,Ni[_i++]=Xo,to=t.id,no=t.overflow,Xo=e}var wn=null,Ut=null,nt=!1,Ko=null,Di=!1,Yf=Error(a(519));function Qo(e){var t=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qa(Mi(t,e)),Yf}function s0(e){var t=e.stateNode,i=e.type,l=e.memoizedProps;switch(t[Zt]=e,t[Rn]=l,i){case"dialog":rt("cancel",t),rt("close",t);break;case"iframe":case"object":case"embed":rt("load",t);break;case"video":case"audio":for(i=0;i<us.length;i++)rt(us[i],t);break;case"source":rt("error",t);break;case"img":case"image":case"link":rt("error",t),rt("load",t);break;case"details":rt("toggle",t);break;case"input":rt("invalid",t),Yo(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":rt("invalid",t);break;case"textarea":rt("invalid",t),fi(t,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||l.suppressHydrationWarning===!0||My(t.textContent,i)?(l.popover!=null&&(rt("beforetoggle",t),rt("toggle",t)),l.onScroll!=null&&rt("scroll",t),l.onScrollEnd!=null&&rt("scrollend",t),l.onClick!=null&&(t.onclick=Pn),t=!0):t=!1,t||Qo(e,!0)}function ic(e){for(wn=e.return;wn;)switch(wn.tag){case 5:case 31:case 13:Di=!1;return;case 27:case 3:Di=!0;return;default:wn=wn.return}}function Hr(e){if(e!==wn)return!1;if(!nt)return ic(e),nt=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||vh(e.type,e.memoizedProps)),i=!i),i&&Ut&&Qo(e),ic(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ut=Ky(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ut=Ky(e)}else t===27?(t=Ut,fl(e.type)?(e=Oh,Oh=null,Ut=e):Ut=t):Ut=wn?zi(e.stateNode.nextSibling):null;return!0}function Gl(){Ut=wn=null,nt=!1}function Ff(){var e=Ko;return e!==null&&(ii===null?ii=e:ii.push.apply(ii,e),Ko=null),e}function qa(e){Ko===null?Ko=[e]:Ko.push(e)}var Gf=je(null),Pl=null,Ao=null;function Zo(e,t,i){Ne(Gf,t._currentValue),t._currentValue=i}function Ro(e){e._currentValue=Gf.current,Se(Gf)}function oc(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function Pf(e,t,i,l){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var c=s.dependencies;if(c!==null){var m=s.child;c=c.firstContext;e:for(;c!==null;){var C=c;c=s;for(var k=0;k<t.length;k++)if(C.context===t[k]){c.lanes|=i,C=c.alternate,C!==null&&(C.lanes|=i),oc(c.return,i,e),l||(m=null);break e}c=C.next}}else if(s.tag===18){if(m=s.return,m===null)throw Error(a(341));m.lanes|=i,c=m.alternate,c!==null&&(c.lanes|=i),oc(m,i,e),m=null}else s.tag===13&&s.memoizedState!==null&&s.memoizedState.dehydrated===null?(s.lanes|=i,m=s.alternate,m!==null&&(m.lanes|=i),oc(s.return,i,e),m=s.child,m=m!==null?m.sibling:null):m=s.child;if(m!==null)m.return=s;else for(m=s;m!==null;){if(m===e){m=null;break}if(s=m.sibling,s!==null){s.return=m.return,m=s;break}m=m.return}s=m}}function Xl(e,t,i,l){e=null;for(var s=t,c=!1;s!==null;){if(!c){if((s.flags&524288)!==0)c=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var m=s.alternate;if(m===null)throw Error(a(387));if(m=m.memoizedProps,m!==null){var C=s.type;pi(s.pendingProps.value,m.value)||(e!==null?e.push(C):e=[C])}}else if(s===Ie.current){if(m=s.alternate,m===null)throw Error(a(387));m.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(ua):e=[ua])}s=s.return}return e!==null&&Pf(t,e,i,l),t.flags|=262144,e!==null}function lc(e){for(e=e.firstContext;e!==null;){if(!pi(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Kl(e){Pl=e,Ao=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Mn(e){return c0(Pl,e)}function rc(e,t){return Pl===null&&Kl(e),c0(e,t)}function c0(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ao===null){if(e===null)throw Error(a(308));Ao=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ao=Ao.next=t;return i}var Kw=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},Qw=n.unstable_scheduleCallback,Zw=n.unstable_NormalPriority,fn={$$typeof:te,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xf(){return{controller:new Kw,data:new Map,refCount:0}}function Ya(e){e.refCount--,e.refCount===0&&Qw(Zw,function(){e.controller.abort()})}function u0(e,t){if((e.pendingLanes&4194048)!==0){var i=e.transitionTypes;for(i===null&&(i=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];i.indexOf(l)===-1&&i.push(l)}}}var Fa=null;function Jw(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ga=null,Kf=0,Ql=0,Br=null;function $w(e,t){if(Ga===null){var i=Ga=[];Kf=0,Ql=uh(),Br={status:"pending",value:void 0,then:function(l){i.push(l)}}}return Kf++,t.then(f0,f0),t}function f0(){if(--Kf===0&&(Fa=null,Ga!==null)){Br!==null&&(Br.status="fulfilled");var e=Ga;Ga=null,Ql=0,Br=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ww(e,t){var i=[],l={status:"pending",value:null,reason:null,then:function(s){i.push(s)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var s=0;s<i.length;s++)(0,i[s])(t)},function(s){for(l.status="rejected",l.reason=s,s=0;s<i.length;s++)(0,i[s])(void 0)}),l}var d0=me.S;me.S=function(e,t){if(oy=Ot(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&$w(e,t),Fa!==null)for(var i=oa;i!==null;)u0(i,Fa),i=i.next;if(i=e.types,i!==null){for(var l=oa;l!==null;)u0(l,i),l=l.next;if(Ql!==0){l=Fa,l===null&&(l=Fa=[]);for(var s=0;s<i.length;s++){var c=i[s];l.indexOf(c)===-1&&l.push(c)}}}d0!==null&&d0(e,t)};var Zl=je(null);function Qf(){var e=Zl.current;return e!==null?e:jt.pooledCache}function ac(e,t){t===null?Ne(Zl,Zl.current):Ne(Zl,t.pool)}function h0(){var e=Qf();return e===null?null:{parent:fn._currentValue,pool:e}}var Vr=Error(a(460)),Zf=Error(a(474)),sc=Error(a(542)),cc={then:function(){}};function p0(e){return e=e.status,e==="fulfilled"||e==="rejected"}function m0(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Pn,Pn),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,y0(e),e===void 0&&!("reason"in t)?Error(a(600)):e;default:if(typeof t.status=="string")t.then(Pn,Pn);else{if(e=jt,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=l}},function(l){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,y0(e),e}throw $l=t,Vr}}function Jl(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?($l=i,Vr):i}}var $l=null;function g0(){if($l===null)throw Error(a(459));var e=$l;return $l=null,e}function y0(e){if(e===Vr||e===sc)throw Error(a(483))}var qr=null,Pa=0;function uc(e){var t=Pa;return Pa+=1,qr===null&&(qr=[]),m0(qr,e,t)}function Jo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function fc(e,t){throw t.$$typeof===z?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function b0(e){function t(W,F){if(e){var ne=W.deletions;ne===null?(W.deletions=[F],W.flags|=16):ne.push(F)}}function i(W,F){if(!e)return null;for(;F!==null;)t(W,F),F=F.sibling;return null}function l(W){for(var F=new Map;W!==null;)W.key===null?F.set(W.index,W):F.set(W.key,W),W=W.sibling;return F}function s(W,F){return W=Eo(W,F),W.index=0,W.sibling=null,W}function c(W,F,ne){return W.index=ne,e?(ne=W.alternate,ne!==null?(ne=ne.index,ne<F?(W.flags|=2,F):ne):(W.flags|=134217730,F)):(W.flags|=1048576,F)}function m(W){return e&&W.alternate===null&&(W.flags|=134217730),W}function C(W,F,ne,he){return F===null||F.tag!==6?(F=Bf(ne,W.mode,he),F.return=W,F):(F=s(F,ne),F.return=W,F)}function k(W,F,ne,he){var ze=ne.type;return ze===V?(W=re(W,F,ne.props.children,he,ne.key),Jo(W,ne),W):F!==null&&(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===K&&Jl(ze)===F.type)?(F=s(F,ne.props),Jo(F,ne),F.return=W,F):(F=ec(ne.type,ne.key,ne.props,null,W.mode,he),Jo(F,ne),F.return=W,F)}function ee(W,F,ne,he){return F===null||F.tag!==4||F.stateNode.containerInfo!==ne.containerInfo||F.stateNode.implementation!==ne.implementation?(F=Vf(ne,W.mode,he),F.return=W,F):(F=s(F,ne.children||[]),F.return=W,F)}function re(W,F,ne,he,ze){return F===null||F.tag!==7?(F=Fl(ne,W.mode,he,ze),F.return=W,F):(F=s(F,ne),F.return=W,F)}function pe(W,F,ne){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=Bf(""+F,W.mode,ne),F.return=W,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case q:return ne=ec(F.type,F.key,F.props,null,W.mode,ne),Jo(ne,F),ne.return=W,ne;case B:return F=Vf(F,W.mode,ne),F.return=W,F;case K:return F=Jl(F),pe(W,F,ne)}if(de(F)||$(F))return F=Fl(F,W.mode,ne,null),F.return=W,F;if(typeof F.then=="function")return pe(W,uc(F),ne);if(F.$$typeof===te)return pe(W,rc(W,F),ne);fc(W,F)}return null}function Z(W,F,ne,he){var ze=F!==null?F.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ze!==null?null:C(W,F,""+ne,he);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case q:return ne.key===ze?k(W,F,ne,he):null;case B:return ne.key===ze?ee(W,F,ne,he):null;case K:return ne=Jl(ne),Z(W,F,ne,he)}if(de(ne)||$(ne))return ze!==null?null:re(W,F,ne,he,null);if(typeof ne.then=="function")return Z(W,F,uc(ne),he);if(ne.$$typeof===te)return Z(W,F,rc(W,ne),he);fc(W,ne)}return null}function oe(W,F,ne,he,ze){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return W=W.get(ne)||null,C(F,W,""+he,ze);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case q:return W=W.get(he.key===null?ne:he.key)||null,k(F,W,he,ze);case B:return W=W.get(he.key===null?ne:he.key)||null,ee(F,W,he,ze);case K:return he=Jl(he),oe(W,F,ne,he,ze)}if(de(he)||$(he))return W=W.get(ne)||null,re(F,W,he,ze,null);if(typeof he.then=="function")return oe(W,F,ne,uc(he),ze);if(he.$$typeof===te)return oe(W,F,ne,rc(F,he),ze);fc(F,he)}return null}function Oe(W,F,ne,he){for(var ze=null,st=null,Be=F,Ye=F=0,pn=null;Be!==null&&Ye<ne.length;Ye++){Be.index>Ye?(pn=Be,Be=null):pn=Be.sibling;var pt=Z(W,Be,ne[Ye],he);if(pt===null){Be===null&&(Be=pn);break}e&&Be&&pt.alternate===null&&t(W,Be),F=c(pt,F,Ye),st===null?ze=pt:st.sibling=pt,st=pt,Be=pn}if(Ye===ne.length)return i(W,Be),nt&&To(W,Ye),ze;if(Be===null){for(;Ye<ne.length;Ye++)Be=pe(W,ne[Ye],he),Be!==null&&(F=c(Be,F,Ye),st===null?ze=Be:st.sibling=Be,st=Be);return nt&&To(W,Ye),ze}for(Be=l(Be);Ye<ne.length;Ye++)pn=oe(Be,W,Ye,ne[Ye],he),pn!==null&&(e&&(pt=pn.alternate,pt!==null&&Be.delete(pt.key===null?Ye:pt.key)),F=c(pn,F,Ye),st===null?ze=pn:st.sibling=pn,st=pn);return e&&Be.forEach(function(gl){return t(W,gl)}),nt&&To(W,Ye),ze}function Le(W,F,ne,he){if(ne==null)throw Error(a(151));for(var ze=null,st=null,Be=F,Ye=F=0,pn=null,pt=ne.next();Be!==null&&!pt.done;Ye++,pt=ne.next()){Be.index>Ye?(pn=Be,Be=null):pn=Be.sibling;var gl=Z(W,Be,pt.value,he);if(gl===null){Be===null&&(Be=pn);break}e&&Be&&gl.alternate===null&&t(W,Be),F=c(gl,F,Ye),st===null?ze=gl:st.sibling=gl,st=gl,Be=pn}if(pt.done)return i(W,Be),nt&&To(W,Ye),ze;if(Be===null){for(;!pt.done;Ye++,pt=ne.next())pt=pe(W,pt.value,he),pt!==null&&(F=c(pt,F,Ye),st===null?ze=pt:st.sibling=pt,st=pt);return nt&&To(W,Ye),ze}for(Be=l(Be);!pt.done;Ye++,pt=ne.next())pt=oe(Be,W,Ye,pt.value,he),pt!==null&&(e&&(pn=pt.alternate,pn!==null&&Be.delete(pn.key===null?Ye:pn.key)),F=c(pt,F,Ye),st===null?ze=pt:st.sibling=pt,st=pt);return e&&Be.forEach(function(jE){return t(W,jE)}),nt&&To(W,Ye),ze}function Je(W,F,ne,he){if(typeof ne=="object"&&ne!==null&&ne.type===V&&ne.key===null&&ne.props.ref===void 0&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case q:e:{for(var ze=ne.key;F!==null;){if(F.key===ze){if(ze=ne.type,ze===V){if(F.tag===7){i(W,F.sibling),he=s(F,ne.props.children),Jo(he,ne),he.return=W,W=he;break e}}else if(F.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===K&&Jl(ze)===F.type){i(W,F.sibling),he=s(F,ne.props),Jo(he,ne),he.return=W,W=he;break e}i(W,F);break}else t(W,F);F=F.sibling}ne.type===V?(he=Fl(ne.props.children,W.mode,he,ne.key),Jo(he,ne),he.return=W,W=he):(he=ec(ne.type,ne.key,ne.props,null,W.mode,he),Jo(he,ne),he.return=W,W=he)}return m(W);case B:e:{for(ze=ne.key;F!==null;){if(F.key===ze)if(F.tag===4&&F.stateNode.containerInfo===ne.containerInfo&&F.stateNode.implementation===ne.implementation){i(W,F.sibling),he=s(F,ne.children||[]),he.return=W,W=he;break e}else{i(W,F);break}else t(W,F);F=F.sibling}he=Vf(ne,W.mode,he),he.return=W,W=he}return m(W);case K:return ne=Jl(ne),Je(W,F,ne,he)}if(de(ne))return Oe(W,F,ne,he);if($(ne)){if(ze=$(ne),typeof ze!="function")throw Error(a(150));return ne=ze.call(ne),Le(W,F,ne,he)}if(typeof ne.then=="function")return Je(W,F,uc(ne),he);if(ne.$$typeof===te)return Je(W,F,rc(W,ne),he);fc(W,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,F!==null&&F.tag===6?(i(W,F.sibling),he=s(F,ne),he.return=W,W=he):(i(W,F),he=Bf(ne,W.mode,he),he.return=W,W=he),m(W)):i(W,F)}return function(W,F,ne,he){try{Pa=0;var ze=Je(W,F,ne,he);return qr=null,ze}catch(Be){if(Be===Vr||Be===sc)throw Be;var st=ei(29,Be,null,W.mode);return st.lanes=he,st.return=W,st}}}var Wl=b0(!0),v0=b0(!1),$o=!1;function Jf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $f(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function el(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(St&2)!==0){var s=l.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),l.pending=t,t=Ws(e),n0(e,null,i),t}return $s(e,l,t,i),Ws(e)}function Xa(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Er(e,i)}}function Wf(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var s=null,c=null;if(i=i.firstBaseUpdate,i!==null){do{var m={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};c===null?s=c=m:c=c.next=m,i=i.next}while(i!==null);c===null?s=c=t:c=c.next=t}else s=c=t;i={baseState:l.baseState,firstBaseUpdate:s,lastBaseUpdate:c,shared:l.shared,callbacks:l.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var ed=!1;function Ka(){if(ed){var e=Br;if(e!==null)throw e}}function Qa(e,t,i,l){ed=!1;var s=e.updateQueue;$o=!1;var c=s.firstBaseUpdate,m=s.lastBaseUpdate,C=s.shared.pending;if(C!==null){s.shared.pending=null;var k=C,ee=k.next;k.next=null,m===null?c=ee:m.next=ee,m=k;var re=e.alternate;re!==null&&(re=re.updateQueue,C=re.lastBaseUpdate,C!==m&&(C===null?re.firstBaseUpdate=ee:C.next=ee,re.lastBaseUpdate=k))}if(c!==null){var pe=s.baseState;m=0,re=ee=k=null,C=c;do{var Z=C.lane&-536870913,oe=Z!==C.lane;if(oe?(at&Z)===Z:(l&Z)===Z){Z!==0&&Z===Ql&&(ed=!0),re!==null&&(re=re.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var Oe=e,Le=C;Z=t;var Je=i;switch(Le.tag){case 1:if(Oe=Le.payload,typeof Oe=="function"){pe=Oe.call(Je,pe,Z);break e}pe=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Le.payload,Z=typeof Oe=="function"?Oe.call(Je,pe,Z):Oe,Z==null)break e;pe=D({},pe,Z);break e;case 2:$o=!0}}Z=C.callback,Z!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=s.callbacks,oe===null?s.callbacks=[Z]:oe.push(Z))}else oe={lane:Z,tag:C.tag,payload:C.payload,callback:C.callback,next:null},re===null?(ee=re=oe,k=pe):re=re.next=oe,m|=Z;if(C=C.next,C===null){if(C=s.shared.pending,C===null)break;oe=C,C=oe.next,oe.next=null,s.lastBaseUpdate=oe,s.shared.pending=null}}while(!0);re===null&&(k=pe),s.baseState=k,s.firstBaseUpdate=ee,s.lastBaseUpdate=re,c===null&&(s.shared.lanes=0),al|=m,e.lanes=m,e.memoizedState=pe}}function S0(e,t){if(typeof e!="function")throw Error(a(191,e));e.call(t)}function w0(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)S0(i[e],t)}var tl=je(null),dc=je(0);function x0(e,t){e=_o,Ne(dc,e),Ne(tl,t),_o=e|t.baseLanes}function td(){Ne(dc,_o),Ne(tl,tl.current)}function nd(){_o=dc.current,Se(tl),Se(dc)}var Nn=je(null),Hn=null;function nl(e){var t=e.alternate;Ne(_n,_n.current&1),Ne(Nn,e),Hn===null&&(t===null||tl.current!==null||t.memoizedState!==null)&&(Hn=e)}function id(e){Ne(_n,_n.current),Ne(Nn,e),Hn===null&&(Hn=e)}function E0(e){e.tag===22?(Ne(_n,_n.current),Ne(Nn,e),Hn===null&&(Hn=e)):il()}function il(){Ne(_n,_n.current),Ne(Nn,Nn.current)}function mi(e){Se(Nn),Hn===e&&(Hn=null),Se(_n)}var _n=je(0);function Za(e,t){Ne(Nn,Nn.current),Ne(_n,t)}function od(e){Se(_n),Se(Nn),Hn===e&&(Hn=null)}function hc(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Rh(i)||Ch(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Co=0,Ze=null,Nt=null,dn=null,pc=!1,Yr=!1,er=!1,mc=0,Ja=0,Fr=null,ex=0;function en(){throw Error(a(321))}function ld(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!pi(e[i],t[i]))return!1;return!0}function rd(e,t,i,l,s,c){return Co=c,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,me.H=e===null||e.memoizedState===null?rg:ag,er=!1,c=i(l,s),er=!1,Yr&&(c=A0(t,i,l,s)),T0(e),c}function T0(e){me.H=xc;var t=Nt!==null&&Nt.next!==null;if(Co=0,dn=Nt=Ze=null,pc=!1,Ja=0,Fr=null,t)throw Error(a(300));e===null||hn||(e=e.dependencies,e!==null&&lc(e)&&(hn=!0))}function A0(e,t,i,l){Ze=e;var s=0;do{if(Yr&&(Fr=null),Ja=0,Yr=!1,25<=s)throw Error(a(301));if(s+=1,dn=Nt=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}me.H=sx,c=t(i,l)}while(Yr);return c}function tx(){var e=me.H,t=e.useState()[0];return t=typeof t.then=="function"?$a(t):t,e=e.useState()[0],(Nt!==null?Nt.memoizedState:null)!==e&&(Ze.flags|=1024),t}function ad(){var e=mc!==0;return mc=0,e}function sd(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function cd(e){if(pc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}pc=!1}Co=0,dn=Nt=Ze=null,Yr=!1,Ja=mc=0,Fr=null}function Kn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dn===null?Ze.memoizedState=dn=e:dn=dn.next=e,dn}function rn(){if(Nt===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=Nt.next;var t=dn===null?Ze.memoizedState:dn.next;if(t!==null)dn=t,Nt=e;else{if(e===null)throw Ze.alternate===null?Error(a(467)):Error(a(310));Nt=e,e={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},dn===null?Ze.memoizedState=dn=e:dn=dn.next=e}return dn}function gc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $a(e){var t=Ja;return Ja+=1,Fr===null&&(Fr=[]),e=m0(Fr,e,t),t=Ze,(dn===null?t.memoizedState:dn.next)===null&&(t=t.alternate,me.H=t===null||t.memoizedState===null?rg:ag),e}function yc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return $a(e);if(e.$$typeof===I)return;if(e.$$typeof===te)return Mn(e)}throw Error(a(438,String(e)))}function ud(e){var t=null,i=Ze.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var l=Ze.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=gc(),Ze.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),l=0;l<e;l++)i[l]=se;return t.index++,i}function Oo(e,t){return typeof t=="function"?t(e):t}function bc(e){var t=rn();return fd(t,Nt,e)}function fd(e,t,i){var l=e.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=i;var s=e.baseQueue,c=l.pending;if(c!==null){if(s!==null){var m=s.next;s.next=c.next,c.next=m}t.baseQueue=s=c,l.pending=null}if(c=e.baseState,s===null)e.memoizedState=c;else{t=s.next;var C=m=null,k=null,ee=t,re=!1;do{var pe=ee.lane&-536870913;if(pe!==ee.lane?(at&pe)===pe:(Co&pe)===pe){var Z=ee.revertLane;if(Z===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),pe===Ql&&(re=!0);else if((Co&Z)===Z){ee=ee.next,Z===Ql&&(re=!0);continue}else pe={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},k===null?(C=k=pe,m=c):k=k.next=pe,Ze.lanes|=Z,al|=Z;pe=ee.action,er&&i(c,pe),c=ee.hasEagerState?ee.eagerState:i(c,pe)}else Z={lane:pe,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},k===null?(C=k=Z,m=c):k=k.next=Z,Ze.lanes|=pe,al|=pe;ee=ee.next}while(ee!==null&&ee!==t);if(k===null?m=c:k.next=C,!pi(c,e.memoizedState)&&(hn=!0,re&&(i=Br,i!==null)))throw i;e.memoizedState=c,e.baseState=m,e.baseQueue=k,l.lastRenderedState=c}return s===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function dd(e){var t=rn(),i=t.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=e;var l=i.dispatch,s=i.pending,c=t.memoizedState;if(s!==null){i.pending=null;var m=s=s.next;do c=e(c,m.action),m=m.next;while(m!==s);pi(c,t.memoizedState)||(hn=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),i.lastRenderedState=c}return[c,l]}function R0(e,t,i){var l=Ze,s=rn(),c=nt;if(c){if(i===void 0)throw Error(a(407));i=i()}else i=t();var m=!pi((Nt||s).memoizedState,i);if(m&&(s.memoizedState=i,hn=!0),s=s.queue,md(M0.bind(null,l,s,e),[e]),e=s.getSnapshot!==t||m||dn!==null&&(dn.memoizedState.tag&1)!==0,Gr(e?9:8,{destroy:void 0},O0.bind(null,l,s,i,t),null),e){if(l.flags|=2048,jt===null)throw Error(a(349));c||(Co&127)!==0||C0(l,t,i)}return i}function C0(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ze.updateQueue,t===null?(t=gc(),Ze.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function O0(e,t,i,l){t.value=i,t.getSnapshot=l,N0(t)&&_0(e)}function M0(e,t,i){return i(function(){N0(t)&&_0(e)})}function N0(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!pi(e,i)}catch{return!0}}function _0(e){var t=Yl(e,2);t!==null&&oi(t,e,2)}function hd(e){var t=Kn();if(typeof e=="function"){var i=e;if(e=i(),er){vt(!0);try{i()}finally{vt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:e},t}function D0(e,t,i,l){return e.baseState=i,fd(e,Nt,typeof l=="function"?l:Oo)}function nx(e,t,i,l,s){if(wc(e))throw Error(a(485));if(e=t.action,e!==null){var c={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){c.listeners.push(m)}};me.T!==null?i(!0):c.isTransition=!1,l(c),i=t.pending,i===null?(c.next=t.pending=c,j0(t,c)):(c.next=i.next,t.pending=i.next=c)}}function j0(e,t){var i=t.action,l=t.payload,s=e.state;if(t.isTransition){var c=me.T,m={};m.types=c!==null?c.types:null,me.T=m;try{var C=i(s,l),k=me.S;k!==null&&k(m,C),z0(e,t,C)}catch(ee){pd(e,t,ee)}finally{c!==null&&m.types!==null&&(c.types=m.types),me.T=c}}else try{c=i(s,l),z0(e,t,c)}catch(ee){pd(e,t,ee)}}function z0(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){L0(e,t,l)},function(l){return pd(e,t,l)}):L0(e,t,i)}function L0(e,t,i){t.status="fulfilled",t.value=i,k0(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,j0(e,i)))}function pd(e,t,i){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=i,k0(t),t=t.next;while(t!==l)}e.action=null}function k0(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function U0(e,t){return t}function I0(e,t){if(nt){var i=jt.formState;if(i!==null){e:{var l=Ze;if(nt){if(Ut){t:{for(var s=Ut,c=Di;s.nodeType!==8;){if(!c){s=null;break t}if(s=zi(s.nextSibling),s===null){s=null;break t}}c=s.data,s=c==="F!"||c==="F"?s:null}if(s){Ut=zi(s.nextSibling),l=s.data==="F!";break e}}Qo(l)}l=!1}l&&(t=i[0])}}return i=Kn(),i.memoizedState=i.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:U0,lastRenderedState:t},i.queue=l,i=ig.bind(null,Ze,l),l.dispatch=i,l=hd(!1),c=Sd.bind(null,Ze,!1,l.queue),l=Kn(),s={state:t,dispatch:null,action:e,pending:null},l.queue=s,i=nx.bind(null,Ze,s,c,i),s.dispatch=i,l.memoizedState=e,[t,i,!1]}function H0(e){var t=rn();return B0(t,Nt,e)}function B0(e,t,i){if(t=fd(e,t,U0)[0],e=bc(Oo)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=$a(t)}catch(m){throw m===Vr?sc:m}else l=t;t=rn();var s=t.queue,c=s.dispatch;return i!==t.memoizedState&&(Ze.flags|=2048,Gr(9,{destroy:void 0},ix.bind(null,s,i),null)),[l,c,e]}function ix(e,t){e.action=t}function V0(e){var t=rn(),i=Nt;if(i!==null)return B0(t,i,e);rn(),t=t.memoizedState,i=rn();var l=i.queue.dispatch;return i.memoizedState=e,[t,l,!1]}function Gr(e,t,i,l){return e={tag:e,create:i,deps:l,inst:t,next:null},t=Ze.updateQueue,t===null&&(t=gc(),Ze.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e),e}function q0(){return rn().memoizedState}function vc(e,t,i,l){var s=Kn();Ze.flags|=e,s.memoizedState=Gr(1|t,{destroy:void 0},i,l===void 0?null:l)}function Sc(e,t,i,l){var s=rn();l=l===void 0?null:l;var c=s.memoizedState.inst;Nt!==null&&l!==null&&ld(l,Nt.memoizedState.deps)?s.memoizedState=Gr(t,c,i,l):(Ze.flags|=e,s.memoizedState=Gr(1|t,c,i,l))}function Y0(e,t){vc(8390656,8,e,t)}function md(e,t){Sc(2048,8,e,t)}function ox(e){Ze.flags|=4;var t=Ze.updateQueue;if(t===null)t=gc(),Ze.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function F0(e){var t=rn().memoizedState;return ox({ref:t,nextImpl:e}),function(){if((St&2)!==0)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function G0(e,t){return Sc(4,2,e,t)}function P0(e,t){return Sc(4,4,e,t)}function X0(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function K0(e,t,i){i=i!=null?i.concat([e]):null,Sc(4,4,X0.bind(null,t,e),i)}function gd(){}function Q0(e,t){var i=rn();t=t===void 0?null:t;var l=i.memoizedState;return t!==null&&ld(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Z0(e,t){var i=rn();t=t===void 0?null:t;var l=i.memoizedState;if(t!==null&&ld(t,l[1]))return l[0];if(l=e(),er){vt(!0);try{e()}finally{vt(!1)}}return i.memoizedState=[l,t],l}function yd(e,t,i){return i===void 0||(Co&1073741824)!==0&&(at&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=ry(),Ze.lanes|=e,al|=e,i)}function J0(e,t,i,l){return pi(i,t)?i:tl.current!==null?(e=yd(e,i,l),pi(e,t)||(hn=!0),e):(Co&106)===0||(Co&1073741824)!==0&&(at&261930)===0?(hn=!0,e.memoizedState=i):(e=ry(),Ze.lanes|=e,al|=e,t)}function $0(e,t,i,l,s){var c=ae.p;ae.p=c!==0&&8>c?c:8;var m=me.T,C={};C.types=m!==null?m.types:null,me.T=C,Sd(e,!1,t,i);try{var k=s(),ee=me.S;if(ee!==null&&ee(C,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var re=Ww(k,l);Wa(e,t,re,vi(e))}else Wa(e,t,l,vi(e))}catch(pe){Wa(e,t,{then:function(){},status:"rejected",reason:pe},vi())}finally{ae.p=c,m!==null&&C.types!==null&&(m.types=C.types),me.T=m}}function lx(){}function bd(e,t,i,l){if(e.tag!==5)throw Error(a(476));var s=W0(e).queue;$0(e,s,t,Re,i===null?lx:function(){return eg(e),i(l)})}function W0(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Re,baseState:Re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:Re},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function eg(e){var t=W0(e);t.next===null&&(t=e.alternate.memoizedState),Wa(e,t.next.queue,{},vi())}function vd(){return Mn(ua)}function tg(){return rn().memoizedState}function ng(){return rn().memoizedState}function rx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=vi();e=Wo(i);var l=el(t,e,i);l!==null&&(oi(l,t,i),Xa(l,t,i)),t={cache:Xf()},e.payload=t;return}t=t.return}}function ax(e,t,i){var l=vi();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},wc(e)?og(t,i):(i=If(e,t,i,l),i!==null&&(oi(i,e,l),lg(i,t,l)))}function ig(e,t,i){var l=vi();Wa(e,t,i,l)}function Wa(e,t,i,l){var s={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(wc(e))og(t,s);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var m=t.lastRenderedState,C=c(m,i);if(s.hasEagerState=!0,s.eagerState=C,pi(C,m))return $s(e,t,s,0),jt===null&&Js(),!1}catch{}if(i=If(e,t,s,l),i!==null)return oi(i,e,l),lg(i,t,l),!0}return!1}function Sd(e,t,i,l){if(l={lane:2,revertLane:uh(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},wc(e)){if(t)throw Error(a(479))}else t=If(e,i,l,2),t!==null&&oi(t,e,2)}function wc(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function og(e,t){Yr=pc=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function lg(e,t,i){if((i&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Er(e,i)}}var xc={readContext:Mn,use:yc,useCallback:en,useContext:en,useEffect:en,useImperativeHandle:en,useLayoutEffect:en,useInsertionEffect:en,useMemo:en,useReducer:en,useRef:en,useState:en,useDebugValue:en,useDeferredValue:en,useTransition:en,useSyncExternalStore:en,useId:en,useHostTransitionStatus:en,useFormState:en,useActionState:en,useOptimistic:en,useMemoCache:en,useCacheRefresh:en,useEffectEvent:en},rg={readContext:Mn,use:yc,useCallback:function(e,t){return Kn().memoizedState=[e,t===void 0?null:t],e},useContext:Mn,useEffect:Y0,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,vc(4194308,4,X0.bind(null,t,e),i)},useLayoutEffect:function(e,t){return vc(4194308,4,e,t)},useInsertionEffect:function(e,t){vc(4,2,e,t)},useMemo:function(e,t){var i=Kn();t=t===void 0?null:t;var l=e();if(er){vt(!0);try{e()}finally{vt(!1)}}return i.memoizedState=[l,t],l},useReducer:function(e,t,i){var l=Kn();if(i!==void 0){var s=i(t);if(er){vt(!0);try{i(t)}finally{vt(!1)}}}else s=t;return l.memoizedState=l.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},l.queue=e,e=e.dispatch=ax.bind(null,Ze,e),[l.memoizedState,e]},useRef:function(e){var t=Kn();return e={current:e},t.memoizedState=e},useState:function(e){e=hd(e);var t=e.queue,i=ig.bind(null,Ze,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:gd,useDeferredValue:function(e,t){var i=Kn();return yd(i,e,t)},useTransition:function(){var e=hd(!1);return e=$0.bind(null,Ze,e.queue,!0,!1),Kn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var l=Ze,s=Kn();if(nt){if(i===void 0)throw Error(a(407));i=i()}else{if(i=t(),jt===null)throw Error(a(349));(at&127)!==0||C0(l,t,i)}s.memoizedState=i;var c={value:i,getSnapshot:t};return s.queue=c,Y0(M0.bind(null,l,c,e),[e]),l.flags|=2048,Gr(9,{destroy:void 0},O0.bind(null,l,c,i,t),null),i},useId:function(){var e=Kn(),t=jt.identifierPrefix;if(nt){var i=no,l=to;i=(l&~(1<<32-mt(l)-1)).toString(32)+i,t="_"+t+"R_"+i,i=mc++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=ex++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:vd,useFormState:I0,useActionState:I0,useOptimistic:function(e){var t=Kn();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Sd.bind(null,Ze,!0,i),i.dispatch=t,[e,t]},useMemoCache:ud,useCacheRefresh:function(){return Kn().memoizedState=rx.bind(null,Ze)},useEffectEvent:function(e){var t=Kn(),i={impl:e};return t.memoizedState=i,function(){if((St&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}},ag={readContext:Mn,use:yc,useCallback:Q0,useContext:Mn,useEffect:md,useImperativeHandle:K0,useInsertionEffect:G0,useLayoutEffect:P0,useMemo:Z0,useReducer:bc,useRef:q0,useState:function(){return bc(Oo)},useDebugValue:gd,useDeferredValue:function(e,t){var i=rn();return J0(i,Nt.memoizedState,e,t)},useTransition:function(){var e=bc(Oo)[0],t=rn().memoizedState;return[typeof e=="boolean"?e:$a(e),t]},useSyncExternalStore:R0,useId:tg,useHostTransitionStatus:vd,useFormState:H0,useActionState:H0,useOptimistic:function(e,t){var i=rn();return D0(i,Nt,e,t)},useMemoCache:ud,useCacheRefresh:ng,useEffectEvent:F0},sx={readContext:Mn,use:yc,useCallback:Q0,useContext:Mn,useEffect:md,useImperativeHandle:K0,useInsertionEffect:G0,useLayoutEffect:P0,useMemo:Z0,useReducer:dd,useRef:q0,useState:function(){return dd(Oo)},useDebugValue:gd,useDeferredValue:function(e,t){var i=rn();return Nt===null?yd(i,e,t):J0(i,Nt.memoizedState,e,t)},useTransition:function(){var e=dd(Oo)[0],t=rn().memoizedState;return[typeof e=="boolean"?e:$a(e),t]},useSyncExternalStore:R0,useId:tg,useHostTransitionStatus:vd,useFormState:V0,useActionState:V0,useOptimistic:function(e,t){var i=rn();return Nt!==null?D0(i,Nt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:ud,useCacheRefresh:ng,useEffectEvent:F0};function wd(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:D({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var xd={enqueueSetState:function(e,t,i){e=e._reactInternals;var l=vi(),s=Wo(l);s.payload=t,i!=null&&(s.callback=i),t=el(e,s,l),t!==null&&(oi(t,e,l),Xa(t,e,l))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=vi(),s=Wo(l);s.tag=1,s.payload=t,i!=null&&(s.callback=i),t=el(e,s,l),t!==null&&(oi(t,e,l),Xa(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=vi(),l=Wo(i);l.tag=2,t!=null&&(l.callback=t),t=el(e,l,i),t!==null&&(oi(t,e,i),Xa(t,e,i))}};function sg(e,t,i,l,s,c,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,m):t.prototype&&t.prototype.isPureReactComponent?!Ha(i,l)||!Ha(s,c):!0}function cg(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&xd.enqueueReplaceState(t,t.state,null)}function tr(e,t){var i=t;if("ref"in t){i={};for(var l in t)l!=="ref"&&(i[l]=t[l])}if(e=e.defaultProps){i===t&&(i=D({},i));for(var s in e)i[s]===void 0&&(i[s]=e[s])}return i}function ug(e){Zs(e)}function fg(e){console.error(e)}function dg(e){Zs(e)}function Ec(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function hg(e,t,i){try{var l=e.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Ed(e,t,i){return i=Wo(i),i.tag=3,i.payload={element:null},i.callback=function(){Ec(e,t)},i}function pg(e){return e=Wo(e),e.tag=3,e}function mg(e,t,i,l){var s=i.type.getDerivedStateFromError;if(typeof s=="function"){var c=l.value;e.payload=function(){return s(c)},e.callback=function(){hg(t,i,l)}}var m=i.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){hg(t,i,l),typeof s!="function"&&(sl===null?sl=new Set([this]):sl.add(this));var C=l.stack;this.componentDidCatch(l.value,{componentStack:C!==null?C:""})})}function cx(e,t,i,l,s){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=i.alternate,t!==null&&Xl(t,i,s,!0),i=Nn.current,i!==null){switch(i.tag){case 31:case 13:case 19:return Hn===null?Fc():i.alternate===null&&tn===0&&(tn=3),i.flags&=-257,i.flags|=65536,i.lanes=s,l===cc?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([l]):t.add(l),ah(e,l,s)),!1;case 22:return i.flags|=65536,l===cc?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([l]):i.add(l)),ah(e,l,s)),!1}throw Error(a(435,i.tag))}return ah(e,l,s),Fc(),!1}if(nt)return t=Nn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,l!==Yf&&(e=Error(a(422),{cause:l}),qa(Mi(e,i)))):(l!==Yf&&(t=Error(a(423),{cause:l}),qa(Mi(t,i))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,l=Mi(l,i),s=Ed(e.stateNode,l,s),Wf(e,s),tn!==4&&(tn=2)),!1;var c=Error(a(520),{cause:l});if(c=Mi(c,i),as===null?as=[c]:as.push(c),tn!==4&&(tn=2),t===null)return!0;l=Mi(l,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=s&-s,i.lanes|=e,e=Ed(i.stateNode,l,e),Wf(i,e),!1;case 1:if(t=i.type,c=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(sl===null||!sl.has(c))))return i.flags|=65536,s&=-s,i.lanes|=s,s=pg(s),mg(s,e,i,l),Wf(i,s),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var Td=Error(a(461)),hn=!1;function yn(e,t,i,l){t.child=e===null?v0(t,null,i,l):Wl(t,e.child,i,l)}function gg(e,t,i,l,s){i=i.render;var c=t.ref;if("ref"in l){var m={};for(var C in l)C!=="ref"&&(m[C]=l[C])}else m=l;return Kl(t),l=rd(e,t,i,m,c,s),C=ad(),e!==null&&!hn?(sd(e,t,s),Mo(e,t,s)):(nt&&C&&nc(t),t.flags|=1,yn(e,t,l,s),t.child)}function yg(e,t,i,l,s){if(e===null){var c=i.type;return typeof c=="function"&&!Hf(c)&&c.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=c,bg(e,t,c,l,s)):(e=ec(i.type,null,l,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Dd(e,s)){var m=c.memoizedProps;if(i=i.compare,i=i!==null?i:Ha,i(m,l)&&e.ref===t.ref)return Mo(e,t,s)}return t.flags|=1,e=Eo(c,l),e.ref=t.ref,e.return=t,t.child=e}function bg(e,t,i,l,s){if(e!==null){var c=e.memoizedProps;if(Ha(c,l)&&e.ref===t.ref)if(hn=!1,t.pendingProps=l=c,Dd(e,s))(e.flags&131072)!==0&&(hn=!0);else return t.lanes=e.lanes,Mo(e,t,s)}return Ad(e,t,i,l,s)}function vg(e,t,i,l){var s=l.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|i:i,e!==null){for(l=t.child=e.child,s=0;l!==null;)s=s|l.lanes|l.childLanes,l=l.sibling;l=s&~c}else l=0,t.child=null;return Sg(e,t,c,i,l)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ac(t,c!==null?c.cachePool:null),c!==null?x0(t,c):td(),E0(t);else return l=t.lanes=536870912,Sg(e,t,c!==null?c.baseLanes|i:i,i,l)}else c!==null?(ac(t,c.cachePool),x0(t,c),il(),t.memoizedState=null):(e!==null&&ac(t,null),td(),il());return yn(e,t,s,i),t.child}function es(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Sg(e,t,i,l,s){var c=Qf();return c=c===null?null:{parent:fn._currentValue,pool:c},t.memoizedState={baseLanes:i,cachePool:c},e!==null&&ac(t,null),td(),E0(t),e!==null&&Xl(e,t,l,!0),t.childLanes=s,null}function Tc(e,t){return t=Ac({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function wg(e,t,i){return Wl(t,e.child,null,i),e=Tc(t,t.pendingProps),e.flags|=2,mi(t),t.memoizedState=null,e}function ux(e,t,i){var l=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(nt){if(l.mode==="hidden")return e=Tc(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},es(null,e);if(id(t),(e=Ut)?(e=Xy(e,Di),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xo!==null?{id:to,overflow:no}:null,retryLane:536870912,hydrationErrors:null},i=o0(e),i.return=t,t.child=i,wn=t,Ut=null)):e=null,e===null)throw Qo(t);return t.lanes=536870912,null}return Tc(t,l)}var c=e.memoizedState;if(c!==null){var m=c.dehydrated;if(id(t),s)if(t.flags&256)t.flags&=-257,t=wg(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(hn||Xl(e,t,i,!1),s=(i&e.childLanes)!==0,hn||s){if(tl.current===null){if(l=jt,l!==null&&(m=Dl(l,i),m!==0&&m!==c.retryLane))throw c.retryLane=m,Yl(e,m),oi(l,e,m),Td;Fc()}t=wg(e,t,i)}else e=c.treeContext,Ut=zi(m.nextSibling),wn=t,nt=!0,Ko=null,Di=!1,e!==null&&a0(t,e),t=Tc(t,l),t.flags|=134221824;return t}return e=Eo(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Pr(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(a(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Ad(e,t,i,l,s){return Kl(t),i=rd(e,t,i,l,void 0,s),l=ad(),e!==null&&!hn?(sd(e,t,s),Mo(e,t,s)):(nt&&l&&nc(t),t.flags|=1,yn(e,t,i,s),t.child)}function xg(e,t,i,l,s,c){return Kl(t),t.updateQueue=null,i=A0(t,l,i,s),T0(e),l=ad(),e!==null&&!hn?(sd(e,t,c),Mo(e,t,c)):(nt&&l&&nc(t),t.flags|=1,yn(e,t,i,c),t.child)}function Eg(e,t,i,l,s){if(Kl(t),t.stateNode===null){var c=kr,m=i.contextType;typeof m=="object"&&m!==null&&(c=Mn(m)),c=new i(l,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=xd,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=l,c.state=t.memoizedState,c.refs={},Jf(t),m=i.contextType,c.context=typeof m=="object"&&m!==null?Mn(m):kr,c.state=t.memoizedState,m=i.getDerivedStateFromProps,typeof m=="function"&&(wd(t,i,m,l),c.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(m=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),m!==c.state&&xd.enqueueReplaceState(c,c.state,null),Qa(t,l,c,s),Ka(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){c=t.stateNode;var C=t.memoizedProps,k=tr(i,C);c.props=k;var ee=c.context,re=i.contextType;m=kr,typeof re=="object"&&re!==null&&(m=Mn(re));var pe=i.getDerivedStateFromProps;re=typeof pe=="function"||typeof c.getSnapshotBeforeUpdate=="function",C=t.pendingProps!==C,re||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(C||ee!==m)&&cg(t,c,l,m),$o=!1;var Z=t.memoizedState;c.state=Z,Qa(t,l,c,s),Ka(),ee=t.memoizedState,C||Z!==ee||$o?(typeof pe=="function"&&(wd(t,i,pe,l),ee=t.memoizedState),(k=$o||sg(t,i,k,l,Z,ee,m))?(re||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=ee),c.props=l,c.state=ee,c.context=m,l=k):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{c=t.stateNode,$f(e,t),m=t.memoizedProps,re=tr(i,m),c.props=re,pe=t.pendingProps,Z=c.context,ee=i.contextType,k=kr,typeof ee=="object"&&ee!==null&&(k=Mn(ee)),C=i.getDerivedStateFromProps,(ee=typeof C=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(m!==pe||Z!==k)&&cg(t,c,l,k),$o=!1,Z=t.memoizedState,c.state=Z,Qa(t,l,c,s),Ka();var oe=t.memoizedState;m!==pe||Z!==oe||$o||e!==null&&e.dependencies!==null&&lc(e.dependencies)?(typeof C=="function"&&(wd(t,i,C,l),oe=t.memoizedState),(re=$o||sg(t,i,re,l,Z,oe,k)||e!==null&&e.dependencies!==null&&lc(e.dependencies))?(ee||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,oe,k),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,oe,k)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||m===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=oe),c.props=l,c.state=oe,c.context=k,l=re):(typeof c.componentDidUpdate!="function"||m===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),l=!1)}return c=l,Pr(e,t),l=(t.flags&128)!==0,c||l?(c=t.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&l?(t.child=Wl(t,e.child,null,s),t.child=Wl(t,null,i,s)):yn(e,t,i,s),t.memoizedState=c.state,e=t.child):e=Mo(e,t,s),e}function Tg(e,t,i,l){return Gl(),t.flags|=256,yn(e,t,i,l),t.child}var Rd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cd(e){return{baseLanes:e,cachePool:h0()}}function Od(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=bi),e}function Ag(e,t,i){var l=t.pendingProps,s=!1,c=(t.flags&128)!==0,m;if((m=c)||(m=e!==null&&e.memoizedState===null?!1:(_n.current&2)!==0),m&&(s=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(nt){if(s?nl(t):il(),(e=Ut)?(e=Xy(e,Di),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xo!==null?{id:to,overflow:no}:null,retryLane:536870912,hydrationErrors:null},i=o0(e),i.return=t,t.child=i,wn=t,Ut=null)):e=null,e===null)throw Qo(t);return Ch(e)?t.lanes=32:t.lanes=536870912,null}return c=l.children,l=l.fallback,s?(il(),s=t.mode,c=Ac({mode:"hidden",children:c},s),l=Fl(l,s,i,null),c.return=t,l.return=t,c.sibling=l,t.child=c,l=t.child,l.memoizedState=Cd(i),l.childLanes=Od(e,m,i),t.memoizedState=Rd,es(null,l)):(nl(t),Md(t,c))}var C=e.memoizedState;if(C!==null){var k=C.dehydrated;if(k!==null)return fx(e,t,c,m,l,k,C,i)}return s?(il(),s=l.fallback,c=t.mode,C=e.child,k=C.sibling,l=Eo(C,{mode:"hidden",children:l.children}),l.subtreeFlags=C.subtreeFlags&1206910976,k!==null?s=Eo(k,s):(s=Fl(s,c,i,null),s.flags|=2),s.return=t,l.return=t,l.sibling=s,t.child=l,es(null,l),l=t.child,s=e.child.memoizedState,s===null?s=Cd(i):(c=s.cachePool,c!==null?(C=fn._currentValue,c=c.parent!==C?{parent:C,pool:C}:c):c=h0(),s={baseLanes:s.baseLanes|i,cachePool:c}),l.memoizedState=s,l.childLanes=Od(e,m,i),t.memoizedState=Rd,es(e.child,l)):(nl(t),i=e.child,e=i.sibling,i=Eo(i,{mode:"visible",children:l.children}),i.return=t,i.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=i,t.memoizedState=null,i)}function Md(e,t){return t=Ac({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ac(e,t){return e=ei(22,e,null,t),e.lanes=0,e}function Rc(e,t,i){return Wl(t,e.child,null,i),e=Md(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function fx(e,t,i,l,s,c,m,C){if(i)return t.flags&256?(nl(t),t.flags&=-257,Rc(e,t,C)):t.memoizedState!==null?(il(),t.child=e.child,t.flags|=128,null):(il(),c=s.fallback,m=t.mode,s=Ac({mode:"visible",children:s.children},m),c=Fl(c,m,C,null),c.flags|=2,s.return=t,c.return=t,s.sibling=c,t.child=s,Wl(t,e.child,null,C),s=t.child,s.memoizedState=Cd(C),s.childLanes=Od(e,l,C),t.memoizedState=Rd,es(null,s));if(nl(t),Ch(c)){if(l=c.nextSibling&&c.nextSibling.dataset,l)var k=l.dgst;return l=k,l!==""&&(s=Error(a(419)),s.stack="",s.digest=l,qa({value:s,source:null,stack:null})),Rc(e,t,C)}if(hn||Xl(e,t,C,!1),l=(C&e.childLanes)!==0,hn||l){if(tl.current!==null)return Rc(e,t,C);if(l=jt,l!==null&&(s=Dl(l,C),s!==0&&s!==m.retryLane))throw m.retryLane=s,Yl(e,s),oi(l,e,s),Td;return Rh(c)||Fc(),Rc(e,t,C)}return Rh(c)?(t.flags|=192,t.child=e.child,null):(e=m.treeContext,Ut=zi(c.nextSibling),wn=t,nt=!0,Ko=null,Di=!1,e!==null&&a0(t,e),t=Md(t,s.children),t.flags|=134221824,t)}function Rg(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),oc(e.return,t,i)}function Cg(e){for(var t=null;e!==null;){var i=e.alternate;i!==null&&hc(i)===null&&(t=e),e=e.sibling}return t}function Cc(e,t,i,l,s,c){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:s,treeForkCount:c}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=i,m.tailMode=s,m.treeForkCount=c)}function Nd(e){var t=e.child;for(e.child=null;t!==null;){var i=t.sibling;t.sibling=e.child,e.child=t,t=i}}function _d(e,t,i){var l=t.pendingProps,s=l.revealOrder,c=l.tail;l=l.children;var m=_n.current;if(t.flags&128)return Za(t,m),null;var C=(m&2)!==0;if(C?(m=m&1|2,t.flags|=128):m&=1,Za(t,m),s==="backwards"&&e!==null?(Nd(e),yn(e,t,l,i),Nd(e)):yn(e,t,l,i),l=nt?Va:0,!C&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rg(e,i,t);else if(e.tag===19)Rg(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"backwards":i=Cg(t.child),i===null?(s=t.child,t.child=null):(s=i.sibling,i.sibling=null,Nd(t)),Cc(t,!0,s,null,c,l);break;case"unstable_legacy-backwards":for(i=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&hc(e)===null){t.child=s;break}e=s.sibling,s.sibling=i,i=s,s=e}Cc(t,!0,i,null,c,l);break;case"together":Cc(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:i=Cg(t.child),i===null?(s=t.child,t.child=null):(s=i.sibling,i.sibling=null),Cc(t,!1,s,i,c,l)}return t.child}function Og(e,t,i){var l=t.pendingProps;return Zo(t,t.type,l.value),yn(e,t,l.children,i),t.child}function Mo(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),al|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Xl(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,i=Eo(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Eo(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Dd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&lc(e)))}function dx(e,t,i){switch(t.tag){case 3:$e(t,t.stateNode.containerInfo),Zo(t,fn,e.memoizedState.cache),Gl();break;case 27:case 5:ue(t);break;case 4:$e(t,t.stateNode.containerInfo);break;case 10:Zo(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,id(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return nl(t),t.flags|=128,null;l=Xl(e,t,i,!1);var s=t.child.childLanes;return l||(i&s)!==0?Ag(e,t,i):(nl(t),e=Mo(e,t,i),e!==null?e.sibling:null)}nl(t);break;case 19:if(t.flags&128)return _d(e,t,i);if(s=(e.flags&128)!==0,l=(i&t.childLanes)!==0,l||(Xl(e,t,i,!1),l=(i&t.childLanes)!==0),s){if(l)return _d(e,t,i);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Za(t,_n.current),l)break;return null;case 22:return t.lanes=0,vg(e,t,i,t.pendingProps);case 24:Zo(t,fn,e.memoizedState.cache)}return Mo(e,t,i)}function Mg(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)hn=!0;else{if(!Dd(e,i)&&(t.flags&128)===0)return hn=!1,dx(e,t,i);hn=(e.flags&131072)!==0}else hn=!1,nt&&(t.flags&1048576)!==0&&r0(t,Va,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Jl(t.elementType),t.type=e,typeof e=="function")Hf(e)?(l=tr(e,l),t.tag=1,t=Eg(null,t,e,l,i)):(t.tag=0,t=Ad(null,t,e,l,i));else{if(e!=null){var s=e.$$typeof;if(s===U){t.tag=11,t=gg(null,t,e,l,i);break e}else if(s===J){t.tag=14,t=yg(null,t,e,l,i);break e}else if(s===te){t.tag=10,t.type=e,t=Og(null,t,i);break e}}throw t=ie(e)||e,Error(a(306,t,""))}}return t;case 0:return Ad(e,t,t.type,t.pendingProps,i);case 1:return l=t.type,s=tr(l,t.pendingProps),Eg(e,t,l,s,i);case 3:e:{if($e(t,t.stateNode.containerInfo),e===null)throw Error(a(387));l=t.pendingProps;var c=t.memoizedState;s=c.element,$f(e,t),Qa(t,l,null,i);var m=t.memoizedState;if(l=m.cache,Zo(t,fn,l),l!==c.cache&&Pf(t,[fn],i,!0),Ka(),l=m.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=Tg(e,t,l,i);break e}else if(l!==s){s=Mi(Error(a(424)),t),qa(s),t=Tg(e,t,l,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ut=zi(e.firstChild),wn=t,nt=!0,Ko=null,Di=!0,i=v0(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling;else{if(Gl(),l===s){t=Mo(e,t,i);break e}yn(e,t,l,i)}t=t.child}return t;case 26:return Pr(e,t),e===null?(i=eb(t.type,null,t.pendingProps,null))?t.memoizedState=i:nt||(t.stateNode=jy(t.type,t.pendingProps,xe.current,t)):t.memoizedState=eb(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&nt&&(l=t.stateNode=Zy(t.type,t.pendingProps,xe.current),wn=t,Di=!0,s=Ut,fl(t.type)?(Oh=s,Ut=zi(l.firstChild)):Ut=s),yn(e,t,t.pendingProps.children,i),Pr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&nt&&((s=l=Ut)&&(l=rE(l,t.type,t.pendingProps,Di),l!==null?(t.stateNode=l,wn=t,Ut=zi(l.firstChild),Di=!1,s=!0):s=!1),s||Qo(t)),ue(t),s=t.type,c=t.pendingProps,m=e!==null?e.memoizedProps:null,l=c.children,vh(s,c)?l=null:m!==null&&vh(s,m)&&(t.flags|=32),t.memoizedState!==null&&(s=rd(e,t,tx,null,null,i),ua._currentValue=s),Pr(e,t),yn(e,t,l,i),t.child;case 6:return e===null&&nt&&((e=i=Ut)&&(i=aE(i,t.pendingProps,Di),i!==null?(t.stateNode=i,wn=t,Ut=null,e=!0):e=!1),e||Qo(t)),null;case 13:return Ag(e,t,i);case 4:return $e(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Wl(t,null,l,i):yn(e,t,l,i),t.child;case 11:return gg(e,t,t.type,t.pendingProps,i);case 7:return l=t.pendingProps,Pr(e,t),yn(e,t,l,i),t.child;case 8:return yn(e,t,t.pendingProps.children,i),t.child;case 12:return yn(e,t,t.pendingProps.children,i),t.child;case 10:return Og(e,t,i);case 9:return s=t.type._context,l=t.pendingProps.children,Kl(t),s=Mn(s),l=l(s),t.flags|=1,yn(e,t,l,i),t.child;case 14:return yg(e,t,t.type,t.pendingProps,i);case 15:return bg(e,t,t.type,t.pendingProps,i);case 19:return _d(e,t,i);case 31:return ux(e,t,i);case 22:return vg(e,t,i,t.pendingProps);case 24:return Kl(t),l=Mn(fn),e===null?(s=Qf(),s===null&&(s=jt,c=Xf(),s.pooledCache=c,c.refCount++,c!==null&&(s.pooledCacheLanes|=i),s=c),t.memoizedState={parent:l,cache:s},Jf(t),Zo(t,fn,s)):((e.lanes&i)!==0&&($f(e,t),Qa(t,null,null,i),Ka()),s=e.memoizedState,c=t.memoizedState,s.parent!==l?(s={parent:l,cache:l},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Zo(t,fn,l)):(l=c.cache,Zo(t,fn,l),l!==s.cache&&Pf(t,[fn],i,!0))),yn(e,t,t.pendingProps.children,i),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=t.pendingProps,l.name!=null&&l.name!=="auto"?t.flags|=e===null?18882560:18874368:nt&&nc(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:Pr(e,t),yn(e,t,l.children,i),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function No(e){e.flags|=4}function jd(e,t,i,l,s){var c;if((c=(e.mode&32)!==0)&&(c=i===null?ob(t,l):ob(t,l)&&(l.src!==i.src||l.srcSet!==i.srcSet)),c){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(uy())e.flags|=8192;else throw $l=cc,Zf}else e.flags&=-16777217}function Ng(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!lb(t))if(uy())e.flags|=8192;else throw $l=cc,Zf}function Oc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Yi():536870912,e.lanes|=t,Jr|=t)}function ts(e,t){if(!nt)switch(e.tailMode){case"visible":break;case"collapsed":for(var i=e.tail,l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null}}function It(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var s=e.child;s!==null;)i|=s.lanes|s.childLanes,l|=s.subtreeFlags&1206910976,l|=s.flags&1206910976,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)i|=s.lanes|s.childLanes,l|=s.subtreeFlags,l|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function hx(e,t,i){var l=t.pendingProps;switch(qf(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(t),null;case 1:return It(t),null;case 3:return i=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Ro(fn),ft(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Hr(t)?No(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ff())),It(t),null;case 26:var s=t.type,c=t.memoizedState;return e===null?(No(t),c!==null?(It(t),Ng(t,c)):(It(t),jd(t,s,null,l,i))):c?c!==e.memoizedState?(No(t),It(t),Ng(t,c)):(It(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&No(t),It(t),jd(t,s,e,l,i)),null;case 27:if(ge(t),i=xe.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&No(t);else{if(!l){if(t.stateNode===null)throw Error(a(166));return It(t),t.subtreeFlags&=-33554433,null}e=Ee.current,Hr(t)?s0(t):(e=Zy(s,l,i),t.stateNode=e,No(t))}return It(t),t.subtreeFlags&=-33554433,null;case 5:if(ge(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&No(t);else{if(!l){if(t.stateNode===null)throw Error(a(166));return It(t),t.subtreeFlags&=-33554433,null}if(c=Ee.current,Hr(t))s0(t);else{var m=ds(xe.current);switch(c){case 1:c=m.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:c=m.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":c=m.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":c=m.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":c=m.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?m.createElement("select",{is:l.is}):m.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?m.createElement(s,{is:l.is}):m.createElement(s)}}c[Zt]=t,c[Rn]=l;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)c.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=c;e:switch(jn(c,s,l),s){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&No(t)}}return It(t),t.subtreeFlags&=-33554433,jd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&No(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(a(166));if(e=xe.current,Hr(t)){if(e=t.stateNode,i=t.memoizedProps,l=null,s=wn,s!==null)switch(s.tag){case 27:case 5:l=s.memoizedProps}e[Zt]=t,e=!!(e.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||My(e.nodeValue,i)),e||Qo(t,!0)}else e=ds(e).createTextNode(l),e[Zt]=t,t.stateNode=e}return It(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(l=Hr(t),i!==null){if(e===null){if(!l)throw Error(a(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[Zt]=t}else Gl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;It(t),e=!1}else i=Ff(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(mi(t),t):(mi(t),null);if((t.flags&128)!==0)throw Error(a(558))}return It(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Hr(t),l!==null&&l.dehydrated!==null){if(e===null){if(!s)throw Error(a(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(317));s[Zt]=t}else Gl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;It(t),s=!1}else s=Ff(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(mi(t),t):(mi(t),null)}return mi(t),(t.flags&128)!==0?(t.lanes=i,t):(i=l!==null,e=e!==null&&e.memoizedState!==null,i&&(l=t.child,s=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(s=l.alternate.memoizedState.cachePool.pool),c=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(c=l.memoizedState.cachePool.pool),c!==s&&(l.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Oc(t,t.updateQueue),It(t),null);case 4:return ft(),e===null&&ph(t.stateNode.containerInfo),t.flags|=67108864,It(t),null;case 10:return Ro(t.type),It(t),null;case 19:if(od(t),l=t.memoizedState,l===null)return It(t),null;if(s=(t.flags&128)!==0,c=l.rendering,c===null)if(s)ts(l,!1);else{if(tn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=hc(e),c!==null){for(t.flags|=128,ts(l,!1),e=c.updateQueue,t.updateQueue=e,Oc(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)i0(i,e),i=i.sibling;return Za(t,_n.current&1|2),nt&&To(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ot()>Bc&&(t.flags|=128,s=!0,ts(l,!1),t.lanes=4194304)}else{if(!s)if(e=hc(c),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Oc(t,e),ts(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!c.alternate&&!nt)return It(t),null}else 2*Ot()-l.renderingStartTime>Bc&&i!==536870912&&(t.flags|=128,s=!0,ts(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(e=l.last,e!==null?e.sibling=c:t.child=c,l.last=c)}if(l.tail!==null){e=l.tail;e:{for(i=e;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ot(),e.sibling=null,c=_n.current,c=s?c&1|2:c&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!i||nt?Za(t,c):(i=c,Ne(Nn,t),Ne(_n,i),Hn===null&&(Hn=t)),nt&&To(t,l.treeForkCount),e}return It(t),null;case 22:case 23:return mi(t),nd(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(i&536870912)!==0&&(t.flags&128)===0&&(It(t),t.subtreeFlags&6&&(t.flags|=8192)):It(t),i=t.updateQueue,i!==null&&Oc(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==i&&(t.flags|=2048),e!==null&&Se(Zl),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ro(fn),It(t),null;case 25:return null;case 30:return t.flags|=33554432,It(t),null}throw Error(a(156,t.tag))}function px(e,t){switch(qf(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ro(fn),ft(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ge(t),null;case 31:if(t.memoizedState!==null){if(mi(t),t.alternate===null)throw Error(a(340));Gl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(mi(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Gl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return od(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ft(),null;case 10:return Ro(t.type),null;case 22:case 23:return mi(t),nd(),e!==null&&Se(Zl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ro(fn),null;case 25:return null;default:return null}}function _g(e,t){switch(qf(t),t.tag){case 3:Ro(fn),ft();break;case 26:case 27:case 5:ge(t);break;case 4:ft();break;case 31:t.memoizedState!==null&&mi(t);break;case 13:mi(t);break;case 19:od(t);break;case 10:Ro(t.type);break;case 22:case 23:mi(t),nd(),e!==null&&Se(Zl);break;case 24:Ro(fn)}}function ns(e,t){try{var i=t.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var s=l.next;i=s;do{if((i.tag&e)===e){l=void 0;var c=i.create,m=i.inst;l=c(),m.destroy=l}i=i.next}while(i!==s)}}catch(C){At(t,t.return,C)}}function ol(e,t,i){try{var l=t.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var c=s.next;l=c;do{if((l.tag&e)===e){var m=l.inst,C=m.destroy;if(C!==void 0){m.destroy=void 0,s=t;var k=i,ee=C;try{ee()}catch(re){At(s,k,re)}}}l=l.next}while(l!==c)}}catch(re){At(t,t.return,re)}}function Dg(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{w0(t,i)}catch(l){At(e,e.return,l)}}}function jg(e,t,i){i.props=tr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(l){At(e,t,l)}}function io(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var s=e.stateNode,c=wo(e.memoizedProps,s);(s.ref===null||s.ref.name!==c)&&(s.ref=By(c)),l=s.ref;break;case 7:if(e.stateNode===null){var m=new Si(e);g(e.child,!1,oE,m,void 0,void 0),e.stateNode=m}l=e.stateNode;break;default:l=e.stateNode}typeof i=="function"?e.refCleanup=i(l):i.current=l}}catch(C){At(e,t,C)}}function Dn(e,t){var i=e.ref,l=e.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(s){At(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(s){At(e,t,s)}else i.current=null}function Mc(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var i=0;i<t.length;i++)Py(e.stateNode,t[i])}function zg(e){for(var t=e.return;t!==null&&(Ld(t)&&Py(e.stateNode,t.stateNode),!zd(t));)t=t.return}function is(e){for(var t=e.return;t!==null&&(Ld(t)&&lE(e.stateNode,t.stateNode),!zd(t));)t=t.return}function zd(e){return e.tag===5||e.tag===3||e.tag===27}function Ld(e){return e&&e.tag===7&&e.stateNode!==null}function kd(e){var t=e.type,i=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(s){At(e,e.return,s)}}function Ud(e,t,i){try{var l=e.stateNode;Bx(l,e.type,i,t),l[Rn]=t}catch(s){At(e,e.return,s)}}function Lg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&fl(e.type)||e.tag===4}function Id(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&fl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hd(e,t,i,l){var s=e.tag;if(s===5||s===6)s=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(s,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(s),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Pn)),Mc(e,l),Ve=!0;else if(s!==4&&(s===27&&(Mc(e,l),l=null,fl(e.type)&&(i=e.stateNode,t=null)),e=e.child,e!==null))for(Hd(e,t,i,l),e=e.sibling;e!==null;)Hd(e,t,i,l),e=e.sibling}function Nc(e,t,i,l){var s=e.tag;if(s===5||s===6)s=e.stateNode,t?i.insertBefore(s,t):i.appendChild(s),Mc(e,l),Ve=!0;else if(s!==4&&(s===27&&(Mc(e,l),l=null,fl(e.type)&&(i=e.stateNode)),e=e.child,e!==null))for(Nc(e,t,i,l),e=e.sibling;e!==null;)Nc(e,t,i,l),e=e.sibling}function kg(e){var t=e.stateNode,i=e.memoizedProps;try{for(var l=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);jn(t,l,i),t[Zt]=e,t[Rn]=i}catch(c){At(e,e.return,c)}}var _c=!1,gi=null;function Ug(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(_c=!0)}var oo=null;function Ig(){var e=oo;return oo=null,e}var ti=0;function Xr(e,t,i,l,s){return ti=0,Hg(e.child,t,i,l,s)}function Hg(e,t,i,l,s){for(var c=!1;e!==null;){if(e.tag===5){var m=e.stateNode;if(l!==null){var C=xh(m);l.push(C),C.view&&(c=!0)}else c||xh(m).view&&(c=!0);_c=!0,Iy(m,ti===0?t:t+"_"+ti,i),ti++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&s||Hg(e.child,t,i,l,s)&&(c=!0));e=e.sibling}return c}function lo(e,t){for(;e!==null;)e.tag===5?Hy(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||lo(e.child,t)),e=e.sibling}function Dc(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Dc(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(a(544));var i=t.name;t=xo(t.default,t.share),t!=="none"&&(Xr(e,i,t,null,!1)||lo(e.child,!1))}e=e.sibling}}function Bd(e,t){if(e.tag===30){var i=e.stateNode,l=e.memoizedProps,s=wo(l,i),c=xo(l.default,i.paired?l.share:l.enter);c!=="none"?Xr(e,s,c,null,!1)?(Dc(e),i.paired||t||ta(e,l.onEnter)):lo(e.child,!1):Dc(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Bd(e,t),e=e.sibling;else Dc(e)}function Vd(e){if(gi!==null&&gi.size!==0){var t=gi;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var i=e.memoizedProps,l=i.name;if(l!=null&&l!=="auto"){var s=t.get(l);if(s!==void 0){var c=xo(i.default,i.share);if(c!=="none"&&(Xr(e,l,c,null,!1)?(c=e.stateNode,s.paired=c,c.paired=s,ta(e,i.onShare)):lo(e.child,!1)),t.delete(l),t.size===0)break}}}Vd(e)}e=e.sibling}}}function qd(e){if(e.tag===30){var t=e.memoizedProps,i=wo(t,e.stateNode),l=gi!==null?gi.get(i):void 0,s=xo(t.default,l!==void 0?t.share:t.exit);s!=="none"&&(Xr(e,i,s,null,!1)?l!==void 0?(s=e.stateNode,l.paired=s,s.paired=l,gi.delete(i),ta(e,t.onShare)):ta(e,t.onExit):lo(e.child,!1)),gi!==null&&Vd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)qd(e),e=e.sibling;else gi!==null&&Vd(e)}function Bg(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,i=wo(t,e.stateNode);t=xo(t.default,t.update),e.flags&=-5,t!=="none"&&Xr(e,i,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Bg(e);e=e.sibling}}function Yd(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,lo(e.child,!1))}Yd(e)}e=e.sibling}}function jc(e){if(e.tag===30)e.stateNode.paired=null,lo(e.child,!1),Yd(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)jc(e),e=e.sibling;else Yd(e)}function Vg(e){for(e=e.child;e!==null;)e.tag===30?lo(e.child,!1):(e.subtreeFlags&33554432)!==0&&Vg(e),e=e.sibling}function Fd(e,t,i,l,s,c,m){for(var C=!1;t!==null;){if(t.tag===5){var k=t.stateNode;if(c!==null&&ti<c.length){var ee=c[ti],re=xh(k);(ee.view||re.view)&&(C=!0);var pe;if(pe=(e.flags&4)===0)if(re.clip)pe=!0;else{pe=ee.rect;var Z=re.rect;pe=pe.y!==Z.y||pe.x!==Z.x||pe.height!==Z.height||pe.width!==Z.width}pe&&(e.flags|=4),re.abs?re=!ee.abs:(ee=ee.rect,re=re.rect,re=ee.height!==re.height||ee.width!==re.width),re&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Iy(k,ti===0?i:i+"_"+ti,s),C&&(e.flags&4)!==0||(oo===null&&(oo=[]),oo.push(k,ti===0?l:l+"_"+ti,t.memoizedProps)),ti++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&m?e.flags|=t.flags&32:Fd(e,t.child,i,l,s,c,m)&&(C=!0));t=t.sibling}return C}function qg(e,t){for(e=e.child;e!==null;){if(e.tag===30){var i=e.memoizedProps,l=e.stateNode,s=wo(i,l),c=xo(i.default,i.update),m;m=e.memoizedState,e.memoizedState=null,l=e;var C=e.child;ti=0,s=Fd(l,C,s,s,c,m,!1),(e.flags&4)!==0&&s&&ta(e,i.onUpdate)}else(e.subtreeFlags&33554432)!==0&&qg(e);e=e.sibling}}var xn=!1,xt=!1,ro=!1,Gd=!1,Yg=typeof WeakSet=="function"?WeakSet:Set,En=null,ao=!1,os=!1,zc=!1,Pd=!1;function mx(e,t,i){if(e=e.containerInfo,yh=fa,e=Xm(e),Df(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var s=l.getSelection&&l.getSelection();if(s&&s.rangeCount!==0){l=s.anchorNode;var c=s.anchorOffset,m=s.focusNode;s=s.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var C=0,k=-1,ee=-1,re=0,pe=0,Z=e,oe=null;t:for(;;){for(var Oe;Z!==l||c!==0&&Z.nodeType!==3||(k=C+c),Z!==m||s!==0&&Z.nodeType!==3||(ee=C+s),Z.nodeType===3&&(C+=Z.nodeValue.length),(Oe=Z.firstChild)!==null;)oe=Z,Z=Oe;for(;;){if(Z===e)break t;if(oe===l&&++re===c&&(k=C),oe===m&&++pe===s&&(ee=C),(Oe=Z.nextSibling)!==null)break;Z=oe,oe=Z.parentNode}Z=Oe}l=k===-1||ee===-1?null:{start:k,end:ee}}else l=null}l=l||{start:0,end:0}}else l=null;for(bh={focusedElem:e,selectionRange:l},fa=!1,i=(i&335544064)===i,En=t,t=i?9270:1024;En!==null;){if(e=En,i&&(l=e.deletions,l!==null))for(c=0;c<l.length;c++)i&&qd(l[c]);if(e.alternate===null&&(e.flags&2)!==0)i&&Ug(e),Lc(i);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&i&&qd(l),Lc(i);continue}else if(l!==null&&l.memoizedState!==null){i&&Ug(e),Lc(i);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,En=l):(i&&Bg(e),Lc(i))}}gi=null}function Lc(e){for(;En!==null;){var t=En,i=e,l=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((s&1024)!==0&&l!==null){i=void 0,s=l.memoizedProps,l=l.memoizedState;var c=t.stateNode;try{var m=tr(t.type,s);i=c.getSnapshotBeforeUpdate(m,l),c.__reactInternalSnapshotBeforeUpdate=i}catch(C){At(t,t.return,C)}}break;case 3:if((s&1024)!==0){if(l=t.stateNode.containerInfo,i=l.nodeType,i===9)Ah(l);else if(i===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":Ah(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&l!==null&&(i=wo(l.memoizedProps,l.stateNode),s=t.memoizedProps,s=xo(s.default,s.update),s!=="none"&&Xr(l,i,s,l.memoizedState=[],!0));break;default:if((s&1024)!==0)throw Error(a(163))}if(l=t.sibling,l!==null){l.return=t.return,En=l;break}En=t.return}}function Fg(e,t,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:so(e,i),l&4&&ns(5,i);break;case 1:if(so(e,i),l&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(m){At(i,i.return,m)}else{var s=tr(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){At(i,i.return,m)}}l&64&&Dg(i),l&512&&io(i,i.return);break;case 3:if(so(e,i),l&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{w0(e,t)}catch(m){At(i,i.return,m)}}break;case 27:t===null&&l&4&&kg(i);case 26:case 5:so(e,i),t===null&&l&4&&kd(i),l&512&&io(i,i.return);break;case 12:so(e,i);break;case 31:so(e,i),l&4&&Kg(e,i);break;case 13:so(e,i),l&4&&Qg(e,i),l&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Cx.bind(null,i),sE(e,i))));break;case 22:if(l=i.memoizedState!==null||xn,!l){var c=t!==null&&t.memoizedState!==null||xt;t=xn,s=xt,xn=l,(xt=c)&&!s?(l=2,(i.subtreeFlags&8772)!==0&&(l|=1),Qi(e,i,l)):so(e,i),xn=t,xt=s}break;case 30:so(e,i),l&512&&io(i,i.return);break;case 7:l&512&&io(i,i.return);default:so(e,i)}}function Xd(e,t){for(e=e.child;e!==null;)Gg(e,t),e=e.sibling}function Gg(e,t){switch(e.tag){case 5:case 26:try{var i=e.stateNode;if(t){var l=i.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var s=e.stateNode,c=e.memoizedProps.style,m=c!=null&&c.hasOwnProperty("display")?c.display:null;s.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(k){At(e,e.return,k)}Kd(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Ve=!0}catch(k){At(e,e.return,k)}break;case 18:try{var C=e.stateNode;t?Uy(C,!0):Uy(e.stateNode,!1)}catch(k){At(e,e.return,k)}break;case 22:case 23:e.memoizedState===null&&Xd(e,t);break;default:Xd(e,t)}}function Kd(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var i=e,l=t;switch(i.tag){case 4:Gg(i,l);break e;case 22:i.memoizedState===null&&Kd(i,l);break e;default:Kd(i,l)}}e=e.sibling}}function Pg(e){var t=e.alternate;t!==null&&(e.alternate=null,Pg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Cr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Gt=null,ni=!1;function Xi(e,t,i){for(i=i.child;i!==null;)Xg(e,t,i),i=i.sibling}function Xg(e,t,i){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(Ft,i)}catch{}switch(i.tag){case 26:xt||Dn(i,t),Xi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!xt&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:xt||Dn(i,t),is(i);var l=Gt,s=ni;fl(i.type)&&(Gt=i.stateNode,ni=!1),Xi(e,t,i),Jy(i.stateNode,i.type,i.memoizedProps),Gt=l,ni=s;break;case 5:xt||Dn(i,t),is(i);case 6:if(i.tag===6&&is(i),l=Gt,s=ni,Gt=null,Xi(e,t,i),Gt=l,ni=s,Gt!==null)if(ni)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(i.stateNode),Ve=!0}catch(c){At(i,t,c)}else try{Gt.removeChild(i.stateNode),Ve=!0}catch(c){At(i,t,c)}break;case 18:Gt!==null&&(ni?(e=Gt,ky(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),da(e)):ky(Gt,i.stateNode));break;case 4:l=Gt,s=ni,Gt=i.stateNode.containerInfo,ni=!0,Xi(e,t,i),Gt=l,ni=s;break;case 0:case 11:case 14:case 15:ol(2,i,t),xt||ol(4,i,t),Xi(e,t,i);break;case 1:xt||(Dn(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"&&jg(i,t,l)),Xi(e,t,i);break;case 21:Xi(e,t,i);break;case 22:xt=(l=xt)||i.memoizedState!==null,Xi(e,t,i),xt=l;break;case 30:Dn(i,t),Xi(e,t,i);break;case 7:xt||Dn(i,t),Xi(e,t,i);break;default:Xi(e,t,i)}}function Kg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{da(e)}catch(i){At(t,t.return,i)}}}function Qg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{da(e)}catch(i){At(t,t.return,i)}}function gx(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Yg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Yg),t;default:throw Error(a(435,e.tag))}}function kc(e,t){var i=gx(e);t.forEach(function(l){if(!i.has(l)){i.add(l);var s=Ox.bind(null,e,l);l.then(s,s)}})}function Qn(e,t,i){var l=t.deletions;if(l!==null)for(var s=0;s<l.length;s++){var c=l[s],m=e,C=t,k=C;e:for(;k!==null;){switch(k.tag){case 27:if(fl(k.type)){Gt=k.stateNode,ni=!1;break e}break;case 5:Gt=k.stateNode,ni=!1;break e;case 3:case 4:Gt=k.stateNode.containerInfo,ni=!0;break e}k=k.return}if(Gt===null)throw Error(a(160));Xg(m,C,c),Gt=null,ni=!1,m=c.alternate,m!==null&&(m.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Zg(t,e,i),t=t.sibling}var Ki=null;function Zg(e,t,i){var l=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(s&4&&(l=e.updateQueue,l=l!==null?l.events:null,l!==null))for(var c=0;c<l.length;c++){var m=l[c];m.ref.impl=m.nextImpl}Qn(t,e,i),Zn(e),s&4&&(ol(3,e,e.return),ns(3,e),ol(5,e,e.return));break;case 1:Qn(t,e,i),Zn(e),s&512&&(xt||l===null||Dn(l,l.return)),s&64&&xn&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?t:i.concat(t))));break;case 26:if(c=Ki,Qn(t,e,i),Zn(e),s&512&&(xt||l===null||Dn(l,l.return)),s&4)if(s=l!==null?l.memoizedState:null,i=e.memoizedState,l===null)if(i===null)if(e.stateNode===null)if(xn)e.stateNode=jy(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,i=e.memoizedProps,s=c.ownerDocument||c;t:switch(t){case"title":l=s.getElementsByTagName("title")[0],(!l||l[zl]||l[Zt]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=s.createElement(t),s.head.insertBefore(l,s.querySelector("head > title"))),jn(l,t,i),l[Zt]=e,ve(l),t=l;break e;case"link":if(c=ib("link","href",s).get(t+(i.href||""))){for(m=0;m<c.length;m++)if(l=c[m],l.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&l.getAttribute("rel")===(i.rel==null?null:i.rel)&&l.getAttribute("title")===(i.title==null?null:i.title)&&l.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){c.splice(m,1);break t}}l=s.createElement(t),jn(l,t,i),s.head.appendChild(l);break;case"meta":if(c=ib("meta","content",s).get(t+(i.content||""))){for(m=0;m<c.length;m++)if(l=c[m],l.getAttribute("content")===(i.content==null?null:""+i.content)&&l.getAttribute("name")===(i.name==null?null:i.name)&&l.getAttribute("property")===(i.property==null?null:i.property)&&l.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&l.getAttribute("charset")===(i.charSet==null?null:i.charSet)){c.splice(m,1);break t}}l=s.createElement(t),jn(l,t,i),s.head.appendChild(l);break;default:throw Error(a(468,t))}l[Zt]=e,ve(l),t=l}e.stateNode=t}else xn||Dh(c,e.type,e.stateNode);else e.stateNode=nb(c,i,e.memoizedProps);else s!==i?(s===null?(t=l.stateNode,t===null||xt||t.parentNode.removeChild(t)):s.count--,i===null?xn||Dh(c,e.type,e.stateNode):nb(c,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Ud(e,e.memoizedProps,l.memoizedProps);break;case 27:Qn(t,e,i),Zn(e),s&512&&(xt||l===null||Dn(l,l.return)),l!==null&&s&4&&Ud(e,e.memoizedProps,l.memoizedProps);break;case 5:if(c=ro,ro=!1,Qn(t,e,i),ro=c,Zn(e),s&512&&(xt||l===null||Dn(l,l.return)),e.flags&32){t=e.stateNode;try{Gn(t,""),Ve=!0}catch(re){At(e,e.return,re)}}s&4&&e.stateNode!=null&&(t=e.memoizedProps,Ud(e,t,l!==null?l.memoizedProps:t)),s&1024&&(Gd=!0);break;case 6:if(Qn(t,e,i),Zn(e),s&4){if(e.stateNode===null)throw Error(a(162));t=e.memoizedProps,i=e.stateNode;try{i.nodeValue=t,Ve=!0}catch(re){At(e,e.return,re)}}break;case 3:if(Ve=!1,Jc=null,c=Ki,Ki=hs(t.containerInfo),Qn(t,e,i),Ki=c,Zn(e),s&4&&l!==null&&l.memoizedState.isDehydrated)try{da(t.containerInfo)}catch(re){At(e,e.return,re)}Gd&&(Gd=!1,Jg(e)),Ve=!1;break;case 4:s=ro,ro=xn,l=gn(),c=Ki,Ki=hs(e.stateNode.containerInfo),Qn(t,e,i),Zn(e),Ki=c,Ve&&os&&(zc=!0),Ve=l,ro=s;break;case 12:Qn(t,e,i),Zn(e);break;case 31:Qn(t,e,i),Zn(e),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,kc(e,t)));break;case 13:Qn(t,e,i),Zn(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Hc=Ot()),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,kc(e,t)));break;case 22:c=e.memoizedState!==null,m=l!==null&&l.memoizedState!==null;var C=xn,k=xt,ee=ro;xn=C||c,ro=ee||c,xt=k||m,Qn(t,e,i),xt=k,ro=ee,xn=C,Zn(e),s&8192&&(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,!c||l===null||m||xn||xt||(t=m||xt,i=xn,l=xt,xn=c||xn,xt=t,ll(e,2),xn=i,xt=l),!c&&ro||Xd(e,c)),s&4&&(t=e.updateQueue,t!==null&&(i=t.retryQueue,i!==null&&(t.retryQueue=null,kc(e,i))));break;case 19:Qn(t,e,i),Zn(e),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,kc(e,t)));break;case 30:s&512&&(xt||l===null||Dn(l,l.return)),s=gn(),c=os,m=(i&335544064)===i,C=e.memoizedProps,os=m&&xo(C.default,C.update)!=="none",Qn(t,e,i),Zn(e),m&&l!==null&&Ve&&(e.flags|=4),os=c,Ve=s;break;case 21:break;case 7:s&512&&(xt||l===null||Dn(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:Qn(t,e,i),Zn(e)}}function Zn(e){var t=e.flags;if(t&2){try{for(var i,l=e.return;l!==null;){if(Lg(l)){i=l;break}l=l.return}l=null;for(var s=e.return;s!==null;){if(Ld(s)){var c=s.stateNode;l===null?l=[c]:l.push(c)}if(zd(s))break;s=s.return}var m=l;if(i==null)throw Error(a(160));switch(i.tag){case 27:var C=i.stateNode,k=Id(e);Nc(e,k,C,m);break;case 5:var ee=i.stateNode;i.flags&32&&(Gn(ee,""),i.flags&=-33);var re=Id(e);Nc(e,re,ee,m);break;case 3:case 4:var pe=i.stateNode.containerInfo,Z=Id(e);Hd(e,Z,pe,m);break;default:throw Error(a(161))}}catch(oe){At(e,e.return,oe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Jg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Jg(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,fa=!0,t.reset(),fa=!1),e=e.sibling}}function Kr(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)$g(t,e),t=t.sibling;else qg(t)}function $g(e,t){var i=e.alternate;if(i===null)Bd(e,!1);else switch(e.tag){case 3:if(Pd=ao=!1,Ig(),Kr(t,e),!ao&&!zc){if(e=oo,e!==null)for(var l=0;l<e.length;l+=3){i=e[l];var s=e[l+1];Hy(i,e[l+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+s+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Pd=!0}oo=null;break;case 5:Kr(t,e);break;case 4:l=ao,ao=!1,Kr(t,e),ao&&(zc=!0),ao=l;break;case 22:e.memoizedState===null&&(i.memoizedState!==null?Bd(e,!1):Kr(t,e));break;case 30:l=ao,s=Ig(),ao=!1,Kr(t,e),ao&&(e.flags|=4);var c=e.memoizedProps,m=e.stateNode;t=wo(c,m),m=wo(i.memoizedProps,m);var C=xo(c.default,c.update);C==="none"?t=!1:(c=i.memoizedState,i.memoizedState=null,i=e.child,ti=0,t=Fd(e,i,t,m,C,c,!0),ti!==(c===null?0:c.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(ta(e,e.memoizedProps.onUpdate),oo=s):s!==null&&(s.push.apply(s,oo),oo=s),ao=(e.flags&32)!==0?!0:l;break;default:Kr(t,e)}}function so(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Fg(e,t.alternate,t),t=t.sibling}function ll(e,t){for(e=e.child;e!==null;){var i=e,l=t;switch(i.tag){case 0:case 11:case 14:case 15:ol(4,i,i.return),ll(i,l);break;case 1:Dn(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&jg(i,i.return,s),ll(i,l);break;case 27:(l&2)!==0&&Jy(i.stateNode,i.type,i.memoizedProps);case 5:Dn(i,i.return),i.tag!==5&&i.tag!==27||is(i),ll(i,l);break;case 6:is(i);break;case 26:Dn(i,i.return),s=i.stateNode,i.memoizedState!==null||s===null||xt||s.parentNode.removeChild(s),ll(i,l);break;case 22:i.memoizedState===null&&ll(i,l);break;case 30:Dn(i,i.return),ll(i,l);break;case 7:Dn(i,i.return);default:ll(i,l)}e=e.sibling}}function Qi(e,t,i){for(i=(t.subtreeFlags&8772)!==0?i:i&-2,t=t.child;t!==null;){var l=t.alternate,s=e,c=t,m=c.flags,C=(i&1)!==0;switch(c.tag){case 0:case 11:case 15:Qi(s,c,i),ns(4,c);break;case 1:if(Qi(s,c,i),l=c,s=l.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(re){At(l,l.return,re)}if(l=c,s=l.updateQueue,s!==null){var k=l.stateNode;try{var ee=s.shared.hiddenCallbacks;if(ee!==null)for(s.shared.hiddenCallbacks=null,s=0;s<ee.length;s++)S0(ee[s],k)}catch(re){At(l,l.return,re)}}C&&m&64&&Dg(c),io(c,c.return);break;case 27:(i&2)!==0&&kg(c);case 5:c.tag!==5&&c.tag!==27||zg(c),Qi(s,c,i),C&&l===null&&m&4&&kd(c),io(c,c.return);break;case 6:zg(c);break;case 26:k=c.stateNode,c.memoizedState!==null||k===null||xn||Dh(hs(k.ownerDocument),c.type,k),Qi(s,c,i),C&&l===null&&m&4&&kd(c),io(c,c.return);break;case 12:Qi(s,c,i);break;case 31:Qi(s,c,i),C&&m&4&&Kg(s,c);break;case 13:Qi(s,c,i),C&&m&4&&Qg(s,c);break;case 22:c.memoizedState===null&&Qi(s,c,i),io(c,c.return);break;case 30:Qi(s,c,i),io(c,c.return);break;case 7:io(c,c.return);default:Qi(s,c,i)}t=t.sibling}}function Qd(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Ya(i))}function Zd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ya(e))}function ji(e,t,i,l){var s=(i&335544064)===i;if(t.subtreeFlags&(s?10262:10256))for(t=t.child;t!==null;)Wg(e,t,i,l),t=t.sibling;else s&&Vg(t)}function Wg(e,t,i,l){var s=(i&335544064)===i;s&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&jc(t);var c=t.flags;switch(t.tag){case 0:case 11:case 15:ji(e,t,i,l),c&2048&&ns(9,t);break;case 1:ji(e,t,i,l);break;case 3:ji(e,t,i,l),s&&Pd&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),c&2048&&(c=null,t.alternate!==null&&(c=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==c&&(t.refCount++,c!=null&&Ya(c)));break;case 12:if(c&2048){ji(e,t,i,l),c=t.stateNode;try{var m=t.memoizedProps,C=m.id,k=m.onPostCommit;typeof k=="function"&&k(C,t.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(ee){At(t,t.return,ee)}}else ji(e,t,i,l);break;case 31:ji(e,t,i,l);break;case 13:ji(e,t,i,l);break;case 23:break;case 22:m=t.stateNode,C=t.alternate,t.memoizedState!==null?(s&&C!==null&&C.memoizedState===null&&jc(C),m._visibility&2?ji(e,t,i,l):ls(e,t)):(s&&C!==null&&C.memoizedState!==null&&jc(t),m._visibility&2?ji(e,t,i,l):(m._visibility|=2,Qr(e,t,i,l,(t.subtreeFlags&10256)!==0||!1))),c&2048&&Qd(C,t);break;case 24:ji(e,t,i,l),c&2048&&Zd(t.alternate,t);break;case 30:s&&(c=t.alternate,c!==null&&(lo(c.child,!0),lo(t.child,!0))),ji(e,t,i,l);break;default:ji(e,t,i,l)}}function Qr(e,t,i,l,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,m=t,C=i,k=l,ee=m.flags;switch(m.tag){case 0:case 11:case 15:Qr(c,m,C,k,s),ns(8,m);break;case 23:break;case 22:var re=m.stateNode;m.memoizedState!==null?re._visibility&2?Qr(c,m,C,k,s):ls(c,m):(re._visibility|=2,Qr(c,m,C,k,s)),s&&ee&2048&&Qd(m.alternate,m);break;case 24:Qr(c,m,C,k,s),s&&ee&2048&&Zd(m.alternate,m);break;default:Qr(c,m,C,k,s)}t=t.sibling}}function ls(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,l=t,s=l.flags;switch(l.tag){case 22:ls(i,l),s&2048&&Qd(l.alternate,l);break;case 24:ls(i,l),s&2048&&Zd(l.alternate,l);break;default:ls(i,l)}t=t.sibling}}var nr=8192;function ir(e,t,i){if(e.subtreeFlags&nr)for(e=e.child;e!==null;)ey(e,t,i),e=e.sibling}function ey(e,t,i){switch(e.tag){case 26:ir(e,t,i),e.flags&nr&&(e.memoizedState!==null?xE(i,Ki,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&ab(i,e)));break;case 5:ir(e,t,i),e.flags&nr&&(e=e.stateNode,(t&335544128)===t&&ab(i,e));break;case 3:case 4:var l=Ki;Ki=hs(e.stateNode.containerInfo),ir(e,t,i),Ki=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=nr,nr=16777216,ir(e,t,i),nr=l):ir(e,t,i));break;case 30:if((e.flags&nr)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var s=e.stateNode;s.paired=null,gi===null&&(gi=new Map),gi.set(l,s)}ir(e,t,i);break;default:ir(e,t,i)}}function ty(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function rs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];En=l,iy(l,e)}ty(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ny(e),e=e.sibling}function ny(e){switch(e.tag){case 0:case 11:case 15:rs(e),e.flags&2048&&ol(9,e,e.return);break;case 3:rs(e);break;case 12:rs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Uc(e)):rs(e);break;default:rs(e)}}function Uc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];En=l,iy(l,e)}ty(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ol(8,t,t.return),Uc(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Uc(t));break;default:Uc(t)}e=e.sibling}}function iy(e,t){for(;En!==null;){var i=En;switch(i.tag){case 0:case 11:case 15:ol(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Ya(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,En=l;else e:for(i=e;En!==null;){l=En;var s=l.sibling,c=l.return;if(Pg(l),l===i){En=null;break e}if(s!==null){s.return=c,En=s;break e}En=c}}}var yx={getCacheForType:function(e){var t=Mn(fn),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Mn(fn).controller.signal}},bx=typeof WeakMap=="function"?WeakMap:Map,St=0,jt=null,lt=null,at=0,Tt=0,yi=null,rl=!1,Zr=!1,Jd=!1,_o=0,tn=0,al=0,or=0,Ic=0,bi=0,Jr=0,as=null,ii=null,$d=!1,Hc=0,oy=0,Bc=1/0,Vc=null,sl=null,$t=0,Zi=null,lr=null,co=0,Wd=0,eh=null,ly=null,$r=null,Wr=null,ea=null,ss=0,qc=null;function vi(){return(St&2)!==0&&at!==0?at&-at:me.T!==null?uh():Ri()}function ry(){if(bi===0)if((at&536870912)===0||nt){var e=Wt;Wt<<=1,(Wt&3932160)===0&&(Wt=262144),bi=e}else bi=536870912;return e=Nn.current,e!==null&&(e.flags|=32),bi}function ta(e,t){if(t!=null){var i=e.stateNode,l=i.ref;l===null&&(l=i.ref=By(wo(e.memoizedProps,i))),Wr===null&&(Wr=[]),Wr.push(t.bind(null,l))}}function oi(e,t,i){(e===jt&&(Tt===2||Tt===9)||e.cancelPendingCommit!==null)&&(na(e,0),cl(e,at,bi,!1)),bo(e,i),((St&2)===0||e!==jt)&&(e===jt&&((St&2)===0&&(or|=i),tn===4&&cl(e,at,bi,!1)),uo(e))}function ay(e,t,i){if((St&6)!==0)throw Error(a(327));var l=!i&&(t&127)===0&&(t&e.expiredLanes)===0||An(e,t),s=l?wx(e,t):nh(e,t,!0),c=l;do{if(s===0){Zr&&!l&&cl(e,t,0,!1);break}else{if(i=e.current.alternate,c&&!vx(i)){s=nh(e,t,!1),c=!1;continue}if(s===2){if(c=t,e.errorRecoveryDisabledLanes&c)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var C=e;s=as;var k=C.current.memoizedState.isDehydrated;if(k&&(na(C,m).flags|=256),m=nh(C,m,!1),m!==2&&m!==6){if(Jd&&!k){C.errorRecoveryDisabledLanes|=c,or|=c,s=4;break e}c=ii,ii=s,c!==null&&(ii===null?ii=c:ii.push.apply(ii,c))}s=m}if(c=!1,s!==2)continue}}if(s===1){na(e,0),cl(e,t,0,!0);break}e:{switch(l=e,c=s,c){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:cl(l,t,bi,!rl);break e;case 2:ii=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(s=Hc+300-Ot(),10<s)){if(cl(l,t,bi,!rl),vn(l,0,!0)!==0)break e;co=t,l.timeoutHandle=wh(sy.bind(null,l,i,ii,Vc,$d,t,bi,or,Jr,rl,c,"Throttled",-0,0),s);break e}sy(l,i,ii,Vc,$d,t,bi,or,Jr,rl,c,null,-0,0)}}break}while(!0);uo(e)}function sy(e,t,i,l,s,c,m,C,k,ee,re,pe,Z,oe){e.timeoutHandle=-1;var Oe=t.subtreeFlags,Le=(c&335544064)===c;if(pe=null,(Le||Oe&8192||(Oe&16785408)===16785408)&&(pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Pn},gi=null,ey(t,c,pe),Le&&(Oe=pe,Le=e.containerInfo,Le=(Le.nodeType===9?Le:Le.ownerDocument).__reactViewTransition,Le!=null&&(Oe.count++,Oe.waitingForViewTransition=!0,Oe=gs.bind(Oe),Le.finished.then(Oe,Oe))),Oe=(c&62914560)===c?Hc-Ot():(c&4194048)===c?oy-Ot():0,Oe=EE(pe,Oe),Oe!==null)){co=c,e.cancelPendingCommit=Oe(gy.bind(null,e,t,c,i,l,s,m,C,k,ee,re,pe,null,Z,oe)),cl(e,c,m,!ee);return}gy(e,t,c,i,l,s,m,C,k,ee,re,pe)}function vx(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var s=i[l],c=s.getSnapshot;s=s.value;try{if(!pi(c(),s))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function cl(e,t,i,l){t=Ti(e,t),t&=~Ic,t&=~or,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var s=t;0<s;){var c=31-mt(s),m=1<<c;l[c]=-1,s&=~m}i!==0&&Fi(e,i,t)}function Yc(){return(St&6)===0?(cs(0),!1):!0}function th(){if(lt!==null){if(Tt===0)var e=lt.return;else e=lt,Ao=Pl=null,cd(e),qr=null,Pa=0,e=lt;for(;e!==null;)_g(e.alternate,e),e=e.return;lt=null}}function na(e,t){var i=e.timeoutHandle;return i!==-1&&(e.timeoutHandle=-1,Yx(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),co=0,th(),jt=e,lt=i=Eo(e.current,null),at=t,Tt=0,yi=null,rl=!1,Zr=An(e,t),Jd=!1,Jr=bi=Ic=or=al=tn=0,ii=as=null,$d=!1,_o=Ti(e,t),Js(),i}function cy(e,t){Ze=null,me.H=xc,t===Vr||t===sc?(t=g0(),Tt=3):t===Zf?(t=g0(),Tt=4):Tt=t===Td?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,yi=t,lt===null&&(tn=1,Ec(e,Mi(t,e.current)))}function uy(){var e=Nn.current;return e===null?!0:(at&4194048)===at?Hn===null:(at&62914560)===at||(at&536870912)!==0?e===Hn:!1}function fy(){var e=me.H;return me.H=xc,e===null?xc:e}function dy(){var e=me.A;return me.A=yx,e}function Fc(){tn=4,rl||(at&4194048)!==at&&Nn.current!==null||(Zr=!0),(al&134217727)===0&&(or&134217727)===0||jt===null||cl(jt,at,bi,!1)}function nh(e,t,i){var l=St;St|=2;var s=fy(),c=dy();(jt!==e||at!==t)&&(Vc=null,na(e,t)),t=!1;var m=tn;e:do try{if(Tt!==0&&lt!==null){var C=lt,k=yi;switch(Tt){case 8:th(),m=6;break e;case 3:case 2:case 9:case 6:Nn.current===null&&(t=!0);var ee=Tt;if(Tt=0,yi=null,ia(e,C,k,ee),i&&Zr){m=0;break e}break;default:ee=Tt,Tt=0,yi=null,ia(e,C,k,ee)}}Sx(),m=tn;break}catch(re){cy(e,re)}while(!0);return t&&e.shellSuspendCounter++,Ao=Pl=null,St=l,me.H=s,me.A=c,lt===null&&(jt=null,at=0,Js()),m}function Sx(){for(;lt!==null;)hy(lt)}function wx(e,t){var i=St;St|=2;var l=fy(),s=dy();jt!==e||at!==t?(Vc=null,Bc=Ot()+500,na(e,t)):Zr=An(e,t);e:do try{if(Tt!==0&&lt!==null){t=lt;var c=yi;t:switch(Tt){case 1:Tt=0,yi=null,ia(e,t,c,1);break;case 2:case 9:if(p0(c)){Tt=0,yi=null,py(t);break}t=function(){Tt!==2&&Tt!==9||jt!==e||(Tt=7),uo(e)},c.then(t,t);break e;case 3:Tt=7;break e;case 4:Tt=5;break e;case 7:p0(c)?(Tt=0,yi=null,py(t)):(Tt=0,yi=null,ia(e,t,c,7));break;case 5:var m=null;switch(lt.tag){case 26:m=lt.memoizedState;case 5:case 27:var C=lt;if(m?lb(m):C.stateNode.complete){Tt=0,yi=null;var k=C.sibling;if(k!==null)lt=k;else{var ee=C.return;ee!==null?(lt=ee,Gc(ee)):lt=null}break t}}Tt=0,yi=null,ia(e,t,c,5);break;case 6:Tt=0,yi=null,ia(e,t,c,6);break;case 8:th(),tn=6;break e;default:throw Error(a(462))}}xx();break}catch(re){cy(e,re)}while(!0);return Ao=Pl=null,me.H=l,me.A=s,St=i,lt!==null?0:(jt=null,at=0,Js(),tn)}function xx(){for(;lt!==null&&!sn();)hy(lt)}function hy(e){var t=Mg(e.alternate,e,_o);e.memoizedProps=e.pendingProps,t===null?Gc(e):lt=t}function py(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=xg(i,t,t.pendingProps,t.type,void 0,at);break;case 11:t=xg(i,t,t.pendingProps,t.type.render,t.ref,at);break;case 5:cd(t);var l=t;l===wn&&(nt?(ic(l),l.tag===5&&l.stateNode!=null&&(Ut=l.stateNode)):(ic(l),nt=!0));default:_g(i,t),t=lt=i0(t,_o),t=Mg(i,t,_o)}e.memoizedProps=e.pendingProps,t===null?Gc(e):lt=t}function ia(e,t,i,l){Ao=Pl=null,cd(t),qr=null,Pa=0;var s=t.return;try{if(cx(e,s,t,i,at)){tn=1,Ec(e,Mi(i,e.current)),lt=null;return}}catch(c){if(s!==null)throw lt=s,c;tn=1,Ec(e,Mi(i,e.current)),lt=null;return}t.flags&32768?(nt||l===1?e=!0:Zr||(at&536870912)!==0?e=!1:(rl=e=!0,(l===2||l===9||l===3||l===6)&&(l=Nn.current,l!==null&&l.tag===13&&(l.flags|=16384))),my(t,e)):Gc(t)}function Gc(e){var t=e;do{if((t.flags&32768)!==0){my(t,rl);return}e=t.return;var i=hx(t.alternate,t,_o);if(i!==null){lt=i;return}if(t=t.sibling,t!==null){lt=t;return}lt=t=e}while(t!==null);tn===0&&(tn=5)}function my(e,t){do{var i=px(e.alternate,e);if(i!==null){i.flags&=32767,lt=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){lt=e;return}lt=e=i}while(e!==null);tn=6,lt=null}function gy(e,t,i,l,s,c,m,C,k,ee,re,pe){e.cancelPendingCommit=null;do Pc();while($t!==0);if((St&6)!==0)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));e===jt&&(lt=jt=null,at=0),lr=t,Zi=e,co=i,eh=s,ly=l,Ex(e,t,i,m,C,k,pe)}}function Ex(e,t,i,l,s,c,m){var C=t.lanes|t.childLanes;if(Wd=C,C|=Uf,xr(e,i,C,l,s,c),Wr=null,(i&335544064)===i?(ea=Jw(e),l=10262):(ea=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,Mx(Vt,function(){return rh(),null})):(e.callbackNode=null,e.callbackPriority=0),_c=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=me.T,me.T=null,s=ae.p,ae.p=2,c=St,St|=4;try{mx(e,t,i)}finally{St=c,ae.p=s,me.T=l}}$t=1,_c?$r=Qx(m,e.containerInfo,ea,ih,oh,Ax,lh,rh,Tx):(ih(),oh(),lh())}function Tx(e){if($t!==0){var t=Zi.onRecoverableError;t(e,{componentStack:null})}}function Ax(){$t===3&&($t=0,$g(lr,Zi),$t=4)}function ih(){if($t===1){$t=0;var e=Zi,t=lr,i=co,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=me.T,me.T=null;var s=ae.p;ae.p=2;var c=St;St|=4;try{os=zc=!1,Zg(t,e,i),i=bh;var m=Xm(e.containerInfo),C=i.focusedElem,k=i.selectionRange;if(m!==C&&C&&C.ownerDocument&&Pm(C.ownerDocument.documentElement,C)){if(k!==null&&Df(C)){var ee=k.start,re=k.end;if(re===void 0&&(re=ee),"selectionStart"in C)C.selectionStart=ee,C.selectionEnd=Math.min(re,C.value.length);else{var pe=C.ownerDocument||document,Z=pe&&pe.defaultView||window;if(Z.getSelection){var oe=Z.getSelection(),Oe=C.textContent.length,Le=Math.min(k.start,Oe),Je=k.end===void 0?Le:Math.min(k.end,Oe);!oe.extend&&Le>Je&&(m=Je,Je=Le,Le=m);var W=Gm(C,Le),F=Gm(C,Je);if(W&&F&&(oe.rangeCount!==1||oe.anchorNode!==W.node||oe.anchorOffset!==W.offset||oe.focusNode!==F.node||oe.focusOffset!==F.offset)){var ne=pe.createRange();ne.setStart(W.node,W.offset),oe.removeAllRanges(),Le>Je?(oe.addRange(ne),oe.extend(F.node,F.offset)):(ne.setEnd(F.node,F.offset),oe.addRange(ne))}}}}for(pe=[],oe=C;oe=oe.parentNode;)oe.nodeType===1&&pe.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<pe.length;C++){var he=pe[C];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}fa=!!yh,bh=yh=null}finally{St=c,ae.p=s,me.T=l}}e.current=t,$t=2}}function oh(){if($t===2){$t=0;var e=Zi,t=lr,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=me.T,me.T=null;var l=ae.p;ae.p=2;var s=St;St|=4;try{Fg(e,t.alternate,t)}finally{St=s,ae.p=l,me.T=i}}$t=3}}function lh(){if($t===4||$t===3){$t=0;var e=$r;$r=null,qn();var t=Zi,i=lr,l=co,s=ly,c=(l&335544064)===l?10262:10256;if((i.subtreeFlags&c)!==0||(i.flags&c)!==0?$t=5:($t=0,lr=Zi=null,yy(t,t.pendingLanes)),c=t.pendingLanes,c===0&&(sl=null),Ai(l),i=i.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(Ft,i,void 0,(i.current.flags&128)===128)}catch{}if(s!==null){i=me.T,c=ae.p,ae.p=2,me.T=null;try{for(var m=t.onRecoverableError,C=0;C<s.length;C++){var k=s[C];m(k.value,{componentStack:k.stack})}}finally{me.T=i,ae.p=c}}if(s=Wr,m=ea,ea=null,s!==null&&(Wr=null,m===null&&(m=[]),e!==null))for(k=0;k<s.length;k++)i=(0,s[k])(m),i!==void 0&&e.finished.finally(i);(co&3)!==0&&Pc(),uo(t),c=t.pendingLanes,(l&261930)!==0&&(c&42)!==0?t===qc?ss++:(ss=0,qc=t):(ss=0,qc=null),cs(0)}}function yy(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ya(t)))}function Pc(){return $r!==null&&($r.skipTransition(),$r=null),ih(),oh(),lh(),rh()}function rh(){if($t!==5)return!1;var e=Zi,t=Wd;Wd=0;var i=Ai(co),l=me.T,s=ae.p;try{ae.p=32>i?32:i,me.T=null,i=eh,eh=null;var c=Zi,m=co;if($t=0,lr=Zi=null,co=0,(St&6)!==0)throw Error(a(331));var C=St;if(St|=4,ny(c.current),Wg(c,c.current,m,i),St=C,cs(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(Ft,c)}catch{}return!0}finally{ae.p=s,me.T=l,yy(e,t)}}function by(e,t,i){t=Mi(i,t),t=Ed(e.stateNode,t,2),e=el(e,t,2),e!==null&&(bo(e,2),uo(e))}function At(e,t,i){if(e.tag===3)by(e,e,i);else for(;t!==null;){if(t.tag===3){by(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(sl===null||!sl.has(l))){e=Mi(i,e),i=pg(2),l=el(t,i,2),l!==null&&(mg(i,l,t,e),bo(l,2),uo(l));break}}t=t.return}}function ah(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new bx;var s=new Set;l.set(t,s)}else s=l.get(t),s===void 0&&(s=new Set,l.set(t,s));s.has(i)||(Jd=!0,s.add(i),e=Rx.bind(null,e,t,i),t.then(e,e))}function Rx(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,jt===e&&(at&i)===i&&((tn===4||tn===3&&(at&62914560)===at&&300>Ot()-Hc)&&(St&2)===0?na(e,0):Ic|=i,Jr===at&&(Jr=0)),uo(e)}function vy(e,t){t===0&&(t=Yi()),e=Yl(e,t),e!==null&&(bo(e,t),uo(e))}function Cx(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),vy(e,i)}function Ox(e,t){var i=0;switch(e.tag){case 31:case 13:var l=e.stateNode,s=e.memoizedState;s!==null&&(i=s.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(t),vy(e,i)}function Mx(e,t){return $n(e,t)}var oa=null,la=null,sh=!1,Xc=!1,ch=!1,ul=0;function uo(e){e!==la&&e.next===null&&(la===null?oa=la=e:la=la.next=e),Xc=!0,sh||(sh=!0,_x())}function cs(e,t){if(!ch&&Xc){ch=!0;do for(var i=!1,l=oa;l!==null;){if(e!==0){var s=l.pendingLanes;if(s===0)var c=0;else{var m=l.suspendedLanes,C=l.pingedLanes;c=(1<<31-mt(42|e)+1)-1,c&=s&~(m&~C),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(i=!0,Ey(l,c))}else c=at,c=vn(l,l===jt?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||An(l,c)||(i=!0,Ey(l,c));l=l.next}while(i);ch=!1}}function Nx(){Sy()}function Sy(){Xc=sh=!1;var e=0;ul!==0&&qx()&&(e=ul);for(var t=Ot(),i=null,l=oa;l!==null;){var s=l.next,c=wy(l,t);c===0?(l.next=null,i===null?oa=s:i.next=s,s===null&&(la=i)):(i=l,(e!==0||(c&3)!==0)&&(Xc=!0)),l=s}$t!==0&&$t!==5||cs(e),ul!==0&&(ul=0)}function wy(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,s=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var m=31-mt(c),C=1<<m,k=s[m];k===-1?((C&i)===0||(C&l)!==0)&&(s[m]=Bo(C,t)):k<=t&&(e.expiredLanes|=C),c&=~C}if(t=jt,i=at,i=vn(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,i===0||e===t&&(Tt===2||Tt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&kn(l),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||An(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(l!==null&&kn(l),Ai(i)){case 2:case 8:i=mn;break;case 32:i=Vt;break;case 268435456:i=si;break;default:i=Vt}return l=xy.bind(null,e),i=$n(i,l),e.callbackPriority=t,e.callbackNode=i,t}return l!==null&&l!==null&&kn(l),e.callbackPriority=2,e.callbackNode=null,2}function xy(e,t){if($t!==0&&$t!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Pc()&&e.callbackNode!==i)return null;var l=at;return l=vn(e,e===jt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(ay(e,l,t),wy(e,Ot()),e.callbackNode!=null&&e.callbackNode===i?xy.bind(null,e):null)}function Ey(e,t){if(Pc())return null;ay(e,t,!0)}function _x(){Fx(function(){(St&6)!==0?$n(Et,Nx):Sy()})}function uh(){if(ul===0){var e=Ql;e===0&&(e=kt,kt<<=1,(kt&261888)===0&&(kt=256)),ul=e}return ul}function Ty(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Cn(e)}function Dx(e,t,i,l,s){if(t==="submit"&&i&&i.stateNode===s){var c=Ty((s[Rn]||null).action),m=l.submitter;m&&(t=(t=m[Rn]||null)?Ty(t.formAction):m.getAttribute("formAction"),t!==null&&(c=t,m=null));var C=new Xs("action","action",null,l,s);e.push({event:C,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ul!==0){var k=new FormData(s,m);bd(i,{pending:!0,data:k,method:s.method,action:c},null,k)}}else typeof c=="function"&&(C.preventDefault(),k=new FormData(s,m),bd(i,{pending:!0,data:k,method:s.method,action:c},c,k))},currentTarget:s}]})}}for(var fh=0;fh<kf.length;fh++){var dh=kf[fh],jx=dh.toLowerCase(),zx=dh[0].toUpperCase()+dh.slice(1);Pi(jx,"on"+zx)}Pi(Zm,"onAnimationEnd"),Pi(Jm,"onAnimationIteration"),Pi($m,"onAnimationStart"),Pi("dblclick","onDoubleClick"),Pi("focusin","onFocus"),Pi("focusout","onBlur"),Pi(Yw,"onTransitionRun"),Pi(Fw,"onTransitionStart"),Pi(Gw,"onTransitionCancel"),Pi(Wm,"onTransitionEnd"),Mt("onMouseEnter",["mouseout","mouseover"]),Mt("onMouseLeave",["mouseout","mouseover"]),Mt("onPointerEnter",["pointerout","pointerover"]),Mt("onPointerLeave",["pointerout","pointerover"]),We("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),We("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),We("onBeforeInput",["compositionend","keypress","textInput","paste"]),We("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),We("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),We("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var us="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Lx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(us));function Ay(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],s=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var m=l.length-1;0<=m;m--){var C=l[m],k=C.instance,ee=C.currentTarget;if(C=C.listener,k!==c&&s.isPropagationStopped())break e;c=C,s.currentTarget=ee;try{c(s)}catch(re){Zs(re)}s.currentTarget=null,c=k}else for(m=0;m<l.length;m++){if(C=l[m],k=C.instance,ee=C.currentTarget,C=C.listener,k!==c&&s.isPropagationStopped())break e;c=C,s.currentTarget=ee;try{c(s)}catch(re){Zs(re)}s.currentTarget=null,c=k}}}}function rt(e,t){var i=t[Oa];i===void 0&&(i=t[Oa]=new Set);var l=e+"__bubble";i.has(l)||(Ry(t,e,2,!1),i.add(l))}function hh(e,t,i){var l=0;t&&(l|=4),Ry(i,e,l,t)}var Kc="_reactListening"+Math.random().toString(36).slice(2);function ph(e){if(!e[Kc]){e[Kc]=!0,Ke.forEach(function(i){i!=="selectionchange"&&(Lx.has(i)||hh(i,!1,e),hh(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Kc]||(t[Kc]=!0,hh("selectionchange",!1,t))}}function Ry(e,t,i,l){switch(mb(t)){case 2:var s=CE;break;case 8:s=OE;break;default:s=zh}i=s.bind(null,t,i,e),s=void 0,!Bl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),l?s!==void 0?e.addEventListener(t,i,{capture:!0,passive:s}):e.addEventListener(t,i,!0):s!==void 0?e.addEventListener(t,i,{passive:s}):e.addEventListener(t,i,!1)}function mh(e,t,i,l,s){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var m=l.tag;if(m===3||m===4){var C=l.stateNode.containerInfo;if(C===s)break;if(m===4)for(m=l.return;m!==null;){var k=m.tag;if((k===3||k===4)&&m.stateNode.containerInfo===s)return;m=m.return}for(;C!==null;){if(m=Gi(C),m===null)return;if(k=m.tag,k===5||k===6||k===26||k===27){l=c=m;continue e}C=C.parentNode}}l=l.return}Hl(function(){var ee=c,re=Il(i),pe=[];e:{var Z=e0.get(e);if(Z!==void 0){var oe=Xs,Oe=e;switch(e){case"keypress":if(Gs(i)===0)break e;case"keydown":case"keyup":oe=vw;break;case"focusin":Oe="focus",oe=Rf;break;case"focusout":Oe="blur",oe=Rf;break;case"beforeblur":case"afterblur":oe=Rf;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=Mm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=aw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Tw;break;case Zm:case Jm:case $m:oe=uw;break;case Wm:oe=Rw;break;case"scroll":case"scrollend":oe=lw;break;case"wheel":oe=Ow;break;case"copy":case"cut":case"paste":oe=dw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=_m;break;case"submit":oe=xw;break;case"toggle":case"beforetoggle":oe=Nw}var Le=(t&4)!==0,Je=!Le&&(e==="scroll"||e==="scrollend"),W=Le?Z!==null?Z+"Capture":null:Z;Le=[];for(var F=ee,ne;F!==null;){var he=F;if(ne=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ne===null||W===null||(he=So(F,W),he!=null&&Le.push(fs(F,he,ne))),Je)break;F=F.return}0<Le.length&&(Z=new oe(Z,Oe,null,i,re),pe.push({event:Z,listeners:Le}))}}if((t&7)===0){e:{if(oe=e==="mouseover"||e==="pointerover",Z=e==="mouseout"||e==="pointerout",oe&&i!==Ul&&(Oe=i.relatedTarget||i.fromElement)&&(Gi(Oe)||Oe[ci]))break e;(Z||oe)&&(Oe=re.window===re?re:(oe=re.ownerDocument)?oe.defaultView||oe.parentWindow:window,Z?(oe=i.relatedTarget||i.toElement,Z=ee,oe=oe?Gi(oe):null,oe!==null&&(Je=f(oe),Le=oe.tag,oe!==Je||Le!==5&&Le!==27&&Le!==6)&&(oe=null)):(Z=null,oe=ee),Z!==oe&&(Le=Mm,he="onMouseLeave",W="onMouseEnter",F="mouse",(e==="pointerout"||e==="pointerover")&&(Le=_m,he="onPointerLeave",W="onPointerEnter",F="pointer"),Je=Z==null?Oe:le(Z),ne=oe==null?Oe:le(oe),Oe=new Le(he,F+"leave",Z,i,re),Oe.target=Je,Oe.relatedTarget=ne,he=null,Gi(re)===ee&&(Le=new Le(W,F+"enter",oe,i,re),Le.target=ne,Le.relatedTarget=Je,he=Le),Je=he,Le=Z&&oe?O(Z,oe,kx):null,Z!==null&&Cy(pe,Oe,Z,Le,!1),oe!==null&&Je!==null&&Cy(pe,Je,oe,Le,!0)))}e:{if(Z=ee?le(ee):window,oe=Z.nodeName&&Z.nodeName.toLowerCase(),oe==="select"||oe==="input"&&Z.type==="file")var ze=Hm;else if(Um(Z))if(Bm)ze=Bw;else{ze=Iw;var st=Uw}else oe=Z.nodeName,!oe||oe.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?ee&&kl(ee.elementType)&&(ze=Hm):ze=Hw;if(ze&&(ze=ze(e,ee))){Im(pe,ze,i,re);break e}st&&st(e,Z,ee)}switch(st=ee?le(ee):window,e){case"focusin":(Um(st)||st.contentEditable==="true")&&(jr=st,jf=ee,Ba=null);break;case"focusout":Ba=jf=jr=null;break;case"mousedown":zf=!0;break;case"contextmenu":case"mouseup":case"dragend":zf=!1,Km(pe,i,re);break;case"selectionchange":if(qw)break;case"keydown":case"keyup":Km(pe,i,re)}var Be;if(Of)e:{switch(e){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else Dr?Lm(e,i)&&(Ye="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ye="onCompositionStart");Ye&&(Dm&&i.locale!=="ko"&&(Dr||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&Dr&&(Be=Cm()):(Go=re,Ef="value"in Go?Go.value:Go.textContent,Dr=!0)),st=Qc(ee,Ye),0<st.length&&(Ye=new Nm(Ye,e,null,i,re),pe.push({event:Ye,listeners:st}),Be?Ye.data=Be:(Be=km(i),Be!==null&&(Ye.data=Be)))),(Be=Dw?jw(e,i):zw(e,i))&&(Ye=Qc(ee,"onBeforeInput"),0<Ye.length&&(st=new Nm("onBeforeInput","beforeinput",null,i,re),pe.push({event:st,listeners:Ye}),st.data=Be)),Dx(pe,e,ee,i,re)}Ay(pe,t)})}function fs(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Qc(e,t){for(var i=t+"Capture",l=[];e!==null;){var s=e,c=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||c===null||(s=So(e,i),s!=null&&l.unshift(fs(e,s,c)),s=So(e,t),s!=null&&l.push(fs(e,s,c))),e.tag===3)return l;e=e.return}return[]}function kx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Cy(e,t,i,l,s){for(var c=t._reactName,m=[];i!==null&&i!==l;){var C=i,k=C.alternate,ee=C.stateNode;if(C=C.tag,k!==null&&k===l)break;C!==5&&C!==26&&C!==27||ee===null||(k=ee,s?(ee=So(i,c),ee!=null&&m.unshift(fs(i,ee,k))):s||(ee=So(i,c),ee!=null&&m.push(fs(i,ee,k)))),i=i.return}m.length!==0&&e.push({event:t,listeners:m})}var Ux=/\r\n?/g,Ix=/\u0000|\uFFFD/g;function Oy(e){return(typeof e=="string"?e:""+e).replace(Ux,`
9
+ `).replace(Ix,"")}function My(e,t){return t=Oy(t),Oy(e)===t}function Rt(e,t,i,l,s,c){switch(i){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||Gn(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&Gn(e,""+l);else return;break;case"className":ui(e,"class",l);break;case"tabIndex":ui(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ui(e,i,l);break;case"style":di(e,l,c);return;case"data":if(t!=="object"){ui(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Cn(l),e.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(i==="formAction"?(t!=="input"&&Rt(e,t,"name",s.name,s,null),Rt(e,t,"formEncType",s.formEncType,s,null),Rt(e,t,"formMethod",s.formMethod,s,null),Rt(e,t,"formTarget",s.formTarget,s,null)):(Rt(e,t,"encType",s.encType,s,null),Rt(e,t,"method",s.method,s,null),Rt(e,t,"target",s.target,s,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Cn(l),e.setAttribute(i,l);break;case"onClick":l!=null&&(e.onclick=Pn);return;case"onScroll":l!=null&&rt("scroll",e);return;case"onScrollEnd":l!=null&&rt("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(i=l.__html,i!=null){if(s.children!=null)throw Error(a(60));c?.__html!==i&&(e.innerHTML=i)}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}i=Cn(l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":l===!0?e.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(i,l):e.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(i):e.setAttribute(i,l);break;case"popover":rt("beforetoggle",e),rt("toggle",e),Jt(e,"popover",l);break;case"xlinkActuate":cn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":cn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":cn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":cn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":cn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":cn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":cn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":cn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":cn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Jt(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=_a.get(i)||i,Jt(e,i,l);else return}Ve=!0}function gh(e,t,i,l,s,c){switch(i){case"style":di(e,l,c);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(i=l.__html,i!=null){if(s.children!=null)throw Error(a(60));c?.__html!==i&&(e.innerHTML=i)}}break;case"children":if(typeof l=="string")Gn(e,l);else if(typeof l=="number"||typeof l=="bigint")Gn(e,""+l);else return;break;case"onScroll":l!=null&&rt("scroll",e);return;case"onScrollEnd":l!=null&&rt("scrollend",e);return;case"onClick":l!=null&&(e.onclick=Pn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Ge.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(s=i.endsWith("Capture"),c=i.slice(2,s?i.length-7:void 0),t=e[Rn]||null,t=t!=null?t[i]:null,typeof t=="function"&&e.removeEventListener(c,t,s),typeof l=="function")){typeof t!="function"&&t!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(c,l,s);break e}Ve=!0,i in e?e[i]=l:l===!0?e.setAttribute(i,""):Jt(e,i,l)}return}Ve=!0}function jn(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":rt("error",e),rt("load",e);var l=!1,s=!1,c;for(c in i)if(i.hasOwnProperty(c)){var m=i[c];if(m!=null)switch(c){case"src":l=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Rt(e,t,c,m,i,null)}}s&&Rt(e,t,"srcSet",i.srcSet,i,null),l&&Rt(e,t,"src",i.src,i,null);return;case"input":rt("invalid",e);var C=c=m=s=null,k=null,ee=null;for(l in i)if(i.hasOwnProperty(l)){var re=i[l];if(re!=null)switch(l){case"name":s=re;break;case"type":m=re;break;case"checked":k=re;break;case"defaultChecked":ee=re;break;case"value":c=re;break;case"defaultValue":C=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,t));break;default:Rt(e,t,l,re,i,null)}}Yo(e,c,C,k,ee,m,s,!1);return;case"select":rt("invalid",e),l=m=c=null;for(s in i)if(i.hasOwnProperty(s)&&(C=i[s],C!=null))switch(s){case"value":c=C;break;case"defaultValue":m=C;break;case"multiple":l=C;default:Rt(e,t,s,C,i,null)}t=c,i=m,e.multiple=!!l,t!=null?Wn(e,!!l,t,!1):i!=null&&Wn(e,!!l,i,!0);return;case"textarea":rt("invalid",e),c=s=l=null;for(m in i)if(i.hasOwnProperty(m)&&(C=i[m],C!=null))switch(m){case"value":l=C;break;case"defaultValue":s=C;break;case"children":c=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(a(91));break;default:Rt(e,t,m,C,i,null)}fi(e,l,s,c);return;case"option":for(k in i)i.hasOwnProperty(k)&&(l=i[k],l!=null)&&(k==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":Rt(e,t,k,l,i,null));return;case"dialog":rt("beforetoggle",e),rt("toggle",e),rt("cancel",e),rt("close",e);break;case"iframe":case"object":rt("load",e);break;case"video":case"audio":for(l=0;l<us.length;l++)rt(us[l],e);break;case"image":rt("error",e),rt("load",e);break;case"details":rt("toggle",e);break;case"embed":case"source":case"link":rt("error",e),rt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in i)if(i.hasOwnProperty(ee)&&(l=i[ee],l!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Rt(e,t,ee,l,i,null)}return;default:if(kl(t)){for(re in i)i.hasOwnProperty(re)&&(l=i[re],l!==void 0&&gh(e,t,re,l,i,void 0));return}}for(C in i)i.hasOwnProperty(C)&&(l=i[C],l!=null&&Rt(e,t,C,l,i,null))}var Hx={};function Bx(e,t,i,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,c=null,m=null,C=null,k=null,ee=null,re=null;for(oe in i){var pe=i[oe];if(i.hasOwnProperty(oe)&&pe!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":k=pe;default:l.hasOwnProperty(oe)||Rt(e,t,oe,null,l,pe)}}for(var Z in l){var oe=l[Z];if(pe=i[Z],l.hasOwnProperty(Z)&&(oe!=null||pe!=null))switch(Z){case"type":oe!==pe&&(Ve=!0),c=oe;break;case"name":oe!==pe&&(Ve=!0),s=oe;break;case"checked":oe!==pe&&(Ve=!0),ee=oe;break;case"defaultChecked":oe!==pe&&(Ve=!0),re=oe;break;case"value":oe!==pe&&(Ve=!0),m=oe;break;case"defaultValue":oe!==pe&&(Ve=!0),C=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,t));break;default:oe!==pe&&Rt(e,t,Z,oe,l,pe)}}In(e,m,C,k,ee,re,c,s);return;case"select":oe=m=C=Z=null;for(c in i)if(k=i[c],i.hasOwnProperty(c)&&k!=null)switch(c){case"value":break;case"multiple":oe=k;default:l.hasOwnProperty(c)||Rt(e,t,c,null,l,k)}for(s in l)if(c=l[s],k=i[s],l.hasOwnProperty(s)&&(c!=null||k!=null))switch(s){case"value":c!==k&&(Ve=!0),Z=c;break;case"defaultValue":c!==k&&(Ve=!0),C=c;break;case"multiple":c!==k&&(Ve=!0),m=c;default:c!==k&&Rt(e,t,s,c,l,k)}t=C,i=m,l=oe,Z!=null?Wn(e,!!i,Z,!1):!!l!=!!i&&(t!=null?Wn(e,!!i,t,!0):Wn(e,!!i,i?[]:"",!1));return;case"textarea":oe=Z=null;for(C in i)if(s=i[C],i.hasOwnProperty(C)&&s!=null&&!l.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:Rt(e,t,C,null,l,s)}for(m in l)if(s=l[m],c=i[m],l.hasOwnProperty(m)&&(s!=null||c!=null))switch(m){case"value":s!==c&&(Ve=!0),Z=s;break;case"defaultValue":s!==c&&(Ve=!0),oe=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(a(91));break;default:s!==c&&Rt(e,t,m,s,l,c)}_r(e,Z,oe);return;case"option":for(var Oe in i)Z=i[Oe],i.hasOwnProperty(Oe)&&Z!=null&&!l.hasOwnProperty(Oe)&&(Oe==="selected"?e.selected=!1:Rt(e,t,Oe,null,l,Z));for(k in l)Z=l[k],oe=i[k],l.hasOwnProperty(k)&&Z!==oe&&(Z!=null||oe!=null)&&(k==="selected"?(Z!==oe&&(Ve=!0),e.selected=Z&&typeof Z!="function"&&typeof Z!="symbol"):Rt(e,t,k,Z,l,oe));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Le in i)Z=i[Le],i.hasOwnProperty(Le)&&Z!=null&&!l.hasOwnProperty(Le)&&Rt(e,t,Le,null,l,Z);for(ee in l)if(Z=l[ee],oe=i[ee],l.hasOwnProperty(ee)&&Z!==oe&&(Z!=null||oe!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(a(137,t));break;default:Rt(e,t,ee,Z,l,oe)}return;default:if(kl(t)){for(var Je in i)Z=i[Je],i.hasOwnProperty(Je)&&Z!==void 0&&!l.hasOwnProperty(Je)&&gh(e,t,Je,void 0,l,Z);for(re in l)Z=l[re],oe=i[re],!l.hasOwnProperty(re)||Z===oe||Z===void 0&&oe===void 0||gh(e,t,re,Z,l,oe);return}}for(var W in i)Z=i[W],i.hasOwnProperty(W)&&Z!=null&&!l.hasOwnProperty(W)&&Rt(e,t,W,null,l,Z);for(pe in l)Z=l[pe],oe=i[pe],!l.hasOwnProperty(pe)||Z===oe||Z==null&&oe==null||Rt(e,t,pe,Z,l,oe)}function Ny(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Vx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var s=i[l],c=s.transferSize,m=s.initiatorType,C=s.duration;if(c&&C&&Ny(m)){for(m=0,C=s.responseEnd,l+=1;l<i.length;l++){var k=i[l],ee=k.startTime;if(ee>C)break;var re=k.transferSize,pe=k.initiatorType;re&&Ny(pe)&&(k=k.responseEnd,m+=re*(k<C?1:(C-ee)/(k-ee)))}if(--l,t+=8*(c+m)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var yh=null,bh=null;function ds(e){return e.nodeType===9?e:e.ownerDocument}function _y(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Dy(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function jy(e,t,i,l){return i=ds(i).createElement(e),i[Zt]=l,i[Rn]=t,jn(i,e,t),ve(i),i}function vh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sh=null;function qx(){var e=window.event;return e&&e.type==="popstate"?e===Sh?!1:(Sh=e,!0):(Sh=null,!1)}var wh=typeof setTimeout=="function"?setTimeout:void 0,Yx=typeof clearTimeout=="function"?clearTimeout:void 0,zy=typeof Promise=="function"?Promise:void 0,Ly=typeof requestAnimationFrame=="function"?requestAnimationFrame:wh,Fx=typeof queueMicrotask=="function"?queueMicrotask:typeof zy<"u"?function(e){return zy.resolve(null).then(e).catch(Gx)}:wh;function Gx(e){setTimeout(function(){throw e})}function fl(e){return e==="head"}function ky(e,t){var i=t,l=0;do{var s=i.nextSibling;if(e.removeChild(i),s&&s.nodeType===8)if(i=s.data,i==="/$"||i==="/&"){if(l===0){e.removeChild(s),da(t);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")Mh(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Mh(i);for(var c=i.firstChild;c;){var m=c.nextSibling,C=c.nodeName;c[zl]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&c.rel.toLowerCase()==="stylesheet"||i.removeChild(c),c=m}}else i==="body"&&Mh(e.ownerDocument.body);i=s}while(i);da(t)}function Uy(e,t){var i=e;e=0;do{var l=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=l}while(i)}function Iy(e,t,i){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,i!=null&&(e.style.viewTransitionClass=i),i=getComputedStyle(e),i.display==="inline"){if(t=e.getClientRects(),t.length===1)var l=1;else for(var s=l=0;s<t.length;s++){var c=t[s];0<c.width&&0<c.height&&l++}l===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+i.paddingTop,e.marginBottom="-"+i.paddingBottom)}}function Hy(e,t){e=e.style,t=t.style;var i=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(i=t.display,e.display=i==null||typeof i=="boolean"?"":i,i=t.margin,i!=null?e.margin=i:(i=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=i==null||typeof i=="boolean"?"":i,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function Px(e,t,i){return i=i.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=i.innerHeight&&e.left<=i.innerWidth}}function xh(e){var t=e.getBoundingClientRect(),i=getComputedStyle(e);return Px(t,i,e)}function Xx(e){return e.documentElement.clientHeight}function Kx(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Qx(e,t,i,l,s,c,m,C,k){var ee=t.nodeType===9?t:t.ownerDocument;try{var re=ee.startViewTransition({update:function(){var Z=ee.defaultView,oe=Z.navigation&&Z.navigation.transition,Oe=ee.fonts.status;l();var Le=[];if(Oe==="loaded"&&(Xx(ee),ee.fonts.status==="loading"&&Le.push(ee.fonts.ready)),Oe=Le.length,e!==null)for(var Je=e.suspenseyImages,W=0,F=0;F<Je.length;F++){var ne=Je[F];if(!ne.complete){var he=ne.getBoundingClientRect();if(0<he.bottom&&0<he.right&&he.top<Z.innerHeight&&he.left<Z.innerWidth){if(W+=rb(ne),W>$c){Le.length=Oe;break}ne=new Promise(Kx.bind(ne)),Le.push(ne)}}}if(0<Le.length)return Z=Promise.race([Promise.all(Le),new Promise(function(ze){return setTimeout(ze,500)})]).then(s,s),(oe?Promise.allSettled([oe.finished,Z]):Z).then(c,c);if(s(),oe)return oe.finished.then(c,c);c()},types:i});ee.__reactViewTransition=re;var pe=[];return re.ready.then(function(){for(var Z=ee.documentElement.getAnimations({subtree:!0}),oe=0;oe<Z.length;oe++){var Oe=Z[oe],Le=Oe.effect,Je=Le.pseudoElement;if(Je!=null&&Je.startsWith("::view-transition")){pe.push(Oe),Oe=Le.getKeyframes();for(var W=Je=void 0,F=!0,ne=0;ne<Oe.length;ne++){var he=Oe[ne],ze=he.width;if(Je===void 0)Je=ze;else if(Je!==ze){F=!1;break}if(ze=he.height,W===void 0)W=ze;else if(W!==ze){F=!1;break}delete he.width,delete he.height,he.transform==="none"&&delete he.transform}F&&Je!==void 0&&W!==void 0&&(Le.setKeyframes(Oe),F=getComputedStyle(Le.target,Le.pseudoElement),F.width!==Je||F.height!==W)&&(F=Oe[0],F.width=Je,F.height=W,F=Oe[Oe.length-1],F.width=Je,F.height=W,Le.setKeyframes(Oe))}}m()},function(Z){ee.__reactViewTransition===re&&(ee.__reactViewTransition=null);try{typeof Z=="object"&&Z!==null&&Z.name==="InvalidStateError"&&(Z.message==="View transition was skipped because document visibility state is hidden."||Z.message==="Skipping view transition because document visibility state has become hidden."||Z.message==="Skipping view transition because viewport size changed."||Z.message==="Transition was aborted because of invalid state")&&(Z=null),Z!==null&&k(Z)}finally{l(),s(),m()}}),re.finished.finally(function(){for(var Z=0;Z<pe.length;Z++)pe[Z].cancel();ee.__reactViewTransition===re&&(ee.__reactViewTransition=null),C()}),re}catch{return l(),s(),m(),null}}function rr(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}rr.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},rr.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,i=e.getAnimations({subtree:!0}),l=[],s=0;s<i.length;s++){var c=i[s].effect;c!==null&&c.target===e&&c.pseudoElement===t&&l.push(i[s])}return l},rr.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function By(e){return{name:e,group:new rr("group",e),imagePair:new rr("image-pair",e),old:new rr("old",e),new:new rr("new",e)}}function Si(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Si.prototype.addEventListener=function(e,t,i){var l=null,s=null;if(!(i!=null&&typeof i!="boolean"&&(l=i.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var c=this._eventListeners;if(qy(c,e,t,i)===-1){var m=this,C=t;i!=null&&typeof i!="boolean"&&i.once===!0&&(C=function(k){m.removeEventListener(e,t,i),typeof t=="function"?t.call(this,k):t.handleEvent(k)}),l!==null&&(s=m.removeEventListener.bind(m,e,t,i),l.addEventListener("abort",s,{once:!0}),s=l.removeEventListener.bind(l,"abort",s)),l=ra(i),c.push({type:e,listener:t,optionsOrUseCapture:i,attachedListener:C,cleanup:s}),g(this._fragmentFiber.child,!1,Zx,e,C,l)}this._eventListeners=c}};function Zx(e,t,i,l){return T(e).addEventListener(t,i,l),!1}Si.prototype.removeEventListener=function(e,t,i){var l=this._eventListeners;if(l!==null&&(t=qy(l,e,t,i),t!==-1)){var s=l[t];i=s.attachedListener;var c=s.cleanup;s=ra(s.optionsOrUseCapture),g(this._fragmentFiber.child,!1,Jx,e,i,s),l.splice(t,1),c!==null&&c()}};function Jx(e,t,i,l){return T(e).removeEventListener(t,i,l),!1}function ra(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Vy(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function qy(e,t,i,l){if(e.length===0)return-1;l=Vy(l);for(var s=0;s<e.length;s++){var c=e[s];if(c.type===t&&c.listener===i&&Vy(c.optionsOrUseCapture)===l)return s}return-1}Si.prototype.dispatchEvent=function(e){var t=w(this._fragmentFiber);if(t===null)return!0;t=T(t);var i=this._eventListeners;if(i!==null&&0<i.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(i)for(var s=0;s<i.length;s++){var c=i[s];l.addEventListener(c.type,c.attachedListener,ra(c.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),i)for(s=0;s<i.length;s++)c=i[s],l.removeEventListener(c.type,c.attachedListener,ra(c.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},Si.prototype.focus=function(e){g(this._fragmentFiber.child,!0,Yy,e,void 0,void 0)};function Yy(e,t){return e.tag===6?!1:(e=T(e),cE(e,t))}Si.prototype.focusLast=function(e){var t=[];g(this._fragmentFiber.child,!0,Eh,t,void 0,void 0);for(var i=t.length-1;0<=i&&!Yy(t[i],e);i--);};function Eh(e,t){return t.push(e),!1}Si.prototype.blur=function(){var e=w(this._fragmentFiber);e!==null&&(e=T(e),e=ds(e).activeElement,e!==null&&g(this._fragmentFiber.child,!1,$x,e,void 0,void 0))};function $x(e,t){return e.tag===6?!1:(e=T(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Si.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),g(this._fragmentFiber.child,!1,Wx,e,void 0,void 0)};function Wx(e,t){return e.tag===6||(e=T(e),t.observe(e)),!1}Si.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),g(this._fragmentFiber.child,!1,eE,e,void 0,void 0);for(var i=t=0;i<Ji.length;i++){var l=Ji[i];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):Ji[t++]=l}Ji.length=t}};function eE(e,t){return e.tag===6||(e=T(e),t.unobserve(e)),!1}var Ji=[],Th=!1;function tE(e,t,i){Ji.push({fragmentInstance:e,observer:t,instance:i}),Th||(Th=!0,uE(function(){Th=!1;var l=Ji;Ji=[];for(var s=0;s<l.length;s++){var c=l[s];c.observer.unobserve(c.instance)}}))}Si.prototype.getClientRects=function(){var e=[];return g(this._fragmentFiber.child,!1,nE,e,void 0,void 0),e};function nE(e,t){if(e.tag===6){e=e.stateNode;var i=e.ownerDocument.createRange();i.selectNodeContents(e),t.push.apply(t,i.getClientRects())}else e=T(e),t.push.apply(t,e.getClientRects());return!1}Si.prototype.getRootNode=function(e){var t=w(this._fragmentFiber);return t===null?this:T(t).getRootNode(e)},Si.prototype.compareDocumentPosition=function(e){var t=w(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];g(this._fragmentFiber.child,!1,Eh,i,void 0,void 0);var l=T(t);if(i.length===0){if(i=l,R(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(i=t)}t=this._fragmentFiber;var s=l=i.compareDocumentPosition(e);return i===e?s=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=M(t)[1],i===null?s=Node.DOCUMENT_POSITION_PRECEDING:(e=T(i).compareDocumentPosition(e),s=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),s|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=T(i[0]),s=T(i[i.length-1]);var c=R(this._fragmentFiber)?t.parentElement:l;if(c==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=c.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,c=c.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINED_BY;var m=t.compareDocumentPosition(e),C=s.compareDocumentPosition(e),k=m&Node.DOCUMENT_POSITION_CONTAINED_BY||C&Node.DOCUMENT_POSITION_CONTAINED_BY;return C=l&&c&&m&Node.DOCUMENT_POSITION_FOLLOWING&&C&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||c&&s===e||k||C?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&t===e||!c&&s===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:m,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||iE(t,this._fragmentFiber,i[0],i[i.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function iE(e,t,i,l,s){var c=Gi(s);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!c)e:{for(;c!==null;){if(c.tag===7&&(c===t||c.alternate===t)){i=!0;break e}c=c.return}i=!1}return i}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(c===null)return c=s.ownerDocument,s===c||s===c.documentElement||s===c.body;e:{for(c=t,t=w(t);c!==null;){if(!(c.tag!==5&&c.tag!==3&&c.tag!==27||c!==t&&c.alternate!==t)){c=!0;break e}c=c.return}c=!1}return c}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!c)&&!(t=c===i)&&(t=O(i,c,j),t===null?t=!1:(g(t,!0,L,c,i),c=A,A=null,t=c!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!c)&&!(t=c===l)&&(t=O(l,c,j),t===null?t=!1:(g(t,!0,E,c,l),c=A,_=A=null,t=c!==null)),t):!1}function Fy(e,t){var i=e.ownerDocument.createRange();i.selectNodeContents(e),e=i.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Si.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(a(566));var t=[];g(this._fragmentFiber.child,!1,Eh,t,void 0,void 0);var i=e!==!1;if(t.length===0){var l=M(this._fragmentFiber);if(l=i?l[1]||l[0]||w(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=T(l),Fy(e,i);return}if(l=T(l),l.nodeType!==9){if(l.nodeType===11){i="host"in l?l.host:null,i!==null&&i.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=i?t.length-1:0;l!==(i?-1:t.length);){var s=t[l];s.tag===6?(s=T(s),Fy(s,i)):T(s).scrollIntoView(e),l+=i?-1:1}};function oE(e,t){return e=T(e),Gy(e,t),!1}function Gy(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Py(e,t){var i=t._eventListeners;if(i!==null)for(var l=0;l<i.length;l++){var s=i[l];e.addEventListener(s.type,s.attachedListener,ra(s.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(c){for(var m=0,C=0;C<Ji.length;C++){var k=Ji[C];(k.fragmentInstance!==t||k.observer!==c||k.instance!==e)&&(Ji[m++]=k)}Ji.length=m,c.observe(e)}),Gy(e,t))}function lE(e,t){var i=t._eventListeners;if(i!==null)for(var l=0;l<i.length;l++){var s=i[l];e.removeEventListener(s.type,s.attachedListener,ra(s.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(c){typeof c.rootMargin=="string"?tE(t,c,e):c.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Ah(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Ah(i),Cr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function rE(e,t,i,l){for(;e.nodeType===1;){var s=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[zl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=zi(e.nextSibling),e===null)break}return null}function aE(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=zi(e.nextSibling),e===null))return null;return e}function Xy(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=zi(e.nextSibling),e===null))return null;return e}function Rh(e){return e.data==="$?"||e.data==="$~"}function Ch(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function sE(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var l=function(){t(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function zi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Oh=null;function Ky(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return zi(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function Qy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function cE(e,t){function i(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",i,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",i,!0)}return l}function uE(e){Ly(function(){Ly(function(t){return e(t)})})}function Zy(e,t,i){switch(t=ds(i),e){case"html":if(e=t.documentElement,!e)throw Error(a(452));return e;case"head":if(e=t.head,!e)throw Error(a(453));return e;case"body":if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Jy(e,t,i){for(var l in i){var s=i[l];i.hasOwnProperty(l)&&s!=null&&Rt(e,t,l,null,Hx,s)}i.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Pn&&(e.onclick=null),Cr(e)}function Mh(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Cr(e)}var Li=new Map,$y=new Set;function hs(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Do=ae.d;ae.d={f:fE,r:dE,D:hE,C:pE,L:mE,m:gE,X:bE,S:yE,M:vE};function fE(){var e=Do.f(),t=Yc();return e||t}function dE(e){var t=Ll(e);t!==null&&t.tag===5&&t.type==="form"?eg(t):Do.r(e)}var aa=typeof document>"u"?null:document;function Wy(e,t,i){var l=aa;if(l&&typeof t=="string"&&t){var s=qt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof i=="string"&&(s+='[crossorigin="'+i+'"]'),$y.has(s)||($y.add(s),e={rel:e,crossOrigin:i,href:t},l.querySelector(s)===null&&(t=l.createElement("link"),jn(t,"link",e),ve(t),l.head.appendChild(t)))}}function hE(e){Do.D(e),Wy("dns-prefetch",e,null)}function pE(e,t){Do.C(e,t),Wy("preconnect",e,t)}function mE(e,t,i){Do.L(e,t,i);var l=aa;if(l&&e&&t){var s='link[rel="preload"][as="'+qt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(s+='[imagesrcset="'+qt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(s+='[imagesizes="'+qt(i.imageSizes)+'"]')):s+='[href="'+qt(e)+'"]';var c=s;switch(t){case"style":c=sa(e);break;case"script":c=ca(e)}if(!(Li.has(c)||(e=D({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Li.set(c,e),l.querySelector(s)!==null||t==="style"&&l.querySelector(ps(c))||t==="script"&&l.querySelector(ms(c))))){var m=l.createElement("link");jn(m,"link",e),t==="style"&&(m[Rr]=!0,m.onload=m.onerror=function(){He(m)}),ve(m),l.head.appendChild(m)}}}function gE(e,t){Do.m(e,t);var i=aa;if(i&&e){var l=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+qt(l)+'"][href="'+qt(e)+'"]',c=s;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=ca(e)}if(!Li.has(c)&&(e=D({rel:"modulepreload",href:e},t),Li.set(c,e),i.querySelector(s)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ms(c)))return}l=i.createElement("link"),jn(l,"link",e),ve(l),i.head.appendChild(l)}}}function yE(e,t,i){Do.S(e,t,i);var l=aa;if(l&&e){var s=be(l).hoistableStyles,c=sa(e);t=t||"default";var m=s.get(c);if(!m){var C={loading:0,preload:null};if(m=l.querySelector(ps(c)))C.loading=5;else{e=D({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Li.get(c))&&Nh(e,i);var k=m=l.createElement("link");ve(k),jn(k,"link",e),k._p=new Promise(function(ee,re){k.onload=ee,k.onerror=re}),k.addEventListener("load",function(){C.loading|=1}),k.addEventListener("error",function(){C.loading|=2}),C.loading|=4,Zc(m,t,l)}m={type:"stylesheet",instance:m,count:1,state:C},s.set(c,m)}}}function bE(e,t){Do.X(e,t);var i=aa;if(i&&e){var l=be(i).hoistableScripts,s=ca(e),c=l.get(s);c||(c=i.querySelector(ms(s)),c||(e=D({src:e,async:!0},t),(t=Li.get(s))&&_h(e,t),c=i.createElement("script"),ve(c),jn(c,"link",e),i.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(s,c))}}function vE(e,t){Do.M(e,t);var i=aa;if(i&&e){var l=be(i).hoistableScripts,s=ca(e),c=l.get(s);c||(c=i.querySelector(ms(s)),c||(e=D({src:e,async:!0,type:"module"},t),(t=Li.get(s))&&_h(e,t),c=i.createElement("script"),ve(c),jn(c,"link",e),i.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(s,c))}}function eb(e,t,i,l){var s=(s=xe.current)?hs(s):null;if(!s)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=sa(i.href),t=be(s).hoistableStyles,l=t.get(i),l||(l={type:"style",instance:null,count:0,state:null},t.set(i,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=sa(i.href);var c=be(s).hoistableStyles,m=c.get(e);if(m||(s=s.ownerDocument||s,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,m),(c=s.querySelector(ps(e)))?c._p||(m.instance=c,m.state.loading=5):(c=Li.get(e),c||(c={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Li.set(e,c)),SE(s,e,c,m.state))),t&&l===null)throw Error(a(528,""));return m}if(t&&l!==null)throw Error(a(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(i=ca(i),t=be(s).hoistableScripts,l=t.get(i),l||(l={type:"script",instance:null,count:0,state:null},t.set(i,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function sa(e){return'href="'+qt(e)+'"'}function ps(e){return'link[rel="stylesheet"]['+e+"]"}function tb(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function SE(e,t,i,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Rr]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[Rr]=!0,t.onload=t.onerror=He.bind(null,t),jn(t,"link",i),ve(t),e.head.appendChild(t);l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2})}function ca(e){return'[src="'+qt(e)+'"]'}function ms(e){return"script[async]"+e}function nb(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+qt(i.href)+'"]');if(l)return t.instance=l,ve(l),l;var s=D({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),ve(l),jn(l,"style",s),Zc(l,i.precedence,e),t.instance=l;case"stylesheet":s=sa(i.href);var c=e.querySelector(ps(s));if(c)return t.state.loading|=4,t.instance=c,ve(c),c;l=tb(i),(s=Li.get(s))&&Nh(l,s),c=(e.ownerDocument||e).createElement("link"),ve(c);var m=c;return m._p=new Promise(function(C,k){m.onload=C,m.onerror=k}),jn(c,"link",l),t.state.loading|=4,Zc(c,i.precedence,e),t.instance=c;case"script":return c=ca(i.src),(s=e.querySelector(ms(c)))?(t.instance=s,ve(s),s):(l=i,(s=Li.get(c))&&(l=D({},i),_h(l,s)),e=e.ownerDocument||e,s=e.createElement("script"),ve(s),jn(s,"link",l),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(a(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Zc(l,i.precedence,e));return t.instance}function Zc(e,t,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=l.length?l[l.length-1]:null,c=s,m=0;m<l.length;m++){var C=l[m];if(C.dataset.precedence===t)c=C;else if(c!==s)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Nh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _h(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Jc=null;function ib(e,t,i){if(Jc===null){var l=new Map,s=Jc=new Map;s.set(i,l)}else s=Jc,l=s.get(i),l||(l=new Map,s.set(i,l));if(l.has(e))return l;for(l.set(e,null),i=i.getElementsByTagName(e),s=0;s<i.length;s++){var c=i[s];if(!(c[zl]||c[Zt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var m=c.getAttribute(t)||"";m=e+m;var C=l.get(m);C?C.push(c):l.set(m,[c])}}return l}function Dh(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function wE(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function ob(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function lb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function rb(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function ab(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=rb(t),e.suspenseyImages.push(t)),e=TE.bind(e),t.decode().then(e,e))}function xE(e,t,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var s=sa(l.href),c=t.querySelector(ps(s));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=gs.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=c,ve(c);return}c=t.ownerDocument||t,l=tb(l),(s=Li.get(s))&&Nh(l,s),c=c.createElement("link"),ve(c);var m=c;m._p=new Promise(function(C,k){m.onload=C,m.onerror=k}),jn(c,"link",l),i.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=gs.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var $c=0;function EE(e,t){return e.stylesheets&&e.count===0&&eu(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var l=setTimeout(function(){if(e.stylesheets&&eu(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&$c===0&&($c=62500*Vx());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&eu(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>$c?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(s)}}:null}function sb(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)eu(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function gs(){this.count--,sb(this)}function TE(){this.imgCount--,sb(this)}var Wc=null;function eu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Wc=new Map,t.forEach(AE,e),Wc=null,gs.call(e))}function AE(e,t){if(!(t.state.loading&4)){var i=Wc.get(e);if(i)var l=i.get(null);else{i=new Map,Wc.set(e,i);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<s.length;c++){var m=s[c];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(i.set(m.dataset.precedence,m),l=m)}l&&i.set(null,l)}s=t.instance,m=s.getAttribute("data-precedence"),c=i.get(m)||l,c===l&&i.set(null,s),i.set(m,s),this.count++,l=gs.bind(this),s.addEventListener("load",l),s.addEventListener("error",l),c?c.parentNode.insertBefore(s,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var ua={$$typeof:te,Provider:null,Consumer:null,_currentValue:Re,_currentValue2:Re,_threadCount:0};function RE(e,t,i,l,s,c,m,C,k){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=wr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wr(0),this.hiddenUpdates=wr(null),this.identifierPrefix=l,this.onUncaughtError=s,this.onCaughtError=c,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.transitionTypes=null,this.incompleteTransitions=new Map}function cb(e,t,i,l,s,c,m,C,k,ee,re,pe){return e=new RE(e,t,i,m,k,ee,re,pe,C),t=1,c===!0&&(t|=24),c=ei(3,null,null,t),e.current=c,c.stateNode=e,t=Xf(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:l,isDehydrated:i,cache:t},Jf(c),e}function ub(e){return e?(e=kr,e):kr}function fb(e,t,i,l,s,c){s=ub(s),l.context===null?l.context=s:l.pendingContext=s,l=Wo(t),l.payload={element:i},c=c===void 0?null:c,c!==null&&(l.callback=c),i=el(e,l,t),i!==null&&(oi(i,e,t),Xa(i,e,t))}function db(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function jh(e,t){db(e,t),(e=e.alternate)&&db(e,t)}function hb(e){if(e.tag===13||e.tag===31){var t=Yl(e,67108864);t!==null&&oi(t,e,67108864),jh(e,67108864)}}function pb(e){if(e.tag===13||e.tag===31){var t=vi();t=Vo(t);var i=Yl(e,t);i!==null&&oi(i,e,t),jh(e,t)}}var fa=!0;function CE(e,t,i,l){var s=me.T;me.T=null;var c=ae.p;try{ae.p=2,zh(e,t,i,l)}finally{ae.p=c,me.T=s}}function OE(e,t,i,l){var s=me.T;me.T=null;var c=ae.p;try{ae.p=8,zh(e,t,i,l)}finally{ae.p=c,me.T=s}}function zh(e,t,i,l){if(fa){var s=Lh(l);if(s===null)mh(e,t,l,tu,i),gb(e,l);else if(NE(s,e,t,i,l))l.stopPropagation();else if(gb(e,l),t&4&&-1<ME.indexOf(e)){for(;s!==null;){var c=Ll(s);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var m=bn(c.pendingLanes);if(m!==0){var C=c;for(C.pendingLanes|=2,C.entangledLanes|=2;m;){var k=1<<31-mt(m);C.entanglements[1]|=k,m&=~k}uo(c),(St&6)===0&&(Bc=Ot()+500,cs(0))}}break;case 31:case 13:C=Yl(c,2),C!==null&&oi(C,c,2),Yc(),jh(c,2)}if(c=Lh(l),c===null&&mh(e,t,l,tu,i),c===s)break;s=c}s!==null&&l.stopPropagation()}else mh(e,t,l,null,i)}}function Lh(e){return e=Il(e),kh(e)}var tu=null;function kh(e){if(tu=null,e=Gi(e),e!==null){var t=f(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=d(t),e!==null)return e;e=null}else if(i===31){if(e=p(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return tu=e,null}function mb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Un()){case Et:return 2;case mn:return 8;case Vt:case Yn:return 32;case si:return 268435456;default:return 32}default:return 32}}var Uh=!1,dl=null,hl=null,pl=null,ys=new Map,bs=new Map,ml=[],ME="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function gb(e,t){switch(e){case"focusin":case"focusout":dl=null;break;case"dragenter":case"dragleave":hl=null;break;case"mouseover":case"mouseout":pl=null;break;case"pointerover":case"pointerout":ys.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":bs.delete(t.pointerId)}}function vs(e,t,i,l,s,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:c,targetContainers:[s]},t!==null&&(t=Ll(t),t!==null&&hb(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function NE(e,t,i,l,s){switch(t){case"focusin":return dl=vs(dl,e,t,i,l,s),!0;case"dragenter":return hl=vs(hl,e,t,i,l,s),!0;case"mouseover":return pl=vs(pl,e,t,i,l,s),!0;case"pointerover":var c=s.pointerId;return ys.set(c,vs(ys.get(c)||null,e,t,i,l,s)),!0;case"gotpointercapture":return c=s.pointerId,bs.set(c,vs(bs.get(c)||null,e,t,i,l,s)),!0}return!1}function yb(e){var t=Gi(e.target);if(t!==null){var i=f(t);if(i!==null){if(t=i.tag,t===13){if(t=d(i),t!==null){e.blockedOn=t,jl(e.priority,function(){pb(i)});return}}else if(t===31){if(t=p(i),t!==null){e.blockedOn=t,jl(e.priority,function(){pb(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function nu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Lh(e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Ul=l,i.target.dispatchEvent(l),Ul=null}else return t=Ll(i),t!==null&&hb(t),e.blockedOn=i,!1;t.shift()}return!0}function bb(e,t,i){nu(e)&&i.delete(t)}function _E(){Uh=!1,dl!==null&&nu(dl)&&(dl=null),hl!==null&&nu(hl)&&(hl=null),pl!==null&&nu(pl)&&(pl=null),ys.forEach(bb),bs.forEach(bb)}function iu(e,t){e.blockedOn===t&&(e.blockedOn=null,Uh||(Uh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,_E)))}var ou=null;function vb(e){ou!==e&&(ou=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){ou===e&&(ou=null);for(var t=0;t<e.length;t+=3){var i=e[t],l=e[t+1],s=e[t+2];if(typeof l!="function"){if(kh(l||i)===null)continue;break}var c=Ll(i);c!==null&&(e.splice(t,3),t-=3,bd(c,{pending:!0,data:s,method:i.method,action:l},l,s))}}))}function da(e){function t(k){return iu(k,e)}dl!==null&&iu(dl,e),hl!==null&&iu(hl,e),pl!==null&&iu(pl,e),ys.forEach(t),bs.forEach(t);for(var i=0;i<ml.length;i++){var l=ml[i];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ml.length&&(i=ml[0],i.blockedOn===null);)yb(i),i.blockedOn===null&&ml.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var s=i[l],c=i[l+1],m=s[Rn]||null;if(typeof c=="function")m||vb(i);else if(m){var C=null;if(c&&c.hasAttribute("formAction")){if(s=c,m=c[Rn]||null)C=m.formAction;else if(kh(s)!==null)continue}else C=m.action;typeof C=="function"?i[l+1]=C:(i.splice(l,3),l-=3),vb(i)}}}function Sb(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(m){return s=m})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Ih(e){this._internalRoot=e}lu.prototype.render=Ih.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var i=t.current,l=vi();fb(i,l,e,t,null,null)},lu.prototype.unmount=Ih.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fb(e.current,2,null,e,null,null),Yc(),t[ci]=null}};function lu(e){this._internalRoot=e}lu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ri();e={blockedOn:null,target:e,priority:t};for(var i=0;i<ml.length&&t!==0&&t<ml[i].priority;i++);ml.splice(i,0,e),i===0&&yb(e)}};var wb=o.version;if(wb!=="19.3.1")throw Error(a(527,wb,"19.3.1"));ae.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=b(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var DE={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:me,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ru=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ru.isDisabled&&ru.supportsFiber)try{Ft=ru.inject(DE),dt=ru}catch{}}return ws.createRoot=function(e,t){if(!u(e))throw Error(a(299));var i=!1,l="",s=ug,c=fg,m=dg;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=cb(e,1,!1,null,null,i,l,null,s,c,m,Sb),e[ci]=t.current,ph(e),new Ih(t)},ws.hydrateRoot=function(e,t,i){if(!u(e))throw Error(a(299));var l=!1,s="",c=ug,m=fg,C=dg,k=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(s=i.identifierPrefix),i.onUncaughtError!==void 0&&(c=i.onUncaughtError),i.onCaughtError!==void 0&&(m=i.onCaughtError),i.onRecoverableError!==void 0&&(C=i.onRecoverableError),i.formState!==void 0&&(k=i.formState)),t=cb(e,1,!0,t,i??null,l,s,k,c,m,C,Sb),t.context=ub(null),i=t.current,l=vi(),l=Vo(l),s=Wo(l),s.callback=null,el(i,s,l),i=l,t.current.lanes=i,bo(t,i),uo(t),e[ci]=t.current,ph(e),new lu(t)},ws.version="19.3.1",ws}var _b;function QE(){if(_b)return Vh.exports;_b=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(o){console.error(o)}}return n(),Vh.exports=KE(),Vh.exports}var ZE=QE();const JE=""+new URL("robot-x3-D4wBvBN8.webp",import.meta.url).href;function $E(n,o){return function(a,...u){const f=new URL(n);return f.searchParams.set("code",a.toString()),u.forEach(d=>f.searchParams.append("args[]",d)),`${o} error #${a}; visit ${f} for the full message.`}}const qi=$E("https://base-ui.com/production-error","Base UI"),u2=S.createContext(void 0);function Ml(n){const o=S.useContext(u2);if(!n&&o===void 0)throw new Error(qi(27));return o}const Db={};function Jn(n,o){const r=S.useRef(Db);return r.current===Db&&(r.current=n(o)),r}function El(n,o,r,a){const u=Jn(f2).current;return eT(u,n,o,r,a)&&d2(u,[n,o,r,a]),u.callback}function WE(n){const o=Jn(f2).current;return tT(o,n)&&d2(o,n),o.callback}function f2(){return{callback:null,cleanup:null,refs:[]}}function eT(n,o,r,a,u){return n.refs[0]!==o||n.refs[1]!==r||n.refs[2]!==a||n.refs[3]!==u}function tT(n,o){return n.refs.length!==o.length||n.refs.some((r,a)=>r!==o[a])}function d2(n,o){if(n.refs=o,o.every(r=>r==null)){n.callback=null;return}n.callback=r=>{if(n.cleanup&&(n.cleanup(),n.cleanup=null),r!=null){const a=Array(o.length).fill(null);for(let u=0;u<o.length;u+=1){const f=o[u];if(f!=null)switch(typeof f){case"function":{const d=f(r);typeof d=="function"&&(a[u]=d);break}case"object":{f.current=r;break}}}n.cleanup=()=>{for(let u=0;u<o.length;u+=1){const f=o[u];if(f!=null)switch(typeof f){case"function":{const d=a[u];typeof d=="function"?d():f(null);break}case"object":{f.current=null;break}}}}}}}const nT=parseInt(S.version,10);function Gp(n){return nT>=n}function jb(n){if(!S.isValidElement(n))return null;const o=n,r=o.props;return(Gp(19)?r?.ref:o.ref)??null}function gp(n,o){if(n&&!o)return n;if(!n&&o)return o;if(n||o)return{...n,...o}}function Pt(){}const Tl=Object.freeze([]),nn=Object.freeze({});function iT(n,o){const r={};for(const a in n){const u=n[a];if(o?.hasOwnProperty(a)){const f=o[a](u);f!=null&&Object.assign(r,f);continue}u===!0?r[`data-${a.toLowerCase()}`]="":u&&(r[`data-${a.toLowerCase()}`]=u.toString())}return r}function oT(n,o){return typeof n=="function"?n(o):n}function lT(n,o){return typeof n=="function"?n(o):n}const h2={};function gr(n,o,r,a,u){if(!r&&!a&&!u&&!n)return zu(o);let f=zu(n);return o&&(f=Ms(f,o)),r&&(f=Ms(f,r)),a&&(f=Ms(f,a)),u&&(f=Ms(f,u)),f}function rT(n){if(n.length===0)return h2;if(n.length===1)return zu(n[0]);let o=zu(n[0]);for(let r=1;r<n.length;r+=1)o=Ms(o,n[r]);return o}function zu(n){return m2(n)?{...n(h2)}:aT(n)}function Ms(n,o){return m2(o)?o(n):sT(n,o)}function aT(n){const o={...n};for(const r in o){const a=o[r];p2(r,a)&&(o[r]=g2(a))}return o}function sT(n,o){if(!o)return n;for(const r in o){const a=o[r];switch(r){case"style":{n[r]=gp(n.style,a);break}case"className":{n[r]=y2(n.className,a);break}default:p2(r,a)?n[r]=cT(n[r],a):n[r]=a}}return n}function p2(n,o){const r=n.charCodeAt(0),a=n.charCodeAt(1),u=n.charCodeAt(2);return r===111&&a===110&&u>=65&&u<=90&&(typeof o=="function"||typeof o>"u")}function m2(n){return typeof n=="function"}function cT(n,o){return o?n?(...r)=>{const a=r[0];if(b2(a)){const f=a;Lu(f);const d=o(...r);return f.baseUIHandlerPrevented||n?.(...r),d}const u=o(...r);return n?.(...r),u}:g2(o):n}function g2(n){return n&&((...o)=>{const r=o[0];return b2(r)&&Lu(r),n(...o)})}function Lu(n){return n.preventBaseUIHandler=()=>{n.baseUIHandlerPrevented=!0},n}function y2(n,o){return o?n?o+" "+n:o:n}function b2(n){return n!=null&&typeof n=="object"&&"nativeEvent"in n}function Lt(n,o,r={}){let a=o.render;r.enabled!==!1&&(a=hT(a));const u=uT(o,r,a);if(r.enabled===!1)return null;const f=r.state??nn;return pT(n,a,u,f)}function uT(n,o,r){const{className:a,style:u}=n,{state:f=nn,ref:d,props:p,stateAttributesMapping:h,enabled:b=!0}=o,y=b?oT(a,f):void 0,g=b?lT(u,f):void 0,w=b?iT(f,h):nn,R=b&&p?fT(p):void 0,M=b?gp(w,R)??{}:nn;return typeof document<"u"&&(b?Array.isArray(d)?M.ref=WE([M.ref,jb(r),...d]):M.ref=El(M.ref,jb(r),d):El(null,null)),b?(y!==void 0&&(M.className=y2(M.className,y)),g!==void 0&&(M.style=gp(M.style,g)),M):nn}function fT(n){return Array.isArray(n)?rT(n):gr(void 0,n)}const dT=Symbol.for("react.lazy");function hT(n){if(n?.$$typeof!==dT)return n;const o=S.Children.toArray(n)[0];return S.isValidElement(o)?o:n}function pT(n,o,r,a){if(o){if(typeof o=="function")return o(r,a);const u=gr(r,o.props);return u.ref=r.ref,S.cloneElement(o,u)}return mT(n,r)}function mT(n,o){return n==="button"?S.createElement("button",{type:"button",...o,key:o.key}):n==="img"?S.createElement("img",{alt:"",...o,key:o.key}):S.createElement(n,o)}const v2="data-starting-style",gT="data-ending-style",yT={[v2]:""},bT={[gT]:""},Aa={transitionStatus(n){return n==="starting"?yT:n==="ending"?bT:null}},vT="data-open",ST="data-closed",wT="data-anchor-hidden",S2="data-popup-open",xT="data-pressed",ET={[S2]:""},TT={[S2]:"",[xT]:""},AT={[vT]:""},RT={[ST]:""},CT={[wT]:""},w2={open(n){return n?ET:null}},OT={open(n){return n?TT:null}},Ju={open(n){return n?AT:RT},anchorHidden(n){return n?CT:null}},MT={...Ju,...Aa},NT=S.forwardRef(function(o,r){const{render:a,className:u,style:f,forceRender:d=!1,...p}=o,h=Ml(),b=h.useState("open"),y=h.useState("nested"),g=h.useState("mounted"),w=h.useState("transitionStatus");return Lt("div",o,{state:{open:b,transitionStatus:w},ref:[h.context.backdropRef,r],stateAttributesMapping:MT,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},p],enabled:d||!y})});function $u(){return typeof window<"u"}function Ln(n){return Pp(n)?(n.nodeName||"").toLowerCase():"#document"}function Kt(n){var o;return(n==null||(o=n.ownerDocument)==null?void 0:o.defaultView)||window}function Ho(n){var o;return(o=(Pp(n)?n.ownerDocument:n.document)||window.document)==null?void 0:o.documentElement}function Pp(n){return $u()?n instanceof Node||n instanceof Kt(n).Node:!1}function Tn(n){return $u()?n instanceof Element||n instanceof Kt(n).Element:!1}function Ht(n){return $u()?n instanceof HTMLElement||n instanceof Kt(n).HTMLElement:!1}function yr(n){return!$u()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Kt(n).ShadowRoot}function Vs(n){const{overflow:o,overflowX:r,overflowY:a,display:u}=Ei(n);return/auto|scroll|overlay|hidden|clip/.test(o+a+r)&&u!=="inline"&&u!=="contents"}function _T(n){return/^(table|td|th)$/.test(Ln(n))}function Wu(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const DT=/transform|translate|scale|rotate|perspective|filter/,jT=/paint|layout|strict|content/,ar=n=>!!n&&n!=="none";let Gh;function Xp(n){const o=Tn(n)?Ei(n):n;return ar(o.transform)||ar(o.translate)||ar(o.scale)||ar(o.rotate)||ar(o.perspective)||!Kp()&&(ar(o.backdropFilter)||ar(o.filter))||DT.test(o.willChange||"")||jT.test(o.contain||"")}function zT(n){let o=Al(n);for(;Ht(o)&&!xl(o);){if(Xp(o))return o;if(Wu(o))return null;o=Al(o)}return null}function Kp(){return Gh==null&&(Gh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Gh}function xl(n){return/^(html|body|#document)$/.test(Ln(n))}function Ei(n){return Kt(n).getComputedStyle(n)}function ef(n){return Tn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Al(n){if(Ln(n)==="html")return n;const o=n.assignedSlot||n.parentNode||yr(n)&&n.host||Ho(n);return yr(o)?o.host:o}function x2(n){const o=Al(n);return xl(o)?(n.ownerDocument||n).body:Ht(o)&&Vs(o)?o:x2(o)}function Ls(n,o,r){var a;o===void 0&&(o=[]),r===void 0&&(r=!0);const u=x2(n),f=u===((a=n.ownerDocument)==null?void 0:a.body),d=Kt(u);if(f){const p=yp(d);return o.concat(d,d.visualViewport||[],Vs(u)?u:[],p&&r?Ls(p):[])}else return o.concat(u,Ls(u,[],r))}function yp(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}const Qp={...FE},Ph=Qp.useInsertionEffect,LT=Ph&&Ph!==Qp.useLayoutEffect?Ph:n=>n();function ke(n){const o=Jn(kT).current;return o.next=n,LT(o.effect),o.trampoline}function kT(){const n={next:void 0,callback:UT,trampoline:(...o)=>n.callback?.(...o),effect:()=>{n.callback=n.next}};return n}function UT(){}const IT=()=>{},De=typeof document<"u"?S.useLayoutEffect:IT,E2=S.createContext(void 0);function Zp(n=!1){const o=S.useContext(E2);if(o===void 0&&!n)throw new Error(qi(16));return o}function HT(n){const{focusableWhenDisabled:o,disabled:r,composite:a=!1,tabIndex:u=0,isNativeButton:f}=n,d=a&&o!==!1,p=a&&o===!1;return{props:S.useMemo(()=>{const b={onKeyDown(y){r&&o&&y.key!=="Tab"&&y.preventDefault()}};return a||(b.tabIndex=u,!f&&r&&(b.tabIndex=o?u:-1)),(f&&(o||d)||!f&&r)&&(b["aria-disabled"]=r),f&&(!o||p)&&(b.disabled=r),b},[a,r,o,d,p,f,u])}}function _t(n){return n?.ownerDocument||document}function Au(n,o,{detail:r=0,pointerType:a=""}={}){n.dispatchEvent(new(Kt(n)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:r,pointerType:a,shiftKey:o.shiftKey,ctrlKey:o.ctrlKey,altKey:o.altKey,metaKey:o.metaKey}))}function Sr(n={}){const{disabled:o=!1,focusableWhenDisabled:r,tabIndex:a=0,native:u=!0,composite:f}=n,d=S.useRef(null),p=Zp(!0),h=f??p!==void 0,{props:b}=HT({focusableWhenDisabled:r,disabled:o,composite:h,tabIndex:a,isNativeButton:u}),y=S.useCallback(()=>{const R=d.current;Xh(R)&&h&&o&&b.disabled===void 0&&R.disabled&&(R.disabled=!1)},[o,b.disabled,h]);De(y,[y]);const g=S.useCallback((R={})=>{const{onClick:M,onMouseDown:x,onKeyUp:T,onKeyDown:A,onPointerDown:_,...L}=R;return gr({onClick(E){if(o){E.preventDefault();return}M?.(E)},onMouseDown(E){o||x?.(E)},onKeyDown(E){if(o||(Lu(E),A?.(E),E.baseUIHandlerPrevented))return;const j=E.target===E.currentTarget,O=E.currentTarget,D=Xh(O),z=!u&&BT(O),q=j&&(u?D:!z),B=E.key==="Enter",V=E.key===" ",G=O.getAttribute("role"),P=G?.startsWith("menuitem")||G==="option"||G==="gridcell";if(j&&h&&V){if(E.defaultPrevented&&P)return;E.preventDefault(),(!u||D)&&(E.preventBaseUIHandler(),Au(O,E));return}if(!q||u||!V&&!B){j&&z&&V&&E.preventDefault();return}E.defaultPrevented||(E.preventDefault(),B&&(E.preventBaseUIHandler(),Au(O,E)))},onKeyUp(E){if(!o){if(Lu(E),T?.(E),E.target===E.currentTarget&&u&&h&&Xh(E.currentTarget)&&E.key===" "){E.preventDefault();return}E.baseUIHandlerPrevented||E.target===E.currentTarget&&!u&&!h&&!E.defaultPrevented&&E.key===" "&&(E.preventBaseUIHandler(),Au(E.currentTarget,E))}},onPointerDown(E){if(o){E.preventDefault();return}_?.(E)}},u?{type:"button"}:{role:"button"},b,L)},[o,b,h,u]),w=ke(R=>{d.current=R,y()});return{getButtonProps:g,buttonRef:w}}function Xh(n){return Ht(n)&&n.tagName==="BUTTON"}function BT(n){return Ht(n)&&n.tagName==="A"&&!!n.href}function Bt(n,o,r,a){let u=!1,f=!1;const d=a??nn;return{reason:n,event:o??new Event("base-ui"),cancel(){u=!0},allowPropagation(){f=!0},get isCanceled(){return u},get isPropagationAllowed(){return f},trigger:r,...d}}const Rl="none",T2="trigger-press",VT="trigger-hover",Jp="outside-press",Kh="item-press",qT="close-press",ks="focus-out",YT="escape-key",zb="list-navigation",FT="cancel-open",GT="disabled",Lb="missing",kb="initial",A2="imperative-action",PT="window-resize",XT=S.forwardRef(function(o,r){const{render:a,className:u,style:f,disabled:d=!1,nativeButton:p=!0,...h}=o,b=Ml(),y=b.useState("open"),{getButtonProps:g,buttonRef:w}=Sr({disabled:d,native:p}),R={disabled:d};function M(x){y&&b.setOpen(!1,Bt(qT,x.nativeEvent))}return Lt("button",o,{state:R,ref:[r,w],props:[{onClick:M},h,g]})});function R2(){const[,n]=S.useState({});return S.useCallback(()=>{n({})},[])}let Ub=0;function KT(n,o="mui"){const r=S.useRef(void 0),a=R2(),u=n??r.current;return S.useEffect(()=>{r.current==null&&(Ub+=1,r.current=`${o}-${Ub}`,n==null&&a())},[n,o,a]),u}const Ib=Qp.useId;function tf(n,o){if(Ib!==void 0){const r=Ib();return n??(o?`${o}-${r}`:r)}return KT(n,o)}function Nl(n){return tf(n,"base-ui")}const QT=S.forwardRef(function(o,r){const{render:a,className:u,style:f,id:d,...p}=o,h=Ml(),b=Nl(d);return h.useSyncedValueWithCleanup("descriptionElementId",b),Lt("p",o,{ref:r,props:[{id:b},p]})});function C2(n){S.useEffect(n,Tl)}const xs=0;class wa{static create(){return new wa}currentId=xs;start(o,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=xs,r()},o)}isStarted(){return this.currentId!==xs}clear=()=>{this.currentId!==xs&&(clearTimeout(this.currentId),this.currentId=xs)};disposeEffect=()=>this.clear}function Bi(){const n=Jn(wa.create).current;return C2(n.disposeEffect),n}function ZT(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:JT,platform:$T,maxTouchPoints:WT}=ZT(),nf=JT.toLowerCase(),Us=$T.toLowerCase(),of=/^i(os$|p)/.test(Us)||Us==="macintel"&&WT>1,Hb="android",bp=Us===Hb||nf.includes(Hb),eA=!of&&Us.startsWith("mac");Us.startsWith("win");const tA=eA||of,_l=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!_l&&nf.includes("firefox");!_l&&nf.includes("chrom");const nA=tA,O2=/jsdom|happydom/.test(nf);function ho(n){n.preventDefault(),n.stopPropagation()}function iA(n){return"nativeEvent"in n}function xa(n){return n.pointerType===""&&n.isTrusted?!0:bp&&n.pointerType?n.type==="click"&&n.buttons===1:n.detail===0&&!n.pointerType}function $p(n){return O2?!1:!bp&&n.width===0&&n.height===0||n.type==="pointerdown"&&n.width===1&&n.height===1&&n.pressure===0&&n.detail===0&&n.pointerType==="mouse"&&(bp||n.buttons===0)||n.width<1&&n.height<1&&n.pressure===0&&n.detail===0&&n.pointerType==="touch"}function Qh(n,o){return["mouse","pen"].includes(n)}function oA(n){const o=n.type;return o==="click"||o==="mousedown"||o==="keydown"||o==="keyup"}function wi(n){let o=n.activeElement;for(;o?.shadowRoot?.activeElement!=null;)o=o.shadowRoot.activeElement;return o}function it(n,o){if(!n||!o)return!1;const r=o.getRootNode?.();if(n.contains(o))return!0;if(r&&yr(r)){let a=o;for(;a;){if(n===a)return!0;a=a.parentNode||a.host}}return!1}function lA(n,o){let r=n;for(;r;){if(Tn(r)&&r.matches(o))return r;r=r.assignedSlot??r.parentNode??(yr(r)?r.host:null)}return null}function Vi(n){return"composedPath"in n?n.composedPath()[0]??n.target:n.target}const vp="data-base-ui-focusable",rA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",lf="ArrowLeft",rf="ArrowRight",M2="ArrowUp",Wp="ArrowDown";function Zh(n,o){if(o==null)return!1;if("composedPath"in n)return n.composedPath().includes(o);const r=n;return r.target!=null&&o.contains(r.target)}function aA(n){return n.matches("html,body")}function af(n){return Ht(n)&&n.matches(rA)}function Sp(n){return n?n.getAttribute("role")==="combobox"&&af(n):!1}function ku(n){return n?n.hasAttribute(vp)?n:n.querySelector(`[${vp}]`)||n:null}function zt(n,o,r,a){return n.addEventListener(o,r,a),()=>{n.removeEventListener(o,r,a)}}function ma(...n){return()=>{for(let o=0;o<n.length;o+=1){const r=n[o];r&&r()}}}function Bn(n){const o=Jn(sA,n).current;return o.next=n,De(o.effect),o}function sA(n){const o={current:n,next:n,effect:()=>{o.current=o.next}};return o}const au=null;class cA{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=o=>{this.isScheduled=!1;const r=this.callbacks,a=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,a>0)for(let u=0;u<r.length;u+=1)r[u]?.(o)};request(o){const r=this.nextId;return this.nextId+=1,this.callbacks.push(o),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),r}cancel(o){const r=o-this.startId;r<0||r>=this.callbacks.length||this.callbacks[r]!==null&&(this.callbacks[r]=null,this.callbacksCount-=1)}}let su=new cA;class po{static create(){return new po}static request(o){return su.request(o)}static cancel(o){return su.cancel(o)}currentId=au;request(o){this.cancel(),this.currentId=su.request(()=>{this.currentId=au,o()})}cancel=()=>{this.currentId!==au&&(su.cancel(this.currentId),this.currentId=au)};disposeEffect=()=>this.cancel}function Ea(){const n=Jn(po.create).current;return C2(n.disposeEffect),n}const N2={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},em={...N2,position:"fixed",margin:0,top:0,left:0},_2={...N2,position:"absolute"},Uu=S.forwardRef(function(o,r){const[a,u]=S.useState();De(()=>{nA&&_l&&u("button")},[]);const f={tabIndex:0,role:a};return v.jsx("span",{...o,ref:r,style:em,"aria-hidden":a?void 0:!0,...f,"data-base-ui-focus-guard":""})}),Ta=Math.min,Uo=Math.max,Iu=Math.round,cu=Math.floor,Io=n=>({x:n,y:n}),uA={left:"right",right:"left",bottom:"top",top:"bottom"};function D2(n,o,r){return Uo(n,Ta(o,r))}function Cl(n,o){return typeof n=="function"?n(o):n}function xi(n){return n.split("-")[0]}function mo(n){return n.split("-")[1]}function tm(n){return n==="x"?"y":"x"}function nm(n){return n==="y"?"height":"width"}function Hi(n){const o=n[0];return o==="t"||o==="b"?"y":"x"}function im(n){return tm(Hi(n))}function fA(n,o,r){r===void 0&&(r=!1);const a=mo(n),u=im(n),f=nm(u);let d=u==="x"?a===(r?"end":"start")?"right":"left":a==="start"?"bottom":"top";return o.reference[f]>o.floating[f]&&(d=Hu(d)),[d,Hu(d)]}function dA(n){const o=Hu(n);return[wp(n),o,wp(o)]}function wp(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const Bb=["left","right"],Vb=["right","left"],hA=["top","bottom"],pA=["bottom","top"];function mA(n,o,r){switch(n){case"top":case"bottom":return r?o?Vb:Bb:o?Bb:Vb;case"left":case"right":return o?hA:pA;default:return[]}}function gA(n,o,r,a){const u=mo(n);let f=mA(xi(n),r==="start",a);return u&&(f=f.map(d=>d+"-"+u),o&&(f=f.concat(f.map(wp)))),f}function Hu(n){const o=xi(n);return uA[o]+n.slice(o.length)}function yA(n){var o,r,a,u;return{top:(o=n.top)!=null?o:0,right:(r=n.right)!=null?r:0,bottom:(a=n.bottom)!=null?a:0,left:(u=n.left)!=null?u:0}}function j2(n){return typeof n!="number"?yA(n):{top:n,right:n,bottom:n,left:n}}function Is(n){const{x:o,y:r,width:a,height:u}=n;return{width:a,height:u,top:r,left:o,right:o+a,bottom:r+u,x:o,y:r}}function ga(n,o){return o<0||o>=n.length}function Ru(n,o){return ya(n.current,{disabledIndices:o})}function xp(n,o){return ya(n.current,{decrement:!0,startingIndex:n.current.length,disabledIndices:o})}function bA(n,o,r){const{decrement:a,loopFocus:u,allowEscape:f,disabledIndices:d,minIndex:p,maxIndex:h}=r,b=()=>ya(n,{startingIndex:o,decrement:a,disabledIndices:d});let y,g=!1;if(!u)y=a?Math.max(p,b()):Math.min(h,b());else if(a?o<=p:o>=h){const w=a?-1:n.length;f&&o!==w?y=-1:(y=a?h:p,g=!0)}else y=b();return{index:ga(n,y)?-1:y,wrapped:g}}function ya(n,{startingIndex:o=-1,decrement:r=!1,disabledIndices:a,amount:u=1}={}){let f=o;do f+=r?-u:u;while(f>=0&&f<=n.length-1&&ba(n,f,a));return f}function ba(n,o,r){if(typeof r=="function"?r(o):r?.includes(o)??!1)return!0;const u=n[o];return u?!sf(u)||u.matches(":disabled")?!0:!r&&(u.hasAttribute("disabled")||u.getAttribute("aria-disabled")==="true"):!1}function vA(n){return n.visibility==="hidden"||n.visibility==="collapse"}function sf(n,o=n?Ei(n):null){return!n||!n.isConnected||!o||vA(o)?!1:typeof n.checkVisibility=="function"?n.checkVisibility():o.display!=="none"&&o.display!=="contents"}const SA='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function wA(n){const o=n.assignedSlot;if(o)return o;if(n.parentElement)return n.parentElement;const r=n.getRootNode();return yr(r)?r.host:null}function Ep(n){for(const o of Array.from(n.children))if(Ln(o)==="summary")return o;return null}function xA(n,o){const r=Ep(o);return!!r&&(n===r||it(r,n))}function z2(n){const o=n?Ln(n):"";return n!=null&&n.matches(SA)&&(o!=="summary"||n.parentElement!=null&&Ln(n.parentElement)==="details"&&Ep(n.parentElement)===n)&&(o!=="details"||Ep(n)==null)&&(o!=="input"||n.type!=="hidden")}function L2(n){if(!z2(n)||!n.isConnected||n.matches(":disabled"))return!1;for(let o=n;o;o=wA(o)){const r=o!==n,a=Ln(o)==="slot";if(o.hasAttribute("inert")||r&&Ln(o)==="details"&&!o.open&&!xA(n,o)||o.hasAttribute("hidden")||!a&&!EA(o,r))return!1}return!0}function EA(n,o){const r=Ei(n);return o?r.display!=="none":sf(n,r)}function k2(n){const o=n.tabIndex;if(o<0){const r=Ln(n);if(r==="details"||r==="audio"||r==="video"||Ht(n)&&n.isContentEditable)return 0}return o}function Jh(n){if(Ln(n)!=="input")return null;const o=n;return o.type==="radio"&&o.name!==""?o:null}function TA(n,o){const r=Jh(n);if(!r)return!0;const a=o.find(u=>{const f=Jh(u);return f?.name===r.name&&f.form===r.form&&f.checked});return a?a===r:o.find(u=>{const f=Jh(u);return f?.name===r.name&&f.form===r.form})===r}function U2(n){if(Ht(n)&&Ln(n)==="slot"){const o=n.assignedElements({flatten:!0});if(o.length>0)return o}return Ht(n)&&n.shadowRoot?Array.from(n.shadowRoot.children):Array.from(n.children)}function I2(n,o){U2(n).forEach(r=>{z2(r)&&o.push(r),I2(r,o)})}function H2(n,o,r){U2(n).forEach(a=>{Ht(a)&&a.matches(o)&&r.push(a),H2(a,o,r)})}function om(n){return L2(n)&&k2(n)>=0}function B2(n){const o=[];return I2(n,o),o.filter(L2)}function cf(n){const o=B2(n);return o.filter(r=>k2(r)>=0&&TA(r,o))}function V2(n,o){const r=cf(n),a=r.length;if(a===0)return;const u=wi(_t(n)),f=r.indexOf(u),d=f===-1?o===1?0:a-1:f+o;return r[d]}function q2(n){return V2(_t(n).body,1)||n}function Y2(n){return V2(_t(n).body,-1)||n}function Ds(n,o){const r=o||n.currentTarget,a=n.relatedTarget;return!a||!it(r,a)}function AA(n){cf(n).forEach(r=>{r.dataset.tabindex=r.getAttribute("tabindex")||"",r.setAttribute("tabindex","-1")})}function qb(n){const o=[];H2(n,"[data-tabindex]",o),o.forEach(r=>{const a=r.dataset.tabindex;delete r.dataset.tabindex,a?r.setAttribute("tabindex",a):r.removeAttribute("tabindex")})}function Hs(n,o,r=!0){return n.filter(u=>u.parentId===o).flatMap(u=>[...!r||u.context?.open?[u]:[],...Hs(n,u.id,r)])}function Yb(n,o){let r=[],a=n.find(u=>u.id===o)?.parentId;for(;a;){const u=n.find(f=>f.id===a);a=u?.parentId,u&&(r=r.concat(u))}return r}function js(n){return`data-base-ui-${n}`}let uu=0;function Cu(n,o={}){const{preventScroll:r=!1,sync:a=!1,shouldFocus:u}=o;cancelAnimationFrame(uu);function f(){u&&!u()||n?.focus({preventScroll:r})}if(a)return f(),Pt;const d=requestAnimationFrame(f);return uu=d,()=>{uu===d&&(cancelAnimationFrame(d),uu=0)}}const Fb="data-base-ui-inert";let Es=new WeakMap,fu=new WeakSet,Ts=new WeakMap,$h=0;function F2(n){return n?yr(n)?n.host:F2(n.parentNode):null}const Gb=(n,o)=>o.map(r=>{if(n.contains(r))return r;const a=F2(r);return n.contains(a)?a:null}).filter(r=>r!=null),Pb=n=>{const o=new Set;return n.forEach(r=>{let a=r;for(;a&&!o.has(a);)o.add(a),a=a.parentNode}),o},Xb=(n,o,r)=>{const a=[],u=f=>{!f||r.has(f)||Array.from(f.children).forEach(d=>{Ln(d)!=="script"&&(o.has(d)?u(d):a.push(d))})};return u(n),a};function RA(n,o,r,{mark:a=!0}){const u=Gb(o,n),f=a?Xb(o,Pb(u),new Set(u)):[],d=[],p=[];if(r){const h=Gb(o,Array.from(o.querySelectorAll("[aria-live]"))),b=u.concat(h);Xb(o,Pb(b),new Set(b)).forEach(g=>{const w=g.getAttribute("aria-hidden"),R=w!==null&&w!=="false",M=(Es.get(g)||0)+1;Es.set(g,M),d.push(g),M===1&&R&&fu.add(g),R||g.setAttribute("aria-hidden","true")})}return a&&f.forEach(h=>{const b=(Ts.get(h)||0)+1;Ts.set(h,b),p.push(h),b===1&&h.setAttribute(Fb,"")}),$h+=1,()=>{d.forEach(h=>{const b=(Es.get(h)||0)-1;Es.set(h,b),b||(fu.has(h)||h.removeAttribute("aria-hidden"),fu.delete(h))}),a&&p.forEach(h=>{const b=(Ts.get(h)||0)-1;Ts.set(h,b),b||h.removeAttribute(Fb)}),$h-=1,$h||(Es=new WeakMap,fu=new WeakSet,Ts=new WeakMap)}}function Kb(n,o={}){const{ariaHidden:r=!1,mark:a=!0}=o,u=_t(n[0]).body;return RA(n,u,r,{mark:a})}var qs=c2();const CA={style:{transition:"none"}},G2="data-base-ui-click-trigger",OA={fallbackAxisSide:"none"},MA={clipPath:"inset(50%)",position:"fixed",top:0,left:0},P2=S.createContext(null),X2=()=>S.useContext(P2),NA=js("portal");function _A(n={}){const{ref:o,container:r,componentProps:a=nn,elementProps:u}=n,f=tf(),p=X2()?.portalNode,[h,b]=S.useState(null),[y,g]=S.useState(null),w=ke(T=>{T!==null&&g(T)}),R=S.useRef(null);De(()=>{if(r===null){R.current&&(R.current=null,g(null),b(null));return}const T=(r&&(Pp(r)?r:r.current))??p??document.body;if(T==null){R.current&&(R.current=null,g(null),b(null));return}R.current!==T&&(R.current=T,g(null),b(T))},[r,p]);const M=Lt("div",a,{ref:[o,w],props:[{id:f,[NA]:""},u]}),x=h&&M?qs.createPortal(M,h):null;return{node:y,nodeId:S.isValidElement(M)?M.props.id:void 0,subtree:x}}const K2=S.forwardRef(function(o,r){const{render:a,className:u,style:f,children:d,container:p,portalOwnerRole:h,...b}=o,{node:y,nodeId:g,subtree:w}=_A({container:p,ref:r,componentProps:o,elementProps:b}),R=S.useRef(null),M=S.useRef(null),x=S.useRef(null),T=S.useRef(null),[A,_]=S.useState(null),L=S.useRef(!1),E=A?.modal,j=A?.open,O=!!A&&!A.modal&&A.open&&!!y;S.useEffect(()=>{if(!y||E)return;function z(q){y&&q.relatedTarget&&Ds(q)&&(q.type==="focusin"?L.current&&(qb(y),L.current=!1):(AA(y),L.current=!0))}return ma(zt(y,"focusin",z,!0),zt(y,"focusout",z,!0))},[y,E]),De(()=>{!y||j!==!0||!L.current||(qb(y),L.current=!1)},[j,y]);const D=S.useMemo(()=>({beforeOutsideRef:R,afterOutsideRef:M,beforeInsideRef:x,afterInsideRef:T,portalNode:y,setFocusManagerState:_}),[y]);return v.jsxs(S.Fragment,{children:[w,v.jsxs(P2.Provider,{value:D,children:[O&&y&&v.jsx(Uu,{"data-type":"outside",ref:R,onFocus:z=>{if(Ds(z,y))x.current?.focus();else{const q=A?A.domReference:null;Y2(q)?.focus()}}}),O&&y&&v.jsx("span",{role:h,"aria-owns":g,style:MA}),y&&qs.createPortal(d,y),O&&y&&v.jsx(Uu,{"data-type":"outside",ref:M,onFocus:z=>{if(Ds(z,y))T.current?.focus();else{const q=A?A.domReference:null;q2(q)?.focus(),A?.closeOnFocusOut&&A?.onOpenChange(!1,Bt(ks,z.nativeEvent))}}})]})]})});function DA(){const n=new Map;return{emit(o,r){n.get(o)?.forEach(a=>a(r))},on(o,r){n.has(o)||n.set(o,new Set),n.get(o).add(r)},off(o,r){n.get(o)?.delete(r)}}}const jA=S.createContext(null),zA=S.createContext(null),lm=()=>S.useContext(jA)?.id||null,uf=n=>{const o=S.useContext(zA);return n??o};function Lo(n){return n==null?n:"current"in n?n.current:n}function LA(n,o){const r=Kt(Vi(n));return n instanceof r.KeyboardEvent?"keyboard":n instanceof r.FocusEvent?o||"keyboard":"pointerType"in n?n.pointerType||(xa(n)?"keyboard":o||"mouse"):"touches"in n?"touch":n instanceof r.MouseEvent?o||(n.detail===0?"keyboard":"mouse"):""}const Qb=20;let vl=[];function rm(){vl=vl.filter(n=>n.deref()?.isConnected)}function Zb(n){rm(),n&&Ln(n)!=="body"&&(vl.push(new WeakRef(n)),vl.length>Qb&&(vl=vl.slice(-Qb)))}function Jb(){return rm(),vl[vl.length-1]?.deref()}function kA(n){return n?om(n)?n:cf(n)[0]||n:null}function $b(n){if(n.hasAttribute("tabindex")&&!n.hasAttribute("data-tabindex")||!n.getAttribute("role")?.includes("dialog"))return;const r=B2(n).filter(u=>{const f=u.getAttribute("data-tabindex")||"";return om(u)||u.hasAttribute("data-tabindex")&&!f.startsWith("-")}),a=n.getAttribute("tabindex");r.length===0?a!=="0"&&(n.setAttribute("tabindex","0"),n.setAttribute("data-tabindex","0")):(a!=="-1"||n.hasAttribute("data-tabindex")&&n.getAttribute("data-tabindex")!=="-1")&&(n.setAttribute("tabindex","-1"),n.setAttribute("data-tabindex","-1"))}function Q2(n){const{context:o,children:r,disabled:a=!1,initialFocus:u=!0,returnFocus:f=!0,explicitReturnFocus:d,restoreFocus:p=!1,modal:h=!0,closeOnFocusOut:b=!0,openInteractionType:y="",nextFocusableElement:g,previousFocusableElement:w,beforeContentFocusGuardRef:R,externalTree:M,getInsideElements:x}=n,T=o.useState("open"),A=o.useState("domReferenceElement"),_=o.useState("floatingElement"),{events:L,dataRef:E}=o.context,j=ke(()=>E.current.floatingContext?.nodeId),O=u===!1,D=Sp(A)&&O,z=Bn(u),q=Bn(f),B=Bn(d),V=Bn(y),G=Bn(T),P=uf(M),Y=X2(),te=S.useRef(!1),U=S.useRef(!1),H=S.useRef(!1),X=S.useRef(null),J=S.useRef(""),K=S.useRef(""),ye=S.useRef(null),fe=S.useRef(null),se=El(ye,R,Y?.beforeInsideRef),N=El(fe,Y?.afterInsideRef),I=Bi(),Q=Bi(),$=Ea(),ce=Y!=null,ie=ku(_),de=ke((we=ie)=>we?cf(we):[]),me=ke(()=>x?.().filter(we=>we!=null)??[]);S.useEffect(()=>{if(a||!h)return;function we(je){je.key==="Tab"&&it(ie,wi(_t(ie)))&&de().length===0&&!D&&ho(je)}const Ce=_t(ie);return zt(Ce,"keydown",we)},[a,ie,h,D,de]),S.useEffect(()=>{if(a||!T)return;const we=_t(ie);function Ce(){H.current=!1}function je(Ne){const Ee=Vi(Ne),Ue=me(),xe=it(_,Ee)||it(A,Ee)||it(Y?.portalNode,Ee)||Ue.some(Ie=>Ie===Ee||it(Ie,Ee));H.current=!xe,K.current=Ne.pointerType||"keyboard",lA(Ee,`[${G2}]`)&&(U.current=!0,Q.start(0,()=>{U.current=!1}))}function Se(){K.current="keyboard"}return ma(zt(we,"pointerdown",je,!0),zt(we,"pointerup",Ce,!0),zt(we,"pointercancel",Ce,!0),zt(we,"keydown",Se,!0),Ce)},[a,_,A,ie,T,Y,Q,me]),S.useEffect(()=>{if(a||!b)return;const we=_t(ie);function Ce(){U.current=!0,Q.start(0,()=>{U.current=!1})}function je(Ue){const xe=Vi(Ue);om(xe)&&(X.current=xe)}function Se(Ue){const xe=Ue.relatedTarget,Ie=Ue.currentTarget,$e=Vi(Ue);h&&xe==null&&$e!=null&&it(_,$e)&&Zb($e),queueMicrotask(()=>{const ft=j(),ue=o.context.triggerElements,ge=me(),Fe=xe?.hasAttribute(js("focus-guard"))&&[ye.current,fe.current,Y?.beforeInsideRef.current,Y?.afterInsideRef.current,Y?.beforeOutsideRef.current,Y?.afterOutsideRef.current,Lo(w),Lo(g)].includes(xe),Ae=!(it(A,xe)||it(_,xe)||it(xe,_)||it(Y?.portalNode,xe)||ge.some(Me=>Me===xe||it(Me,xe))||ue.hasMatchingElement(Me=>it(Me,xe))||Fe||P&&(Hs(P.nodesRef.current,ft).find(Me=>it(Me.context?.elements.floating,xe)||it(Me.context?.elements.domReference,xe))||Yb(P.nodesRef.current,ft).find(Me=>[Me.context?.elements.floating,ku(Me.context?.elements.floating)].includes(xe)||Me.context?.elements.domReference===xe)));if(Ie===A&&ie&&$b(ie),p&&Ie!==A&&!sf($e)&&wi(we)===we.body){if(Ht(ie)&&(ie.focus(),p==="popup")){$.request(()=>{ie.focus()});return}const Me=de(),Ct=X.current,yt=(Ct&&Me.includes(Ct)?Ct:null)||Me[Me.length-1]||ie;Ht(yt)&&yt.focus()}if(E.current.insideReactTree){E.current.insideReactTree=!1;return}(D||!h)&&xe&&Ae&&!U.current&&(D||xe!==Jb())&&(te.current=!0,o.setOpen(!1,Bt(ks,Ue)))})}function Ne(){H.current||(E.current.insideReactTree=!0,I.start(0,()=>{E.current.insideReactTree=!1}))}const Ee=Ht(A)?A:null;if(!(!_&&!Ee))return ma(Ee&&zt(Ee,"focusout",Se),Ee&&zt(Ee,"pointerdown",Ce),_&&zt(_,"focusin",je),_&&zt(_,"focusout",Se),_&&Y&&zt(_,"focusout",Ne,!0))},[a,A,_,ie,h,P,Y,o,b,p,de,D,j,E,I,Q,$,g,w,me]),S.useEffect(()=>{if(a||!_||!T)return;const we=Array.from(Y?.portalNode?.querySelectorAll(`[${js("portal")}]`)||[]),je=(P?Yb(P.nodesRef.current,j()):[]).find(Ie=>Sp(Ie.context?.elements.domReference||null))?.context?.elements.domReference,Ne=[...[_,...we,ye.current,fe.current,Y?.beforeOutsideRef.current,Y?.afterOutsideRef.current,...me()],je,Lo(w),Lo(g),D?A:null].filter(Ie=>Ie!=null),Ee=Kb(Ne,{ariaHidden:h||D,mark:!1}),Ue=[_,...we].filter(Ie=>Ie!=null),xe=Kb(Ue);return()=>{xe(),Ee()}},[T,a,A,_,h,Y,D,P,j,g,w,me]),De(()=>{if(!T||a||!Ht(ie))return;J.current="",K.current="";const we=_t(ie),Ce=wi(we);queueMicrotask(()=>{const je=z.current,Se=typeof je=="function"?je(V.current||""):je;if(Se===void 0||Se===!1||it(ie,Ce))return;let Ee=null;const Ue=()=>(Ee==null&&(Ee=de(ie)),Ee[0]||ie);let xe;Se===!0||Se===null?xe=Ue():xe=Lo(Se),xe=xe||Ue();const Ie=it(ie,wi(we)),$e=E.current.openEvent,ft=$e?.type==="mousedown"&&xa($e);Cu(xe,{sync:ft,preventScroll:xe===ie,shouldFocus(){if(!G.current)return!1;if(Ie)return!0;const ue=wi(we);return!(ue!==xe&&it(ie,ue))}})})},[a,T,ie,de,z,V,G,E]);const ae=S.useRef(null);De(()=>{if(a||!ie){ae.current=null;return}ae.current&&(ae.current.cancelled=!0,ae.current=null);const we=_t(ie),Ce=wi(we),je=V.current==null;Zb(Ce);function Se(Ee){if(Ee.open||(J.current=LA(Ee.nativeEvent,K.current)),(Ee.reason===ks&&Ee.triggerElement?.hasAttribute(js("focus-guard"))||Ee.reason===VT&&Ee.nativeEvent.type==="mouseleave")&&(te.current=!0),Ee.reason===Jp)if(Ee.nested)te.current=!1;else if(xa(Ee.nativeEvent)||$p(Ee.nativeEvent))te.current=!1;else{let Ue=!1;_t(ie).createElement("div").focus({get preventScroll(){return Ue=!0,!1}}),Ue?te.current=!1:te.current=!0}}L.on("openchange",Se);function Ne(Ee){const Ue=q.current;let xe=typeof Ue=="function"?Ue(Ee):Ue;if(xe===void 0||xe===!1)return null;xe===null&&(xe=!0);const Ie=A?.isConnected?A:null,$e=Ce?.isConnected&&Ln(Ce)!=="body"?Ce:null;let ft=je?$e||Ie:Ie||$e;return ft||(ft=Jb()||null),typeof xe=="boolean"?ft:Lo(xe)||ft||null}return()=>{L.off("openchange",Se);const Ee=wi(we),Ue=me(),xe=it(_,Ee)||Ue.some(ge=>ge===Ee||it(ge,Ee))||P&&Hs(P.nodesRef.current,j(),!1).some(ge=>it(ge.context?.elements.floating,Ee)),Ie=q.current,$e=J.current,ft=Ne($e),ue={cancelled:!1};ae.current=ue,queueMicrotask(()=>{ae.current===ue&&(ae.current=null);const ge=kA(ft),Fe=B.current??typeof Ie!="boolean";if(!ue.cancelled&&Ie&&!te.current&&Ht(ge)&&(!(!Fe&&ge!==Ee&&Ee!==we.body)||xe)){const Ae={preventScroll:!0};$e==="keyboard"&&(Ae.focusVisible=!0),ge.focus(Ae)}te.current=!1})}},[a,_,ie,q,B,V,L,P,A,j,me]),De(()=>{if(!_l||T||!_)return;const we=wi(_t(_));!Ht(we)||!af(we)||it(_,we)&&we.blur()},[T,_]),De(()=>{if(!(a||!Y))return Y.setFocusManagerState({modal:h,closeOnFocusOut:b,open:T,onOpenChange:o.setOpen,domReference:A}),()=>{Y.setFocusManagerState(null)}},[a,Y,h,T,o,b,A]),De(()=>{if(!(a||!ie))return $b(ie),()=>{queueMicrotask(rm)}},[a,ie]);const Re=!a&&(h?!D:!0)&&(ce||h);return v.jsxs(S.Fragment,{children:[Re&&v.jsx(Uu,{"data-type":"inside",ref:se,onFocus:we=>{if(h){const Ce=de();Cu(Ce[Ce.length-1])}else Y?.portalNode&&(te.current=!1,Ds(we,Y.portalNode)?q2(A)?.focus():Lo(w??Y.beforeOutsideRef)?.focus())}}),r,Re&&v.jsx(Uu,{"data-type":"inside",ref:N,onFocus:we=>{h?Cu(de()[0]):Y?.portalNode&&(b&&(te.current=!0),Ds(we,Y.portalNode)?Y2(A)?.focus():Lo(g??Y.afterOutsideRef)?.focus())}})]})}function Z2(n,o={}){const{enabled:r=!0,event:a="click",toggle:u=!0,ignoreMouse:f=!1,stickIfOpen:d=!0,touchOpenDelay:p=0,reason:h=T2}=o,b=n.context.dataRef,y=S.useRef(void 0),g=Ea(),w=Bi(),R=S.useMemo(()=>{function M(T,A,_,L){const E=Bt(h,A,_);T&&L==="touch"&&p>0?w.start(p,()=>{n.setOpen(!0,E)}):n.setOpen(T,E)}function x(T,A,_){const L=b.current.openEvent,E=n.select("domReferenceElement")!==A;return T&&E||!T||!u?!0:L&&(typeof d=="function"?d():d)?!_(L.type):!1}return{onPointerDown(T){y.current=Qh(T.pointerType)&&$p(T.nativeEvent)?"virtual":T.pointerType},onMouseDown(T){const A=y.current,_=T.nativeEvent,L=n.select("open");if(T.button!==0||a==="click"||Qh(A)&&f)return;const E=x(L,T.currentTarget,z=>z==="click"||z==="mousedown"),j=Vi(_),O=af(j);if(O||A==="virtual"){M(E,_,O?j:T.currentTarget,A);return}const D=T.currentTarget;g.request(()=>{M(E,_,D,A)})},onClick(T){if(a==="mousedown-only")return;const A=y.current;if(a==="mousedown"&&A){y.current=void 0;return}if(Qh(A)&&f)return;const _=n.select("open"),L=x(_,T.currentTarget,E=>E==="click"||E==="mousedown"||E==="keydown"||E==="keyup");M(L,T.nativeEvent,T.currentTarget,A)},onKeyDown(){y.current=void 0}}},[b,a,f,h,n,d,u,g,w,p]);return S.useMemo(()=>r?{reference:R}:nn,[r,R])}function UA(){return!1}function IA(n){return{escapeKey:typeof n=="boolean"?n:n?.escapeKey??!1,outsidePress:typeof n=="boolean"?n:n?.outsidePress??!0}}function J2(n,o={}){const{enabled:r=!0,escapeKey:a=!0,outsidePress:u=!0,outsidePressEvent:f="sloppy",referencePress:d=UA,bubbles:p,externalTree:h}=o,b=n.useState("open"),y=n.useState("floatingElement"),{dataRef:g,events:w}=n.context,R=uf(h),M=ke(typeof u=="function"?u:()=>!1),x=typeof u=="function"?M:u,T=x!==!1,A=ke(()=>f),{escapeKey:_,outsidePress:L}=IA(p),E=S.useRef(!1),j=S.useRef(!1),O=S.useRef(!1),D=S.useRef(!1),z=S.useRef(!1),q=S.useRef(""),B=S.useRef(null),V=Bi(),G=Bi(),P=Bi(),Y=ke(()=>{G.clear(),g.current.insideReactTree=!1}),te=ke(N=>{const I=g.current.floatingContext?.nodeId;return(R?Hs(R.nodesRef.current,I):[]).some($=>$.context?.open&&!$.context.dataRef.current[N])}),U=ke(N=>Zh(N,n.select("floatingElement"))||Zh(N,n.select("domReferenceElement"))),H=ke(N=>{d()&&n.setOpen(!1,Bt(T2,N.nativeEvent))}),X=ke(N=>{if(!b||!r||!a||N.key!=="Escape")return;const I=iA(N)?N.nativeEvent:N;if(z.current||I.isComposing||!_&&te("__escapeKeyBubbles"))return;const Q=Bt(YT,I);n.setOpen(!1,Q),Q.isCanceled||N.preventDefault(),!_&&!Q.isPropagationAllowed&&N.stopPropagation()}),J=ke(()=>{g.current.insideReactTree=!0,G.start(0,Y)}),K=ke(N=>{if(!b||!r||N.button!==0)return;const I=Vi(N.nativeEvent);it(n.select("floatingElement"),I)&&(E.current||(E.current=!0,j.current=!1))}),ye=ke(N=>{!b||!r||(N.defaultPrevented||N.nativeEvent.defaultPrevented)&&E.current&&(j.current=!0)});S.useEffect(()=>{function N(I){I.open||(D.current=!1)}return w.on("openchange",N),()=>{w.off("openchange",N)}},[w]),S.useEffect(()=>Y,[Y]),S.useEffect(()=>{if(!b||!r)return b||(D.current=!1,z.current=!1,q.current="",B.current=null),Y;g.current.__escapeKeyBubbles=_,g.current.__outsidePressBubbles=L;const N=new wa,I=_t(y);function Q(){P.clear(),z.current=!0}function $(){z.current=!0,P.start(_l?5:0,()=>{z.current=!1})}function ce(){O.current=!0,N.start(0,()=>{O.current=!1})}function ie(){E.current=!1,j.current=!1}function de(){const ue=q.current,ge=ue==="pen"||!ue?"mouse":ue,Fe=A(),Ae=typeof Fe=="function"?Fe():Fe;return typeof Ae=="string"?Ae:Ae[ge]}function me(ue){const ge=de();return ge==="intentional"&&ue.type!=="click"||ge==="sloppy"&&ue.type==="click"}function ae(ue){const ge=g.current.floatingContext?.nodeId,Fe=R&&Hs(R.nodesRef.current,ge).some(Ae=>Zh(ue,Ae.context?.elements.floating));return U(ue)||Fe}function Re(ue){if(me(ue)){ue.type!=="click"&&!U(ue)&&(N.clear(),O.current=!1),Y();return}if(g.current.insideReactTree){Y();return}const ge=Vi(ue),Fe=`[${js("inert")}]`,Ae=Tn(ge)?ge.getRootNode():null,Me=Array.from((yr(Ae)?Ae:_t(n.select("floatingElement"))).querySelectorAll(Fe)),Ct=n.context.triggerElements;if(ge&&(Ct.hasElement(ge)||Ct.hasMatchingElement(ut=>it(ut,ge))))return;let yt=Tn(ge)?ge:null;for(;yt&&!xl(yt);){const ut=Al(yt);if(xl(ut)||!Tn(ut))break;yt=ut}if(!(Me.length&&Tn(ge)&&!aA(ge)&&!it(ge,n.select("floatingElement"))&&Me.every(ut=>!it(yt,ut)))){if(Ht(ge)&&!("touches"in ue)){const ut=xl(ge),Dt=Ei(ge),an=/auto|scroll/,$n=ut||an.test(Dt.overflowX),kn=ut||an.test(Dt.overflowY),sn=$n&&ge.clientWidth>0&&ge.scrollWidth>ge.clientWidth,qn=kn&&ge.clientHeight>0&&ge.scrollHeight>ge.clientHeight,Ot=Dt.direction==="rtl",Un=qn&&(Ot?ue.offsetX<=ge.offsetWidth-ge.clientWidth:ue.offsetX>ge.clientWidth),Et=sn&&ue.offsetY>ge.clientHeight;if(Un||Et)return}if(!ae(ue)){if(de()==="intentional"){if(ue.detail!==0&&!xa(ue)&&!D.current)return;if(O.current){N.clear(),O.current=!1;return}}typeof x=="function"&&!x(ue)||te("__outsidePressBubbles")||(n.setOpen(!1,Bt(Jp,ue)),Y())}}}function we(ue){de()!=="sloppy"||ue.pointerType==="touch"||!n.select("open")||!r||U(ue)||Re(ue)}function Ce(ue){if(de()!=="sloppy"||!n.select("open")||!r||U(ue))return;const ge=ue.touches[0];ge&&(B.current={startTime:Date.now(),startX:ge.clientX,startY:ge.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},V.start(1e3,()=>{B.current&&(B.current.dismissOnTouchEnd=!1,B.current.dismissOnMouseDown=!1)}))}function je(ue,ge){const Fe=Vi(ue);if(!Fe)return;const Ae=zt(Fe,ue.type,()=>{ge(ue),Ae()})}function Se(ue){q.current="touch",je(ue,Ce)}function Ne(ue){V.clear(),ue.type==="pointerdown"&&(ue.button===0&&(D.current=!0),q.current=ue.pointerType),!(ue.type==="mousedown"&&B.current&&!B.current.dismissOnMouseDown)&&je(ue,ge=>{ge.type==="pointerdown"?we(ge):Re(ge)})}function Ee(ue){if(ue.type==="pointercancel"&&(D.current=!1),!E.current)return;const ge=j.current;if(ie(),de()==="intentional"){if(ue.type==="pointercancel"){ge&&ce();return}if(!ae(ue)){if(ge){ce();return}typeof x=="function"&&!x(ue)||(N.clear(),O.current=!0,Y())}}}function Ue(ue){if(de()!=="sloppy"||!B.current||U(ue))return;const ge=ue.touches[0];if(!ge)return;const Fe=Math.abs(ge.clientX-B.current.startX),Ae=Math.abs(ge.clientY-B.current.startY),Me=Math.sqrt(Fe*Fe+Ae*Ae);Me>5&&(B.current.dismissOnTouchEnd=!0),Me>10&&(Re(ue),V.clear(),B.current=null)}function xe(ue){je(ue,Ue)}function Ie(ue){de()!=="sloppy"||!B.current||U(ue)||(B.current.dismissOnTouchEnd&&Re(ue),V.clear(),B.current=null)}function $e(ue){je(ue,Ie)}const ft=ma(a&&ma(zt(I,"keydown",X),zt(I,"compositionstart",Q),zt(I,"compositionend",$)),T&&ma(zt(I,"click",Ne,!0),zt(I,"pointerdown",Ne,!0),zt(I,"pointerup",Ee,!0),zt(I,"pointercancel",Ee,!0),zt(I,"mousedown",Ne,!0),zt(I,"mouseup",Ee,!0),zt(I,"touchstart",Se,{capture:!0,passive:!0}),zt(I,"touchmove",xe,{capture:!0,passive:!0}),zt(I,"touchend",$e,{capture:!0,passive:!0})));return()=>{ft(),N.clear(),ie(),O.current=!1}},[g,y,a,T,x,b,r,_,L,X,Y,A,te,U,R,n,V,P]);const fe=S.useMemo(()=>({onKeyDown:X,onPointerDown:H,onClick:H}),[X,H]),se=S.useMemo(()=>({onKeyDown:X,onPointerDown:ye,onMouseDown:ye,onClickCapture:J,onMouseDownCapture(N){J(),K(N)},onPointerDownCapture(N){J(),K(N)},onMouseUpCapture:J,onTouchEndCapture:J,onTouchMoveCapture:J}),[X,J,K,ye]);return S.useMemo(()=>r?{reference:fe,floating:se,trigger:fe}:{},[r,fe,se])}function HA(n){const{popupStore:o,treatPopupAsFloatingElement:r=!1,floatingRootContext:a,floatingId:u,nested:f,onOpenChange:d}=n,p=o.useState("open"),h=o.useState("activeTriggerElement"),b=o.useState(r?"popupElement":"positionerElement"),y=d;return o.useSyncedValue("floatingId",u),De(()=>{const g={open:p,floatingId:u,referenceElement:h,floatingElement:b};Tn(h)&&(g.domReferenceElement=h),a.state.positionReference===a.state.referenceElement&&(g.positionReference=h),a.update(g)},[p,u,h,b,a]),a.context.onOpenChange=y,a.context.nested=f,a}function ff(n,o=!1,r=!1,a=!1){const[u,f]=S.useState(n&&o?"idle":void 0),[d,p]=S.useState(n&&!a);return n&&!d&&(p(!0),f("starting")),!n&&d&&u!=="ending"&&!r&&f("ending"),!n&&!d&&u==="ending"&&f(void 0),De(()=>{if(!n&&d&&u!=="ending"&&r){const h=po.request(()=>{f("ending")});return()=>{po.cancel(h)}}},[n,d,u,r]),De(()=>{if(!n||o||u===void 0)return;const h=po.request(()=>{f(void 0)});return()=>{po.cancel(h)}},[o,n,u]),De(()=>{if(!n||!o)return;n&&d&&u!=="idle"&&f("starting");const h=po.request(()=>{f("idle")});return()=>{po.cancel(h)}},[o,n,d,u]),{mounted:d,setMounted:p,transitionStatus:u}}function Wb(n,o){return n.getAnimations(o).filter(r=>{const a=r.effect?.getTiming();return a?.duration!==1/0&&a?.iterations!==1/0})}let du=null;function BA(n){if(!du){const o=[];du=o,queueMicrotask(()=>{du=null,qs.flushSync(()=>{for(const r of o)r()})})}du.push(n)}function VA(n,o=!1,r=!1){const a=Ea();return ke((u,f=null)=>{a.cancel();const d=Lo(n);if(d==null)return;const p=d,h=()=>{if(!r){qs.flushSync(u);return}BA(()=>{f?.aborted||u()})};if(typeof p.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){u();return}function b(){Promise.all(Wb(p).map(y=>y.finished.then(Pt))).then(()=>{f?.aborted||h()},()=>{if(f?.aborted)return;if(Wb(p).some(g=>g.pending||g.playState!=="finished")){b();return}h()})}if(o){const y=v2;if(!p.hasAttribute(y)){a.request(b);return}const g=new MutationObserver(()=>{p.hasAttribute(y)||(g.disconnect(),b())});g.observe(p,{attributes:!0,attributeFilter:[y]}),f?.addEventListener("abort",()=>g.disconnect(),{once:!0});return}a.request(b)})}function Ra(n){const{enabled:o=!0,open:r,ref:a,batch:u=!1,onComplete:f}=n,d=ke(f),p=VA(a,r,u);S.useEffect(()=>{if(!o)return;const h=new AbortController;return p(d,h.signal),()=>{h.abort()}},[o,r,d,p])}function $2(n){const{open:o,ref:r,preventUnmountOnClose:a,setPreventUnmountOnClose:u,onUnmount:f,animateInitialOpen:d}=n,p=ke(u),{mounted:h,setMounted:b,transitionStatus:y}=ff(o,!1,!1,d),g=o?!1:a;De(()=>{o&&p(!1)},[o,p]);const w=S.useRef(h),R=S.useRef(!1),M=R2(),x=()=>{w.current=!1,b(!1),f()};De(()=>{w.current=h,R.current&&(R.current=!1,!o&&h&&x())});const T=ke(()=>{if(w.current){if(o){R.current=!0,M();return}x()}});return Ra({enabled:h&&!o&&!g,open:o,ref:r,onComplete(){o||T()}}),{mounted:h,transitionStatus:y,preventUnmountingOnClose:g,forceUnmount:T}}const W2={tabIndex:-1,[vp]:""};function qA(n){return o=>o==="touch"?n.current:!0}function YA(n,o=!1){const r=tf(),a=lm()!=null,u=Jn(()=>n(r,a)).current;return HA({popupStore:u,treatPopupAsFloatingElement:o,floatingRootContext:u.state.floatingRootContext,floatingId:r,nested:a,onOpenChange:u.setOpen}),u}function FA({handle:n,store:o}){return De(()=>n.attachStore(o),[n,o]),null}function ev(n){const o=n.context.triggerElements.size;n.select("open")&&n.state.triggerCount!==o&&n.set("triggerCount",o)}function GA(n,o){const r=S.useRef(null);return ke(a=>{const u=r.current;if(u!==null){if(u.element===a&&u.store===o&&u.id===n)return;r.current=null;const f=u.store;f.context.triggerElements.getById(u.id)===u.element&&(f.context.triggerElements.delete(u.id),ev(f))}a!==null&&n!==void 0&&(r.current={store:o,id:n,element:a},o.context.triggerElements.add(n,a),ev(o))})}function PA(n,o,r,a=!1){let u=n.preventUnmountingOnClose;o?u=!1:a&&(u=!0);const f=r?.id??null;let d=n.activeTriggerId,p=n.activeTriggerElement;return(f||o)&&(d=f,p=r??null),{open:o,preventUnmountingOnClose:u,activeTriggerId:d,activeTriggerElement:p,openedWithoutTrigger:o?r==null:n.openedWithoutTrigger}}function XA(n){let o=!1;return n.preventUnmountOnClose=()=>{o=!0},()=>o}function KA(n,o,r,a){const u=r.useState("isMountedByTrigger",n),f=GA(n,r),d=ke(h=>{const b=r.select("open"),y=r.select("activeTriggerId");if(y===n){const g={activeTriggerElement:h,...b?a:null};r.update(g);return}if(y==null&&b&&!r.state.openedWithoutTrigger){const g={activeTriggerId:n??null,activeTriggerElement:h,...a};r.update(g)}}),p=ke(h=>{f(h),h&&d(h)});return De(()=>(p(o.current),()=>p(null)),[p,o,r,n]),De(()=>{if(u){const h={activeTriggerElement:o.current,...a};r.update(h)}},[u,r,o,...Object.values(a)]),{registerTrigger:p,isMountedByThisTrigger:u}}function QA(n,o={}){const{closeOnActiveTriggerUnmount:r=!1}=o,a=S.useRef(null),u=n.useState("open"),f=n.useState("triggerCount"),d=n.useState("activeTriggerId"),p=n.useState("activeTriggerElement");De(()=>{if(!u){a.current=null,n.state.triggerCount!==0&&n.set("triggerCount",0),n.state.openedWithoutTrigger&&n.set("openedWithoutTrigger",!1);return}const h=n.context.triggerElements.size,b={};n.state.triggerCount!==h&&(b.triggerCount=h);const y=n.select("activeTriggerId");let g=null;if(y){const w=n.context.triggerElements.getById(y);if(w)a.current=y,w!==n.state.activeTriggerElement&&(b.activeTriggerElement=w);else{for(const[R,M]of n.context.triggerElements.entries())if(M===n.state.activeTriggerElement){b.activeTriggerId=R,b.activeTriggerElement=M,a.current=R;break}b.activeTriggerId===void 0&&(a.current===y?g=y:a.current=null)}}else a.current=null;if(!g&&!y&&!n.state.openedWithoutTrigger&&h===1){const w=n.context.triggerElements.entries().next();if(!w.done){const[R,M]=w.value;b.activeTriggerId=R,b.activeTriggerElement=M,a.current=R}}(b.triggerCount!==void 0||b.activeTriggerId!==void 0||b.activeTriggerElement!==void 0)&&n.update(b),g&&r&&queueMicrotask(()=>{if(n.select("open")&&n.select("activeTriggerId")===g&&!n.context.triggerElements.getById(g)){const w=Bt(Rl);n.setOpen(!1,w),w.isCanceled||n.update({activeTriggerId:null,activeTriggerElement:null})}})},[u,n,f,d,p,r])}function ZA(n,o,r,a){const{mounted:u,transitionStatus:f,forceUnmount:d}=$2({open:n,ref:o.context.popupRef,preventUnmountOnClose:o.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:p=>o.set("preventUnmountingOnClose",p),animateInitialOpen:a,onUnmount(){o.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),o.context.onOpenChangeComplete?.(!1)}});return Jn(()=>(o.set("mounted",u),null)),o.useSyncedValues({mounted:u,transitionStatus:f}),{forceUnmount:d,transitionStatus:f}}function JA(n,o){n.useSyncedValues(o),De(()=>()=>{n.update({activeTriggerProps:nn,inactiveTriggerProps:nn,popupProps:nn})},[n])}function $A(n,o){De(()=>{!o&&n.state.openMethod!==null&&n.set("openMethod",null)},[o,n]),De(()=>()=>{n.state.openMethod!==null&&n.set("openMethod",null)},[n])}class e1{idMap=new Map;add(o,r){this.idMap.set(o,r)}delete(o){this.idMap.delete(o)}hasElement(o){for(const r of this.idMap.values())if(r===o)return!0;return!1}hasMatchingElement(o){for(const r of this.idMap.values())if(o(r))return!0;return!1}getById(o){return this.idMap.get(o)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}var Wh={exports:{}},ep={};var tv;function WA(){if(tv)return ep;tv=1;var n=Bs();function o(g,w){return g===w&&(g!==0||1/g===1/w)||g!==g&&w!==w}var r=typeof Object.is=="function"?Object.is:o,a=n.useState,u=n.useEffect,f=n.useLayoutEffect,d=n.useDebugValue;function p(g,w){var R=w(),M=a({inst:{value:R,getSnapshot:w}}),x=M[0].inst,T=M[1];return f(function(){x.value=R,x.getSnapshot=w,h(x)&&T({inst:x})},[g,R,w]),u(function(){return h(x)&&T({inst:x}),g(function(){h(x)&&T({inst:x})})},[g]),d(R),R}function h(g){var w=g.getSnapshot;g=g.value;try{var R=w();return!r(g,R)}catch{return!0}}function b(g,w){return w()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?b:p;return ep.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:y,ep}var nv;function t1(){return nv||(nv=1,Wh.exports=WA()),Wh.exports}var am=t1(),tp={exports:{}},np={};var iv;function eR(){if(iv)return np;iv=1;var n=Bs(),o=t1();function r(b,y){return b===y&&(b!==0||1/b===1/y)||b!==b&&y!==y}var a=typeof Object.is=="function"?Object.is:r,u=o.useSyncExternalStore,f=n.useRef,d=n.useEffect,p=n.useMemo,h=n.useDebugValue;return np.useSyncExternalStoreWithSelector=function(b,y,g,w,R){var M=f(null);if(M.current===null){var x={hasValue:!1,value:null};M.current=x}else x=M.current;M=p(function(){function A(O){if(!_){if(_=!0,L=O,O=w(O),R!==void 0&&x.hasValue){var D=x.value;if(R(D,O))return E=D}return E=O}if(D=E,a(L,O))return D;var z=w(O);return R!==void 0&&R(D,z)?(L=O,D):(L=O,E=z)}var _=!1,L,E,j=g===void 0?null:g;return[function(){return A(y())},j===null?void 0:function(){return A(j())}]},[y,g,w,R]);var T=u(b,M[0],M[1]);return d(function(){x.hasValue=!0,x.value=T},[T]),h(T),T},np}var ov;function tR(){return ov||(ov=1,tp.exports=eR()),tp.exports}var nR=tR();const Tp=[];let Ap;function iR(){return Ap}function oR(n){Tp.push(n)}function n1(n){const o=(r,a)=>{const u=Jn(rR).current;let f;try{Ap=u;for(const d of Tp)d.before(u);f=n(r,a);for(const d of Tp)d.after(u);u.didInitialize=!0}finally{Ap=void 0}return f};return o.displayName=n.displayName||n.name,o}function lR(n){return S.forwardRef(n1(n))}function rR(){return{didInitialize:!1}}const aR=Gp(19),sR=aR?uR:fR;function i1(n,o,r,a,u){return sR(n,o,r,a,u)}function cR(n,o,r,a,u){const f=S.useCallback(()=>o(n.getSnapshot(),r,a,u),[n,o,r,a,u]);return am.useSyncExternalStore(n.subscribe,f,f)}oR({before(n){n.syncIndex=0,n.didInitialize||(n.syncTick=1,n.syncHooks=[],n.didChangeStore=!0,n.getSnapshot=()=>{let o=!1;for(let r=0;r<n.syncHooks.length;r+=1){const a=n.syncHooks[r],u=a.selector(a.store.state,a.a1,a.a2,a.a3);Object.is(a.value,u)||(o=!0,a.value=u)}return o&&(n.syncTick+=1),n.syncTick})},after(n){n.syncHooks.length>0&&(n.didChangeStore&&(n.didChangeStore=!1,n.subscribe=o=>{const r=new Set;for(const u of n.syncHooks)r.add(u.store);const a=[];for(const u of r)a.push(u.subscribe(o));return()=>{for(const u of a)u()}}),am.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot))}});function uR(n,o,r,a,u){const f=iR();if(!f)return cR(n,o,r,a,u);const d=f.syncIndex;f.syncIndex+=1;let p;return f.didInitialize?(p=f.syncHooks[d],(p.store!==n||p.selector!==o||!Object.is(p.a1,r)||!Object.is(p.a2,a)||!Object.is(p.a3,u))&&(p.store!==n&&(f.didChangeStore=!0),p.store=n,p.selector=o,p.a1=r,p.a2=a,p.a3=u,p.value=o(n.getSnapshot(),r,a,u))):(p={store:n,selector:o,a1:r,a2:a,a3:u,value:o(n.getSnapshot(),r,a,u)},f.syncHooks.push(p)),p.value}function fR(n,o,r,a,u){return nR.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getSnapshot,f=>o(f,r,a,u))}class dR{static create(o){return new this(o)}constructor(o){this.state=o,this.listeners=new Set,this.updateTick=0}subscribe=o=>(this.listeners.add(o),()=>{this.listeners.delete(o)});getSnapshot=()=>this.state;setState(o){if(this.state===o)return;this.state=o,this.updateTick+=1;const r=this.updateTick;for(const a of this.listeners){if(r!==this.updateTick)return;a(o)}}update(o){for(const r in o)if(!Object.is(this.state[r],o[r])){this.setState({...this.state,...o});return}}set(o,r){Object.is(this.state[o],r)||this.setState({...this.state,[o]:r})}notifyAll(){const o={...this.state};this.setState(o)}use(o,r,a,u){return i1(this,o,r,a,u)}}class sm extends dR{constructor(o,r={},a){super(o),this.context=r,this.selectors=a}useSyncedValue(o,r){S.useDebugValue(o);const a=this;De(()=>{a.state[o]!==r&&a.set(o,r)},[a,o,r])}useSyncedValueWithCleanup(o,r){const a=this;De(()=>(a.state[o]!==r&&a.set(o,r),()=>{a.set(o,void 0)}),[a,o,r])}useSyncedValues(o){const r=this,a=Object.values(o);De(()=>{r.update(o)},[r,...a])}useControlledProp(o,r){S.useDebugValue(o);const a=this,u=r!==void 0;De(()=>{u&&!Object.is(a.state[o],r)&&a.setState({...a.state,[o]:r})},[a,o,r,u])}select(o,r,a,u){const f=this.selectors[o];return f(this.state,r,a,u)}useState(o,r,a,u){return S.useDebugValue(o),i1(this,this.selectors[o],r,a,u)}useContextCallback(o,r){S.useDebugValue(o);const a=ke(r??Pt);this.context[o]=a}useStateSetter(o){const r=S.useRef(void 0);return r.current===void 0&&(r.current=a=>{this.set(o,a)}),r.current}observe(o,r){let a;typeof o=="function"?a=o:a=this.selectors[o];let u=a(this.state);return r(u,u,this),this.subscribe(f=>{const d=a(f);if(!Object.is(u,d)){const p=u;u=d,r(d,p,this)}})}}const hR={open:n=>n.open,transitionStatus:n=>n.transitionStatus,domReferenceElement:n=>n.domReferenceElement,referenceElement:n=>n.positionReference??n.referenceElement,floatingElement:n=>n.floatingElement,floatingId:n=>n.floatingId};class o1 extends sm{constructor(o){const{syncOnly:r,nested:a,onOpenChange:u,triggerElements:f,...d}=o;super({...d,positionReference:d.referenceElement,domReferenceElement:d.referenceElement},{onOpenChange:u,dataRef:{current:{}},events:DA(),nested:a,triggerElements:f},hR),this.syncOnly=r}syncOpenEvent=(o,r)=>{(!o||!this.state.open||r!=null&&oA(r))&&(this.context.dataRef.current.openEvent=o?r:void 0)};dispatchOpenChange=(o,r)=>{this.syncOpenEvent(o,r.event);const a={open:o,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",a)};setOpen=(o,r)=>{if(this.syncOnly){this.context.onOpenChange?.(o,r);return}this.dispatchOpenChange(o,r),this.context.onOpenChange?.(o,r)}}function pR(n,o,r=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new o1({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:n,floatingId:o,syncOnly:!0,nested:r,onOpenChange:void 0}),floatingId:o,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:nn,inactiveTriggerProps:nn,popupProps:nn}}const zs=n=>n.triggerIdProp??n.activeTriggerId,Bu=n=>n.openProp??n.open,lv=n=>(n.popupElement?.id??n.floatingId)||void 0;function l1(n,o){return o!==void 0&&Bu(n)&&zs(n)===o}function mR(n,o){return l1(n,o)?!0:o!==void 0&&Bu(n)&&zs(n)==null&&!n.openedWithoutTrigger&&n.triggerCount===1}const gR={open:Bu,mounted:n=>n.mounted,transitionStatus:n=>Bu(n)&&!n.mounted?"starting":n.transitionStatus,floatingRootContext:n=>n.floatingRootContext,triggerCount:n=>n.triggerCount,preventUnmountingOnClose:n=>n.preventUnmountingOnClose,payload:n=>n.payload,activeTriggerId:zs,activeTriggerElement:n=>n.mounted?n.activeTriggerElement:null,popupId:lv,isTriggerActive:(n,o)=>o!==void 0&&zs(n)===o,isOpenedByTrigger:(n,o)=>l1(n,o),isMountedByTrigger:(n,o)=>o!==void 0&&zs(n)===o&&n.mounted,triggerProps:(n,o)=>o?n.activeTriggerProps:n.inactiveTriggerProps,triggerPopupId:(n,o)=>mR(n,o)?lv(n):void 0,popupProps:n=>n.popupProps,popupElement:n=>n.popupElement,positionerElement:n=>n.positionerElement};function yR(n){const o=S.useCallback(a=>n===void 0?Pt:n.subscribeStore(a),[n]),r=S.useCallback(()=>n===void 0?void 0:n.store,[n]);return am.useSyncExternalStore(o,r,()=>n?.serverStore)}function bR(n){const{open:o=!1,onOpenChange:r,elements:a={}}=n,u=tf(),f=lm()!=null,d=Jn(()=>new o1({open:o,transitionStatus:void 0,onOpenChange:r,referenceElement:a.reference??null,floatingElement:a.floating??null,triggerElements:new e1,floatingId:u,syncOnly:!1,nested:f})).current;return De(()=>{const p={open:o,floatingId:u};a.reference!==void 0&&(p.referenceElement=a.reference,p.domReferenceElement=Tn(a.reference)?a.reference:null),a.floating!==void 0&&(p.floatingElement=a.floating),d.update(p)},[o,u,a.reference,a.floating,d]),d.context.onOpenChange=r,d.context.nested=f,d}function rv(n){return _l&&n.movementX===0&&n.movementY===0}function df(n,o,r){switch(n){case"vertical":return o;case"horizontal":return r;default:return o||r}}function hu(n,o){return df(o,n===M2||n===Wp,n===lf||n===rf)}function ip(n,o,r){return df(o,n===Wp,r?n===lf:n===rf)||n==="Enter"||n===" "||n===""}function vR(n,o,r){return df(o,r?n===lf:n===rf,n===Wp)}function SR(n,o,r,a){const u=r?n===rf:n===lf,f=n===M2;return o==="both"||o==="horizontal"&&a?n==="Escape":df(o,u,f)}function wR(n,o){const{listRef:r,activeIndex:a,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:d=null,allowEscape:p=!1,loopFocus:h=!1,nested:b=!1,rtl:y=!1,virtual:g=!1,focusItemOnOpen:w="auto",focusItemOnHover:R=!0,openOnArrowKeyDown:M=!0,disabledIndices:x=void 0,orientation:T="vertical",triggerOrientation:A=T,parentOrientation:_,id:L,resetOnPointerLeave:E=!0,externalTree:j,nestedReturnFocusRef:O,grid:D}=o,z=D!=null,q=n.useState("open"),B=n.useState("floatingElement"),V=n.useState("domReferenceElement"),G=n.context.dataRef,P=ku(B),Y=Sp(V),te=Bn(P),U=lm(),H=uf(j),X=S.useRef(w),J=S.useRef(d??-1),K=S.useRef(null),ye=S.useRef(!0),fe=ke(ue=>{u(J.current===-1?null:J.current,ue)}),se=S.useRef(!!B),N=S.useRef(q),I=S.useRef(!1),Q=S.useRef(!1),$=S.useRef(null),ce=Bn(x),ie=Bn(q),de=Bn(d),me=Bn(E),ae=Ea(),Re=Ea(),we=ke(()=>{ae.cancel();function ue(Me){g||($.current=Cu(Me,{sync:I.current,preventScroll:!0}))}const ge=r.current[J.current],Fe=Q.current;ge&&ue(ge),(I.current?Me=>Me():Me=>ae.request(Me))(()=>{const Me=r.current[J.current]||ge;if(!Me)return;ge||ue(Me),Ue&&(Fe||!ye.current)&&Me.scrollIntoView?.({block:"nearest",inline:"nearest"})})});De(()=>{G.current.orientation=T},[G,T]),De(()=>{q||(K.current=null),(!q||w!=="auto")&&(X.current=w)},[q,w]),De(()=>{f&&(q&&B?(J.current=d??-1,X.current&&d!=null&&(Q.current=!0,fe())):se.current&&(J.current=-1,fe()))},[f,q,B,d,fe]),De(()=>{if(f){if(!q){I.current=!1;return}if(B)if(a==null){if(I.current=!1,de.current!=null)return;if(se.current&&(J.current=-1,we()),(!N.current||!se.current)&&X.current&&(K.current!=null||X.current===!0&&K.current==null)){let ue=0;const ge=()=>{r.current[0]==null?(ue<2&&(ue?Ae=>Re.request(Ae):queueMicrotask)(ge),ue+=1):(J.current=K.current==null||ip(K.current,A,y)||b?Ru(r):xp(r),K.current=null,fe())};ge()}}else ga(r.current,a)||(J.current=a,we(),Q.current=!1)}},[f,q,B,a,de,b,r,A,y,fe,we,Re]),De(()=>{if(!f||B||!H||g||!se.current)return;const ue=H.nodesRef.current,ge=ue.find(Me=>Me.id===U)?.context?.elements.floating,Fe=wi(_t(V??ge??null)),Ae=ue.some(Me=>Me.context&&it(Me.context.elements.floating,Fe));ge&&!Ae&&ye.current&&ge.focus({preventScroll:!0})},[f,B,V,H,U,g]),De(()=>{N.current=q,se.current=!!B});const Ce=a!=null,je=ke(ue=>{if(!ie.current)return;const ge=r.current.indexOf(ue.currentTarget);ge!==-1&&(J.current!==ge||a!==ge)&&(J.current=ge,fe(ue))}),Se=ke(()=>_??H?.nodesRef.current.find(ue=>ue.id===U)?.context?.dataRef?.current.orientation),Ne=ke(()=>Ru(r,ce.current)),Ee=ke(ue=>{if(ye.current=!1,I.current=!0,ue.which===229||!ie.current&&ue.currentTarget===te.current)return;if(b&&SR(ue.key,T,y,z)){hu(ue.key,Se())||ho(ue),n.setOpen(!1,Bt(zb,ue.nativeEvent));const Me=O?.current??V;Ht(Me)&&Me.focus();return}a!=null&&a!==J.current&&!ga(r.current,a)&&(J.current=a);const ge=J.current,Fe=Ru(r,x),Ae=xp(r,x);if(Y||(ue.key==="Home"&&(ho(ue),J.current=Fe,fe(ue)),ue.key==="End"&&(ho(ue),J.current=Ae,fe(ue))),D!=null){const Me=D(ue,J.current,r,T,h,y,x,Fe,Ae);if(Me!=null&&Me!==J.current&&(J.current=Me,fe(ue)),T==="both")return}if(hu(ue.key,T)){ho(ue);const Me=wi(ue.currentTarget.ownerDocument);if(q&&!g&&it(ue.currentTarget,Me)&&!r.current.some(ut=>ut!=null&&it(ut,Me))){J.current=ip(ue.key,T,y)?Fe:Ae,fe(ue),a===J.current&&we();return}const{index:Ct,wrapped:yt}=bA(r.current,ge,{decrement:!ip(ue.key,T,y),loopFocus:h,allowEscape:p,disabledIndices:x,minIndex:Fe,maxIndex:Ae});yt&&(I.current=!1),J.current=Ct,fe(ue)}}),Ue=S.useMemo(()=>({onFocus(ge){I.current=!0,je(ge)},onClick({currentTarget:ge}){g||ge.focus({preventScroll:!0})},onMouseMove(ge){rv(ge)||(I.current=!0,Q.current=!1,R&&je(ge))},onPointerLeave(ge){if(!ie.current||!ye.current||ge.pointerType==="touch")return;I.current=!0;const Fe=ge.relatedTarget;if(!(!R||r.current.includes(Fe))&&me.current&&($.current?.(),$.current=null,J.current=-1,fe(ge),!g)){const Ae=te.current,Me=wi(_t(Ae));Ae&&it(Ae,Me)&&Ae.focus({preventScroll:!0})}}}),[je,ie,te,R,r,fe,me,g]),xe=S.useMemo(()=>g&&q&&Ce&&{"aria-activedescendant":`${L}-${a}`},[g,q,Ce,L,a]),Ie=S.useMemo(()=>({...Y?{}:xe,onKeyDown(ue){if(ue.key==="Tab"&&ue.shiftKey&&q&&!g){const ge=Vi(ue.nativeEvent);if(ge&&!it(te.current,ge))return;ho(ue);const Fe=Bt(ks,ue.nativeEvent);n.setOpen(!1,Fe);const Ae=O?.current??V;!Fe.isCanceled&&Ht(Ae)&&Ae.focus();return}Ee(ue)},onPointerMove(ue){rv(ue)||(ye.current=!0)}}),[xe,Ee,te,Y,n,q,g,V,O]),$e=S.useMemo(()=>{function ue(Ae){n.setOpen(!0,Bt(zb,Ae.nativeEvent,Ae.currentTarget))}function ge(Ae){w==="auto"&&xa(Ae.nativeEvent)&&(X.current=!g)}function Fe(Ae){X.current=w,w==="auto"&&$p(Ae.nativeEvent)&&(X.current=!0)}return{onKeyDown(Ae){const Me=n.select("open");ye.current=!1;const Ct=Ae.key.startsWith("Arrow"),yt=vR(Ae.key,Se(),y),ut=hu(Ae.key,Me?T:A),Dt=(b?yt:ut)||Ae.key==="Enter"||Ae.key.trim()==="";if(g&&Me&&(!b||af(Ae.currentTarget)))return Ee(Ae);if(!(!Me&&!M&&Ct)){if(Dt){const an=hu(Ae.key,Se());K.current=b&&an?null:Ae.key}if(b){yt&&(ho(Ae),Me?(J.current=Ne(),fe(Ae),g&&te.current?.focus()):ue(Ae));return}ut&&(de.current!=null&&(J.current=de.current),ho(Ae),!Me&&M?ue(Ae):Ee(Ae),Me&&fe(Ae))}},onFocus(Ae){Ae.target===Ae.currentTarget&&n.select("open")&&!g&&(J.current=-1,fe(Ae))},onPointerDown:Fe,onPointerEnter:Fe,onMouseDown:ge,onClick:ge}},[Ee,w,Ne,b,fe,n,M,T,A,Se,y,de,g,te]),ft=S.useMemo(()=>({...xe,...$e}),[xe,$e]);return S.useMemo(()=>f?{reference:ft,floating:Ie,item:Ue,trigger:$e}:{},[f,ft,Ie,$e,Ue])}function xR(n,o){const{listRef:r,elementsRef:a,activeIndex:u,onMatch:f,disabledIndices:d,onTyping:p,enabled:h=!0,resetMs:b=750,selectedIndex:y=null}=o,g=ke(p),w=n.useState("open"),R=Bi(),M=S.useRef(""),x=S.useRef(y??u??-1),T=S.useRef(null),A=ke(E=>{function j(Y){return a?.current[Y]}function O(Y){const te=j(Y);return te&&!sf(te)||te?.matches(":disabled")?!1:d==null||!ba(Tl,Y,d)}function D(Y,te,U=0){if(Y.length===0)return-1;const H=(U%Y.length+Y.length)%Y.length,X=te.toLowerCase();for(let J=0;J<Y.length;J+=1){const K=(H+J)%Y.length;if(!(!Y[K]?.toLowerCase().startsWith(X)||!O(K)))return K}return-1}const z=r.current;if(M.current.length>0&&E.key===" "&&(ho(E),g?.(!0)),M.current.length>0&&M.current[0]!==" "&&D(z,M.current)===-1&&E.key!==" "&&g?.(!1),z==null||E.key.length!==1||E.ctrlKey||E.metaKey||E.altKey)return;w&&E.key!==" "&&(ho(E),g?.(!0));const q=M.current==="";q&&(x.current=y??u??-1),z.every((Y,te)=>Y&&O(te)?Y[0]?.toLowerCase()!==Y[1]?.toLowerCase():!0)&&M.current===E.key&&(M.current="",x.current=T.current),M.current+=E.key,R.start(b,()=>{M.current="",x.current=T.current,g?.(!1)});const G=((q?y??u??-1:x.current)??0)+1,P=D(z,M.current,G);P!==-1?(f?.(P,E),T.current=P):E.key!==" "&&(M.current="",g?.(!1))}),_=ke(E=>{const j=E.relatedTarget,O=n.select("domReferenceElement"),D=n.select("floatingElement");it(O,j)||it(D,j)||(R.clear(),M.current="",x.current=T.current,g?.(!1))});De(()=>{!w&&y!==null||(R.clear(),T.current=null,M.current!==""&&(M.current="",g?.(!1)))},[w,y,R,g]);const L=S.useMemo(()=>({onKeyDown:A,onBlur:_}),[A,_]);return S.useMemo(()=>h?{reference:L,floating:L}:{},[h,L])}function av(n,o,r){let{reference:a,floating:u}=n;const f=Hi(o),d=im(o),p=nm(d),h=xi(o),b=f==="y",y=a.x+a.width/2-u.width/2,g=a.y+a.height/2-u.height/2,w=a[p]/2-u[p]/2;let R;switch(h){case"top":R={x:y,y:a.y-u.height};break;case"bottom":R={x:y,y:a.y+a.height};break;case"right":R={x:a.x+a.width,y:g};break;case"left":R={x:a.x-u.width,y:g};break;default:R={x:a.x,y:a.y}}const M=mo(o);return M&&(R[d]+=w*(M==="end"?1:-1)*(r&&b?-1:1)),R}async function ER(n,o){var r;o===void 0&&(o={});const{x:a,y:u,platform:f,rects:d,elements:p,strategy:h}=n,{boundary:b="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:w=!1,padding:R=0}=Cl(o,n),M=j2(R),T=p[w?g==="floating"?"reference":"floating":g],A=Is(await f.getClippingRect({element:(r=await(f.isElement==null?void 0:f.isElement(T)))==null||r?T:T.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(p.floating)),boundary:b,rootBoundary:y,strategy:h})),_=g==="floating"?{x:a,y:u,width:d.floating.width,height:d.floating.height}:d.reference,L=await(f.getOffsetParent==null?void 0:f.getOffsetParent(p.floating)),E=await(f.isElement==null?void 0:f.isElement(L))&&await(f.getScale==null?void 0:f.getScale(L))||{x:1,y:1},j=Is(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:_,offsetParent:L,strategy:h}):_);return{top:(A.top-j.top+M.top)/E.y,bottom:(j.bottom-A.bottom+M.bottom)/E.y,left:(A.left-j.left+M.left)/E.x,right:(j.right-A.right+M.right)/E.x}}const TR=50,AR=async(n,o,r)=>{const{placement:a="bottom",strategy:u="absolute",middleware:f=[],platform:d}=r,p=d.detectOverflow?d:{...d,detectOverflow:ER},h=await(d.isRTL==null?void 0:d.isRTL(o));let b=await d.getElementRects({reference:n,floating:o,strategy:u}),{x:y,y:g}=av(b,a,h),w=a,R=0;const M={};for(let x=0;x<f.length;x++){const T=f[x];if(!T)continue;const{name:A,fn:_}=T,{x:L,y:E,data:j,reset:O}=await _({x:y,y:g,initialPlacement:a,placement:w,strategy:u,middlewareData:M,rects:b,platform:p,elements:{reference:n,floating:o}});y=L??y,g=E??g,M[A]={...M[A],...j},O&&R<TR&&(R++,typeof O=="object"&&(O.placement&&(w=O.placement),O.rects&&(b=O.rects===!0?await d.getElementRects({reference:n,floating:o,strategy:u}):O.rects),{x:y,y:g}=av(b,w,h)),x=-1)}return{x:y,y:g,placement:w,strategy:u,middlewareData:M}},RR=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(o){var r,a;const{placement:u,middlewareData:f,rects:d,initialPlacement:p,platform:h,elements:b}=o,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:w,fallbackStrategy:R="bestFit",fallbackAxisSideDirection:M="none",flipAlignment:x=!0,...T}=Cl(n,o);if((r=f.arrow)!=null&&r.alignmentOffset)return{};const A=xi(u),_=Hi(p),L=xi(p)===p,E=await(h.isRTL==null?void 0:h.isRTL(b.floating)),j=w||(L||!x?[Hu(p)]:dA(p)),O=M!=="none";!w&&O&&j.push(...gA(p,x,M,E));const D=[p,...j],z=await h.detectOverflow(o,T),q=[];let B=((a=f.flip)==null?void 0:a.overflows)||[];if(y&&q.push(z[A]),g){const Y=fA(u,d,E);q.push(z[Y[0]],z[Y[1]])}if(B=[...B,{placement:u,overflows:q}],!q.every(Y=>Y<=0)){var V,G;const Y=(((V=f.flip)==null?void 0:V.index)||0)+1,te=D[Y];if(te&&(!(g==="alignment"?_!==Hi(te):!1)||B.every(X=>Hi(X.placement)===_?X.overflows[0]>0:!0)))return{data:{index:Y,overflows:B},reset:{placement:te}};let U=(G=B.filter(H=>H.overflows[0]<=0).sort((H,X)=>H.overflows[1]-X.overflows[1])[0])==null?void 0:G.placement;if(!U)switch(R){case"bestFit":{var P;const H=(P=B.filter(X=>{if(O){const J=Hi(X.placement);return J===_||J==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(J=>J>0).reduce((J,K)=>J+K,0)]).sort((X,J)=>X[1]-J[1])[0])==null?void 0:P[0];H&&(U=H);break}case"initialPlacement":U=p;break}if(u!==U)return{reset:{placement:U}}}return{}}}},r1=new Set(["left","top"]);async function CR(n,o){const{placement:r,platform:a,elements:u}=n,f=await(a.isRTL==null?void 0:a.isRTL(u.floating)),d=xi(r),p=mo(r),h=Hi(r)==="y",b=r1.has(d)?-1:1,y=f&&h?-1:1,g=Cl(o,n);let{mainAxis:w,crossAxis:R,alignmentAxis:M}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return p&&typeof M=="number"&&(R=p==="end"?M*-1:M),h?{x:R*y,y:w*b}:{x:w*b,y:R*y}}const OR=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(o){var r,a;const{x:u,y:f,placement:d,middlewareData:p}=o,h=await CR(o,n);return d===((r=p.offset)==null?void 0:r.placement)&&(a=p.arrow)!=null&&a.alignmentOffset?{}:{x:u+h.x,y:f+h.y,data:{...h,placement:d}}}}},MR=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(o){const{x:r,y:a,placement:u,platform:f}=o,{mainAxis:d=!0,crossAxis:p=!1,limiter:h={fn:_=>{let{x:L,y:E}=_;return{x:L,y:E}}},...b}=Cl(n,o),y={x:r,y:a},g=await f.detectOverflow(o,b),w=Hi(u),R=tm(w);let M=y[R],x=y[w];const T=(_,L)=>D2(L+g[_==="y"?"top":"left"],L,L-g[_==="y"?"bottom":"right"]);d&&(M=T(R,M)),p&&(x=T(w,x));const A=h.fn({...o,[R]:M,[w]:x});return{...A,data:{x:A.x-r,y:A.y-a,enabled:{[R]:d,[w]:p}}}}}},NR=function(n){return n===void 0&&(n={}),{options:n,fn(o){var r,a;const{x:u,y:f,placement:d,rects:p,middlewareData:h}=o,{offset:b=0,mainAxis:y=!0,crossAxis:g=!0}=Cl(n,o),w={x:u,y:f},R=Hi(d),M=tm(R);let x=w[M],T=w[R];const A=Cl(b,o),_=typeof A=="number"?{mainAxis:A,crossAxis:0}:{mainAxis:(r=A.mainAxis)!=null?r:0,crossAxis:(a=A.crossAxis)!=null?a:0};if(y){const j=M==="y"?"height":"width",O=p.reference[M]-p.floating[j]+_.mainAxis,D=p.reference[M]+p.reference[j]-_.mainAxis;x<O?x=O:x>D&&(x=D)}if(g){var L,E;const j=M==="y"?"width":"height",O=r1.has(xi(d)),D=p.reference[R]-p.floating[j]+(O&&((L=h.offset)==null?void 0:L[R])||0)+(O?0:_.crossAxis),z=p.reference[R]+p.reference[j]+(O?0:((E=h.offset)==null?void 0:E[R])||0)-(O?_.crossAxis:0);T<D?T=D:T>z&&(T=z)}return{[M]:x,[R]:T}}}},_R=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(o){const{placement:r,rects:a,platform:u,elements:f}=o,{apply:d=()=>{},...p}=Cl(n,o),h=await u.detectOverflow(o,p),b=xi(r),y=mo(r),g=Hi(r)==="y",{width:w,height:R}=a.floating;let M,x;b==="top"||b==="bottom"?(M=b,x=y===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(x=b,M=y==="end"?"top":"bottom");const T=R-h.top-h.bottom,A=w-h.left-h.right,_=Ta(R-h[M],T),L=Ta(w-h[x],A),E=o.middlewareData.shift,j=!E;let O=_,D=L;E!=null&&E.enabled.x&&(D=A),E!=null&&E.enabled.y&&(O=T),j&&!y&&(g?D=w-2*Uo(h.left,h.right):O=R-2*Uo(h.top,h.bottom)),await d({...o,availableWidth:D,availableHeight:O});const z=await u.getDimensions(f.floating);return w!==z.width||R!==z.height?{reset:{rects:!0}}:{}}}};function a1(n){const o=Ei(n);let r=parseFloat(o.width)||0,a=parseFloat(o.height)||0;const u=Ht(n),f=u?n.offsetWidth:r,d=u?n.offsetHeight:a,p=Iu(r)!==f||Iu(a)!==d;return p&&(r=f,a=d),{width:r,height:a,$:p}}function cm(n){return Tn(n)?n:n.contextElement}function va(n){const o=cm(n);if(!Ht(o))return Io(1);const r=o.getBoundingClientRect(),{width:a,height:u,$:f}=a1(o);let d=(f?Iu(r.width):r.width)/a,p=(f?Iu(r.height):r.height)/u;return(!d||!Number.isFinite(d))&&(d=1),(!p||!Number.isFinite(p))&&(p=1),{x:d,y:p}}const DR=Io(0);function s1(n){const o=Kt(n);return!Kp()||!o.visualViewport?DR:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function jR(n,o,r){return o===void 0&&(o=!1),!!r&&o&&r===Kt(n)}function br(n,o,r,a){o===void 0&&(o=!1),r===void 0&&(r=!1);const u=n.getBoundingClientRect(),f=cm(n);let d=Io(1);o&&(a?Tn(a)&&(d=va(a)):d=va(n));const p=jR(f,r,a)?s1(f):Io(0);let h=(u.left+p.x)/d.x,b=(u.top+p.y)/d.y,y=u.width/d.x,g=u.height/d.y;if(f&&a){const w=Kt(f),R=Tn(a)?Kt(a):a;let M=w,x=yp(M);for(;x&&R!==M;){const T=va(x),A=x.getBoundingClientRect(),_=Ei(x),L=A.left+(x.clientLeft+parseFloat(_.paddingLeft))*T.x,E=A.top+(x.clientTop+parseFloat(_.paddingTop))*T.y;h*=T.x,b*=T.y,y*=T.x,g*=T.y,h+=L,b+=E,M=Kt(x),x=yp(M)}}return Is({width:y,height:g,x:h,y:b})}function hf(n,o){const r=ef(n).scrollLeft;return o?o.left+r:br(Ho(n)).left+r}function c1(n,o){const r=n.getBoundingClientRect(),a=r.left+o.scrollLeft-hf(n,r),u=r.top+o.scrollTop;return{x:a,y:u}}function zR(n){let{elements:o,rect:r,offsetParent:a,strategy:u}=n;const f=u==="fixed",d=Ho(a),p=o?Wu(o.floating):!1;if(a===d||p&&f)return r;let h={scrollLeft:0,scrollTop:0},b=Io(1);const y=Io(0),g=Ht(a);if((g||!f)&&((Ln(a)!=="body"||Vs(d))&&(h=ef(a)),g)){const R=br(a);b=va(a),y.x=R.x+a.clientLeft,y.y=R.y+a.clientTop}const w=d&&!g&&!f?c1(d,h):Io(0);return{width:r.width*b.x,height:r.height*b.y,x:r.x*b.x-h.scrollLeft*b.x+y.x+w.x,y:r.y*b.y-h.scrollTop*b.y+y.y+w.y}}function LR(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function kR(n){const o=ef(n),r=n.ownerDocument.body,a=Uo(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),u=Uo(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let f=-o.scrollLeft+hf(n);const d=-o.scrollTop;return Ei(r).direction==="rtl"&&(f+=Uo(n.clientWidth,r.clientWidth)-a),{width:a,height:u,x:f,y:d}}const UR=25;function IR(n,o,r){r===void 0&&(r="viewport");const a=r==="layoutViewport",u=Kt(n),f=Ho(n),d=u.visualViewport;let p=f.clientWidth,h=f.clientHeight,b=0,y=0;if(d){const w=!Kp()||o==="fixed";a?w||(b=-d.offsetLeft,y=-d.offsetTop):(p=d.width,h=d.height,w&&(b=d.offsetLeft,y=d.offsetTop))}if(hf(f)<=0){const w=f.ownerDocument,R=w.body,M=getComputedStyle(R),x=w.compatMode==="CSS1Compat"&&parseFloat(M.marginLeft)+parseFloat(M.marginRight)||0,T=Math.abs(f.clientWidth-R.clientWidth-x),A=getComputedStyle(f).scrollbarGutter==="stable both-edges"?T/2:T;A<=UR&&(p-=A)}return{width:p,height:h,x:b,y}}function HR(n,o){const r=br(n,!0,o==="fixed"),a=r.top+n.clientTop,u=r.left+n.clientLeft,f=va(n),d=n.clientWidth*f.x,p=n.clientHeight*f.y,h=u*f.x,b=a*f.y;return{width:d,height:p,x:h,y:b}}function sv(n,o,r){let a;if(o==="viewport"||o==="layoutViewport")a=IR(n,r,o);else if(o==="document")a=kR(Ho(n));else if(Tn(o))a=HR(o,r);else{const u=s1(n);a={x:o.x-u.x,y:o.y-u.y,width:o.width,height:o.height}}return Is(a)}function BR(n,o){const r=o.get(n);if(r)return r;let a=Ls(n,[],!1).filter(p=>Tn(p)&&Ln(p)!=="body"),u=null;const f=Ei(n).position==="fixed";let d=f?Al(n):n;for(;Tn(d)&&!xl(d);){const p=Ei(d),h=Xp(d),b=u?u.position:f?"fixed":"";!h&&(b==="fixed"||b==="absolute"&&p.position==="static")?a=a.filter(g=>g!==d):u=p,d=Al(d)}return o.set(n,a),a}function VR(n){let{element:o,boundary:r,rootBoundary:a,strategy:u}=n;const d=[...r==="clippingAncestors"?Wu(o)?[]:BR(o,this._c):[].concat(r),a],p=sv(o,d[0],u);let h=p.top,b=p.right,y=p.bottom,g=p.left;for(let w=1;w<d.length;w++){const R=sv(o,d[w],u);h=Uo(R.top,h),b=Ta(R.right,b),y=Ta(R.bottom,y),g=Uo(R.left,g)}return{width:b-g,height:y-h,x:g,y:h}}function qR(n){const{width:o,height:r}=a1(n);return{width:o,height:r}}function YR(n,o,r){const a=Ht(o),u=Ho(o),f=r==="fixed",d=br(n,!0,f,o);let p={scrollLeft:0,scrollTop:0};const h=Io(0);if((a||!f)&&((Ln(o)!=="body"||Vs(u))&&(p=ef(o)),a)){const w=br(o,!0,f,o);h.x=w.x+o.clientLeft,h.y=w.y+o.clientTop}!a&&u&&(h.x=hf(u));const b=u&&!a&&!f?c1(u,p):Io(0),y=d.left+p.scrollLeft-h.x-b.x,g=d.top+p.scrollTop-h.y-b.y;return{x:y,y:g,width:d.width,height:d.height}}function op(n){return Ei(n).position==="static"}function cv(n,o){if(!Ht(n)||Ei(n).position==="fixed")return null;if(o)return o(n);let r=n.offsetParent;return Ho(n)===r&&(r=r.ownerDocument.body),r}function u1(n,o){const r=Kt(n);if(Wu(n))return r;if(!Ht(n)){let u=Al(n);for(;u&&!xl(u);){if(Tn(u)&&!op(u))return u;u=Al(u)}return r}let a=cv(n,o);for(;a&&_T(a)&&op(a);)a=cv(a,o);return a&&xl(a)&&op(a)&&!Xp(a)?r:a||zT(n)||r}const FR=async function(n){const o=this.getOffsetParent||u1,r=this.getDimensions,a=await r(n.floating);return{reference:YR(n.reference,await o(n.floating),n.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function GR(n){return Ei(n).direction==="rtl"}const f1={convertOffsetParentRelativeRectToViewportRelativeRect:zR,getDocumentElement:Ho,getClippingRect:VR,getOffsetParent:u1,getElementRects:FR,getClientRects:LR,getDimensions:qR,getScale:va,isElement:Tn,isRTL:GR};function d1(n,o){return n.x===o.x&&n.y===o.y&&n.width===o.width&&n.height===o.height}function PR(n,o,r){let a=null,u;const f=Ho(n);function d(){var y;clearTimeout(u),(y=a)==null||y.disconnect(),a=null}function p(y,g){y===void 0&&(y=!1),g===void 0&&(g=1),d();const w=n.getBoundingClientRect(),{left:R,top:M,width:x,height:T}=w;if(y||o(),!x||!T)return;const A=cu(M),_=cu(f.clientWidth-(R+x)),L=cu(f.clientHeight-(M+T)),E=cu(R),O={rootMargin:-A+"px "+-_+"px "+-L+"px "+-E+"px",threshold:Uo(0,Ta(1,g))||1};let D=!0;function z(q){const B=q[0].intersectionRatio;if(!d1(w,n.getBoundingClientRect()))return p();if(B!==g){if(!D)return p();B?p(!1,B):u=setTimeout(()=>{p(!1,1e-7)},1e3)}D=!1}try{a=new IntersectionObserver(z,{...O,root:f.ownerDocument})}catch{a=new IntersectionObserver(z,O)}a.observe(n)}const h=Kt(n),b=()=>p(r);return h.addEventListener("resize",b),p(!0),()=>{h.removeEventListener("resize",b),d()}}function uv(n,o,r,a){a===void 0&&(a={});const{ancestorScroll:u=!0,ancestorResize:f=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:h=!1}=a,b=cm(n),y=u||f?[...b?Ls(b):[],...o?Ls(o):[]]:[];y.forEach(A=>{u&&A.addEventListener("scroll",r),f&&A.addEventListener("resize",r)});const g=b&&p?PR(b,r,f):null;let w=-1,R=null;d&&(R=new ResizeObserver(A=>{let[_]=A;_&&_.target===b&&R&&o&&(R.unobserve(o),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var L;(L=R)==null||L.observe(o)})),r()}),b&&!h&&R.observe(b),o&&R.observe(o));let M,x=h?br(n):null;h&&T();function T(){const A=br(n);x&&!d1(x,A)&&r(),x=A,M=requestAnimationFrame(T)}return r(),()=>{var A;y.forEach(_=>{u&&_.removeEventListener("scroll",r),f&&_.removeEventListener("resize",r)}),g?.(),(A=R)==null||A.disconnect(),R=null,h&&cancelAnimationFrame(M)}}const XR=OR,KR=MR,QR=RR,ZR=_R,JR=NR,$R=(n,o,r)=>{const a=new Map,u=r??{},f={...f1,...u.platform,_c:a};return AR(n,o,{...u,platform:f})};var WR=typeof document<"u",eC=function(){},Ou=WR?S.useLayoutEffect:eC;function Vu(n,o){if(n===o)return!0;if(typeof n!=typeof o)return!1;if(typeof n=="function"&&n.toString()===o.toString())return!0;let r,a,u;if(n&&o&&typeof n=="object"){if(Array.isArray(n)){if(r=n.length,r!==o.length)return!1;for(a=r;a--!==0;)if(!Vu(n[a],o[a]))return!1;return!0}if(u=Object.keys(n),r=u.length,r!==Object.keys(o).length)return!1;for(a=r;a--!==0;)if(!{}.hasOwnProperty.call(o,u[a]))return!1;for(a=r;a--!==0;){const f=u[a];if(!(f==="_owner"&&n.$$typeof)&&!Vu(n[f],o[f]))return!1}return!0}return n!==n&&o!==o}function h1(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function fv(n,o){const r=h1(n);return Math.round(o*r)/r}function lp(n){const o=S.useRef(n);return Ou(()=>{o.current=n}),o}function tC(n){n===void 0&&(n={});const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:u,elements:{reference:f,floating:d}={},transform:p=!0,whileElementsMounted:h,open:b}=n,[y,g]=S.useState({x:0,y:0,strategy:r,placement:o,middlewareData:{},isPositioned:!1}),[w,R]=S.useState(a);Vu(w,a)||R(a);const[M,x]=S.useState(null),[T,A]=S.useState(null),_=S.useCallback(X=>{X!==O.current&&(O.current=X,x(X))},[]),L=S.useCallback(X=>{X!==D.current&&(D.current=X,A(X))},[]),E=f||M,j=d||T,O=S.useRef(null),D=S.useRef(null),z=S.useRef(y),q=h!=null,B=lp(h),V=lp(u),G=lp(b),P=S.useCallback(()=>{if(!O.current||!D.current)return;const X={placement:o,strategy:r,middleware:w};V.current&&(X.platform=V.current),$R(O.current,D.current,X).then(J=>{const K={...J,isPositioned:G.current!==!1};Y.current&&!Vu(z.current,K)&&(z.current=K,qs.flushSync(()=>{g(K)}))})},[w,o,r,V,G]);Ou(()=>{b===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,g(X=>({...X,isPositioned:!1})))},[b]);const Y=S.useRef(!1);Ou(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Ou(()=>{if(E&&(O.current=E),j&&(D.current=j),E&&j){if(B.current)return B.current(E,j,P);P()}},[E,j,P,B,q]);const te=S.useMemo(()=>({reference:O,floating:D,setReference:_,setFloating:L}),[_,L]),U=S.useMemo(()=>({reference:E,floating:j}),[E,j]),H=S.useMemo(()=>{const X={position:r,left:0,top:0};if(!U.floating)return X;const J=fv(U.floating,y.x),K=fv(U.floating,y.y);return p?{...X,transform:"translate("+J+"px, "+K+"px)",...h1(U.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:J,top:K}},[r,p,U.floating,y.x,y.y]);return S.useMemo(()=>({...y,update:P,refs:te,elements:U,floatingStyles:H}),[y,P,te,U,H])}const nC=(n,o)=>{const r=XR(n);return{name:r.name,fn:r.fn,options:[n,o]}},iC=(n,o)=>{const r=KR(n);return{name:r.name,fn:r.fn,options:[n,o]}},oC=(n,o)=>({fn:JR(n).fn,options:[n,o]}),lC=(n,o)=>{const r=QR(n);return{name:r.name,fn:r.fn,options:[n,o]}},rC=(n,o)=>{const r=ZR(n);return{name:r.name,fn:r.fn,options:[n,o]}},p1=S.createContext(void 0);function aC(){const n=S.useContext(p1);if(n===void 0)throw new Error(qi(26));return n}const Rp="ArrowUp",Cp="ArrowDown",Op="ArrowLeft",Mp="ArrowRight",Np="Home",_p="End",um=new Set([Rp,Cp,Op,Mp,Np,_p]),sC="Shift",cC=[sC,"Control","Alt","Meta"];function uC(n){return Ht(n)&&n.tagName==="INPUT"}function dv(n){return!!(uC(n)&&n.selectionStart!=null||Ht(n)&&n.tagName==="TEXTAREA")}function hv(n,o,r,a){if(!n||!o||!o.scrollTo)return;let u=n.scrollLeft,f=n.scrollTop;const d=n.clientWidth<n.scrollWidth,p=n.clientHeight<n.scrollHeight;if(d&&a!=="vertical"){const h=pv(n,o,"left"),b=pu(n),y=pu(o);r==="ltr"&&(h+o.offsetWidth+y.scrollMarginRight>n.scrollLeft+n.clientWidth-b.scrollPaddingRight?u=h+o.offsetWidth+y.scrollMarginRight-n.clientWidth+b.scrollPaddingRight:h-y.scrollMarginLeft<n.scrollLeft+b.scrollPaddingLeft&&(u=h-y.scrollMarginLeft-b.scrollPaddingLeft)),r==="rtl"&&(h-y.scrollMarginLeft<n.scrollLeft+b.scrollPaddingLeft?u=h-y.scrollMarginLeft-b.scrollPaddingLeft:h+o.offsetWidth+y.scrollMarginRight>n.scrollLeft+n.clientWidth-b.scrollPaddingRight&&(u=h+o.offsetWidth+y.scrollMarginRight-n.clientWidth+b.scrollPaddingRight))}if(p&&a!=="horizontal"){const h=pv(n,o,"top"),b=pu(n),y=pu(o);h-y.scrollMarginTop<n.scrollTop+b.scrollPaddingTop?f=h-y.scrollMarginTop-b.scrollPaddingTop:h+o.offsetHeight+y.scrollMarginBottom>n.scrollTop+n.clientHeight-b.scrollPaddingBottom&&(f=h+o.offsetHeight+y.scrollMarginBottom-n.clientHeight+b.scrollPaddingBottom)}n.scrollTo({left:u,top:f,behavior:"auto"})}function pv(n,o,r){const a=r==="left"?"offsetLeft":"offsetTop";let u=0;for(;o.offsetParent&&(u+=o[a],o.offsetParent!==n);)o=o.offsetParent;return u}function pu(n){const o=getComputedStyle(n);return{scrollMarginTop:parseFloat(o.scrollMarginTop)||0,scrollMarginRight:parseFloat(o.scrollMarginRight)||0,scrollMarginBottom:parseFloat(o.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(o.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(o.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(o.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(o.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(o.scrollPaddingLeft)||0}}const fC="--nested-dialogs",dC="data-nested-dialog-open",hC={...Ju,...Aa,nestedDialogOpen(n){return n?{[dC]:""}:null}},pC=S.forwardRef(function(o,r){const{render:a,className:u,style:f,finalFocus:d,initialFocus:p,...h}=o,b=Ml(),y=b.useState("descriptionElementId"),g=b.useState("disablePointerDismissal"),w=b.useState("floatingRootContext"),R=b.useState("popupProps"),M=b.useState("modal"),x=b.useState("mounted"),T=b.useState("nested"),A=b.useState("nestedOpenDialogCount"),_=b.useState("open"),L=b.useState("openMethod"),E=b.useState("titleElementId"),j=b.useState("transitionStatus"),O=b.useState("role"),D=w.useState("floatingId");aC(),Ra({open:_,ref:b.context.popupRef,onComplete(){_&&b.context.onOpenChangeComplete?.(!0)}});const z=p===void 0?qA(b.context.popupRef):p,q=A>0,B=b.useStateSetter("popupElement"),G=Lt("div",o,{state:{open:_,nested:T,transitionStatus:j,nestedDialogOpen:q},props:[R,{id:D,"aria-labelledby":E,"aria-describedby":y,role:O,...W2,hidden:!x,onKeyDown(P){um.has(P.key)&&P.stopPropagation()},style:{[fC]:A}},h],ref:[r,b.context.popupRef,B],stateAttributesMapping:hC});return v.jsx(Q2,{context:w,openInteractionType:L,disabled:!x,closeOnFocusOut:!g,initialFocus:z,returnFocus:d,modal:M!==!1,restoreFocus:"popup",children:G})});function fm(n){return Gp(19)?n:n?"true":void 0}const m1=S.forwardRef(function(o,r){const{cutout:a,...u}=o;let f;if(a){const d=a.getBoundingClientRect();f=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${d.left}px ${d.top}px,${d.left}px ${d.bottom}px,${d.right}px ${d.bottom}px,${d.right}px ${d.top}px,${d.left}px ${d.top}px)`}return v.jsx("div",{ref:r,role:"presentation","data-base-ui-inert":"",...u,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:f}})}),mC=S.forwardRef(function(o,r){const{keepMounted:a=!1,...u}=o,f=Ml(),d=f.useState("mounted"),p=f.useState("modal"),h=f.useState("open");return d||a?v.jsx(p1.Provider,{value:a,children:v.jsxs(K2,{ref:r,...u,children:[d&&p===!0&&v.jsx(m1,{ref:f.context.internalBackdropRef,inert:fm(!h)}),o.children]})}):null});let mv={},gv={},yv="";function pf(n,o){return Vs(n)?n:o}function bv(n,o,r){return/hidden|clip/.test(n.getComputedStyle(pf(o,r)).overflowY)}function gC(n){if(typeof document>"u")return!1;const o=_t(n);return Kt(o).innerWidth-o.documentElement.clientWidth>0}function yC(n){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const r=_t(n),a=r.documentElement,u=r.body,f=pf(a,u),d=f.style.overflowY,p=a.style.scrollbarGutter;a.style.scrollbarGutter="stable",f.style.overflowY="scroll";const h=f.offsetWidth;f.style.overflowY="hidden";const b=f.offsetWidth;return f.style.overflowY=d,a.style.scrollbarGutter=p,h===b}function bC(n){const o=_t(n),r=o.documentElement,a=o.body,u=pf(r,a),f={overflowY:u.style.overflowY,overflowX:u.style.overflowX};return Object.assign(u.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(u.style,f)}}function vC(n){const o=_t(n),r=o.documentElement,a=o.body,u=Kt(r);let f=0,d=0,p=!1;const h=po.create();if(_l&&(u.visualViewport?.scale??1)!==1)return()=>{};function b(){const R=u.getComputedStyle(r),M=u.getComputedStyle(a),A=(R.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";f=r.scrollTop,d=r.scrollLeft,mv={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},yv=r.style.scrollBehavior,gv={position:a.style.position,height:a.style.height,width:a.style.width,boxSizing:a.style.boxSizing,overflowY:a.style.overflowY,overflowX:a.style.overflowX,scrollBehavior:a.style.scrollBehavior};const _=r.scrollHeight>r.clientHeight,L=r.scrollWidth>r.clientWidth,E=R.overflowY==="scroll"||M.overflowY==="scroll",j=R.overflowX==="scroll"||M.overflowX==="scroll",O=Math.max(0,u.innerWidth-a.clientWidth),D=Math.max(0,u.innerHeight-a.clientHeight),z=parseFloat(M.marginTop)+parseFloat(M.marginBottom),q=parseFloat(M.marginLeft)+parseFloat(M.marginRight),B=pf(r,a);if(p=yC(n),p){r.style.scrollbarGutter=A,B.style.overflowY="hidden",B.style.overflowX="hidden";return}Object.assign(r.style,{scrollbarGutter:A,overflowY:"hidden",overflowX:"hidden"}),(_||E)&&(r.style.overflowY="scroll"),(L||j)&&(r.style.overflowX="scroll"),Object.assign(a.style,{position:"relative",height:z||D?`calc(100dvh - ${z+D}px)`:"100dvh",width:q||O?`calc(100vw - ${q+O}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),a.scrollTop=f,a.scrollLeft=d,r.setAttribute("data-base-ui-scroll-locked",""),r.style.scrollBehavior="unset"}function y(){Object.assign(r.style,mv),Object.assign(a.style,gv),p||(r.scrollTop=f,r.scrollLeft=d,r.removeAttribute("data-base-ui-scroll-locked"),r.style.scrollBehavior=yv)}function g(){y(),h.request(b)}b();const w=zt(u,"resize",g);return()=>{h.cancel(),y(),typeof u.removeEventListener=="function"&&w()}}class SC{lockCount=0;restore=null;timeoutLock=wa.create();timeoutUnlock=wa.create();acquire(o){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(o)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(o){if(this.lockCount===0||this.restore!==null)return;const r=_t(o),a=r.documentElement,u=r.body,f=Kt(a);if(bv(f,a,u)){const p=new f.MutationObserver(()=>{bv(f,a,u)||(p.disconnect(),this.restore=null,this.lock(o))}),h={attributes:!0};p.observe(a,h),p.observe(u,h),this.restore=()=>p.disconnect();return}const d=of||!gC(o);this.restore=d?bC(o):vC(o)}}const wC=new SC;function g1(n=!0,o=null){De(()=>{if(n)return wC.acquire(o)},[n,o])}function xC({store:n,parentContext:o,isDrawer:r}){const a=n.useState("open"),u=n.useState("mounted"),f=n.useState("disablePointerDismissal"),d=n.useState("modal"),p=n.useState("popupElement"),h=n.useState("floatingRootContext"),[b,y]=S.useState(0),[g,w]=S.useState(0),R=b===0,M=J2(h,{outsidePressEvent(){return n.context.internalBackdropRef.current||n.context.backdropRef.current?"intentional":{mouse:d==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(x){if(!n.context.outsidePressEnabledRef.current||"button"in x&&x.button!==0)return!1;if("touches"in x){if(x.type==="touchend"){if(x.changedTouches.length!==1||x.touches.length!==0)return!1}else if(x.touches.length!==1)return!1}const T=Vi(x);if(R&&!f){if(d){const A=n.context.internalBackdropRef.current,_=n.context.backdropRef.current;return A||_?A===T||_===T||it(T,p)&&!T?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:R});return g1(a&&d===!0,p),n.useContextCallback("onNestedDialogOpen",(x,T)=>{!n.select("open")&&!n.select("mounted")||(y(x),w(T))}),De(()=>{!a&&!u&&(y(0),w(0))},[a,u]),De(()=>(o?.onNestedDialogOpen&&a&&o.onNestedDialogOpen(b+1,g+(r?1:0)),()=>{o?.onNestedDialogOpen&&a&&o.onNestedDialogOpen(0,0)}),[r,a,b,g,o]),JA(n,{activeTriggerProps:M.reference,inactiveTriggerProps:M.trigger,popupProps:M.floating,nestedOpenDialogCount:b,nestedOpenDrawerCount:g}),null}const EC={...gR,modal:n=>n.modal,nested:n=>n.nested,nestedOpenDialogCount:n=>n.nestedOpenDialogCount,nestedOpenDrawerCount:n=>n.nestedOpenDrawerCount,disablePointerDismissal:n=>n.disablePointerDismissal,openMethod:n=>n.openMethod,descriptionElementId:n=>n.descriptionElementId,titleElementId:n=>n.titleElementId,viewportElement:n=>n.viewportElement,role:n=>n.role};class TC extends sm{constructor(o,r,a){const u=new e1,f=AC(o,u,r,a);super(f,RC(u),EC)}setOpen=(o,r)=>{r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!o&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(o,r),!r.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(o,r),this.update(PA(this.state,o,r.trigger)))}}function AC(n,o,r,a=!1){return{...pR(o,r,a),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...n}}function RC(n){return{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:n,onOpenChange:void 0,onOpenChangeComplete:void 0}}function CC(n,o){const{children:r,open:a,defaultOpen:u=!1,onOpenChange:f,onOpenChangeComplete:d,disablePointerDismissal:p=!1,modal:h=!0,actionsRef:b,handle:y,triggerId:g,defaultTriggerId:w=null}=o,R=n==="drawer",M=h,x=p,T="dialog",A=Ml(!0),_=A!=null,L={modal:M,disablePointerDismissal:x,nested:_,role:T},E=YA((B,V)=>new TC({open:u,openProp:a,activeTriggerId:w,triggerIdProp:g,...L},B,V),!0);E.useControlledProp("openProp",a),E.useControlledProp("triggerIdProp",g),E.useSyncedValues(L),E.useContextCallback("onOpenChange",f),E.useContextCallback("onOpenChangeComplete",d);const j=E.useState("open"),O=E.useState("mounted"),D=E.useState("payload");$A(E,j),QA(E);const{forceUnmount:z}=ZA(j,E);S.useImperativeHandle(b,()=>({unmount:z,close:()=>E.setOpen(!1,Bt(A2))}),[z,E]);const q=j||O||y!=null;return v.jsxs(u2.Provider,{value:E,children:[y&&v.jsx(FA,{handle:y,store:E}),q&&v.jsx(xC,{store:E,parentContext:A?.context,isDrawer:R}),typeof r=="function"?r({payload:D}):r]})}const OC=n1(function(o){return CC("dialog",o)}),MC=S.forwardRef(function(o,r){const{render:a,className:u,style:f,id:d,...p}=o,h=Ml(),b=Nl(d);return h.useSyncedValueWithCleanup("titleElementId",b),Lt("h2",o,{ref:r,props:[{id:b},p]})});function NC(n){const o=S.useRef(""),r=S.useCallback(u=>{u.defaultPrevented||(o.current=u.pointerType,n(u,u.pointerType))},[n]);return{onClick:S.useCallback(u=>{if(u.detail===0){n(u,"keyboard");return}"pointerType"in u?n(u,u.pointerType):n(u,o.current),o.current=""},[n]),onPointerDown:r}}function mf(n,o){const r=S.useRef(n),a=ke(o);De(()=>{r.current!==n&&a(r.current),r.current=n},[n,a])}function y1(n,o){const r=ke((f,d)=>{(typeof n=="function"?n():n)||o(d||(of?"touch":""))}),{onClick:a,onPointerDown:u}=NC(r);return S.useMemo(()=>({onClick:a,onPointerDown:u}),[a,u])}function _C(n){const[o,r]=S.useState(null),a=y1(n,r);return mf(n,u=>{u&&!n&&r(null)}),S.useMemo(()=>({openMethod:o,triggerProps:a}),[o,a])}const DC=lR(function(o,r){const{render:a,className:u,style:f,disabled:d=!1,nativeButton:p=!0,id:h,payload:b,handle:y,...g}=o,w=Ml(!0),M=yR(y)??w;if(!M)throw new Error(qi(79));const x=Nl(h),T=M.useState("floatingRootContext"),A=M.useState("isOpenedByTrigger",x),_=M.useState("triggerPopupId",x),L=S.useRef(null),{registerTrigger:E,isMountedByThisTrigger:j}=KA(x,L,M,{payload:b}),{getButtonProps:O,buttonRef:D}=Sr({disabled:d,native:p}),z=Z2(T),q=y1(()=>M.select("open"),G=>{M.set("openMethod",G)}),B={disabled:d,open:A},V=M.useState("triggerProps",j);return Lt("button",o,{state:B,ref:[D,r,E,L],props:[z.reference,V,q,{[G2]:"",id:x,"aria-haspopup":"dialog","aria-expanded":A,"aria-controls":_},g,O],stateAttributesMapping:w2})});const jC=n=>n?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function zC(n,o,r=[]){if(o==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:jC(n),size:24,node:o,...r.length>0?{aliases:r}:{}}}const LC=n=>{let o="",r=!1;for(const a of n){if(a==="-"||a==="_"||a<=" "){r=o.length>0;continue}o.length===0?o+=a.toLowerCase():o+=r?a.toUpperCase():a,r=!1}return o};const kC=n=>{const o=LC(n);return o.charAt(0).toUpperCase()+o.slice(1)};const Dp=(...n)=>n.filter((o,r,a)=>!!o&&o.trim()!==""&&a.indexOf(o)===r).join(" ").trim();const sr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function rp(n){return n!=null}function UC(n,o={}){const r=o.attributeNames??{},a=w=>r[w]??w,u=n.size??n.width??sr.width,f=n.size??n.height??sr.height,d=n.aliases?.filter(w=>typeof w=="string"&&w.trim()!=="").map(w=>`lucide-${w}`)??[],p=[...n.name?[`lucide-${n.name}`]:[],...d],h=o.className?.split(" ").filter(Boolean)??[],b=o.includeDefaultClasses===!1?Dp(...h):Dp("lucide",...p,...h),y=o.absoluteStrokeWidth?Number(o.strokeWidth??sr["stroke-width"])*Number(n.size??n.width??sr.width)/Number(o.size??o.width??sr.width):o.strokeWidth??sr["stroke-width"];return["svg",{...Object.entries(sr).reduce((w,[R,M])=>(w[a(R)]=M,w),{}),..."color"in o&&o.color&&{[a("stroke")]:o.color},..."size"in o&&rp(o.size)&&{[a("width")]:o.size,[a("height")]:o.size},..."width"in o&&rp(o.width)&&{[a("width")]:o.width},..."height"in o&&rp(o.height)&&{[a("height")]:o.height},[a("stroke-width")]:y,...b&&{[a("class")]:b},[a("viewBox")]:`0 0 ${u} ${f}`,...o.hasA11yProp===!1?{[a("aria-hidden")]:"true"}:{},..."attributes"in o&&o.attributes},n.node.map(w=>{const[R,M,x]=w,T=o.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...M}:M;return x?[R,T,x]:[R,T]})]}function IC(n,o={}){return UC(n,{...o,attributeNames:{...o.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const HC=n=>{for(const o in n)if(o.startsWith("aria-")||o==="role"||o==="title")return!0;return!1},BC=S.createContext({}),VC=()=>S.useContext(BC),qC=S.forwardRef(({color:n,size:o,width:r,height:a,strokeWidth:u,absoluteStrokeWidth:f,nonScalingStroke:d,className:p="",children:h,iconNode:b=[],icon:y={node:b,aliases:[],size:24},...g},w)=>{const{size:R=24,strokeWidth:M=2,absoluteStrokeWidth:x=!1,nonScalingStroke:T=!1,color:A="currentColor",className:_=""}=VC()??{},L=!!h||HC(g),[E,j,O=[]]=IC(y,{color:n??A,width:r??o??R,height:a??o??R,strokeWidth:u??M,absoluteStrokeWidth:f??x,nonScalingStroke:d??T,className:Dp(_,p),hasA11yProp:L,attributes:g});return S.createElement(E,{ref:w,...j},[...O.map(([D,z])=>S.createElement(D,z)),...Array.isArray(h)?h:[h]])});function et(n,o=[],r=[]){const a=typeof n=="string"?zC(n,o,r):n,u=S.forwardRef(({className:f,...d},p)=>S.createElement(qC,{ref:p,icon:a,className:f,...d}));return a.name&&(u.displayName=kC(a.name)),u}const b1={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};b1.node;const v1=et(b1);const S1={name:"antenna",size:24,node:[["path",{d:"M2 12 7 2",key:"117k30"}],["path",{d:"m7 12 5-10",key:"1tvx22"}],["path",{d:"m12 12 5-10",key:"ev1o1a"}],["path",{d:"m17 12 5-10",key:"1e4ti3"}],["path",{d:"M4.5 7h15",key:"vlsxkz"}],["path",{d:"M12 16v6",key:"c8a4gj"}]]};S1.node;const YC=et(S1);const w1={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};w1.node;const FC=et(w1);const x1={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};x1.node;const GC=et(x1);const E1={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};E1.node;const PC=et(E1);const T1={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};T1.node;const XC=et(T1);const A1={name:"brush-cleaning",size:24,node:[["path",{d:"m16 22-1-4",key:"1ow2iv"}],["path",{d:"M19 14a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2h-3a1 1 0 0 1-1-1V4a2 2 0 0 0-4 0v5a1 1 0 0 1-1 1H6a2 2 0 0 0-2 2v1a1 1 0 0 0 1 1",key:"11gii7"}],["path",{d:"M19 14H5l-1.973 6.767A1 1 0 0 0 4 22h16a1 1 0 0 0 .973-1.233z",key:"bju7h4"}],["path",{d:"m8 22 1-4",key:"s3unb"}]]};A1.node;const R1=et(A1);const C1={name:"camera",size:24,node:[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]};C1.node;const KC=et(C1);const O1={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};O1.node;const QC=et(O1);const M1={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};M1.node;const N1=et(M1);const _1={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};_1.node;const ZC=et(_1);const D1={name:"circle-dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};D1.node;const JC=et(D1);const j1={name:"circle-stop",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],aliases:["stop-circle"]};j1.node;const $C=et(j1);const z1={name:"crosshair",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]};z1.node;const L1=et(z1);const k1={name:"external-link",size:24,node:[["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"}]]};k1.node;const WC=et(k1);const U1={name:"file-search",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]]};U1.node;const eO=et(U1);const I1={name:"footprints",size:24,node:[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]]};I1.node;const H1=et(I1);const B1={name:"gamepad-2",size:24,node:[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]]};B1.node;const tO=et(B1);const V1={name:"grid-2x2",size:24,node:[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],aliases:["grid-2-x-2"]};V1.node;const q1=et(V1);const Y1={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};Y1.node;const F1=et(Y1);const G1={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};G1.node;const nO=et(G1);const P1={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};P1.node;const iO=et(P1);const X1={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};X1.node;const oO=et(X1);const K1={name:"move",size:24,node:[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]};K1.node;const Q1=et(K1);const Z1={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};Z1.node;const J1=et(Z1);const $1={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};$1.node;const lO=et($1);const W1={name:"radio",size:24,node:[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};W1.node;const vv=et(W1);const eS={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};eS.node;const jp=et(eS);const tS={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};tS.node;const rO=et(tS);const nS={name:"scan-line",size:24,node:[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]]};nS.node;const aO=et(nS);const iS={name:"settings-2",size:24,node:[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]};iS.node;const zp=et(iS);const oS={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};oS.node;const lS=et(oS);const rS={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};rS.node;const aS=et(rS);const sS={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};sS.node;const sO=et(sS);const cS={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};cS.node;const cO=et(cS);const uS={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};uS.node;const Sv=et(uS);const fS={name:"volume-2",size:24,node:[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]};fS.node;const Lp=et(fS);const dS={name:"volume-x",size:24,node:[["path",{d:"M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z",key:"1p7khw"}],["path",{d:"m16.5 14.5 5-5",key:"cul3yw"}],["path",{d:"m16.5 9.5 5 5",key:"1akey5"}]]};dS.node;const wv=et(dS);const hS={name:"wifi-off",size:24,node:[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};hS.node;const uO=et(hS);const pS={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};pS.node;const mS=et(pS),fO=3e4,xv=65536,gf=[{urls:"stun:8.156.38.92:3478"}];let dO=0;function Ev(n="r"){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${n}-${Date.now()}-${++dO}`}function hO(n,o=.25){const r=n*o;return Math.round(n-r+Math.random()*r*2)}class pO{ws=null;opts;handlers=new Map;frameHandlers=new Map;status="idle";attempt=0;heartbeatTimer=null;reconnectTimer=null;manualClose=!1;closing=null;cancelConnect=null;pending=new Map;expectType=new Map;constructor(o){this.opts={autoReconnect:!0,...o}}on(o,r){let a=this.handlers.get(o);a||(a=new Set,this.handlers.set(o,a));const u=r;return a.add(u),()=>{a.delete(u)}}onFrame(o,r){const a=this.frameHandlers.get(o)??new Set;this.frameHandlers.set(o,a);const u=f=>r(f);return a.add(u),()=>{a.delete(u)&&a.size===0&&this.frameHandlers.delete(o)}}emit(o,r){const a=this.handlers.get(o);if(a)for(const u of a)try{u(r)}catch(f){console.error(`[signaling] handler for "${o}" threw`,f)}}getStatus(){return this.status}connectSignaling(){if(this.closing||this.ws&&this.ws.readyState!==WebSocket.CLOSED)return Promise.reject(new Error("[signaling] 连接已存在或正在建立"));this.manualClose=!1,this.status=this.attempt===0?"connecting":"reconnecting";const o=new URL(this.opts.url);return o.searchParams.set("jti",this.opts.jti),this.opts.sn&&o.searchParams.set("sn",this.opts.sn),new Promise((r,a)=>{const u=new WebSocket(o.toString());this.ws=u;let f=!1;const d=h=>{f||(f=!0,p(),this.cancelConnect=null,h())};this.cancelConnect=h=>d(()=>a(h)),u.onopen=()=>{this.ws!==u||this.manualClose||(this.attempt=0,this.status="open",this.startHeartbeat(),this.emit("open",void 0))},u.onmessage=h=>{this.ws!==u||this.manualClose||this.handleMessage(h.data)},u.onclose=h=>{if(this.ws!==u)return;this.stopHeartbeat(),this.rejectAllPending(new Error(`[signaling] 连接关闭 ${h.code} ${h.reason}`));const b=h.code===1008||h.code===4001||h.code===4003,y=!this.manualClose&&this.opts.autoReconnect&&!b;this.status=y?"reconnecting":"closed",this.emit("close",{code:h.code,reason:h.reason,willRetry:y}),d(()=>a(new Error(`[signaling] 握手失败 (${h.code})`))),y&&this.scheduleReconnect()};const p=this.on("authOk",h=>{p(),d(()=>r(h))})})}close(o=3e3){if(this.closing)return this.closing;if(!Number.isSafeInteger(o)||o<1||o>3e4)return Promise.reject(new Error("[signaling] 关闭超时应为 1–30000 ms"));this.manualClose=!0,this.clearReconnectTimer(),this.stopHeartbeat(),this.cancelConnect?.(new Error("[signaling] 连接初始化已取消")),this.rejectAllPending(new Error("[signaling] 连接已主动关闭"));const r=this.ws;if(this.status="closed",!r||r.readyState===WebSocket.CLOSED)return this.ws=null,Promise.resolve();r.onopen=null,r.onmessage=null,r.onerror=null,r.onclose=null;const a=new Promise((u,f)=>{let d=!1;const p=y=>{d||(d=!0,clearTimeout(b),r.removeEventListener("close",h),r.readyState===WebSocket.CLOSED&&this.ws===r&&(this.ws=null),y?f(y):u())},h=()=>p(),b=setTimeout(()=>p(new Error("[signaling] 等待 WebSocket 关闭超时")),o);r.addEventListener("close",h,{once:!0});try{r.readyState===WebSocket.OPEN?r.close(1e3,"client closed"):r.readyState===WebSocket.CONNECTING&&r.close()}catch(y){p(y instanceof Error?y:new Error("关闭 WebSocket 失败"))}});return this.closing=a,a.then(()=>{this.closing=null},()=>{this.closing=null}),a}scheduleReconnect(){this.clearReconnectTimer();const o=[1e3,2e3,4e3,8e3,16e3,3e4],r=o[Math.min(this.attempt,o.length-1)]??3e4;this.attempt+=1,this.reconnectTimer=setTimeout(()=>{this.connectSignaling().catch(()=>{})},hO(r))}clearReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.send({type:"ping",requestId:`hb-${Date.now()}`})},fO)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}send(o,r=!1){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return console.warn("[signaling] 发送跳过,连接未就绪:",o.type),!1;const a=JSON.stringify(o);if(r&&new TextEncoder().encode(a).byteLength>xv)throw new RangeError(`[signaling] 信令帧超过 ${xv} 字节`);return this.ws.send(a),!0}sendFrame(o,{requestId:r,targetSN:a,payload:u}){const f={type:o,payload:u};return r!==void 0&&(f.requestId=r),a!==void 0&&(f.targetSN=a),this.send(f,!0)}request(o,r,a,u=1e4){const f=Ev();return new Promise((d,p)=>{const h=setTimeout(()=>{this.pending.delete(f),this.expectType.delete(f),p(new Error(`[signaling] "${o}" 超时 (${u}ms)`))},u);this.pending.set(f,{resolve:y=>{clearTimeout(h),d(y)},reject:y=>{clearTimeout(h),p(y)}}),this.expectType.set(f,a),this.send({type:o,requestId:f,payload:r})||(clearTimeout(h),this.pending.delete(f),this.expectType.delete(f),p(new Error("[signaling] 连接未就绪")))})}listDevices(o=1e4){return this.request("device.list",void 0,"device.list.result",o)}sendOffer(o,r,a="offer"){return this.send({type:"offer",requestId:Ev("neg"),targetSN:o,payload:{sdp:r,sdpType:a}})}sendIce(o,r){return this.send({type:"ice",targetSN:o,payload:{candidate:r.candidate??"",sdpMid:r.sdpMid??null,sdpMLineIndex:r.sdpMLineIndex??null}})}handleMessage(o){let r;try{r=JSON.parse(String(o))}catch{console.warn("[signaling] 非法 JSON,已丢弃");return}if(!r||typeof r.type!="string")return;this.dispatchMessage(r);const a=this.frameHandlers.get(r.type);if(a)for(const u of[...a])try{u(r)}catch(f){console.error(`[signaling] frame handler for "${r.type}" threw`,f)}}dispatchMessage(o){const r=o.requestId;if(r&&this.pending.has(r)){const a=this.expectType.get(r),u=this.pending.get(r);if(o.type==="error"){this.pending.delete(r),this.expectType.delete(r);const f=o.payload;u.reject(new Error(`[signaling] ${f?.code??"error"}: ${f?.message??""}`));return}if(a&&o.type===a){this.pending.delete(r),this.expectType.delete(r),u.resolve(o.payload);return}}this.dispatch(o)}dispatch(o){const r=o.payload;switch(o.type){case"auth.ok":this.emit("authOk",r);break;case"device.status":this.emit("deviceStatus",r);break;case"offer":this.emit("offer",{payload:r,from:o.from});break;case"answer":this.emit("answer",{payload:r,from:o.from});break;case"ice":this.emit("ice",{payload:r,from:o.from});break;case"command":case"command.result":this.emit("command",{payload:r,from:o.from});break;case"error":this.emit("error",r);break}}rejectAllPending(o){for(const r of this.pending.values())r.reject(o);this.pending.clear(),this.expectType.clear()}}class mO{pc;control=null;telemetry=null;blob=null;tof=null;remoteStream=null;handlers=new Map;pendingCandidates=[];remoteDescSet=!1;audioCtx=null;placeholderTracks=[];closed=!1;establishedEmitted=!1;sn;deviceName=null;media;constructor(o){this.sn=o.sn,this.media={receiveVideo:o.media?.receiveVideo??!1,receiveAudio:o.media?.receiveAudio??!1,addSilentAudio:o.media?.addSilentAudio??!1},this.pc=new RTCPeerConnection({iceServers:o.iceServers,bundlePolicy:"max-bundle"}),this.wire(),(o.createChannels??!0)&&(this.control=this.pc.createDataChannel("control",{ordered:!0}),this.bindControl(this.control),this.telemetry=this.pc.createDataChannel("telemetry",{ordered:!1,maxRetransmits:0}),this.bindTelemetry(this.telemetry),this.blob=this.pc.createDataChannel("blob",{ordered:!0}),this.tof=this.pc.createDataChannel("tof",{ordered:!1,maxRetransmits:0})),this.media.addSilentAudio&&this.addSilentAudioTrack()}on(o,r){let a=this.handlers.get(o);a||(a=new Set,this.handlers.set(o,a));const u=r;return a.add(u),()=>{a.delete(u)}}emit(o,r){const a=this.handlers.get(o);if(a)for(const u of a)try{u(r)}catch(f){console.error(`[negotiator] handler for "${o}" threw`,f)}}wire(){const o=this.pc;o.onicecandidate=r=>{r.candidate&&this.emit("iceCandidate",r.candidate.toJSON())},o.oniceconnectionstatechange=()=>{this.emit("iceState",o.iceConnectionState),o.iceConnectionState==="failed"&&this.emit("failed",{reason:"ice_failed"})},o.ontrack=r=>{r.streams[0]&&(this.remoteStream=r.streams[0],this.tryEmitEstablished())},o.ondatachannel=r=>{const a=r.channel;a.label==="control"?(console.warn("[negotiator] 收到对端创建的 control 通道,覆盖本地实例"),this.control=a,this.bindControl(a)):a.label==="telemetry"?(console.warn("[negotiator] 收到对端创建的 telemetry 通道,覆盖本地实例"),this.telemetry=a,this.bindTelemetry(a)):a.label==="tof"&&!this.tof&&!this.establishedEmitted?this.tof=a:console.debug("[negotiator] 未知数据通道",a.label)},o.onconnectionstatechange=()=>{o.connectionState==="connected"?this.tryEmitEstablished():o.connectionState==="failed"&&!this.closed&&this.emit("failed",{reason:"connection_failed"})}}bindControl(o){o.onopen=()=>{console.debug("[negotiator] control 通道 open"),this.tryEmitEstablished()},o.onclose=()=>{console.warn("[negotiator] control 通道 closed"),this.closed||this.emit("failed",{reason:"control_closed"})}}bindTelemetry(o){o.onopen=()=>{console.debug("[negotiator] telemetry 通道 open"),this.tryEmitEstablished()},o.onclose=()=>{console.warn("[negotiator] telemetry 通道 closed")}}addSilentAudioTrack(){try{const o=new AudioContext,r=o.createMediaStreamDestination(),a=o.createOscillator(),u=o.createGain();u.gain.value=0,a.connect(u).connect(r),a.start(),r.stream.getAudioTracks().forEach(f=>{f.enabled=!1,this.placeholderTracks.push(f),this.pc.addTrack(f,r.stream)}),this.audioCtx=o}catch(o){console.warn("[negotiator] 静音音轨添加失败",o)}}async createOffer(){const o=await this.pc.createOffer({offerToReceiveVideo:this.media.receiveVideo,offerToReceiveAudio:this.media.receiveAudio});return await this.pc.setLocalDescription(o),o}async applyAnswer(o,r){r&&(this.deviceName=r),await this.pc.setRemoteDescription(o),this.remoteDescSet=!0,await this.flushPendingCandidates(),this.tryEmitEstablished()}async applyOffer(o){await this.pc.setRemoteDescription(o),this.remoteDescSet=!0,await this.flushPendingCandidates();const r=await this.pc.createAnswer();return await this.pc.setLocalDescription(r),r}async addIceCandidate(o){if(o.candidate){if(!this.remoteDescSet){this.pendingCandidates.push(o);return}try{await this.pc.addIceCandidate(o)}catch(r){console.warn("[negotiator] addIceCandidate 失败",r)}}}async flushPendingCandidates(){const o=this.pendingCandidates;this.pendingCandidates=[];for(const r of o)try{await this.pc.addIceCandidate(r)}catch(a){console.warn("[negotiator] 缓冲候选应用失败",a)}}tryEmitEstablished(){this.establishedEmitted||this.pc.connectionState==="connected"&&this.control?.readyState==="open"&&this.telemetry?.readyState==="open"&&(this.establishedEmitted=!0,console.info("[negotiator] 连接就绪",`sn=${this.sn}`,`control=${this.control.readyState}`,`telemetry=${this.telemetry.readyState}`),this.emit("established",{pc:this.pc,control:this.control,telemetry:this.telemetry,blob:this.blob,tof:this.tof,remoteStream:this.remoteStream,sn:this.sn,deviceName:this.deviceName}))}isReady(){return this.establishedEmitted}getConnectionState(){return this.pc.connectionState}close(){if(!this.closed){this.closed=!0,this.control?.close(),this.telemetry?.close(),this.blob?.close(),this.tof?.close(),this.blob=null,this.tof=null,this.control=null,this.telemetry=null,this.pc.getSenders().forEach(o=>{try{this.pc.removeTrack(o)}catch{}}),this.pc.close();for(const o of this.placeholderTracks)o.stop();this.placeholderTracks=[],this.pendingCandidates=[],this.handlers.clear(),this.audioCtx?.close().catch(()=>{}),this.audioCtx=null}}}function gO(n){const o=new pO({url:n.url,jti:n.jti,...n.sn===void 0?{}:{sn:n.sn},...n.autoReconnect===void 0?{}:{autoReconnect:n.autoReconnect}}),r={ws:"idle",authed:!1,role:null,phase:"idle",sn:null,devices:[],iceState:null,error:null},a=new Set,u=new Set,f=new Set,d=new Set;let p=null;const h=n.iceServers??gf,b=()=>{const x={...r,devices:[...r.devices]};for(const T of a)try{T(x)}catch(A){console.error("[signaling] state listener threw",A)}},y=x=>{r.error=x.message,b();for(const T of d)try{T(x)}catch(A){console.error("[signaling] error listener threw",A)}},g=()=>{p?.close(),p=null},w=x=>{r.phase="idle",r.sn=null,r.iceState=null,b();for(const T of f)try{T(x)}catch(A){console.error("[signaling] ended listener threw",A)}};o.on("close",x=>{r.ws=o.getStatus(),r.authed=!1,r.phase==="offering"||r.phase==="answering"||r.phase==="connected"?(g(),w(x.willRetry?"signaling_reconnecting":"signaling_closed")):b(),!x.willRetry&&!x.reason.includes("client closed")&&y({kind:"ws",code:String(x.code),message:"信令连接已关闭"})}),o.on("authOk",x=>{r.authed=!0,r.role=x.role,r.ws="open",b()}),o.on("deviceStatus",x=>{const T=r.devices.findIndex(A=>A.sn===x.sn);if(T>=0){const A=[...r.devices];A[T]={...A[T],online:x.online,name:x.name},r.devices=A}else x.online&&(r.devices=[...r.devices,{sn:x.sn,name:x.name,online:!0,connectedAt:new Date().toISOString()}]);b()});const R=x=>x?.type==="device"?x.sn:void 0,M=x=>{const T=R(x.from);return T?T===r.sn:!0};return o.on("answer",x=>{if(!p)return;if(!M(x)){console.debug("[signaling] 忽略非当前设备的 answer",R(x.from),"!=",r.sn);return}const T=x.payload,A=x.from&&x.from.type==="device"?x.from.name:void 0;p.applyAnswer({type:"answer",sdp:T.sdp},A).catch(_=>{console.error("[signaling] 应用 answer 失败",_),y({kind:"negotiation",message:"应用 SDP answer 失败"})})}),o.on("ice",x=>{if(!p)return;if(!M(x)){console.debug("[signaling] 忽略非当前设备的 ICE",R(x.from),"!=",r.sn);return}const T=x.payload;p.addIceCandidate({candidate:T.candidate,sdpMid:T.sdpMid,sdpMLineIndex:T.sdpMLineIndex})}),o.on("error",x=>{y({kind:"server",code:x.code,message:x.message})}),{async connectSignaling(){r.ws="connecting",b();try{const x=await o.connectSignaling();return b(),x}catch(x){r.ws=o.getStatus();const T=x instanceof Error?x.message:String(x);throw y({kind:"ws",message:T}),x}},disconnectSignaling(){p?.close(),p=null;const x=o.close();return r.ws="closed",r.authed=!1,r.phase="idle",r.sn=null,b(),x},sendFrame(x,T){return o.sendFrame(x,T)},onFrame(x,T){return o.onFrame(x,T)},async listDevices(){try{const x=await o.listDevices();return r.devices=x.devices,b(),x.devices}catch(x){const T=x instanceof Error?x.message:String(x);throw y({kind:"server",message:T}),x}},async negotiate(x,T){if(r.phase!=="idle"||p!==null){if(r.phase==="connected"&&r.sn===x)return;g(),r.phase="idle",r.sn=null,r.iceState=null,b()}r.sn=x,r.phase="offering",b();const _=new mO({sn:x,iceServers:T??h,createChannels:n.createChannels??!0,media:{...n.media,addSilentAudio:n.media?.addSilentAudio??!0}});p=_,_.on("iceCandidate",L=>{o.sendIce(x,L)}),_.on("iceState",L=>{r.iceState=L,b()}),_.on("established",L=>{if(p!==_){L.pc.close();return}r.phase="connected",b();for(const E of u)try{E(L)}catch(j){console.error("[signaling] established listener threw",j)}}),_.on("failed",({reason:L})=>{p===_&&(y({kind:"negotiation",message:`WebRTC 协商失败:${L}`}),g(),w(L))});try{const L=await _.createOffer();if(p!==_)return;o.sendOffer(x,L.sdp??"","offer"),r.phase="answering",b()}catch(L){if(p!==_)return;g();const E=L instanceof Error?L.message:String(L);throw y({kind:"negotiation",message:E}),w("offer_failed"),L}},stopNegotiation(){g(),r.phase!=="idle"&&w("user")},getState(){return{...r,devices:[...r.devices]}},subscribe(x){return a.add(x),x({...r,devices:[...r.devices]}),()=>a.delete(x)},onEstablished(x){return u.add(x),()=>u.delete(x)},onEnded(x){return f.add(x),()=>f.delete(x)},onError(x){return d.add(x),()=>d.delete(x)},clearError(){r.error=null,b()}}}function yO(n,o){return n==="robot.init"||n==="robot.enable"||n==="robot.relax"||n==="robot.estop"?15e3:n==="robot.lightFollow.start"?25e3:n==="robot.lightFollow.stop"?2e4:n==="robot.do"&&typeof o=="object"&&o!==null&&"wait"in o&&o.wait===!0?35e3:5e3}const bO=new Set(["robot.move","robot.do","robot.invoke","robot.setMode","robot.init","robot.enable","robot.head","robot.look","robot.mouth","robot.pose","robot.servo.set"]);function gS(n){return bO.has(n)}function qu(n){return n==="robot.stop"||n==="robot.relax"}const vO=new Set(["robot.move","robot.head","robot.look","robot.mouth","robot.pose","robot.servo.set"]);function SO(n){return vO.has(n)}const Te=Object.freeze({move:"robot.move",invoke:"robot.invoke",stopAudio:"robot.audio.stop",listActions:"robot.actions.list",deleteAction:"robot.actions.delete",getConfig:"robot.config",setMode:"robot.setMode",init:"robot.init",enable:"robot.enable",head:"robot.head",look:"robot.look",mouth:"robot.mouth",pose:"robot.pose",getServoState:"robot.servo.state",setServoJoints:"robot.servo.set",relax:"robot.relax",stop:"robot.stop",reset:"robot.reset",doSkill:"robot.do",getStatus:"robot.status",getCapabilities:"robot.capabilities",subscribeTof:"robot.tof.subscribe",unsubscribeTof:"robot.tof.unsubscribe",startLightFollow:"robot.lightFollow.start",stopLightFollow:"robot.lightFollow.stop",getLightFollowStatus:"robot.lightFollow.status"}),dm=Object.freeze(["left_hip_yaw","left_hip_roll","left_hip_pitch","left_knee","left_ankle","neck_pitch","head_pitch","head_yaw","head_roll","mouth","right_hip_yaw","right_hip_roll","right_hip_pitch","right_knee","right_ankle"]),Tv={L_hip_yaw:"left_hip_yaw",L_hip_roll:"left_hip_roll",L_hip_pitch:"left_hip_pitch",L_knee:"left_knee",L_ankle:"left_ankle",R_hip_yaw:"right_hip_yaw",R_hip_roll:"right_hip_roll",R_hip_pitch:"right_hip_pitch",R_knee:"right_knee",R_ankle:"right_ankle"},wO=new Set(dm);function xO(n){if(n===null||typeof n!="object"||Array.isArray(n))return"robot.servo.set 需要 joints 对象";const o=Object.entries(n);if(o.length===0||o.length>dm.length)return"robot.servo.set 需要 1~15 个关节";const r=new Set;for(const[a,u]of o){const f=a.trim(),d=Object.hasOwn(Tv,f)?Tv[f]:f;if(!wO.has(d))return`未知舵机关节 ${a}`;if(r.has(d))return`舵机关节 ${d} 重复指定`;if(typeof u!="number"||!Number.isFinite(u))return`舵机关节 ${d} 的角度必须为有限数`;r.add(d)}}const Av={[Te.enable]:{on:"boolean"},[Te.head]:{neck_pitch:"number?",head_pitch:"number?",head_yaw:"number?",head_roll:"number?"},[Te.look]:{x:"number",y:"number",z:"number",neck_pitch:"number?"},[Te.mouth]:{open:"number"},[Te.pose]:{z:"number?",roll:"number?",pitch:"number?",active:"boolean?"}},EO=3,TO=new Set([Te.move,Te.head,Te.look,Te.pose]);function yS(n){return TO.has(n)}function kp(n,o){const r=o!==null&&typeof o=="object"&&!Array.isArray(o)?o:void 0;if(r?.priority!==void 0&&!yS(n))return`${n} 不接受 priority`;if(n===Te.init||n===Te.getServoState||n===Te.relax||n===Te.unsubscribeTof||n===Te.stopLightFollow||n===Te.getLightFollowStatus)return o==null||r&&Object.keys(r).length===0?void 0:`${n} 不接受参数`;if(n===Te.startLightFollow)return o==null?void 0:!r||Object.keys(r).some(a=>a!=="allow_forward")?`${n} 只接受 allow_forward 参数`:r.allow_forward!==void 0&&typeof r.allow_forward!="boolean"?`${n} 的 allow_forward 必须是布尔值`:void 0;if(n===Te.subscribeTof){if(o==null)return;if(!r||Object.keys(r).some(u=>u!=="hz"))return"robot.tof.subscribe 只接受 hz 参数";const a=r.hz;return a===void 0||typeof a=="number"&&Number.isInteger(a)&&a>=1&&a<=15?void 0:"robot.tof.subscribe 的 hz 必须是 1~15 的整数"}if(n===Te.setServoJoints)return!r||Object.keys(r).length!==1||!Object.hasOwn(r,"joints")?"robot.servo.set 只接受 joints 参数":xO(r.joints);if(n===Te.invoke)return r&&Object.keys(r).length===1&&typeof r.text=="string"&&r.text.trim()?void 0:"robot.invoke 只接受非空 text 参数";if(Object.hasOwn(Av,n)){if(!r&&!(o===void 0&&(n===Te.head||n===Te.pose)))return`${n} 需要对象参数`;for(const[a,u]of Object.entries(Av[n])){const f=r?.[a];if(f===void 0&&u.endsWith("?"))continue;if(!(u.startsWith("number")?typeof f=="number"&&Number.isFinite(f):typeof f=="boolean"))return`${n} 的 ${a} 参数无效`}}}function Sa(n){return n===null||typeof n=="number"&&Number.isSafeInteger(n)&&n>0}function bS(n){return(n.hasTof===void 0||typeof n.hasTof=="boolean")&&(n.tofUnavailable===void 0||typeof n.tofUnavailable=="string")&&[n.tofRows,n.tofCols,n.tofHz].every(o=>o===void 0||Sa(o))}function As(n){return typeof n=="number"&&Number.isInteger(n)&&n>=0}function AO(n){const{rows:o,cols:r,distance_mm:a,status:u,seq:f,at_us:d,t_ns:p}=n;if(o===null||r===null||!Sa(o)||!Sa(r))return!1;const h=o*r;return Number.isSafeInteger(h)&&Number.isSafeInteger(f)&&As(f)&&As(d)&&As(p)&&Array.isArray(a)&&a.length===h&&a.every(As)&&Array.isArray(u)&&u.length===h&&u.every(b=>As(b)&&b<=255)}class _e extends Error{code;source;data;constructor(o,r,a="sdk",u){super(r),this.name="RaydiculousXError",this.code=o,this.source=a,u!==void 0&&(this.data=u)}toJSON(){return{code:this.code,message:this.message,source:this.source,...this.data===void 0?{}:{data:this.data}}}}function Mu(n,o){if(!Number.isSafeInteger(n)||n<1||n>2147483647)throw new _e("INVALID_ARGUMENT",o+" must be a positive timer duration");return n}const vS=1048576;function RO(n){const o=new Set;let r=0;function a(u,f){if(++r>5e4||f>32)throw new _e("INVALID_ARGUMENT","JSON is too complex");if(!(u===null||typeof u=="string"||typeof u=="boolean")&&!(typeof u=="number"&&Number.isFinite(u))){if(typeof u!="object"||u===null||o.has(u))throw new _e("INVALID_ARGUMENT","Expected finite, acyclic JSON");if(!Array.isArray(u)&&Object.getPrototypeOf(u)!==Object.prototype&&Object.getPrototypeOf(u)!==null)throw new _e("INVALID_ARGUMENT","Only plain JSON objects are supported");if(Object.getOwnPropertySymbols(u).length)throw new _e("INVALID_ARGUMENT","Symbol keys are unsupported");o.add(u);for(const d of Array.isArray(u)?u:Object.values(u))a(d,f+1);o.delete(u)}}return a(n,0),new TextEncoder().encode(JSON.stringify(n)).byteLength}function CO(n,o=vS){if(RO(n)>o)throw new _e("PAYLOAD_TOO_LARGE","Message exceeds negotiated byte limit")}function Wi(n){return CO(n),n}function OO(n){try{const o=new URL(n);if(!["http:","https:"].includes(o.protocol)||o.origin!==n)throw new Error;return n}catch{throw new _e("INVALID_ARGUMENT","Expected an explicit HTTP(S) origin without path or trailing slash")}}function Yu(){const n=new Uint8Array(16);return globalThis.crypto.getRandomValues(n),Array.from(n,o=>o.toString(16).padStart(2,"0")).join("")}function MO(n){if(typeof n!="object"||n===null||!("error"in n))return!1;const o=n.error;return typeof o=="object"&&o!==null&&"code"in o&&typeof o.code=="number"&&Number.isFinite(o.code)&&"message"in o&&typeof o.message=="string"}const cr={PARSE_ERROR:-32600,UNKNOWN_METHOD:-32601,INVALID_PARAMS:-32602,INTERNAL:-32603,BUSY:409,NOT_READY:423,TOO_FAST:429},NO={[cr.PARSE_ERROR]:"报文格式错误",[cr.UNKNOWN_METHOD]:"未知方法",[cr.INVALID_PARAMS]:"参数错误",[cr.INTERNAL]:"机器人内部错误",[cr.BUSY]:"机器人正在执行技能",[cr.NOT_READY]:"机器人未就绪",[cr.TOO_FAST]:"指令过快"},_O=16*1024,DO=10,ap=16*1024,jO=["robot.move","robot.invoke","robot.audio.stop","robot.actions.list","robot.actions.delete","robot.config","robot.setMode","robot.init","robot.enable","robot.head","robot.look","robot.mouth","robot.pose","robot.servo.state","robot.servo.set","robot.relax","robot.stop","robot.do","robot.status","robot.capabilities","robot.tof.subscribe","robot.tof.unsubscribe","robot.lightFollow.start","robot.lightFollow.stop","robot.lightFollow.status","robot.reset"];function Rv(n){return jO.includes(n)}let Cv=1;const zO=32,li=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);class LO extends Error{code;data;constructor(o,r,a){super(r||NO[o]||"机器人请求失败"),this.name="RobotRpcError",this.code=o,this.data=a}}class kO extends Error{code;constructor(o,r){super(r),this.name="RobotTransportError",this.code=o}}const ot=(n,o)=>new kO(n,o);function jo(n,o){for(const r of[...n])try{r(o)}catch(a){console.error("[robot] listener failed",a)}}function yl(n,o){return n.add(o),()=>{n.delete(o)}}class UO{connection;control;connectionEpoch;requestTimeoutMs;maxCommandHz;lastCommandAt=new Map;pending=new Map;disposed=!1;lifetime=new AbortController;tofRequestPending=!1;activeSessions=new Set;closedSessions=new Set;cleanup=new Map;revision=0;caps=null;capabilityTimers=new Set;telemetryListeners=new Set;tofListeners=new Set;responseListeners=new Set;faultListeners=new Set;skillListeners=new Set;audioErrorListeners=new Set;closeListeners=new Set;capabilityListeners=new Set;constructor(o){if(!o.connection.control)throw ot("NOT_READY","连接没有 control 通道");if(this.connection=o.connection,this.control=o.connection.control,this.connectionEpoch=o.connectionEpoch??0,this.requestTimeoutMs=o.requestTimeoutMs,this.maxCommandHz=o.maxCommandHz??DO,!Number.isFinite(this.maxCommandHz)||this.maxCommandHz<=0)throw ot("INVALID_ARGUMENT","maxCommandHz 必须为正数");this.control.addEventListener("message",this.onControlMessage),this.control.addEventListener("close",this.onClosed),this.control.addEventListener("error",this.onClosed),this.connection.pc.addEventListener("connectionstatechange",this.onConnectionState),this.connection.telemetry?.addEventListener("message",this.onTelemetryMessage),this.connection.tof?.addEventListener("message",this.onTofMessage)}onTelemetry(o){return yl(this.telemetryListeners,o)}onTof(o){return yl(this.tofListeners,o)}onResponse(o){return yl(this.responseListeners,o)}onFault(o){return yl(this.faultListeners,o)}onSkill(o){return yl(this.skillListeners,o)}onAudioError(o){return yl(this.audioErrorListeners,o)}onClose(o){return yl(this.closeListeners,o)}onCapabilities(o){return yl(this.capabilityListeners,o)}get capabilitiesSnapshot(){return this.caps}get pendingCount(){return this.pending.size}isReady(){return!this.disposed&&this.control.readyState==="open"&&this.connection.pc.connectionState==="connected"}onConnectionState=()=>{["disconnected","failed","closed"].includes(this.connection.pc.connectionState)&&this.onClosed()};onClosed=()=>{this.rejectAll(ot("CONTEXT_CHANGED","设备连接已断开,执行结果可能未知")),jo(this.closeListeners,void 0)};parse(o,r=!1){if(typeof o!="string")return null;const a=r?vS:ap;if(o.length>a)return null;const u=new TextEncoder().encode(o).length;if(u>a)return null;try{const f=JSON.parse(o);return!li(f)||f.jsonrpc!=="2.0"||u>ap&&(typeof f.id!="number"||this.pending.get(f.id)?.method!=="robot.config")?null:f}catch{return null}}onControlMessage=o=>{if(this.disposed)return;const r=this.parse(o.data,!0);if(!r)return;if(jo(this.responseListeners,r),!("id"in r)&&r.method==="robot.fault"&&li(r.params)&&r.params.state==="FAULT"&&typeof r.params.reason=="string"){jo(this.faultListeners,r);return}if(!("id"in r)&&r.method==="robot.skill"&&li(r.params)){const{skill:u,status:f,reason:d,durationMs:p}=r.params;typeof u=="string"&&(f==="completed"||f==="timed_out"||f==="failed"||f==="cancelled")&&(d===null||typeof d=="string")&&(p===null||typeof p=="number"&&Number.isFinite(p)&&p>=0)&&jo(this.skillListeners,{skill:u,status:f,reason:d,durationMs:p});return}if(!("id"in r)&&r.method==="robot.audio.error"&&li(r.params)&&typeof r.params.reason=="string"&&typeof r.params.message=="string"){jo(this.audioErrorListeners,{jsonrpc:"2.0",method:"robot.audio.error",params:{reason:r.params.reason,message:r.params.message}});return}if(typeof r.id!="number")return;const a=this.pending.get(r.id);if(a){if(this.pending.delete(r.id),a.release(),MO(r)&&!("result"in r&&r.result!==null)){a.reject(new LO(r.error.code,r.error.message,r.error.data));return}if(!("result"in r)||r.error!==void 0&&r.error!==null){a.reject(ot("PROTOCOL_ERROR","设备回包缺少 result 或包含无效 error"));return}if(a.method==="robot.capabilities")try{this.acceptCapabilities(r.result)}catch(u){a.reject(u);return}a.revision===this.revision&&li(r.result)&&(qu(a.method)&&r.result.accepted===!0&&this.activeSessions.clear(),a.newActivity&&a.session&&r.result.accepted===!1&&this.activeSessions.delete(a.session)),a.resolve(r.result)}};onTelemetryMessage=o=>{if(this.disposed)return;const r=this.parse(o.data);r&&!("id"in r)&&r.method==="robot.state"&&li(r.params)&&jo(this.telemetryListeners,r)};onTofMessage=o=>{if(!this.isReady()||this.connection.tof?.readyState!=="open")return;const r=this.parse(o.data);r&&!("id"in r)&&r.method==="robot.tof"&&li(r.params)&&AO(r.params)&&jo(this.tofListeners,r.params)};acceptCapabilities(o){if(!li(o)||o.protocol!=="v1"||o.dof!==15||!Array.isArray(o.jointNames)||o.jointNames.length!==15||!o.jointNames.every(u=>typeof u=="string")||typeof o.maxCommandHz!="number"||!Number.isFinite(o.maxCommandHz)||o.maxCommandHz<=0||typeof o.telemetryHz!="number"||!Number.isFinite(o.telemetryHz)||o.telemetryHz<=0||!["hasVideo","hasAudioOut","hasAudioIn"].every(u=>typeof o[u]=="boolean")||!bS(o)||o.hasLightFollow!==void 0&&typeof o.hasLightFollow!="boolean")throw ot("PROTOCOL_ERROR","设备能力回包不符合 WebRTC v1");this.caps=o,this.maxCommandHz=this.caps.maxCommandHz;const r=this.caps,a=setTimeout(()=>{this.capabilityTimers.delete(a),this.disposed||jo(this.capabilityListeners,r)},0);this.capabilityTimers.add(a)}waitForTof(o,r,a){return new Promise((u,f)=>{const d=new AbortController,p={signal:d.signal},h=R=>{clearTimeout(g),d.abort(),w(),R?f(R):u()},b=()=>h(ot("UNSUPPORTED","连接没有可用的 tof 通道")),y=()=>h(ot("CONTEXT_CHANGED","等待 tof 通道时设备连接已关闭")),g=setTimeout(()=>h(ot("REQUEST_TIMEOUT","等待 tof 通道打开超时")),r),w=this.onClose(y);o.addEventListener("open",()=>h(),p),o.addEventListener("close",b,p),o.addEventListener("error",b,p),a?.addEventListener("abort",()=>h(ot("ABORTED","等待 tof 通道已取消")),p),this.lifetime.signal.addEventListener("abort",y,p)})}request(o,r,a={}){return o!=="robot.tof.subscribe"&&o!=="robot.tof.unsubscribe"?this.sendRequest(o,r,a):(a.context?.signal??a.signal)?.aborted?Promise.reject(ot("ABORTED","请求已取消")):this.tofRequestPending?Promise.reject(ot("BUSY","当前连接已有 ToF 请求在进行")):(this.tofRequestPending=!0,this.sendRequest(o,r,a).finally(()=>{this.tofRequestPending=!1}))}sendRequest(o,r,a){return new Promise((u,f)=>{const d=a.context,p=d?.signal??a.signal,h=a.timeoutMs??this.requestTimeoutMs??yO(o,r);if(p?.aborted)throw ot("ABORTED","请求已取消");if(d&&(d.robotId!==this.connection.sn||d.connectionEpoch!==this.connectionEpoch))throw ot("CONTEXT_CHANGED","请求设备或连接代次已失效");if(d&&this.closedSessions.has(d.appSessionId))throw ot("APP_DISPOSED","应用会话已关闭");if(!this.isReady())throw ot("NOT_READY","control 通道未就绪");if(!Rv(o))throw ot("UNSUPPORTED","未注册的机器人请求");const b=kp(o,r);if(b)throw ot("INVALID_ARGUMENT",b);if(o==="robot.actions.delete"&&(!li(r)||typeof r.name!="string"||!r.name))throw ot("INVALID_ARGUMENT","deleteAction 需要非空动作名");if((o==="robot.audio.stop"||o==="robot.actions.list"||o==="robot.config")&&r!=null&&(!li(r)||Object.keys(r).length>0))throw ot("INVALID_ARGUMENT","此方法不接受参数");if(o==="robot.setMode"&&(!li(r)||typeof r.mode!="string"))throw ot("INVALID_ARGUMENT","setMode 需要字符串 mode");if(o==="robot.move"&&(!li(r)||![r.vx,r.vyaw,r.vy??0].every(j=>typeof j=="number"&&Number.isFinite(j))||r.vy===null||"duration_s"in r))throw ot("INVALID_ARGUMENT","move 需要有限 vx/vyaw、可选 vy,不接受 duration_s");if(o==="robot.do"&&(!li(r)||typeof r.skill!="string"||!r.skill.trim()||r.skill.length>256))throw ot("INVALID_ARGUMENT","skill 必须是非空字符串,最多 256 字符");if(!Number.isSafeInteger(h)||h<1||h>12e4)throw ot("INVALID_ARGUMENT","请求超时应为 1–120000 ms");if(o==="robot.tof.subscribe"){const j=this.connection.tof;if(!j||j.readyState==="closing"||j.readyState==="closed")throw ot("UNSUPPORTED","连接没有可用的 tof 通道");if(j.readyState==="connecting"){const O=performance.now()+h;this.waitForTof(j,h,p).then(()=>{const D=Math.ceil(O-performance.now());if(D<1)throw ot("REQUEST_TIMEOUT","等待 tof 通道打开超时");return this.sendRequest(o,r,{...a,timeoutMs:D})}).then(u,f);return}}if(this.control.bufferedAmount>_O)throw ot("BACKPRESSURE","发送缓冲积压,请稍后重试");const y=qu(o);if(this.pending.size>=zO&&(!y||[...this.pending.values()].some(j=>j.method===o)))throw ot("TOO_MANY_REQUESTS","等待设备响应的请求过多");const g=gS(o);if(g&&[...this.activeSessions].some(j=>this.closedSessions.has(j)))throw ot("BUSY","正在等待旧应用的停车回执");if(g&&[...this.activeSessions].some(j=>j!==d?.appSessionId))throw ot("BUSY","其他应用仍有未清理的设备活动");const w=SO(o);if(w&&performance.now()-(this.lastCommandAt.get(o)??-1/0)<1e3/this.maxCommandHz)throw ot("RATE_LIMITED",`${o} 超过设备 maxCommandHz`);const R=Cv++,M=yS(o)?{...li(r)?r:{},priority:EO}:r,x=JSON.stringify({jsonrpc:"2.0",id:R,method:o,...M===void 0?{}:{params:M}});if(new TextEncoder().encode(x).length>ap)throw ot("MESSAGE_TOO_LARGE","请求超过 16 KB");const T=d?.appSessionId,A=!!(g&&T&&!this.activeSessions.has(T));(g||y)&&this.revision++;const _=j=>{const O=this.pending.get(R);O&&(this.pending.delete(R),O.release(),f(j))},L=setTimeout(()=>_(ot("REQUEST_TIMEOUT","等待 "+o+" 回执超时,执行结果未知")),h),E=()=>_(ot("ABORTED","本地等待已取消,远端执行结果未知"));this.pending.set(R,{resolve:u,reject:f,method:o,session:T,revision:this.revision,newActivity:A,release:()=>{clearTimeout(L),p?.removeEventListener("abort",E)}}),p?.addEventListener("abort",E,{once:!0}),g&&T&&this.activeSessions.add(T);try{this.control.send(x),w&&this.lastCommandAt.set(o,performance.now())}catch{A&&T&&this.activeSessions.delete(T),_(ot("SEND_FAILED","设备请求未能发送"))}})}sendRawFrame(o){const r=this.parse(o);return!r||typeof r.method!="string"||!Rv(r.method)||!this.isReady()?!1:(this.request(r.method,r.params).catch(a=>{jo(this.responseListeners,{localError:{code:a.code,message:a.message}})}),!0)}move(o){return this.request("robot.move",{...o,vy:o.vy??0})}setMode(o){return this.request("robot.setMode",o)}init(){return this.request("robot.init")}enable(o){return this.request("robot.enable",o)}head(o={}){return this.request("robot.head",o)}look(o){return this.request("robot.look",o)}mouth(o){return this.request("robot.mouth",o)}pose(o={}){return this.request("robot.pose",o)}relax(){return this.request("robot.relax")}stop(){return this.request("robot.stop")}do(o){return this.request("robot.do",o)}stopAudio(){return this.request("robot.audio.stop")}listActions(){return this.request("robot.actions.list")}deleteAction(o){return this.request("robot.actions.delete",{name:o})}getConfig(){return this.request("robot.config")}status(){return this.request("robot.status")}capabilities(){return this.request("robot.capabilities")}closeSession(o){const r=o.appSessionId,a=this.cleanup.get(r);if(a)return a;this.closedSessions.add(r);for(const[f,d]of this.pending)d.session===r&&(this.pending.delete(f),d.release(),d.reject(ot("APP_DISPOSED","应用会话已撤销")));const u=(async()=>{if(!this.activeSessions.has(r))return;if((await this.stop())?.accepted!==!0)throw ot("CLEANUP_UNCONFIRMED","未收到停车受理回执");this.activeSessions.delete(r)})();return this.cleanup.set(r,u),u}reset(){return this.request("robot.reset",{})}async shutdownGracefully(){if((await this.stop())?.accepted!==!0)throw ot("CLEANUP_UNCONFIRMED","未收到停车受理回执")}shutdownFast(){if(this.isReady())try{this.control.send(JSON.stringify({jsonrpc:"2.0",id:Cv++,method:"robot.stop"}))}catch{}}dispose(){if(!this.disposed){this.disposed=!0,this.lifetime.abort(),this.rejectAll(ot("CONTEXT_CHANGED","设备通道已释放")),this.control.removeEventListener("message",this.onControlMessage),this.control.removeEventListener("close",this.onClosed),this.control.removeEventListener("error",this.onClosed),this.connection.pc.removeEventListener("connectionstatechange",this.onConnectionState),this.connection.telemetry?.removeEventListener("message",this.onTelemetryMessage),this.connection.tof?.removeEventListener("message",this.onTofMessage);for(const o of this.capabilityTimers)clearTimeout(o);this.capabilityTimers.clear(),this.telemetryListeners.clear(),this.tofListeners.clear(),this.responseListeners.clear(),this.faultListeners.clear(),this.skillListeners.clear(),this.audioErrorListeners.clear(),this.closeListeners.clear(),this.capabilityListeners.clear()}}rejectAll(o){for(const r of this.pending.values())r.release(),r.reject(o);this.pending.clear()}}function Yt(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function ri(n){return typeof n=="number"&&Number.isFinite(n)}function hm(n){return typeof n=="number"&&Number.isSafeInteger(n)&&n>=0}function IO(n){return(!Yt(n)||!Array.isArray(n.actions)||!n.actions.every(o=>Yt(o)&&typeof o.name=="string"&&typeof o.path=="string"&&(o.durationS===null||ri(o.durationS))&&hm(o.sizeBytes)&&typeof o.modifiedAt=="string"&&o.source==="user"))&&Xt("robot.actions.list"),n}function HO(n,o){return(!Yt(n)||n.deleted!==!0||n.name!==o||!hm(n.sizeBytes))&&Xt("robot.actions.delete"),n}function BO(n){return(!Yt(n)||typeof n.path!="string"||typeof n.exists!="boolean"||n.size!==void 0&&!hm(n.size)||n.config!==void 0&&!Yt(n.config)||["mtime","sha256","error","parseError"].some(o=>n[o]!==void 0&&typeof n[o]!="string"))&&Xt("robot.config"),n}function sp(n,o){return Array.isArray(n)&&n.length===o&&n.every(ri)}function SS(n){return["INIT","READY","RUNNING","FAULT"].includes(n.state)&&(n.faultReason===null||typeof n.faultReason=="string")}function Xt(n){throw new _e("INVALID_RESPONSE",`Invalid ${n} payload from robot`,"sdk")}function cp(n){return(!Yt(n)||n.accepted!==!0)&&Xt("acceptance"),n}function Sl(n,o){if((!Yt(n)||typeof n.accepted!="boolean"||n.reason!=null&&typeof n.reason!="string")&&Xt(o),n.reason===null){const{reason:r,...a}=n;return{...a,accepted:n.accepted}}return n}function wS(n){return Yt(n)&&[n.neck_pitch,n.head_pitch,n.head_yaw,n.head_roll].every(ri)}function VO(n){const o=Sl(n,"robot.head");return wS(o.head)||Xt("robot.head"),o}function qO(n){return(!Yt(n)||n.accepted!==!0||!wS(n.head)||typeof n.clamped!="boolean")&&Xt("robot.look"),n}function YO(n){const o=Sl(n,"robot.mouth");return(!ri(o.open)||o.open<0||o.open>1)&&Xt("robot.mouth"),o}function FO(n){const o=Sl(n,"robot.pose");return(!Yt(o.pose)||![o.pose.z,o.pose.roll,o.pose.pitch].every(ri)||typeof o.pose.active!="boolean")&&Xt("robot.pose"),o}function GO(n){return(!Yt(n)||typeof n.mode!="string"||typeof n.enabled!="boolean"||typeof n.moving!="boolean"||!Yt(n.joints)||!Object.values(n.joints).every(ri))&&Xt("robot.servo.state"),n}function PO(n){const o=Sl(n,"robot.servo.set");return(typeof o.mode!="string"||!Yt(o.joints)||!Object.values(o.joints).every(ri))&&Xt("robot.servo.set"),o}function xS(n){return(n.halted===void 0||typeof n.halted=="boolean")&&(n.haltReason==null||typeof n.haltReason=="string")&&(n.poseActive===void 0||typeof n.poseActive=="boolean")}function XO(n){if((!Yt(n)||typeof n.accepted!="boolean")&&Xt("skill"),n.completed!==void 0&&typeof n.completed!="boolean"&&Xt("skill"),n.status!==void 0&&typeof n.status!="string"&&Xt("skill"),n.durationMs!=null&&(!ri(n.durationMs)||n.durationMs<0)&&Xt("skill"),n.reason===null){const{reason:o,...r}=n;return{...r,accepted:n.accepted}}return n.reason!==void 0&&typeof n.reason!="string"&&Xt("skill"),n}function Ov(n){return(!Yt(n)||!SS(n)||!xS(n)||n.faultRecoverable!==void 0&&typeof n.faultRecoverable!="boolean"||n.motionLimits!==void 0&&(!Yt(n.motionLimits)||!ri(n.motionLimits.durationMs)||!ri(n.motionLimits.keepaliveMs))||n.mode!==void 0&&(!Yt(n.mode)||typeof n.mode.mode!="string")||n.supportedModes!==void 0&&(!Array.isArray(n.supportedModes)||!n.supportedModes.every(o=>typeof o=="string")))&&Xt("robot.status"),n}function KO(n){return(!Yt(n)||n.protocol!=="v1"||n.dof!==15||!Array.isArray(n.jointNames)||n.jointNames.length!==15||!n.jointNames.every(o=>typeof o=="string"&&o.length>0)||!ri(n.maxCommandHz)||n.maxCommandHz<=0||!ri(n.telemetryHz)||n.telemetryHz<=0||typeof n.hasVideo!="boolean"||typeof n.hasAudioOut!="boolean"||typeof n.hasAudioIn!="boolean"||!bS(n)||n.hasLightFollow!==void 0&&typeof n.hasLightFollow!="boolean")&&Xt("robot.capabilities"),n}function ES(n){return typeof n.allowForward!="boolean"?!1:n.running===!1?n.pid===null&&n.previewUrl===null:n.running===!0&&typeof n.pid=="number"&&Number.isSafeInteger(n.pid)&&n.pid>0&&(n.previewUrl===null||typeof n.previewUrl=="string")}function Up(n,o){return(!Yt(n)||!ES(n)||n.accepted!==!0||n.running!==o)&&Xt(o?Te.startLightFollow:Te.stopLightFollow),{...n,accepted:!0}}function QO(n){return(!Yt(n)||!ES(n)||typeof n.installed!="boolean")&&Xt(Te.getLightFollowStatus),{...n,installed:n.installed}}function ZO(n){return(!Yt(n)||n.accepted!==!0||n.alreadySubscribed!==void 0&&typeof n.alreadySubscribed!="boolean"||!Sa(n.rows)||!Sa(n.cols)||!Sa(n.hz))&&Xt("robot.tof.subscribe"),n}function JO(n){return(!Yt(n)||n.accepted!==!0||typeof n.wasSubscribed!="boolean")&&Xt("robot.tof.unsubscribe"),{accepted:!0,wasSubscribed:n.wasSubscribed}}function $O(n){return(!Yt(n)||!SS(n)||!xS(n)||typeof n.policy!="string"||n.activeSkill!=null&&typeof n.activeSkill!="string"||!sp(n.joints,15)||!sp(n.targets,15)||n.currents_ma!==null&&!sp(n.currents_ma,15)||n.move!==null&&(!Yt(n.move)||!Array.isArray(n.move.applied)||!n.move.applied.every(ri))||!ri(n.t))&&Xt("robot.state"),n}function WO(n){return(!Yt(n)||n.state!=="FAULT"||typeof n.reason!="string")&&Xt("robot.fault"),n}const eM=new Set(["kick_left","kick_right","ground_pick","roulade"]);function tM(n){if(!n||typeof n!="object"||Array.isArray(n)||!Number.isFinite(n.vx)||!Number.isFinite(n.vyaw)||n.vy!==void 0&&!Number.isFinite(n.vy)||"duration_s"in n)throw new _e("INVALID_ARGUMENT","move requires finite vx/vyaw and optional vy; duration_s is not supported by v1");return{vx:n.vx,vy:n.vy??0,vyaw:n.vyaw}}class nM{runtime;sittingState=null;postureRevision=0;stopRevision=0;audioOutput=null;audioAbort=null;offAudioLeave=null;constructor(o){this.runtime=o;let r=o.context;this.runtime.on("context",()=>{const a=o.context;(r.connectionEpoch!==a.connectionEpoch||r.connectionState!==a.connectionState)&&(this.postureRevision++,this.sittingState=null,this.stopRevision++),r=a}),this.runtime.onAppExit(()=>{this.sittingState=null,this.postureRevision++,this.stopRevision++}),this.onTelemetry(({policy:a})=>{(a==="sit"||a==="stand")&&(this.postureRevision++,this.sittingState=a==="sit")})}get sitting(){return this.runtime.disposed?null:this.sittingState}get context(){return this.runtime.context}get disposed(){return this.runtime.disposed}get mode(){return this.runtime.mode}get rtcConnection(){return this.runtime.rtcConnection}get incomingRobotAudioTrack(){return this.runtime.incomingRobotAudioTrack}bindRobotVideo(o){return this.runtime.bindRobotVideo(o)}async uploadAction(o,r,a={}){if(!this.runtime.uploadAction)throw new _e("UNSUPPORTED","设备连接没有动作上传通道");return this.runtime.uploadAction(o,r,a)}async move(o,r={}){return cp(await this._sendCommand({method:Te.move,params:tM(o)},r))}async stop(o={}){return this.stopRevision++,cp(await this._sendCommand({method:Te.stop,params:null},o))}async reset(o={}){return Ov(await this.request(Te.reset,null,o))}async setMode(o,r={}){if(typeof o?.mode!="string")throw new _e("INVALID_ARGUMENT","setMode 需要字符串 mode");return o.mode==="direct"&&this.stopRevision++,Sl(await this.request(Te.setMode,{mode:o.mode},r),Te.setMode)}async init(o={}){return this.stopRevision++,Sl(await this.request(Te.init,null,o),Te.init)}async enable(o,r={}){return this.stopRevision++,Sl(await this.requestControl(Te.enable,o,r),Te.enable)}async head(o={},r={}){return VO(await this.requestControl(Te.head,o,r))}async look(o,r={}){return qO(await this.requestControl(Te.look,o,r))}async mouth(o,r={}){return YO(await this.requestControl(Te.mouth,o,r))}async pose(o={},r={}){return o?.active!==!1&&this.stopRevision++,FO(await this.requestControl(Te.pose,o,r))}async getServoState(o={}){return GO(await this.request(Te.getServoState,null,o))}async setServoJoints(o,r={}){return PO(await this.requestControl(Te.setServoJoints,o,r))}async relax(o={}){return this.stopRevision++,Sl(await this._sendCommand({method:Te.relax,params:null},o),Te.relax)}requestControl(o,r,a){const u=kp(o,r);if(u)throw new _e("INVALID_ARGUMENT",u);const f=Object.fromEntries(Object.entries(r).filter(([,d])=>d!==void 0));return this.request(o,Wi(f),a)}async doSkill(o,r=!0,a={}){if(typeof o!="string"||o.trim().length===0||o.length>256)throw new _e("INVALID_ARGUMENT","skill must be a non-empty string of at most 256 characters");const u=typeof r=="boolean"?r:!0,f=typeof r=="boolean"?a:r;if(eM.has(o)){if(this.sitting===null&&!this.disposed){const h=this.stopRevision;if(await this.getStatus(f),h!==this.stopRevision)throw new _e("ABORTED","Skill preparation was interrupted")}if(this.sitting===!0&&!f.signal?.aborted)return{accepted:!1,reason:"机器人当前坐着,请先站起来,再重新选择动作。"}}const d=this.postureRevision,p=XO(await this._sendCommand({method:Te.doSkill,params:{skill:o,wait:u}},f));return o==="sit_toggle"&&p.accepted&&d===this.postureRevision&&(this.sittingState=null,this.postureRevision++),p}async getStatus(o={}){const r=++this.postureRevision,a=Ov(await this._sendCommand({method:Te.getStatus,params:null},o)),u=a.policies;return r===this.postureRevision&&u&&typeof u=="object"&&!Array.isArray(u)&&typeof u.sitting=="boolean"&&(this.sittingState=u.sitting),a}async getCapabilities(o={}){return KO(await this._sendCommand({method:Te.getCapabilities,params:null},o))}async subscribeTof(o,r={}){return ZO(await this.request(Te.subscribeTof,o??null,r))}async unsubscribeTof(o={}){return JO(await this.request(Te.unsubscribeTof,null,o))}async startLightFollow(o,r={}){const a=Te.startLightFollow,u=o==null?await this.request(a,null,r):await this.requestControl(a,o,r);return Up(u,!0)}async stopLightFollow(o={}){return Up(await this.request(Te.stopLightFollow,null,o),!1)}async getLightFollowStatus(o={}){return QO(await this.request(Te.getLightFollowStatus,null,o))}async listActions(o={}){return IO(await this.request(Te.listActions,null,o))}async deleteAction(o,r={}){if(typeof o!="string"||!o)throw new _e("INVALID_ARGUMENT","deleteAction 需要非空动作名");return HO(await this.request(Te.deleteAction,{name:o},r),o)}async getConfig(o={}){return BO(await this.request(Te.getConfig,null,o))}async stopAudio(o={}){return cp(await this.request(Te.stopAudio,null,o))}async openAudioOutput(o){this.closeAudioOutput(),o.throwIfAborted();const r=new AbortController,a=this.runtime.createAudioOutput();this.audioAbort=r,this.audioOutput=a;try{this.offAudioLeave=this.onAppExit(()=>this.closeAudioOutput()),await a.open(AbortSignal.any([o,r.signal]))}catch(u){throw this.audioOutput===a&&this.closeAudioOutput(),u}}async writeAudio(o){await this.requireAudioOutput().write(o)}async clearAudioOutput(){await this.requireAudioOutput().clear()}async setAudioVolume(o){await this.requireAudioOutput().setOutputGain(o)}async drainAudioOutput(){await this.requireAudioOutput().drain()}closeAudioOutput(){this.audioAbort?.abort(),this.audioAbort=null,this.audioOutput?.dispose(),this.audioOutput=null,this.offAudioLeave?.(),this.offAudioLeave=null}requireAudioOutput(){if(!this.audioOutput)throw new Error("请先调用 openAudioOutput");return this.audioOutput}onTelemetry(o){if(typeof o!="function")throw new _e("INVALID_ARGUMENT","Expected a state callback");return this.on("robot.state",r=>o($O(r)))}onTof(o){if(typeof o!="function")throw new _e("INVALID_ARGUMENT","需要 ToF 帧回调");return this.on("robot.tof",o)}onFault(o){if(typeof o!="function")throw new _e("INVALID_ARGUMENT","Expected a fault callback");return this.on("robot.fault",r=>o(WO(r)))}request(o,r=null,a={}){return o===Te.relax&&!kp(o,r)&&this.stopRevision++,this._sendCommand({method:o,params:r},a)}on(o,r){return this.runtime.on(o,r)}onAppExit(o){return this.runtime.onAppExit(o)}reportAppState(o){this.runtime.reportAppState(o)}requestAppExit(o){this.runtime.requestAppExit(o)}dispose(){return this.closeAudioOutput(),this.runtime.dispose()}_sendCommand(o,r){return this.runtime.request(o.method,o.params,r)}}function Rs(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:void 0}function iM(n){switch(n){case Te.move:return"move";case Te.head:case Te.look:return"head";case Te.pose:return"pose";case Te.doSkill:return"skill";case Te.setServoJoints:return"servo";case Te.setMode:case Te.init:case Te.enable:return"drive"}}const oM=new Set(["move","head","pose"]),Mv=5e3;class lM{current;mode;stopping=0;revision=0;requestOrder=0;statusOrder=0;servoOrder=0;modeOrder=0;finishSkill(o){const r=this.current;r?.kind!=="skill"||r.skill!==o||(r.pending?r.ended=!0:(this.current=void 0,this.revision++))}async request(o,r,a){this.expireModeChange();const u=this.current,f=u?.pending,d=iM(o),p=qu(o);if(d&&(this.stopping||u&&(u.pending||u.kind!==d||!oM.has(d))))throw new _e("BUSY","已有动作占用,请先结束当前动作");if(this.mode==="direct"&&d&&d!=="servo"&&d!=="drive")throw new _e("BUSY","请先切换到行走或轮滑模式");const h=d?{kind:d,pending:!0}:void 0;if(h){const g=Rs(r);d==="skill"&&typeof g?.skill=="string"&&(h.skill=g.skill),o===Te.setMode&&typeof g?.mode=="string"&&(g.mode==="direct"||this.mode==="direct")&&(h.targetMode=g.mode,h.modeDeadline=performance.now()+Mv),this.current=h,this.revision++}p&&this.stopping++;const b=this.revision,y=++this.requestOrder;try{const g=await a(),w=Rs(g);return o===Te.relax&&w?.accepted===!0?(this.current=void 0,this.revision++):h&&this.current===h?w?.accepted===!1?this.current=u:this.isComplete(h,w)?this.current=void 0:(h.pending=!1,h.targetMode!==void 0&&(h.modeDeadline=performance.now()+Mv)):this.revision===b&&this.current===u&&w&&this.observe(o,w,y,f),g}catch(g){throw h&&this.current===h&&(g instanceof _e&&(g.code==="ABORTED"||g.code==="REQUEST_TIMEOUT"||g.code==="PROTOCOL_ERROR"||/^5\d\d$/.test(g.code))?this.isComplete(h)?this.current=void 0:h.pending=!1:this.current=u),g}finally{p&&this.stopping--}}isComplete(o,r){switch(o.kind){case"drive":return o.targetMode===void 0;case"head":{const a=Rs(r?.head);return!!(a&&["neck_pitch","head_pitch","head_yaw","head_roll"].every(u=>a[u]===0))}case"pose":return Rs(r?.pose)?.active===!1;case"skill":return!!(o.ended||r?.completed===!0||r?.status==="completed"||r?.status==="failed"||r?.status==="cancelled"||r?.status==="timed_out");default:return!1}}observe(o,r,a,u){const f=this.current?.kind;r.accepted===!0&&o===Te.stop&&(f==="move"||f==="skill")&&(this.current=void 0),!u&&(o===Te.getStatus&&a>this.statusOrder?(this.statusOrder=a,this.observeMode(Rs(r.mode)?.mode,a),f==="move"&&r.state==="READY"&&(this.current=void 0),f==="pose"&&r.poseActive===!1&&(this.current=void 0),!this.current&&r.poseActive===!0&&(this.current={kind:"pose",pending:!1})):o===Te.getServoState&&a>this.servoOrder&&(this.servoOrder=a,this.observeMode(r.mode,a),f==="servo"&&r.moving===!1&&(this.current=void 0)))}observeMode(o,r){typeof o!="string"||!o||r<=this.modeOrder||(this.modeOrder=r,this.mode=o,o===this.current?.targetMode&&(this.current=void 0))}expireModeChange(){const o=this.current;o&&!o.pending&&o.modeDeadline!==void 0&&performance.now()>=o.modeDeadline&&(this.current=void 0,this.revision++)}}class rM{listeners=new Map;on(o,r){let a=this.listeners.get(o);a||(a=new Set,this.listeners.set(o,a)),a.add(r);let u=!0;return()=>{u&&(u=!1,a.delete(r),!a.size&&this.listeners.get(o)===a&&this.listeners.delete(o))}}emit(o,r){for(const a of[...this.listeners.get(o)??[]])try{a(structuredClone(r))}catch{console.error("[RaydiculousX-sdk] event listener failed:",o)}}clear(){this.listeners.clear()}}class TS{options;queue=Promise.resolve();sender=null;constructor(o){this.options=o}setOutgoingAudioTrack(o){if(o&&(o.kind!=="audio"||o.readyState==="ended"))return Promise.reject(new TypeError("需要有效的 audio MediaStreamTrack"));const r=this.options.getConnection(),a=this.queue.then(async()=>{if(!r||r!==this.options.getConnection()||r.connectionState!=="connected"||o&&!this.options.hasAudioOut())return!1;const u=r.getTransceivers().find(f=>f.receiver.track.kind==="audio"&&(f.currentDirection==="sendrecv"||f.currentDirection==="sendonly"));return u?(await u.sender.replaceTrack(o),r!==this.options.getConnection()?(await u.sender.replaceTrack(null).catch(()=>{}),!1):(this.sender=u.sender,!0)):!1});return this.queue=a.catch(()=>{}),a}async clearIncomingAudio(){const o=this.options.getConnection();return!this.options.hasAudioOut()||o?.connectionState!=="connected"?!1:(await this.options.clearIncomingAudio?.()??!1)&&o===this.options.getConnection()&&o.connectionState==="connected"}get incomingRobotAudioTrack(){return this.options.getConnection()?.getTransceivers().find(o=>o.receiver.track.kind==="audio"&&(o.currentDirection==="sendrecv"||o.currentDirection==="recvonly"))?.receiver.track??null}async dispose(){await this.queue,await this.sender?.replaceTrack(null).catch(()=>{}),this.sender=null}}async function aM(n,o){o.throwIfAborted();const r=new TS(n),a=new AudioContext({sampleRate:24e3}),u=a.createMediaStreamDestination(),f=a.createGain();f.connect(u);const d=u.stream.getAudioTracks()[0],p=new Set;let h=0,b=!1,y=null;const g=()=>{for(const M of p)M.stop(),M.disconnect();p.clear(),h=a.currentTime},w=()=>y||(b=!0,g(),o.removeEventListener("abort",R),y=(async()=>{await r.dispose(),d.stop(),await a.close()})(),y),R=()=>{w()};o.addEventListener("abort",R,{once:!0});try{let M;try{await Promise.race([a.resume(),new Promise((x,T)=>{M=setTimeout(()=>T(new Error("请先在 页面中启用音频播放")),4e3)})])}finally{clearTimeout(M)}if(o.throwIfAborted(),!await r.setOutgoingAudioTrack(d))throw new Error("机器人音频能力或 WebRTC 音轨尚未就绪");return o.throwIfAborted(),{write(x){if(b||a.state!=="running")throw new Error("页面音频已暂停");if(Math.max(h,a.currentTime)-a.currentTime+x.length/24e3>30)throw new Error("页面音频缓冲超过 30 秒");const T=a.createBuffer(1,x.length,24e3);T.copyToChannel(new Float32Array(x),0);const A=a.createBufferSource();A.buffer=T,A.connect(f),p.add(A),A.onended=()=>{p.delete(A),A.disconnect()};const _=Math.max(h,a.currentTime+.02);A.start(_),h=_+T.duration},clear:g,setOutputGain(x){f.gain.setTargetAtTime(x,a.currentTime,.015)},playing:()=>!b&&h>a.currentTime,close:w}}catch(M){throw await w(),M}}class sM{sink=null;lifetime=new AbortController;closing=null;opening=null;options;beforeOpen;onClose;openDriver;constructor(o,r,a,u=aM){this.options=o,this.beforeOpen=r,this.onClose=a,this.openDriver=u}open(o){return this.lifetime.signal.aborted||o.aborted?Promise.reject(new DOMException("音频初始化已取消","AbortError")):this.opening?this.opening:(this.opening=this.openOnce(o),this.opening)}async openOnce(o){const r=AbortSignal.any([o,this.lifetime.signal]);await this.beforeOpen(),r.throwIfAborted();const a=await this.openDriver(this.options,r);r.aborted&&(await a.close(),r.throwIfAborted()),this.sink=a,r.addEventListener("abort",()=>this.dispose(),{once:!0})}ready(){if(!this.sink||this.lifetime.signal.aborted)throw new Error("音频输出已关闭");return this.sink}async write(o){if(!(o instanceof Float32Array)||!o.length||o.length>24e3||o.some(r=>!Number.isFinite(r)||Math.abs(r)>1))throw new Error("PCM 必须为 1~24000 个 -1~1 的有限 Float32 样本");this.ready().write(o.slice())}async clear(){this.ready().clear()}async setOutputGain(o){if(!Number.isFinite(o))throw new Error("音量必须为有限数");this.ready().setOutputGain(Math.max(0,Math.min(1,o)))}async drain(){const o=Date.now()+35e3;for(;this.ready().playing();){if(Date.now()>=o)throw new Error("音频排程超时");await new Promise(r=>setTimeout(r,50))}}dispose(){this.closing||(this.closing=Promise.resolve().then(async()=>{await this.opening?.catch(()=>{});const o=this.sink;this.sink=null,await o?.close()}),this.onClose(this.closing),this.lifetime.abort())}}function mu(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function cM(n,o,r,a,u){const f=n.ownerDocument,d=f?.defaultView;let p,h,b=1e3,y=!1;function g(){y||f?.hidden||p||h!==void 0||(p=uM(n,o,r,a,R,()=>{b=1e3}))}function w(){try{g()}catch{R(!0)}}function R(A,_=0){if(!y){if(p=void 0,A){const L=Math.max(b,_);b=Math.min(L*2,3e4),h=setTimeout(()=>{h=void 0,w()},L)}else T();n.dispatchEvent(new Event("error"))}}function M(){clearTimeout(h),h=void 0,p?.(),p=void 0}function x(){f.hidden?M():w()}function T(){y||(y=!0,f?.removeEventListener("visibilitychange",x),d?.removeEventListener("pagehide",M),d?.removeEventListener("pageshow",w),M(),u())}f?.addEventListener("visibilitychange",x),d?.addEventListener("pagehide",M),d?.addEventListener("pageshow",w);try{g()}catch(A){throw T(),A}return T}function uM(n,o,r,a,u,f){const d=Yu();let p,h,b,y=!1,g=!1,w=Promise.resolve();const R=[];function M(O){if(!o.sendFrame("video.peer",{requestId:d,targetSN:r,payload:O}))throw new _e("NOT_READY","视频信令未连接","transport")}function x(O){if(!g){if(g=!0,clearTimeout(j),E(),O)try{M({type:"endSession",sessionId:b})}catch{}p&&(p.ontrack=p.onicecandidate=p.onconnectionstatechange=null,p.close()),h&&n.srcObject===h&&(n.srcObject=null)}}function T(O=!0,D=0){g||(x(!0),u(O,D))}function A(O){O.connectionState==="connected"&&h&&(clearTimeout(j),f())}function _(){const O=new RTCPeerConnection({iceServers:a});p=O,O.addTransceiver("video",{direction:"recvonly"}),O.ontrack=({track:D})=>{g||D.kind!=="video"||(h=new MediaStream([D]),n.srcObject=h,n.play().catch(()=>{}),A(O))},O.onicecandidate=({candidate:D})=>{if(!(g||!D?.candidate))try{const z={candidate:D.candidate,sdpMLineIndex:D.sdpMLineIndex};M({type:"peer",sessionId:b,ice:z})}catch{T()}},O.onconnectionstatechange=()=>{["failed","disconnected","closed"].includes(O.connectionState)?T():A(O)}}async function L(O){if(!g&&!(b&&O.sessionId!==void 0&&O.sessionId!==b))switch(O.type){case"list":{if(y)return;const D=Array.isArray(O.producers)&&O.producers[0];if(!mu(D)||typeof D.id!="string"||!D.id)return T(!1);y=!0,M({type:"startSession",peerId:D.id});break}case"sessionStarted":if(!y||p||typeof O.sessionId!="string"||!O.sessionId)return;b=O.sessionId,_();break;case"peer":{if(!p||O.sessionId!==b)return;if(mu(O.sdp)&&O.sdp.type==="offer"&&typeof O.sdp.sdp=="string"){if(await p.setRemoteDescription({type:"offer",sdp:O.sdp.sdp}),g)return;const D=await p.createAnswer();if(g||(await p.setLocalDescription(D),g))return;M({type:"peer",sessionId:b,sdp:D});for(const z of R.splice(0)){if(g)return;await Nv(p,z)}}else if(mu(O.ice)&&typeof O.ice.candidate=="string"&&O.ice.candidate&&typeof O.ice.sdpMLineIndex=="number"){const D={candidate:O.ice.candidate,sdpMLineIndex:O.ice.sdpMLineIndex};p.remoteDescription?await Nv(p,D):R.push(D)}break}case"endSession":case"sessionEnded":case"error":T();break;case"sessionRejected":T(!0,8e3)}}const E=o.onFrame("video.peer",O=>{if(O.requestId!==d||O.from&&(O.from.type!=="device"||O.from.sn!==r))return;const D=O.payload;mu(D)&&(w=w.then(()=>L(D)).catch(()=>T()))}),j=setTimeout(T,3e4);try{M({type:"list"})}catch(O){throw x(!1),O}return()=>x(!0)}async function Nv(n,o){try{await n.addIceCandidate(o)}catch{}}const _v=8*1024,Dv=256*1024;class fM{active=!1;mayReceiveOrphanEnd=!1;channel;constructor(o){this.channel=o}async upload(o,r,a,u){const f=this.channel;if(this.active)throw new _e("BUSY","当前连接正在上传动作");if(f.readyState==="closing"||f.readyState==="closed")throw new _e("UNSUPPORTED","当前连接没有可用的动作上传通道");if(typeof o!="string"||!/^[a-z][a-z0-9_-]{0,31}$/.test(o))throw new _e("INVALID_ARGUMENT","动作名须以小写字母开头,限 1~32 个小写字母、数字、下划线或连字符");if(!r||typeof r.arrayBuffer!="function"||!Number.isSafeInteger(r.size)||r.size<=0||r.size>16*1024*1024)throw new _e("INVALID_ARGUMENT","需要非空且不超过 16 MiB 的动作文件");const{durationS:d}=a;if(d!==void 0&&(!Number.isFinite(d)||d<=0))throw new _e("INVALID_ARGUMENT","durationS 必须为有限正数");const p=Mu(a.timeoutMs??12e4,"timeoutMs"),h=a.signal?AbortSignal.any([u,a.signal]):u;if(h.aborted)throw new _e("ABORTED","上传已取消");if(!globalThis.crypto?.subtle)throw new _e("UNSUPPORTED","上传需要 Web Crypto SHA-256");this.active=!0;const b=new AbortController,y={signal:b.signal},g=f.bufferedAmountLowThreshold;let w=!1,R=!1,M,x,T=0,A;try{return f.bufferedAmountLowThreshold=Dv/2,await new Promise((_,L)=>{const E=(D,z=!1)=>{b.signal.aborted||(b.abort(),w&&z&&f.close(),D instanceof Error?L(D):_(D))},j=()=>{if(!(!M||!x||R||f.readyState!=="open"||b.signal.aborted))try{for(w||(w=!0,f.send(x));T<M.length&&f.bufferedAmount<Dv;){const D=M.subarray(T,T+_v),z=new Uint8Array(4+D.length);new DataView(z.buffer).setUint32(0,T/_v,!1),z.set(D,4),f.send(z),T+=D.length}T===M.length&&(R=!0,f.send('{"op":"end"}'))}catch{E(new _e("CONNECTION_FAILED","无法发送动作文件","transport"),!0)}};f.addEventListener("open",j,y),f.addEventListener("bufferedamountlow",j,y),f.addEventListener("close",()=>E(new _e(w?"CONNECTION_FAILED":"UNSUPPORTED","动作上传通道已关闭","transport")),y),f.addEventListener("error",()=>E(new _e("CONNECTION_FAILED","动作上传通道出错","transport"),!0),y),h.addEventListener("abort",()=>E(new _e("ABORTED","上传已取消"),!0),y),f.addEventListener("message",({data:D})=>{if(w)try{const z=JSON.parse(D);if(!z||z.op!=="result")throw new Error;if(this.mayReceiveOrphanEnd&&z.ok===!1&&z.name==null&&z.error==="no upload in progress"){this.mayReceiveOrphanEnd=!1;return}if(this.mayReceiveOrphanEnd=!1,z.ok===!1&&typeof z.error=="string"){this.mayReceiveOrphanEnd=R,E(new _e("UPLOAD_REJECTED",z.error,"daemon"));return}if(!R||z.ok!==!0||z.name!==o||z.skill!==o||z.sizeBytes!==r.size||!Number.isFinite(z.durationS)||z.durationS<=0)throw new Error;E(z)}catch{E(new _e("INVALID_RESPONSE","无效的动作上传回执"),!0)}},y),A=setTimeout(()=>E(new _e("REQUEST_TIMEOUT","动作上传超时"),!0),p),(async()=>{const D=await r.arrayBuffer();if(b.signal.aborted)return;const z=await crypto.subtle.digest("SHA-256",D);if(b.signal.aborted)return;const q=Array.from(new Uint8Array(z),B=>B.toString(16).padStart(2,"0")).join("");x=JSON.stringify({op:"begin",name:o,size:r.size,sha256:q,durationS:d}),M=new Uint8Array(D),j()})().catch(()=>E(new _e("INVALID_ARGUMENT","读取或校验动作文件失败")))})}finally{b.abort(),clearTimeout(A),f.bufferedAmountLowThreshold=g,this.active=!1}}}const dM="/api/campus-websocket/api/signaling/ice-servers";function jv(n){return!Array.isArray(n)||!n.length?!1:n.every(o=>{if(!o||typeof o!="object")return!1;const r=Array.isArray(o.urls)?o.urls:[o.urls];return r.length>0&&r.every(a=>typeof a=="string"&&(/^stuns?:\S+$/i.test(a)||/^turns?:\S+$/i.test(a)&&typeof o.username=="string"&&typeof o.credential=="string"))})}function hM(n){const o=new URL(n);return o.protocol=o.protocol==="wss:"?"https:":"http:",o.pathname=o.pathname==="/campus-websocket/ws"?"/campus-websocket/api/signaling/ice-servers":dM,o.search="",o.hash="",o.href}async function pM(n,o,r,a){if(r.throwIfAborted(),a){const{iceServers:u,iceExpiresAt:f,iceTtlSeconds:d}=a.payload,p=f!==void 0?Date.parse(f):d!==void 0?a.receivedAt+d*1e3:1/0;if(jv(u)&&p>Date.now())return u}try{const u=await fetch(n,{headers:{jti:o,Authorization:`Bearer ${o}`,Accept:"application/json"},signal:AbortSignal.any([r,AbortSignal.timeout(5e3)]),cache:"no-store",redirect:"error"});if(u.ok){const f=await u.json();if((f?.code===0||f?.code===200)&&f.success!==!1&&jv(f.data?.iceServers)&&(f.data.expiresAt==null||Date.parse(f.data.expiresAt)>Date.now())&&(f.data.ttlSeconds==null||f.data.ttlSeconds>0))return f.data.iceServers}}catch{r.throwIfAborted()}return gf}class zv extends _e{cleanupResult;constructor(o,r){super(o.code,o.message,o.source),this.name="DirectConnectionError",this.cleanupResult=r}}function Cs(n){if(n instanceof _e)return n;if(n instanceof Error&&"code"in n){if(n.name==="RobotRpcError"&&typeof n.code=="number"){const o="data"in n?n.data:void 0,r={};return o&&typeof o=="object"&&("halted"in o&&typeof o.halted=="boolean"&&(r.halted=o.halted),"haltReason"in o&&(o.haltReason===null||typeof o.haltReason=="string")&&(r.haltReason=o.haltReason),"retryable"in o&&typeof o.retryable=="boolean"&&(r.retryable=o.retryable),"recoverable"in o&&typeof o.recoverable=="boolean"&&(r.recoverable=o.recoverable),"reason"in o&&typeof o.reason=="string"&&(r.reason=o.reason),"maxCommandHz"in o&&typeof o.maxCommandHz=="number"&&Number.isFinite(o.maxCommandHz)&&o.maxCommandHz>0&&(r.maxCommandHz=o.maxCommandHz)),new _e(String(n.code),n.message,"daemon",Object.keys(r).length?r:void 0)}if(typeof n.code=="string")return new _e(n.code,n.message,"transport")}return new _e("CONNECTION_FAILED","机器人连接或请求失败","transport")}const mM=4e4,gM=new Set(["INVALID_ARGUMENT","UNSUPPORTED","NOT_READY","BUSY","BACKPRESSURE","TOO_MANY_REQUESTS","SEND_FAILED","-32601","-32602","409","423"]);function AS(n){const o=new URL(n.url);if(!["ws:","wss:"].includes(o.protocol)||o.username||o.password||o.search||o.hash)throw new _e("INVALID_ARGUMENT","信令地址必须为不含凭据的 ws(s) 地址");if(!n.jti?.trim()||!n.sn?.trim())throw new _e("INVALID_ARGUMENT","需要访问凭据与机器人序列号");if(Mu(n.timeoutMs??2e4,"timeoutMs"),Mu(n.cleanupTimeoutMs??5e3,"cleanupTimeoutMs"),n.requestTimeoutMs!==void 0&&Mu(n.requestTimeoutMs,"requestTimeoutMs"),n.theme!==void 0&&!["light","dark"].includes(n.theme))throw new _e("INVALID_ARGUMENT","theme 必须为 light 或 dark");Wi(n.config??{})}class yM{mode="direct";events=new rM;leaveHandlers=new Set;requests=new AbortController;actions=new lM;cleanupTimeout;session=Yu();outputs=new Set;audioClosing=Promise.resolve();detachVideo;uploader;sessionIceServers=gf;module=null;channel=null;conn=null;current;closing=null;closeIncomplete=!1;state="connecting";off=[];resolveReady=null;rejectReady=null;stopConfirmed=!0;lightFollowMayBeRunning=!1;lightFollowRevision=0;options;factories;constructor(o,r={signaling:gO,channel:a=>new UO({connection:a,connectionEpoch:1})}){AS(o),this.options={...o,...o.iceServers?{iceServers:structuredClone(o.iceServers)}:{},...o.config!==void 0?{config:structuredClone(o.config)}:{}},this.factories=r,this.cleanupTimeout=o.cleanupTimeoutMs??5e3,this.current={mode:"direct",appId:o.appId??"standalone",appSessionId:this.session,robotId:o.sn,connectionEpoch:1,connectionState:"connecting",daemonVersion:null,daemonProtocolVersion:null,capabilities:{},stateSnapshot:null,theme:o.theme??"light",config:structuredClone(o.config??{}),limits:{maxMessageBytes:16384,maxPendingRequests:32}}}get context(){return structuredClone(this.current)}get disposed(){return this.state==="leaving"||this.state==="closed"}get closed(){return this.state==="closed"}get rtcConnection(){return this.conn?.pc??null}get incomingRobotAudioTrack(){return new TS(this.audioOptions()).incomingRobotAudioTrack}publish(o){this.current={...this.current,...o};const r=Wi(this.current);this.events.emit("context",r)}async start(){if(this.options.signal?.aborted){const f=await this.dispose();throw new zv(new _e("ABORTED","连接已取消"),f)}const o=new Promise((f,d)=>{this.resolveReady=f,this.rejectReady=d}),r=setTimeout(()=>this.rejectReady?.(new _e("INIT_TIMEOUT","机器人连接超时")),this.options.timeoutMs??2e4),a=()=>{this.rejectReady?.(new _e("ABORTED","连接已取消")),this.state==="ready"&&this.dispose()};this.options.signal?.addEventListener("abort",a,{once:!0}),this.off.push(()=>this.options.signal?.removeEventListener("abort",a)),(async()=>{const f=this.factories.signaling({url:this.options.url,jti:this.options.jti,autoReconnect:!1,...this.options.iceServers?{iceServers:this.options.iceServers}:{}});this.module=f,this.off.push(f.onEstablished(p=>this.established(p))),this.off.push(f.onError(()=>{this.state==="connecting"&&this.rejectReady?.(new _e("CONNECTION_FAILED","无法建立机器人连接","transport"))})),this.off.push(f.onEnded(()=>{this.state==="connecting"&&this.rejectReady?.(new _e("CONNECTION_FAILED","机器人连接中断","transport")),this.state==="ready"&&(this.publish({connectionState:"disconnected",stateSnapshot:null}),this.dispose())}));const d=await f.connectSignaling();if(!this.disposed){if(d.role!=="user")throw new _e("INVALID_ARGUMENT","应用必须使用用户身份连接");this.sessionIceServers=this.options.iceServers??await pM(hM(this.options.url),this.options.jti,this.requests.signal,{payload:d,receivedAt:Date.now()}),!this.disposed&&await f.negotiate(this.options.sn,this.sessionIceServers)}})().catch(f=>this.rejectReady?.(Cs(f)));try{if(await o,this.options.signal?.throwIfAborted(),this.disposed||!this.channel?.isReady())throw new _e("CONNECTION_FAILED","机器人通道已关闭");this.state="ready",this.publish({connectionState:"ready"});const f=()=>{this.channel?.shutdownFast(),this.dispose()};typeof window<"u"&&(window.addEventListener("pagehide",f),this.off.push(()=>window.removeEventListener("pagehide",f)))}catch(f){const d=await this.dispose();throw new zv(Cs(f),d)}finally{clearTimeout(r),this.resolveReady=null,this.rejectReady=null}}established(o){if(this.disposed||this.conn||o.sn!==this.options.sn){o.pc.close(),o.sn!==this.options.sn&&this.rejectReady?.(new _e("CONTEXT_CHANGED","连接设备不匹配"));return}this.conn=o,o.blob&&(this.uploader=new fM(o.blob));const r=this.factories.channel(o);this.channel=r,this.off.push(r.onTelemetry(a=>{if(this.disposed)return;const u=Wi(a.params);this.publish({stateSnapshot:u}),this.events.emit("robot.state",u)})),this.off.push(r.onTof(a=>{this.disposed||this.events.emit("robot.tof",a)})),this.off.push(r.onFault(a=>this.events.emit("robot.fault",Wi(a.params)))),this.off.push(r.onSkill(a=>{this.actions.finishSkill(a.skill),this.events.emit("robot.skill",a)})),this.off.push(r.onAudioError(a=>{this.disposed||this.events.emit("robot.audio.error",Wi(a.params))})),this.off.push(r.onClose(()=>{this.state==="connecting"&&this.rejectReady?.(new _e("CONNECTION_FAILED","机器人通道已关闭")),this.state==="ready"&&(this.publish({connectionState:"disconnected",stateSnapshot:null}),this.dispose())})),r.capabilities().then(()=>{this.publishCapabilities(),this.resolveReady?.()}).catch(a=>{const u=Cs(a);u.code==="REQUEST_TIMEOUT"&&r.isReady()?this.resolveReady?.():this.rejectReady?.(u)})}publishCapabilities(){const o=this.channel?.capabilitiesSnapshot;this.disposed||!o||this.publish({daemonProtocolVersion:o.protocol,capabilities:{move:{supported:!0,schemaVersion:o.protocol},skills:{supported:!0,schemaVersion:o.protocol},status:{supported:!0,schemaVersion:o.protocol},video:{supported:o.hasVideo,schemaVersion:o.protocol},audioOut:{supported:o.hasAudioOut,schemaVersion:o.protocol},audioIn:{supported:o.hasAudioIn,schemaVersion:o.protocol},...o.hasTof===void 0?{}:{tof:{supported:o.hasTof,schemaVersion:o.protocol}},...o.hasLightFollow===void 0?{}:{lightFollow:{supported:o.hasLightFollow,schemaVersion:o.protocol}}}})}assertReady(){if(this.disposed)throw new _e("APP_DISPOSED","应用连接已关闭");if(this.state!=="ready"||!this.channel?.isReady())throw new _e("NOT_READY","机器人连接未就绪")}async request(o,r=null,a={}){if(this.assertReady(),!Object.values(Te).includes(o))throw new _e("UNSUPPORTED","直连应用未开放此设备方法");let u=Wi(r);if(o===Te.doSkill&&(u===null||typeof u!="object"||Array.isArray(u)||u.wait!==void 0&&typeof u.wait!="boolean"))throw new _e("INVALID_ARGUMENT","技能参数无效");if((o===Te.getConfig||o===Te.listActions||o===Te.stopAudio||o===Te.stop||o===Te.relax||o===Te.reset||o===Te.getStatus||o===Te.getCapabilities||o===Te.getServoState||o===Te.unsubscribeTof||o===Te.stopLightFollow||o===Te.getLightFollowStatus)&&u!==null){if(typeof u!="object"||Array.isArray(u)||Object.keys(u).length>0)throw new _e("INVALID_ARGUMENT","此方法不接受参数");u=null}const f=a.signal?AbortSignal.any([a.signal,this.requests.signal]):this.requests.signal,d=a.timeoutMs??this.options.requestTimeoutMs;if(f.aborted)throw new _e("ABORTED","请求已取消","transport");const p=o===Te.startLightFollow,h=o===Te.stopLightFollow,b=this.lightFollowMayBeRunning,y=p||h||o===Te.getLightFollowStatus?++this.lightFollowRevision:void 0;try{const g=await this.actions.request(o,u,async()=>{gS(o)&&(this.stopConfirmed=!1),p&&(this.lightFollowMayBeRunning=!0);try{return await this.channel.request(o,u===null?void 0:u,{context:{appId:this.current.appId,requestId:Yu(),appSessionId:this.session,connectionEpoch:1,robotId:this.options.sn,signal:f},...d!==void 0?{timeoutMs:d}:{}})}catch(w){throw Cs(w)}});return o===Te.getCapabilities&&this.publishCapabilities(),y===this.lightFollowRevision&&!p&&g&&typeof g=="object"&&!Array.isArray(g)&&g.running===!1&&(h?g.accepted===!0:typeof g.installed=="boolean")&&(this.lightFollowMayBeRunning=!1),qu(o)&&g&&typeof g=="object"&&!Array.isArray(g)&&g.accepted===!0&&(this.stopConfirmed=!0),o===Te.getConfig?g:Wi(g)}catch(g){const w=Cs(g);throw p&&y===this.lightFollowRevision&&gM.has(w.code)&&(this.lightFollowMayBeRunning=b),w}}on(o,r){if(this.disposed)throw new _e("APP_DISPOSED","应用连接已关闭");if(!o||o.length>256||typeof r!="function")throw new _e("INVALID_ARGUMENT","事件参数无效");return this.events.on(o,r)}onAppExit(o){if(this.disposed)throw new _e("APP_DISPOSED","应用连接已关闭");if(typeof o!="function")throw new _e("INVALID_ARGUMENT","需要清理回调");return this.leaveHandlers.add(o),()=>{this.leaveHandlers.delete(o)}}reportAppState(o){this.assertReady(),this.options.onAppState?.(Wi(o))}requestAppExit(o="app-request"){if(!o||o.length>1024)throw new _e("INVALID_ARGUMENT","离场原因无效");this.options.onLeaveRequested?this.options.onLeaveRequested(o):this.dispose()}audioOptions(){return{getConnection:()=>this.rtcConnection,hasAudioOut:()=>this.channel?.capabilitiesSnapshot?.hasAudioOut===!0&&!this.disposed}}uploadAction(o,r,a){if(this.assertReady(),!this.uploader)throw new _e("UNSUPPORTED","设备连接没有动作上传通道");return this.uploader.upload(o,r,a,this.requests.signal)}bindRobotVideo(o){if(this.assertReady(),!o||o.localName!=="video"||typeof o.play!="function")throw new _e("INVALID_ARGUMENT","需要 HTMLVideoElement");const r=this.channel?.capabilitiesSnapshot;if(!this.module||!r?.hasVideo||r.video?.signaling!=="hub"||r.video.transport!=="webrtc")throw new _e("UNSUPPORTED","设备未提供中枢 WebRTC 视频流");return this.detachVideo?.(),this.detachVideo=cM(o,this.module,this.options.sn,this.sessionIceServers,()=>{this.detachVideo=void 0}),this.detachVideo}createAudioOutput(){this.assertReady();const o=new sM(this.audioOptions(),()=>this.audioClosing,r=>{this.audioClosing=Promise.all([this.audioClosing,r]).then(()=>{}),this.audioClosing.catch(()=>{}),this.outputs.delete(o)});return this.outputs.add(o),o}dispose(){return this.closing&&!this.closeIncomplete?this.closing:(this.closeIncomplete=!1,this.state="leaving",this.rejectReady?.(new _e("ABORTED","连接初始化已结束")),this.requests.abort(),this.closing=this.cleanup(),this.closing)}async cleanup(){const o=this.lightFollowMayBeRunning,r=o&&this.options.cleanupTimeoutMs===void 0?mM:this.cleanupTimeout,a={reason:"dispose",deadline:Date.now()+r};this.detachVideo?.();for(const d of this.outputs)d.dispose();let u,f="complete";try{const d=Promise.allSettled([...[...this.leaveHandlers].map(p=>Promise.resolve().then(()=>p(a))),this.audioClosing,this.channel?.closeSession({appSessionId:this.session}).then(()=>{this.stopConfirmed=!0}),o?this.stopLightFollowForCleanup(r):void 0]).then(p=>{if(p.some(h=>h.status==="rejected"))throw new _e("CLEANUP_FAILED","应用清理未完成")});await Promise.race([d,new Promise((p,h)=>{u=setTimeout(()=>h(new _e("CLEANUP_TIMEOUT","应用清理超时")),r)})])}catch(d){f=d instanceof _e&&d.code==="CLEANUP_TIMEOUT"?"timeout":"failed"}finally{clearTimeout(u),this.stopConfirmed||this.channel?.shutdownFast();for(const d of this.off.splice(0))d();this.channel?.dispose(),this.channel=null,this.conn=null;try{await this.module?.disconnectSignaling(),this.module=null}catch{f="failed",this.closeIncomplete=!0}this.publish({connectionState:"disconnected",stateSnapshot:null}),this.events.clear(),this.leaveHandlers.clear(),this.state=this.closeIncomplete?"leaving":"closed"}return f}async stopLightFollowForCleanup(o){const r=await this.channel?.request(Te.stopLightFollow,void 0,{timeoutMs:Math.min(o,12e4)});Up(r,!1),this.lightFollowMayBeRunning=!1}}let ki=null;function bM(n){try{if(AS(n),ki?.runtime.closed&&(ki=null),ki?.runtime.disposed)throw new _e("BUSY","请等待上一连接清理完成");const o=JSON.stringify([n.url,n.jti,n.sn,n.iceServers,n.timeoutMs,n.requestTimeoutMs,n.cleanupTimeoutMs,n.appId,n.theme,n.config]);if(ki){if(ki.key!==o||ki.options.signal!==n.signal||ki.options.onAppState!==n.onAppState||ki.options.onLeaveRequested!==n.onLeaveRequested)throw new _e("BUSY","当前页面已有其他机器人连接,请先完成 dispose");return ki.promise}const r=new yM(n),a={key:o,options:{...n},runtime:r,promise:r.start().then(()=>{const u=new nM(r);return a.robot=u,u}).catch(u=>{throw ki===a&&r.closed&&(ki=null),u})};return ki=a,a.promise}catch(o){return Promise.reject(o)}}const RS="microbotx-direct-bootstrap",CS=1;function Lv(n,o,r={}){return{source:RS,version:CS,type:n,nonce:o,...r}}function kv(n){if(!n||typeof n!="object")return!1;const o=n;return o.source===RS&&o.version===CS&&typeof o.type=="string"&&typeof o.nonce=="string"&&/^[a-zA-Z0-9-]{16,128}$/.test(o.nonce)}function OS(n){return OO(n)}function vM(n,o){if(!n||typeof n!="object")throw new Error("缺少直连启动凭据");const r=n;if(typeof r.url!="string"||typeof r.jti!="string"||!r.jti||r.jti.length>8192||typeof r.sn!="string"||!r.sn||r.sn.length>256)throw new Error("直连启动凭据格式错误");const a=new URL(r.url);if(!["ws:","wss:"].includes(a.protocol)||a.username||a.password||a.search||a.hash)throw new Error("信令地址必须是不含凭据的 WS(S) 地址");const u={url:a.href,jti:r.jti,sn:r.sn},f=r.appId;if(f!==void 0){if(typeof f!="string"||!f.trim()||f.length>256)throw new Error("应用标识无效");u.appId=f}if(r.iceServers!==void 0){if(!Array.isArray(r.iceServers))throw new Error("ICE 配置无效");Wi(r.iceServers),u.iceServers=structuredClone(r.iceServers)}for(const d of["timeoutMs","requestTimeoutMs","cleanupTimeoutMs"]){const p=r[d];if(p!==void 0){if(!Number.isFinite(p)||p<=0)throw new Error(`${d} 必须为正的有限毫秒数`);u[d]=p}}if(r.theme!==void 0){if(r.theme!=="light"&&r.theme!=="dark")throw new Error("主题无效");u.theme=r.theme}return r.config!==void 0&&(Wi(r.config),u.config=structuredClone(r.config)),u}function MS(n,o){const r=n??o;if(!Number.isFinite(r)||r<=0||r>3e5)throw new Error("超时必须为 1~300000 毫秒");return r}const gu=new WeakMap;function SM(n={}){const o=n.window??window;if(o.parent===o)return Promise.reject(new Error("请先通过 mountAppShell 或商店启动应用"));const r=OS(n.expectedHostOrigin??o.location.origin),a=MS(n.timeoutMs,45e3),u=gu.get(o);if(u)return u.origin!==r||u.signal!==n.signal||u.timeoutMs!==a||u.onPlatformCredential!==n.onPlatformCredential?Promise.reject(new Error("同一应用窗口不能同时使用不同启动配置")):u.promise;const f={origin:r,signal:n.signal,timeoutMs:a,onPlatformCredential:n.onPlatformCredential,promise:void 0};gu.set(o,f);const d=()=>{gu.get(o)===f&&gu.delete(o)};try{f.promise=wM({...n,window:o,expectedHostOrigin:r,timeoutMs:a},bM,d)}catch(p){d(),f.promise=Promise.reject(p)}return f.promise}function wM(n,o,r=()=>{}){const a=n.window??window;if(a.parent===a)return Promise.reject(new Error("请先通过 mountAppShell 或商店启动应用"));const u=OS(n.expectedHostOrigin??a.location.origin),f=MS(n.timeoutMs,45e3),d=Yu(),p=new AbortController;let h=null,b=null,y=null,g=null,w=null,R=!1,M=!1,x="complete",T=Date.now(),A,_,L,E,j;const O=new Promise((H,X)=>{E=H,j=X});function D(H,X={}){h?.postMessage(Lv(H,d,X))}function z(H){clearInterval(A),clearTimeout(_),clearInterval(L),a.removeEventListener("message",te),a.removeEventListener("pagehide",P),n.signal?.removeEventListener("abort",V),h?.close(),h=null,H&&r()}function q(H){M||(M=!0,j(H))}function B(){return w||(p.abort(),q(new Error("应用启动已取消")),w=(async()=>{if(!b&&g){try{b=await g}catch(X){G(X)}b&&!y&&(y=b.dispose.bind(b))}let H=x;try{y&&(H=await y())}catch{H="failed"}return D("closed",{result:H}),z(H==="complete"),H})(),w)}function V(){q(new Error("应用初始化已取消")),B()}function G(H){H&&typeof H=="object"&&"cleanupResult"in H&&(H.cleanupResult==="failed"||H.cleanupResult==="timeout")&&(x=H.cleanupResult)}function P(){B()}function Y(H){const X=H.data;!kv(X)||X.nonce!==d||(T=Date.now(),X.type==="ping"?D("pong"):X.type==="leave"&&B())}function te(H){const X=H.data;R||p.signal.aborted||!kv(X)||X.nonce!==d||H.source!==a.parent||H.origin!==u||X.type!=="init"||H.ports.length===1&&(R=!0,clearInterval(A),a.removeEventListener("message",te),h=H.ports[0],h.onmessage=Y,h.onmessageerror=()=>{B()},h.start(),T=Date.now(),L=setInterval(()=>{Date.now()-T>1e4&&B()},2e3),(async()=>{try{const J=vM(X.credentials);if(g=o({...J,iceServers:J.iceServers??gf,signal:p.signal,onAppState:K=>D("state",{state:K}),onLeaveRequested:K=>D("leave-request",{reason:K})}),b=await g,y=b.dispose.bind(b),p.signal.aborted){await B();return}b.dispose=B,b.onAppExit(()=>{queueMicrotask(()=>{B()})}),n.onPlatformCredential?.(J.jti),clearTimeout(_),n.signal?.removeEventListener("abort",V),M=!0,D("ready"),E(b)}catch(J){G(J),q(new Error("机器人直连初始化失败,请检查登录、设备和信令配置")),p.signal.aborted||D("error"),B()}})())}a.addEventListener("message",te),a.addEventListener("pagehide",P),n.signal?.addEventListener("abort",V,{once:!0}),_=setTimeout(()=>{q(new Error("应用启动超时")),B()},f);const U=()=>a.parent.postMessage(Lv("ready",d),u);return n.signal?.aborted?V():(A=setInterval(U,250),U()),O}const xM="1.0.0",EM=S.forwardRef(function(o,r){const{render:a,className:u,disabled:f=!1,focusableWhenDisabled:d=!1,nativeButton:p=!0,style:h,...b}=o,{getButtonProps:y,buttonRef:g}=Sr({disabled:f,focusableWhenDisabled:d,native:p});return Lt("button",o,{state:{disabled:f},ref:[r,g],props:[b,y]})});function NS(n){var o,r,a="";if(typeof n=="string"||typeof n=="number")a+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(o=0;o<u;o++)n[o]&&(r=NS(n[o]))&&(a&&(a+=" "),a+=r)}else for(r in n)n[r]&&(a&&(a+=" "),a+=r);return a}function TM(){for(var n,o,r=0,a="",u=arguments.length;r<u;r++)(n=arguments[r])&&(o=NS(n))&&(a&&(a+=" "),a+=o);return a}const Uv=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,Iv=TM,pm=(n,o)=>r=>{var a;if(o?.variants==null)return Iv(n,r?.class,r?.className);const{variants:u,defaultVariants:f}=o,d=Object.keys(u).map(b=>{const y=r?.[b],g=f?.[b];if(y===null)return null;const w=Uv(y)||Uv(g);return u[b][w]}),p=r&&Object.entries(r).reduce((b,y)=>{let[g,w]=y;return w===void 0||(b[g]=w),b},{}),h=o==null||(a=o.compoundVariants)===null||a===void 0?void 0:a.reduce((b,y)=>{let{class:g,className:w,...R}=y;return Object.entries(R).every(M=>{let[x,T]=M;return Array.isArray(T)?T.includes({...f,...p}[x]):{...f,...p}[x]===T})?[...b,g,w]:b},[]);return Iv(n,d,h,r?.class,r?.className)},_S=48,go=(n,o=0)=>{const r=new Int32Array(n.length);for(let a=0;a<n.length;a++)r[a]=n.charCodeAt(a)-_S-o;return r},yf=n=>{const o=new Int32Array(n.length+1);for(let r=0;r<n.length;r++)o[r+1]=o[r]+n[r];return o},Ol=n=>{const o=new Int32Array(n.length);let r=0;for(let a=0;a<n.length;a++){const u=n.charCodeAt(a)-_S;r+=u>>>1^-(u&1),o[a]=r}return o},AM=384,RM=[],hr=yf(go("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),CM=yf(go(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),OM="@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",MM=(()=>{const n=hr.length-1,o=new Int32Array(n);for(let u=n-1;u>=0;u--){let f=1,d=u+1;for(let p=hr[u];p<hr[u+1];p++)f+=o[d],d+=o[d];o[u]=f}const r=new Int32Array(hr[n]);let a=0;for(let u=0;u<n;u++){let f=u+1;for(let d=hr[u];d<hr[u+1];d++)r[a++]=f,f+=o[f]}return r})(),NM=go("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),_M=yf(go("123333359346463635126536711576")),DM=go("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),jM=go("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),zM=Ol("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),LM=(()=>{const n=new Int32Array(319).fill(-1),o=Ol("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),r=Ol("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let a=0;a<o.length;a++)n[o[a]]=r[a];return n})(),kM="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map(n=>{const o=n.split(" "),r=o.shift();for(let a=0;a<o.length;a++)o[a]=r+o[a];return o}),Hv=Ol("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),UM=Ol("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),IM=Ol("02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}€22ƒ†…:22z22222222222G000q†OVI00000{˜2™<40000Œ›@00000G¦§000ª00000000000000021K¬«00®“000000000000000000000–222›HGH_1¸222½2¾2222ÇÊ000­°2±"),DS=new Int32Array(987),jS=new Int32Array(987),zS=new Int32Array(987);let Ip="";const Hp=new Int32Array(1022);{const n=new Map;let o=0,r=0;for(let a=0;a<Hv.length;a++)for(const u of kM[IM[a]]){let f=n.get(u);f===void 0&&(f=o++,n.set(u,f),Hp[f*2]=Ip.length,Hp[f*2+1]=u.length,Ip+=u),DS[r]=Hv[a],jS[r]=UM[a],zS[r]=f,r++}}const HM=Ol("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),BM=yf(go("1::24444432:442:44:44>222222:44:4421322511111311111114")),VM=Ol("2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222"),qM=go("ij"),YM=go("—"),FM=go("1"),GM="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var PM={GROUP_COUNT:AM,customValidatorNames:RM,edgeStart:hr,labelStart:CM,labelText:OM,edgeTarget:MM,nodeGroup:NM,nodeVlist:LM,vlistPat:_M,vlistOps:DM,vlistRef:jM,vlistGroup:zM,litAnchor:DS,litGroup:jS,litPool:zS,poolOffsets:Hp,poolText:Ip,adjGid:HM,adjStart:BM,adjTgt:VM,patGid:qM,patTgt:YM,postfixLookupGroups:FM,orderSensitiveModifiers:GM};const XM="line"in new Error,fo=-1,ur=-1,up=(n,o,r)=>{let a=2166136261;for(let u=o;u<r;u++)a=Math.imul(a^n.charCodeAt(u),16777619);return a},Nu=(n,o,r)=>{const a=r-o;let u=Math.imul(a,2654435761)^n.charCodeAt(o);if(a>3){const f=a>>2,d=a>>1;u=Math.imul(u^n.charCodeAt(o+1)<<8^n.charCodeAt(o+2)<<16^n.charCodeAt(o+f),2246822507),u=Math.imul(u^n.charCodeAt(o+d)<<8^n.charCodeAt(o+d+f)<<16^n.charCodeAt(r-3),3266489909),u^=n.charCodeAt(r-2)<<8^n.charCodeAt(r-1)<<16;for(let p=o+3,h=r-4;p<o+8&&p<h;p++,h--)u=Math.imul(u^n.charCodeAt(p)^n.charCodeAt(h)<<8,16777619)}return u^u>>>15|0},KM=(n,o,r={})=>{const{GROUP_COUNT:a,edgeStart:u,labelStart:f,labelText:d,edgeTarget:p,nodeGroup:h,nodeVlist:b,vlistPat:y,vlistOps:g,vlistRef:w,vlistGroup:R,litAnchor:M,litGroup:x,litPool:T,poolOffsets:A,poolText:_,adjGid:L,adjStart:E,adjTgt:j,patGid:O,patTgt:D,postfixLookupGroups:z,customValidatorNames:q,orderSensitiveModifiers:B}=n,V=new Int32Array(a).fill(-1);for(let le=0;le<L.length;le++)V[L[le]]=le;let G=0;for(let le=0;le+1<E.length;le++){const be=E[le+1]-E[le];be>G&&(G=be)}let P=32;for(;P<2*(1+G+O.length);)P<<=1;const Y=new Int32Array(w.length+1);for(let le=0;le<w.length;le++)Y[le+1]=Y[le]+y[w[le]+1]-y[w[le]];const te=new Uint8Array(a);for(let le=0;le<z.length;le++)te[z[le]]=1;const U=u.length-1,H=new Uint8Array(U);let X=0,J=!0;for(let le=0;le<M.length;le++){H[M[le]]=1;const be=A[T[le]*2+1];be>X&&(X=be);const ve=_.charCodeAt(A[T[le]*2]);(ve===91||ve===40)&&(J=!1)}let K=1;for(;K<M.length*2;)K<<=1;const ye=new Int32Array(K).fill(-1);for(let le=0;le<M.length;le++){const be=A[T[le]*2];let ve=(up(_,be,be+A[T[le]*2+1])^Math.imul(M[le],2654435761)|0)&K-1;for(;ye[ve]!==-1;)ve=ve+1&K-1;ye[ve]=le}const fe=(le,be,ve,He)=>{let Ke=(up(be,ve,He)^Math.imul(le,2654435761)|0)&K-1;const Ge=He-ve;for(;;){const We=ye[Ke];if(We===-1)return-1;if(M[We]===le&&A[T[We]*2+1]===Ge){const Mt=A[T[We]*2];let wt=!0;for(let qe=0;qe<Ge;qe++)if(_.charCodeAt(Mt+qe)!==be.charCodeAt(ve+qe)){wt=!1;break}if(wt)return x[We]}Ke=Ke+1&K-1}},se=r.cacheSize??8192,N=r.prefix??n.prefix??"",I=N===""?"":N+":",Q=I.length,$=(q??[]).map(le=>{throw new Error("cn: missing validator "+le)}),ce=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,de=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,me=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let ae=0,Re=-1,we=-1,Ce=-1,je=-1;const Se=le=>le>=97&&le<=122||le>=65&&le<=90||le>=48&&le<=57||le===95,Ne=le=>/\s/.test(String.fromCharCode(le)),Ee=(le,be,ve)=>{if(ae=0,Re=-1,ve-be<3)return;const He=le.charCodeAt(be),Ke=le.charCodeAt(ve-1);if(He===91&&Ke===93)ae=1;else if(He===40&&Ke===41)ae=2;else return;Ce=be+1,je=ve-1;let Ge=be+1;if(Se(le.charCodeAt(Ge))){for(Ge++;Ge<ve-1;){const We=le.charCodeAt(Ge);if(!Se(We)&&We!==45)break;Ge++}Ge<ve-2&&le.charCodeAt(Ge)===58&&(Re=be+1,we=Ge,Ce=Ge+1)}},Ue=(le,be,ve,He)=>{if(ve-be!==He.length)return!1;for(let Ke=0;Ke<He.length;Ke++)if(le.charCodeAt(be+Ke)!==He.charCodeAt(Ke))return!1;return!0},xe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$e=le=>!!le&&!Number.isNaN(Number(le)),ft=(le,be,ve)=>{if(ve-be<11||!Ue(le,be,be+10,"@container"))return!1;if(le.charCodeAt(be+10)===47)return ve-be>=12;const He=le.charCodeAt(be+11);return He===115&&ve-be>=17&&Ue(le,be+10,be+16,"-size/")||He===110&&ve-be>=19&&Ue(le,be+10,be+18,"-normal/")},ue=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ge="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map(le=>le.split(" ")),Fe=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Ae=(le,be,ve,He)=>{if(le>=10){if(le>=25)return $[le-25](be.slice(ve,He));const Ke=le-10;if(ae!==ue[Ke])return!1;if(Re>=0){for(const Ge of ge[Ke])if(Ue(be,Re,we,Ge))return!0;return!1}switch(Fe[Ke]){case 0:return!1;case 1:return!0;case 2:{const Ge=be.slice(Ce,je);return ce.test(Ge)&&!ie.test(Ge)}case 3:return $e(be.slice(Ce,je));case 4:return me.test(be.slice(Ce,je));default:return de.test(be.slice(Ce,je))}}switch(le){case 0:return!0;case 1:return ae===0;case 2:return ae===1;case 3:return ae===2;case 4:return xe.test(be.slice(ve,He));case 5:return $e(be.slice(ve,He));case 6:{const Ke=be.slice(ve,He);return!!Ke&&Number.isInteger(Number(Ke))}case 7:return He>ve&&be.charCodeAt(He-1)===37&&$e(be.slice(ve,He-1));case 8:return Ie.test(be.slice(ve,He));default:return ft(be,ve,He)}},Me=new Set(typeof B=="string"?B.split(" "):B),Ct=(le,be,ve,He,Ke,Ge)=>{const We=up(be,ve,He)^(Ke?2654435769:0)|0;let Mt=le.get(We);if(Mt!==void 0)e:for(let Qe=0;Qe<Mt.length;Qe++){const gt=Mt[Qe];if(!(gt.imp!==Ke||gt.k.length!==He-ve)){for(let Ve=0;Ve<gt.k.length;Ve++)if(gt.k.charCodeAt(Ve)!==be.charCodeAt(ve+Ve))continue e;return gt.id}}else le.set(We,Mt=[]);const wt=be.slice(ve,He),qe=Ge(wt);return Mt.push({k:wt,imp:Ke,id:qe}),qe};let yt=new Map,ut=new Map,Dt=2;const an=4096,$n=(le,be)=>{const ve=[];let He=0,Ke=0,Ge=0;for(let qe=0;qe<le.length;qe++){const Qe=le.charCodeAt(qe);He===0&&Ke===0&&Qe===58?(ve.push(le.slice(Ge,qe)),Ge=qe+1):Qe===91?He++:Qe===93?He--:Qe===40?Ke++:Qe===41&&Ke--}ve.push(le.slice(Ge));let We=ve[0];if(ve.length>1){const qe=[];let Qe=[];for(const gt of ve)gt.charCodeAt(0)===91||Me.has(gt)?(Qe.length&&(qe.push(...Qe.sort()),Qe=[]),qe.push(gt)):Qe.push(gt);Qe.length&&qe.push(...Qe.sort()),We=qe.join(":")}const Mt=be?We+" !":We;let wt=ut.get(Mt);return wt===void 0&&ut.set(Mt,wt=Dt++),wt};let kn=new Map,sn=a;const qn=a+4096,Ot=()=>sn++,Un=2097152,Et=8192,mn=new Int32Array(Et),Vt=new Array(Et).fill(null),Yn=new Int32Array(Et),si=new Int32Array(Et),tt=new Uint8Array(Et);let on=0;const Ft=(le,be,ve,He,Ke,Ge,We,Mt)=>{let wt=le;if(Vt[le]!==null)if(Vt[le|1]===null)wt=le|1;else if((on++&3)===0)wt=le|on>>2&1;else return;Vt[wt]=be.slice(ve,He),mn[wt]=Ke,Yn[wt]=Ge,si[wt]=We,tt[wt]=Mt},dt=()=>Vt.fill(null);let vt=256,mt=[new Int32Array(vt),new Int32Array(vt),new Int32Array(vt),new Int32Array(vt)],[Fn,Pe,bt,kt]=mt,Wt=new Uint8Array(vt),Qt=new Uint8Array(vt);const bn=()=>{vt*=2,mt=mt.map(be=>{const ve=new Int32Array(vt);return ve.set(be),ve}),[Fn,Pe,bt,kt]=mt;const le=new Uint8Array(vt);le.set(Wt),Wt=le,Qt=new Uint8Array(vt)};let vn=64,An=new Int32Array(vn),Ti=new Int32Array(vn);const Bo=new Int32Array(a);let Yi=2048,wr=21,bo=new Float64Array(Yi),xr=new Int32Array(Yi),Fi=0;const Er=(le,be)=>{if(le===0&&be<a)return Bo[be]===Fi?1:(Bo[be]=Fi,0);const ve=le*2097152+be+1;let He=Math.imul(ve,2654435761)>>>wr;for(;xr[He]===Fi;){if(bo[He]===ve)return 1;He=He+1&Yi-1}return bo[He]=ve,xr[He]=Fi,0},Dl=(le,be,ve,He,Ke)=>{if(ve-be>=2&&le.charCodeAt(be)===91&&le.charCodeAt(ve-1)===93){let Ge=-1;for(let We=be+1;We<ve-1;We++)if(le.charCodeAt(We)===58){Ge=We;break}return Ge===-1||Ge===be+1?fo:Ct(kn,le,be+1,Ge,0,Ot)}if(He>=0&&h[He]>=0)return h[He];for(let Ge=Ke-1;Ge>=0;Ge--){const We=Ti[Ge];if(We>ve)continue;const Mt=An[Ge],wt=ve-We;if(H[Mt]===1&&wt>0&&wt<=X){const Jt=le.charCodeAt(We);if(J===!1||Jt!==91&&Jt!==40){const ui=fe(Mt,le,We,ve);if(ui>=0)return ui}}const qe=b[Mt];if(qe<0)continue;const Qe=w[qe],gt=y[Qe],Ve=y[Qe+1];if(gt===Ve)continue;Ee(le,We,ve);const gn=Y[qe]-gt;for(let Jt=gt;Jt<Ve;Jt++)if(Ae(g[Jt],le,We,ve))return R[gn+Jt]}return fo},Vo=le=>{const be=le.length;let ve=0,He=0,Ke=!1;(Dt>an||yt.size>an)&&(yt=new Map,ut=new Map,Dt=2,dt()),sn>qn&&(kn=new Map,sn=a,dt());let Ge=0;for(;Ge<be;){let qe=le.charCodeAt(Ge);if(qe===32||qe>=9&&qe<=13||qe>=160&&Ne(qe)){qe!==32&&(Ke=!0),Ge++;continue}const Qe=Ge;let gt=0;for(;Ge<be;){if(qe=le.charCodeAt(Ge),qe<=32){if(qe===32)break;if(qe>=9&&qe<=13){Ke=!0;break}}else if(qe>=160&&Ne(qe)){Ke=!0;break}gt=Math.imul(gt^qe,16777619),Ge++}const Ve=Ge,gn=Ve-Qe;ve===vt&&bn();const Jt=ve++;Fn[Jt]=Qe,Pe[Jt]=Ve,He+=gn,gt^=Math.imul(gn,2654435761);const ui=gt^gt>>>15|0,cn=ui&8190;{let ht=-1;if(mn[cn]===ui&&Vt[cn]!==null&&Vt[cn].length===gn?ht=cn:mn[cn|1]===ui&&Vt[cn|1]!==null&&Vt[cn|1].length===gn&&(ht=cn|1),ht>=0){const Sn=Vt[ht];let Ci=!0;for(let hi=0;hi<gn;hi++)if(Sn.charCodeAt(hi)!==le.charCodeAt(Qe+hi)){Ci=!1;break}if(Ci){bt[Jt]=Yn[ht],kt[Jt]=si[ht],Wt[Jt]=tt[ht];continue}}}let un=Qe;if(Q!==0){if(Ve-Qe<=Q||!le.startsWith(I,Qe)){bt[Jt]=fo,Ft(cn,le,Qe,Ve,ui,fo,0,0);continue}un=Qe+Q}let Or=0,Ma=0,vo=-1,Mr=-1;for(let ht=un;ht<Ve;ht++){const Sn=le.charCodeAt(ht);if(Or===0&&Ma===0){if(Sn===58){vo=ht;continue}if(Sn===47){Mr=ht;continue}}Sn===91?Or++:Sn===93?Or--:Sn===40?Ma++:Sn===41&&Ma--}const Ys=vo>=un?vo+1:un;let qt=Ys,In=Ve,Yo=!1,Nr=0;In>qt&&le.charCodeAt(In-1)===33?(Yo=!0,In--):In>qt&&le.charCodeAt(qt)===33&&(Yo=!0,qt++,Nr=1);let Wn=-1;Mr>Ys&&(Wn=Mr+Nr,Wn>=In&&(Wn=-1));let _r=qt;In-qt>1&&le.charCodeAt(qt)===45&&(_r=qt+1);let fi=0,Gn=0,Fo=0,Na=-1,di=0;(b[0]>=0||H[0]===1)&&(An[0]=0,Ti[0]=_r,di=1);let kl=ur,_a=0;for(let ht=_r;ht<In;ht++)if(ht===Wn&&(kl=Gn<Fo?ur:fi,_a=di),fi!==ur){const Sn=le.charCodeAt(ht);let Ci=-1;if(Gn<Fo)d.charCodeAt(Gn)===Sn?(Gn++,Gn===Fo&&(Ci=fi=Na)):fi=ur;else{const hi=u[fi],Hl=u[fi+1];let So=ur;for(let On=hi;On<Hl;On++){const Bl=f[On];if(d.charCodeAt(Bl)===Sn){f[On+1]-Bl===1?Ci=So=p[On]:(Gn=Bl+1,Fo=f[On+1],Na=p[On],So=fi);break}}fi=So}if(Ci>=0&&(b[Ci]>=0||H[Ci]===1)&&ht+1<In&&le.charCodeAt(ht+1)===45){if(di===vn){vn*=2;const hi=new Int32Array(vn);hi.set(An),An=hi;const Hl=new Int32Array(vn);Hl.set(Ti),Ti=Hl}An[di]=Ci,Ti[di]=ht+2,di++}}Wn===In&&(kl=Gn<Fo?ur:fi,_a=di);const Da=Gn<Fo?ur:fi;let Cn,Pn=!1;if(Wn>=0)if(Pn=!0,Cn=Dl(le,qt,Wn,kl,_a),Cn!==fo&&Cn<a&&te[Cn]){const ht=Dl(le,qt,In,Da,di);ht!==fo&&ht!==Cn&&(Cn=ht,Pn=!1)}else Cn===fo&&(Cn=Dl(le,qt,In,Da,di),Pn=!1);else Cn=Dl(le,qt,In,Da,di);let Ul=0,Il=0;Cn===fo?bt[Jt]=fo:(Il=Pn?1:0,Ul=un>=vo?Yo?1:0:Ct(yt,le,un,vo,Yo?1:0,ht=>$n(ht,Yo)),bt[Jt]=Cn,Wt[Jt]=Il,kt[Jt]=Ul),Ft(cn,le,Qe,Ve,ui,Cn,Ul,Il)}if(ve===0)return"";if(ve===1)return Fn[0]===0&&Pe[0]===be?le:le.slice(Fn[0],Pe[0]);if(ve*P>Yi){for(;ve*P>Yi;)Yi<<=1,wr--;bo=new Float64Array(Yi),xr=new Int32Array(Yi)}if(Dt>=Un||sn>=Un)throw new Error("cn: too many distinct classes in one merge");Fi=Fi+1|0,Fi===0&&(Bo.fill(0),xr.fill(0),Fi=1);let We=!1;for(let qe=ve-1;qe>=0;qe--){const Qe=bt[qe];if(Qe===fo){Qt[qe]=1;continue}const gt=kt[qe];if(Er(gt,Qe)===1){Qt[qe]=0,We=!0;continue}if(Qt[qe]=1,Qe<a){const Ve=V[Qe];if(Ve>=0)for(let gn=E[Ve];gn<E[Ve+1];gn++)Er(gt,j[gn]);if(Wt[qe]&1)for(let gn=0;gn<O.length;gn++)O[gn]===Qe&&Er(gt,D[gn])}}if(!We&&!Ke&&be===He+ve-1)return le;let Mt="",wt=0;for(;wt<ve;){if(!Qt[wt]){wt++;continue}const qe=Fn[wt];let Qe=Pe[wt],gt=wt+1;for(;gt<ve&&Qt[gt]&&Fn[gt]===Qe+1&&le.charCodeAt(Qe)===32;)Qe=Pe[gt],gt++;Mt.length>0&&(Mt+=" "),Mt+=le.slice(qe,Qe),wt=gt}return Mt},Ai=16384,Ri=new Int32Array(Ai*2);let jl=0,ln=1,Zt=Object.create(null),Rn=Object.create(null),ci=new Map,Oa=new Map,Tr=0,Ar=0;const qo=()=>{jl^=Ai,ln=ln+1|0,Ar=0},zl=le=>{let be=Zt[le];if(be!==void 0)return be;const ve=Nu(le,0,le.length),He=(ve&16383)+jl,Ke=Ri[He]===(ve^ln)||Ri[He^Ai]===(ve^ln-1);return Ke&&(be=Rn[le],be!==void 0)?(Zt[le]=be,be):(be=Vo(le),Ke?(Zt[le]=be,++Tr>se&&(Tr=0,Rn=Zt,Zt=Object.create(null),qo())):(Ri[He]=ve^ln,++Ar>Ai&&qo()),be)},Rr=le=>{let be=ci.get(le);if(be!==void 0)return be;const ve=Nu(le,0,le.length),He=(ve&16383)+jl,Ke=Ri[He]===(ve^ln)||Ri[He^Ai]===(ve^ln-1);return Ke&&(be=Oa.get(le),be!==void 0)?(ci.set(le,be),be):(be=Vo(le),Ke?(ci.set(le,be),++Tr>se&&(Tr=0,Oa=ci,ci=new Map,qo())):(Ri[He]=ve^ln,++Ar>Ai&&qo()),be)},Cr=le=>{const be=Nu(le,0,le.length),ve=(be&16383)+jl;return Ri[ve]===(be^ln)||Ri[ve^Ai]===(be^ln-1)?!0:(Ri[ve]=be^ln,++Ar>Ai&&qo(),!1)},Gi=se===0?Vo:XM?le=>{const be=ci.get(le);return be!==void 0?be:Rr(le)}:zl;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?Gi(arguments[0]):Gi(ZM.apply(null,arguments))},mergeString:Gi,seenBefore:se===0?()=>!1:Cr,mergeUncached:Vo}},Fu=(n,o)=>{if(!n)return"";if(typeof n=="string")return n;let r="";if(typeof n.length=="number"&&(!o||Array.isArray(n))){const a=n;for(let u=0;u<a.length;u++){const f=a[u];if(!f)continue;const d=typeof f=="string"?f:Fu(f,o);d&&(r&&(r+=" "),r+=d)}return r}if(o){if(typeof n=="number")return""+n;if(typeof n=="object")for(const a in n)n[a]&&(r&&(r+=" "),r+=a)}return r},QM=(n,o)=>{let r="";for(let a=0;a<n.length;a++){const u=n[a];if(!u)continue;const f=typeof u=="string"?u:Fu(u,o);f&&(r&&(r+=" "),r+=f)}return r},ZM=function(){return QM(arguments,!1)},JM=256,Bv=16,$M=1024,fp=4096,WM=(n,o)=>{const r=o===void 0?()=>!0:o.seenBefore,a=o===void 0?n:o.mergeUncached;let u=new Map,f=new Map,d=0,p=null,h=null,b=[],y=[],g=0;const w=(A,_,L)=>{h===null&&(h=new Array(fp).fill(""),b=new Array(fp).fill(""),y=new Array(fp).fill(""));const E=Nu(A,0,A.length)&4094;if(h[E]===A&&b[E]===_)return y[E];if(h[E|1]===A&&b[E|1]===_)return y[E|1];const j=n(L?_+" "+A:A),O=h[E]===""?E:E|(h[E|1]===""?1:g++&1);return h[O]=A,b[O]=_,y[O]=j,j},R=(A,_,L,E)=>{let j=0;if(_){if(_!==A.a0)return!1;j=1}if(L){if(L!==(j===0?A.a0:A.a1))return!1;j++}if(E){if(E!==(j===0?A.a0:j===1?A.a1:A.a2))return!1;j++}return j===A.t},M=(A,_)=>{const L=A.a;let E=0;for(let j=0;j<_.length;j++){const O=_[j];if(O){if(O!==L[E])return!1;E++}}return E===A.t},x=(A,_)=>{const L=A.length,E=p===null?null:p.n;if(!_){if(E!==null&&M(E,A))return p=E,E.r;if(p!==null&&p!==E&&M(p,A))return p.r}let j="",O=-1,D=0,z=!1;for(let V=0;V<L;V++){let G=A[V];if(G){if(typeof G!="string"){if(G=A[V]=Fu(G,!0),!G)continue;z=!0}O<0&&(j=G,O=V),D++}}if(D===0)return"";if(D===1)return n(j);if(z){if(E!==null&&M(E,A))return p=E,E.r;if(p!==null&&p!==E&&M(p,A))return p.r}let q=u.get(j);q===void 0&&(q=f.get(j),q!==void 0&&u.set(j,q));let B=null;if(q!==void 0){if(q.skip>0){q.skip--,p=null;let G=j;for(let P=O+1;P<L;P++){const Y=A[P];Y&&(G+=" "+Y)}return w(G,"",!1)}const V=q.e;e:for(let G=0;G<V.length;G++){const P=V[G];if(P.t!==D)continue;const Y=P.a;let te=1;for(let U=O+1;U<L;U++){const H=A[U];if(H&&H!==Y[te++])continue e}B=P;break}B!==null&&(q.miss=0)}if(B===null){let V=j;const G=[j];for(let Y=O+1;Y<L;Y++){const te=A[Y];te&&(V+=" "+te,G.push(te))}if(!r(V))return a(V);B={r:n(V),t:G.length,a0:G[0],a1:G[1],a2:G[2]??"",a:G,n:null},q===void 0?u.set(j,q={e:[],miss:0,skip:0,at:0}):++q.miss>Bv&&(q.miss=Bv,q.skip=$M,q.e.length=0,q.at=0);const P=q.e;P.length<JM?P.push(B):(P[q.at]=B,q.at=q.at+1&255),++d>1e3&&(d=0,f=u,u=new Map)}return p!==null&&p!==B&&(p.n=B),p=B,B.r},T=A=>Array.isArray(A)?x(A.slice(),!1):n(Fu(A,!0));return function(A,_,L){const E=arguments.length;if((E|1)===3){const D=p;if(D!==null){const z=D.n;if(z!==null&&R(z,A,_,L))return p=z,z.r;if(D!==z&&R(D,A,_,L))return D.r}if(E===2&&typeof _=="string"&&_!==""){const z=u.get(A);if(z!==void 0&&z.skip>0)return z.skip--,p=null,w(_,A,!0)}return x([A,_,L],!0)}if(E===1)return typeof A=="string"?n(A):T(A);const j=p;if(j!==null){const D=j.n;if(D!==null){const z=D.a;let q=0,B=!0;for(let V=0;V<E;V++){const G=arguments[V];if(G){if(G!==z[q]){B=!1;break}q++}}if(B&&q===D.t)return p=D,D.r}if(j!==D){const z=j.a;let q=0,B=!0;for(let V=0;V<E;V++){const G=arguments[V];if(G){if(G!==z[q]){B=!1;break}q++}}if(B&&q===j.t)return j.r}}const O=[];for(let D=0;D<E;D++)O.push(arguments[D]);return x(O,!0)}},Vv=KM(PM),Vn=WM(Vv.mergeString,Vv),eN=pm("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ct({className:n,variant:o="default",size:r="default",...a}){return v.jsx(EM,{"data-slot":"button",className:Vn(eN({variant:o,size:r,className:n})),...a})}function ko({as:n="div",className:o,size:r="default",...a}){return v.jsx(n,{"data-slot":"card","data-size":r,className:Vn("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",o),...a})}function tN(n){return Lt(n.defaultTagName??"div",n,n)}const nN=pm("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function iN({className:n,variant:o="default",render:r,...a}){return tN({defaultTagName:"span",props:gr({className:Vn(nN({variant:o}),n)},a),render:r,state:{slot:"badge",variant:o}})}function Gu({controlled:n,default:o,name:r,state:a="value"}){const{current:u}=S.useRef(n!==void 0),[f,d]=S.useState(()=>o),p=u&&n!==void 0?n:f,h=S.useCallback(b=>{u||d(b)},[]);return[p,h]}const LS=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function oN(){return S.useContext(LS)}function mm(n){const{children:o,elementsRef:r,labelsRef:a,onMapChange:u}=n,f=ke(u),[,d]=S.useState(0),p=Jn(rN).current,h=Jn(lN).current,b=S.useRef(0),y=S.useRef(!0),g=S.useRef(null),w=S.useRef(null),R=ke(()=>{y.current||(y.current=!0,d(j=>j+1))}),M=ke((j,O)=>{h.set(j,O),R()}),x=ke(j=>{h.delete(j),R()}),T=ke(j=>{const O=new Map;return r.current.length=0,a&&(a.current.length=0),j.forEach(D=>{O.set(D.element,{...D.registration.metadata??{},index:D.index}),r.current[D.index]=D.element,a&&(a.current[D.index]=D.registration.label!==void 0?D.registration.label:D.registration.textRef?.current?.textContent??D.element.textContent)}),b.current=r.current.length,O});function A(j){if(w.current?.disconnect(),w.current=null,typeof MutationObserver!="function"||j.length<2)return;const O=new MutationObserver(z=>{if(!cN(z))return;let q=null;for(const B of j)if(B.isConnected){if(q&&kS(q,B)>0){O.disconnect(),R();return}q=B}});w.current=O;const D=new Set;for(let z=1;z<j.length;z+=1){const q=sN(j[z-1],j[z]);q&&D.add(q)}D.forEach(z=>O.observe(z,{childList:!0}))}const _=ke(()=>{const[j,O]=aN(h),D=T(j),z=g.current,q=!z||z.length!==j.length||j.some((B,V)=>{const G=z[V];return B.index!==G.index||B.element!==G.element||B.registration.index!==G.registration.index||B.registration.metadata!==G.registration.metadata});A(O),g.current=j,y.current=!1,q&&(p.forEach(B=>B(D)),f(D))});De(()=>(!y.current&&g.current&&T(g.current),()=>{r.current=[],a&&(a.current=[])}),[r,a,T]),De(()=>{y.current&&_()}),De(()=>()=>{w.current?.disconnect(),y.current=!0},[]);const L=ke(j=>(p.add(j),()=>{p.delete(j)})),E=S.useMemo(()=>({register:M,unregister:x,subscribeMapChange:L,nextIndexRef:b}),[M,x,L,b]);return v.jsx(LS.Provider,{value:E,children:o})}function lN(){return new Map}function rN(){return new Set}function aN(n){const o=new Set,r=[],a=[];n.forEach((f,d)=>{if(!d.isConnected)return;const p=f.index,h={index:p??-1,element:d,registration:f};p===null?a.push(h):p>=0&&(o.add(p),r.push(h))});let u=0;return a.sort((f,d)=>kS(f.element,d.element)),a.forEach(f=>{for(;o.has(u);)u+=1;f.index=u,r.push(f),u+=1}),o.size>0&&r.sort((f,d)=>f.index-d.index),[r,a.map(f=>f.element)]}function sN(n,o){let r=n.parentElement;for(;r&&!r.contains(o);)r=r.parentElement;return r}function cN(n){for(const o of n)for(let r=0;r<o.removedNodes.length;r+=1)if(o.removedNodes[r].isConnected)return!0;return!1}function kS(n,o){return n.nextElementSibling===o?-1:o.nextElementSibling===n?1:n.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const US=S.createContext(void 0);function gm(){const n=S.useContext(US);if(n===void 0)throw new Error(qi(64));return n}const uN="data-activation-direction",bf={tabActivationDirection:n=>({[uN]:n})},fN=S.forwardRef(function(o,r){const{className:a,defaultValue:u=0,onValueChange:f,orientation:d="horizontal",render:p,value:h,style:b,...y}=o,g=o.defaultValue!==void 0,w=S.useRef([]),[R,M]=S.useState(()=>new Map),[x,T]=Gu({controlled:h,default:u,name:"Tabs",state:"value"}),A=h!==void 0,[_,L]=S.useState(()=>new Map),E=S.useRef(void 0),j=S.useCallback(ce=>Bp(_,ce),[_]),[O,D]=S.useState(()=>({previousValue:x,tabActivationDirection:"none"})),{previousValue:z,tabActivationDirection:q}=O;let B=q,V=!1;z!==x&&(B=qv(z,x,d,_),V=z!=null&&x!=null&&j(x)==null);const G=V?z:x,P=z!==G||q!==B;De(()=>{P&&D({previousValue:G,tabActivationDirection:B})},[G,P,B]);const Y=ke((ce,ie)=>{const de=qv(x,ce,d,_);ie.activationDirection=de,f?.(ce,ie),!ie.isCanceled&&T(()=>ce)}),te=ke((ce,ie)=>{f?.(ce,Bt(ie,void 0,void 0,{activationDirection:"none"}))}),U=ke((ce,ie)=>(M(de=>{const me=new Map(de);return me.set(ce,ie),me}),()=>{M(de=>{if(de.get(ce)!==ie)return de;const me=new Map(de);return me.delete(ce),me})})),H=S.useCallback(ce=>R.get(ce),[R]),X=S.useCallback(ce=>{for(const ie of _.values())if(ce===ie.value)return ie.id},[_]),J=S.useMemo(()=>({getTabElementBySelectedValue:j,getTabIdByPanelValue:X,getTabPanelIdByValue:H,onValueChange:Y,orientation:d,registerMountedTabPanel:U,setTabMap:L,tabActivationDirection:B,value:x}),[j,X,H,Y,d,U,L,B,x]),K=S.useMemo(()=>{for(const ce of _.values())if(ce.value===x)return ce},[_,x]),ye=S.useMemo(()=>{for(const ce of _.values())if(!ce.disabled)return ce.value},[_]),fe=S.useRef(!g),se=S.useRef(u),N=S.useRef(g),I=S.useRef(!1);De(()=>{if(A)return;function ce(ae,Re){T(()=>ae),D({previousValue:ae,tabActivationDirection:"none"}),te(ae,Re),fe.current=!1}if(_.size===0){I.current&&x!==null&&!E.current?.isConnected&&ce(null,Lb);return}I.current=!0,E.current=_.keys().next().value;const ie=K?.disabled,de=K==null&&x!==null;if(!ie&&x===se.current&&(N.current=!1),N.current&&ie&&x===se.current)return;const me=fe.current;if(ie||de){const ae=ye??null;if(x===ae){fe.current=!1;return}let Re=Lb;me?Re=kb:ie&&(Re=GT),ce(ae,Re);return}me&&K!=null&&(te(x,kb),fe.current=!1)},[ye,A,te,K,T,_,x]);const $=Lt("div",o,{state:{orientation:d,tabActivationDirection:B},ref:r,props:y,stateAttributesMapping:bf});return v.jsx(US.Provider,{value:J,children:v.jsx(mm,{elementsRef:w,children:$})})});function Bp(n,o){for(const[r,a]of n.entries())if(o===a.value)return r;return null}function qv(n,o,r,a){if(n==null||o==null)return"none";const[u,f,d]=r==="horizontal"?["left","left","right"]:["top","up","down"],p=Bp(a,n),h=Bp(a,o);if(p==null||h==null)return p!==h&&(typeof n=="number"||typeof n=="string")&&typeof n==typeof o?o>n?d:f:"none";const b=p.getBoundingClientRect()[u],y=h.getBoundingClientRect()[u];return y<b?f:y>b?d:"none"}const ym="data-composite-item-active";function bm(n={}){const{guess:o,label:r,metadata:a,textRef:u,index:f}=n,{register:d,unregister:p,subscribeMapChange:h,nextIndexRef:b}=oN(),y=S.useRef(-1),[g,w]=S.useState(f==null&&o?()=>{if(y.current===-1){const T=b.current;b.current+=1,y.current=T}return y.current}:-1),R=f??g,M=S.useRef(null),x=S.useCallback(T=>{const A=M.current;A&&p(A),M.current=T,T&&d(T,{metadata:a??null,index:f??null,label:r,textRef:u})},[f,d,p,a,r,u]);return De(()=>{if(f==null)return h(T=>{const A=M.current?T.get(M.current)?.index:null;A!=null&&w(A)})},[f,h]),{ref:x,index:R}}function dN(n={}){const{highlightItemOnHover:o,highlightedIndex:r,onHighlightedIndexChange:a}=Zp(),{ref:u,index:f}=bm(n),d=r===f,p=S.useRef(null),h=El(u,p);return{compositeProps:{tabIndex:d?0:-1,onFocus(){a(f)},onMouseMove(){const y=p.current;if(!o||!y)return;const g=y.hasAttribute("disabled")||y.ariaDisabled==="true";!d&&!g&&y.focus()}},compositeRef:h,index:f}}const IS=S.createContext(void 0);function hN(){const n=S.useContext(IS);if(n===void 0)throw new Error(qi(65));return n}const pN=S.forwardRef(function(o,r){const{className:a,disabled:u=!1,render:f,value:d,id:p,nativeButton:h=!0,style:b,...y}=o,{value:g,getTabPanelIdByValue:w,onValueChange:R,orientation:M,tabActivationDirection:x}=gm(),{activateOnFocus:T,registerTabResizeObserverElement:A,tabsListElement:_}=hN(),{highlightedIndex:L,onHighlightedIndexChange:E}=Zp(),j=Nl(p),O=S.useMemo(()=>({disabled:u,id:j,value:d}),[u,j,d]),{compositeProps:D,compositeRef:z,index:q}=dN({metadata:O}),B=d===g,V=S.useRef(!1),G=S.useRef(null),P=ke(I=>{G.current?.(),G.current=I?A(I):null});De(()=>{if(V.current){V.current=!1;return}if(!(B&&q>-1&&L!==q))return;const I=_;if(I!=null){const Q=wi(_t(I));if(Q&&it(I,Q))return}u||E(q)},[B,q,L,E,u,_]);const{getButtonProps:Y,buttonRef:te}=Sr({disabled:u,native:h,focusableWhenDisabled:!0}),U=w(d),H=S.useRef(!1),X=S.useRef(!1);function J(I){R(d,Bt(Rl,I.nativeEvent,void 0,{activationDirection:"none"}))}function K(I){B||u||J(I)}function ye(I){B||u||T&&(!H.current||X.current)&&J(I)}function fe(I){if(B||u)return;H.current=!0,X.current=I.button===0;const Q=_t(I.currentTarget);function $(){H.current=!1,X.current=!1,Q.removeEventListener("pointerup",$),Q.removeEventListener("pointercancel",$)}Q.addEventListener("pointerup",$),Q.addEventListener("pointercancel",$)}return Lt("button",o,{state:{disabled:u,active:B,orientation:M,tabActivationDirection:x},ref:[r,te,z,P],props:[D,{role:"tab","aria-controls":U,"aria-selected":B,id:j,onClick:K,onFocus:ye,onPointerDown:fe,[ym]:B?"":void 0,onKeyDownCapture(){V.current=!0}},y,Y],stateAttributesMapping:bf})}),mN=S.createContext(void 0),gN={disableStyleElements:!1};function yN(){return S.useContext(mN)??gN}const bN="data-index",vN={...bf,...Aa},SN=S.forwardRef(function(o,r){const{className:a,value:u,render:f,keepMounted:d=!1,style:p,...h}=o,{value:b,getTabIdByPanelValue:y,orientation:g,tabActivationDirection:w,registerMountedTabPanel:R}=gm(),M=Nl(),{ref:x,index:T}=bm(),A=u===b,{mounted:_,transitionStatus:L,setMounted:E}=ff(A),j=!_,O=y(u),D={hidden:j,orientation:g,tabActivationDirection:w,transitionStatus:L},z=S.useRef(null),q=Lt("div",o,{state:D,ref:[r,x,z],props:[{"aria-labelledby":O,hidden:j,id:M,role:"tabpanel",tabIndex:A?0:-1,inert:fm(!A),[bN]:T},h],stateAttributesMapping:vN});return Ra({open:A,ref:z,onComplete(){A||E(!1)}}),De(()=>{if(!(M==null||j&&!d))return R(u,M)},[j,d,u,M,R]),d||_?q:null});function HS(n){return n==null||n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true"}function wN(n){const{loopFocus:o=!0,orientation:r="both",grid:a,onLoop:u,direction:f,highlightedIndex:d,onHighlightedIndexChange:p,rootRef:h,enableHomeAndEndKeys:b=!1,stopEventPropagation:y,disabledIndices:g,modifierKeys:w=Tl}=n,[R,M]=S.useState(0),x=a!=null,T=S.useRef(null),A=El(T,h),_=S.useRef([]),L=S.useRef(!1),E=S.useRef(null),j=d??R,O=ke((V,G=!1)=>{if(E.current=_.current[V]??null,(p??M)(V),G){const P=_.current[V];hv(T.current,P,f,r)}}),D=ke(V=>{if(V.size===0)return;if(L.current){const te=_.current,U=te.indexOf(E.current);if(U===-1){const H=te[j];!H||ba(te,j,g)?O(xN(te,g)):E.current=H}else U!==j&&O(U);return}L.current=!0;const G=Array.from(V.keys()),P=G.find(te=>te?.hasAttribute(ym))??null,Y=P?V.get(P)?.index??-1:-1;if(Y!==-1)O(Y);else if(ba(G,j,g)){const te=ya(G,{disabledIndices:g});ga(G,te)||O(te)}hv(T.current,P,f,r)});De(()=>{if(g==null||d!=null||!L.current)return;const V=_.current;if(ba(V,j,g)){const G=ya(V,{disabledIndices:g});ga(V,G)||O(G)}},[g,d,j,_,O]);const z=ke((V,G,P)=>u?u(V,G,P,_):P),q=ke(V=>{const G=V.key===Np||V.key===_p;if(!um.has(V.key)||!b&&G||EN(V,w)||!T.current)return;const Y=f==="rtl",te=Y?Op:Mp,U=Y?Mp:Op,H=r==="vertical"?Cp:te,X=r==="vertical"?Rp:U,J=Vi(V.nativeEvent);if(J!=null&&dv(J)&&!HS(J)){const I=J.selectionStart,Q=J.selectionEnd,$=J.value;if(I==null||V.shiftKey||I!==Q||V.key!==X&&I<$.length||V.key!==H&&I>0)return}let K=j;const ye=Ru(_,g),fe=xp(_,g);a!=null&&(K=a({disabledIndices:g,elementsRef:_,event:V,highlightedIndex:j,loopFocus:o,maxIndex:fe,minIndex:ye,onLoop:z,orientation:r,rtl:Y}));const se=r!=="vertical"&&V.key===te||r!=="horizontal"&&V.key===Cp,N=r!=="vertical"&&V.key===U||r!=="horizontal"&&V.key===Rp;b&&(V.key===Np?K=ye:V.key===_p&&(K=fe)),K===j&&(se||N)&&(o&&K===fe&&se?(K=ye,u&&(K=u(V,j,K,_))):o&&K===ye&&N?(K=fe,u&&(K=u(V,j,K,_))):K=ya(_.current,{startingIndex:K,decrement:N,disabledIndices:g})),K!==j&&!ga(_.current,K)&&(y&&V.stopPropagation(),(x||G||se||N)&&V.preventDefault(),O(K,!0),queueMicrotask(()=>{_.current[K]?.focus()}))});return{props:{ref:A,onFocus(V){const G=T.current,P=Vi(V.nativeEvent);!G||P==null||!dv(P)||P.setSelectionRange(0,P.value.length)},onKeyDown:q},highlightedIndex:j,onHighlightedIndexChange:O,elementsRef:_,onMapChange:D,relayKeyboardEvent:q}}function xN(n,o){let r=-1;for(let a=0;a<n.length;a+=1){const u=n[a];if(!(!u||ba(n,a,o))){if(u.hasAttribute(ym))return a;r===-1&&(r=a)}}return Math.max(r,0)}function EN(n,o){for(const r of cC)if(!o.includes(r)&&n.getModifierState(r))return!0;return!1}const TN=S.createContext(void 0);function vm(){return S.useContext(TN)?.direction??"ltr"}function AN(n){const{render:o,className:r,style:a,refs:u=Tl,props:f=Tl,state:d=nn,stateAttributesMapping:p,highlightedIndex:h,onHighlightedIndexChange:b,orientation:y,grid:g,loopFocus:w,onLoop:R,enableHomeAndEndKeys:M,onMapChange:x,stopEventPropagation:T=!0,rootRef:A,disabledIndices:_,modifierKeys:L,highlightItemOnHover:E=!1,tag:j="div",...O}=n,D=vm(),{props:z,highlightedIndex:q,onHighlightedIndexChange:B,elementsRef:V,onMapChange:G,relayKeyboardEvent:P}=wN({grid:g,loopFocus:w,onLoop:R,orientation:y,highlightedIndex:h,onHighlightedIndexChange:b,rootRef:A,stopEventPropagation:T,enableHomeAndEndKeys:M,direction:D,disabledIndices:_,modifierKeys:L}),Y=Lt(j,n,{state:d,ref:u,props:[z,...f,O],stateAttributesMapping:p}),te=S.useMemo(()=>({highlightedIndex:q,onHighlightedIndexChange:B,highlightItemOnHover:E,relayKeyboardEvent:P}),[q,B,E,P]);return v.jsx(E2.Provider,{value:te,children:v.jsx(mm,{elementsRef:V,onMapChange:U=>{x?.(U),G(U)},children:Y})})}const RN=S.forwardRef(function(o,r){const{activateOnFocus:a=!1,className:u,loopFocus:f=!0,render:d,style:p,...h}=o,{orientation:b,setTabMap:y,tabActivationDirection:g}=gm(),[w,R]=S.useState(0),[M,x]=S.useState(null),T=S.useRef(new Set),A=S.useRef(new Set),_=S.useRef(null);De(()=>{if(typeof ResizeObserver>"u")return;const z=new ResizeObserver(()=>{T.current.forEach(q=>{q()})});return _.current=z,M&&z.observe(M),A.current.forEach(q=>{z.observe(q)}),()=>{z.disconnect(),_.current=null}},[M]);const L=ke(z=>(T.current.add(z),()=>{T.current.delete(z)})),E=ke(z=>(A.current.add(z),_.current?.observe(z),()=>{A.current.delete(z),_.current?.unobserve(z)})),j={orientation:b,tabActivationDirection:g},O={"aria-orientation":b==="vertical"?"vertical":void 0,role:"tablist"},D=S.useMemo(()=>({activateOnFocus:a,registerIndicatorUpdateListener:L,registerTabResizeObserverElement:E,tabsListElement:M}),[a,L,E,M]);return v.jsx(IS.Provider,{value:D,children:v.jsx(AN,{render:d,className:u,style:p,state:j,refs:[r,x],props:[O,h],stateAttributesMapping:bf,highlightedIndex:w,enableHomeAndEndKeys:!0,loopFocus:f,orientation:b,onHighlightedIndexChange:R,onMapChange:y,disabledIndices:Tl})})});function Yv({className:n,orientation:o="horizontal",...r}){return v.jsx(fN,{"data-slot":"tabs","data-orientation":o,className:Vn("group/tabs flex gap-2 data-horizontal:flex-col",n),...r})}const CN=pm("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Fv({className:n,variant:o="default",...r}){return v.jsx(RN,{"data-slot":"tabs-list","data-variant":o,className:Vn(CN({variant:o}),n),...r})}function zo({className:n,...o}){return v.jsx(pN,{"data-slot":"tabs-trigger",className:Vn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",n),...o})}function Ui({className:n,...o}){return v.jsx(SN,{"data-slot":"tabs-content",className:Vn("flex-1 text-sm outline-none",n),...o})}function wl({className:n,...o}){return v.jsx("label",{"data-slot":"label",className:Vn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",n),...o})}function ON(n){const o=S.useRef(!0);o.current&&(o.current=!1,n())}function MN(n){const[o,r]=S.useState({current:n,previous:null});return Object.is(n,o.current)||r({current:n,previous:o.current}),o.previous}const BS=S.createContext(void 0),VS=S.createContext(void 0);function yo(){const n=S.useContext(BS);if(n===void 0)throw new Error(qi(60));return n}function qS(){const n=S.useContext(VS);if(n===void 0)throw new Error(qi(61));return n}const NN="data-valid",_N="data-invalid",DN={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},jN={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},zN={disabled:!1,...jN},Sm={valid(n){return n===null?null:n?{[NN]:""}:{[_N]:""}}},LN={invalid:void 0,name:void 0,validityData:{state:DN,errors:[],error:"",value:"",initialValue:null},setValidityData:Pt,disabled:void 0,setTouched:Pt,setDirty:Pt,setFilled:Pt,setFocused:Pt,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:zN,registerFieldControl:Pt,validation:{getValidationProps:(n,o=nn)=>o,inputRef:{current:null},registeredInputs:new Map,registerInput:Pt,getInputControl:()=>null,commit:async()=>{},change:Pt}},kN=S.createContext(LN);function Ca(n=!0){const o=S.useContext(kN);if(o.setValidityData===Pt&&!n)throw new Error(qi(28));return o}function wm(n,o,r,a,u=!0,f){const{registerFieldControl:d}=Ca(),p=Jn(()=>Symbol());De(()=>{const h=p.current;if(!u){d(h,void 0);return}d(h,{controlRef:n,getValue:a,id:o,name:f,value:r})},[n,u,a,o,f,d,p,r]),De(()=>{const h=p.current;return()=>{d(h,void 0)}},[d,p])}const UN=S.createContext({controlId:void 0,registerControlId:Pt,resetControlId:Pt,labelId:void 0,setLabelId:Pt,messageIds:[],setMessageIds:Pt,getDescriptionProps:n=>n});function vf(){return S.useContext(UN)}function Sf(n={}){const{id:o,enabled:r=!0}=n,{controlId:a,registerControlId:u,resetControlId:f}=vf(),d=Nl(),p=Jn(()=>Symbol()),h=S.useRef(!1),b=S.useRef(!1),y=ke(()=>{!h.current||u===Pt||(h.current=!1,u(p.current,void 0))});return De(()=>{if(!r||u===Pt){y();return}let g;if(o!==void 0)b.current=!0,g=o;else if(b.current)g=d;else{f();return}if(g===void 0){y();return}h.current=!0,u(p.current,g)},[o,r,u,f,d,p,y]),De(()=>y,[y]),(r?a:void 0)??o??d}function IN(n,o,r=Object.is){const{length:a}=n;if(a!==o.length)return!1;for(let u=0;u<a;u+=1)if(!r(n[u],o[u]))return!1;return!0}const YS=(n,o)=>Object.is(n,o);function vr(n,o,r){return n==null||o==null?Object.is(n,o):r(n,o)}function HN(n,o,r){return Array.isArray(n)&&Array.isArray(o)?!IN(n,o,(a,u)=>vr(a,u,r)):n!==o}function Vp(n,o,r){return n?n.some(a=>a===void 0?!1:vr(o,a,r)):!1}function _u(n,o,r){return n?n.findIndex(a=>a===void 0?!1:vr(a,o,r)):-1}function BN(n,o){if(o!==YS)return a=>Vp(n,a,o);const r=new Set(n);return r.delete(void 0),a=>r.has(a)&&(a!==0||n.some(u=>Object.is(a,u)))}function FS(n,o,r,a){const u=a&&Array.isArray(o)?n.findIndex(BN(o,r)):_u(n,o,r);return u===-1?null:u}function VN(n,o,r,a,u,f){return Vp(a,o,u)?f!=null&&n>f&&Vp(a,r[f],u)?f:n:n===f?FS(r,a,u,!0):f}function qN(n,o,r){return n.filter(a=>!vr(o,a,r))}function qp(n){if(n==null)return"";if(typeof n=="string")return n;try{return JSON.stringify(n)}catch{return String(n)}}function YN(n){return typeof n=="object"&&n!=null&&Array.isArray(n.items)}function GS(n){return YN(n?.[0])}function FN(n){return GS(n)?n.flatMap(o=>o.items):n}function GN(n){if(!Array.isArray(n))return n!=null&&"null"in n;const o=n;if(GS(o)){for(const r of o)for(const a of r.items)if(a&&a.value==null&&a.label!=null)return!0;return!1}for(const r of o)if(r&&r.value==null&&r.label!=null)return!0;return!1}function PS(n,o){if(o&&n!=null)return o(n)??"";if(n&&typeof n=="object"){if("label"in n&&n.label!=null)return String(n.label);if("value"in n)return String(n.value)}return qp(n)}function pa(n,o){return o&&n!=null?o(n)??"":n&&typeof n=="object"&&"value"in n&&"label"in n?qp(n.value):qp(n)}function XS(n,o,r){function a(){return PS(n,r)}if(r&&n!=null)return r(n);if(n&&typeof n=="object"&&"label"in n&&n.label!=null)return n.label;if(o&&!Array.isArray(o))return(Object.hasOwn(o,n)?o[n]:void 0)??a();if(Array.isArray(o)){const f=FN(o);if(n==null||typeof n!="object"){const d=f.find(p=>p.value===n);return d&&d.label!=null?d.label:a()}if("value"in n){const d=f.find(p=>p&&p.value===n.value);if(d&&d.label!=null)return d.label}}return a()}function PN(n,o,r){return n.reduce((a,u,f)=>(f>0&&a.push(", "),a.push(v.jsx(S.Fragment,{children:XS(u,o,r)},f)),a),[])}const XN={id:n=>n.id,labelId:n=>n.labelId,modal:n=>n.modal,multiple:n=>n.multiple,disabled:n=>n.disabled,readOnly:n=>n.readOnly,required:n=>n.required,highlightItemOnHover:n=>n.highlightItemOnHover,items:n=>n.items,itemToStringLabel:n=>n.itemToStringLabel,isItemEqualToValue:n=>n.isItemEqualToValue,value:n=>n.value,hasSelectedValue:n=>{const{value:o,multiple:r,itemToStringValue:a}=n;return o==null?!1:r&&Array.isArray(o)?o.length>0:pa(o,a)!==""},hasNullItemLabel:(n,o)=>o?GN(n.items):!1,open:n=>n.open,mounted:n=>n.mounted,forceMount:n=>n.forceMount,transitionStatus:n=>n.transitionStatus,openMethod:n=>n.openMethod,activeIndex:n=>n.activeIndex,selectedIndex:n=>n.selectedIndex,isActive:(n,o)=>n.activeIndex===o,isSelected:(n,o)=>{const r=n.isItemEqualToValue,a=n.value;return n.multiple?Array.isArray(a)&&a.some(u=>vr(o,u,r)):vr(o,a,r)},isSelectedByFocus:(n,o)=>n.selectedIndex===o,popupProps:n=>n.popupProps,triggerProps:n=>n.triggerProps,itemRoot:n=>n.itemRoot,triggerElement:n=>n.triggerElement,positionerElement:n=>n.positionerElement,listElement:n=>n.listElement,popupSide:n=>n.popupSide,scrollUpArrowVisible:n=>n.scrollUpArrowVisible,scrollDownArrowVisible:n=>n.scrollDownArrowVisible,hasScrollArrows:n=>n.hasScrollArrows},KN=S.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Pt,validationMode:"onSubmit",submitCountRef:{current:0}});function xm(){return S.useContext(KN)}function Ns(n,o=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(o,Math.min(n,r))}const eo=1;function Em(n,o){return Math.max(0,n-o)}function Pu(n,o){if(o<=0)return 0;const r=Ns(n,0,o),a=r,u=o-r,f=a<=eo,d=u<=eo;return f&&d?a<=u?0:o:f?0:d?o:r}function QN(n){const{id:o,value:r,defaultValue:a=null,onValueChange:u,open:f,defaultOpen:d=!1,onOpenChange:p,name:h,form:b,autoComplete:y,disabled:g=!1,readOnly:w=!1,required:R=!1,modal:M=!0,actionsRef:x,inputRef:T,onOpenChangeComplete:A,items:_,multiple:L=!1,itemToStringLabel:E,itemToStringValue:j,isItemEqualToValue:O=YS,highlightItemOnHover:D=!0,children:z}=n,{clearErrors:q}=xm(),{setDirty:B,setTouched:V,setFocused:G,validityData:P,setFilled:Y,name:te,disabled:U,validation:H,validationMode:X}=Ca(),J=Sf({id:o}),K=U||g,ye=te??h,[fe,se]=Gu({controlled:r,default:L?a??Tl:a,name:"Select",state:"value"}),[N,I]=Gu({controlled:f,default:d,name:"Select",state:"open"}),Q=S.useRef([]),$=S.useRef([]),ce=S.useRef(null),ie=S.useRef(null),de=S.useRef(0),me=S.useRef(null),ae=S.useRef([]),Re=S.useRef(!1),we=S.useRef(null),Ce=S.useRef(null),je=S.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Se=S.useRef(!1),Ne=S.useRef(fe),{openMethod:Ee,triggerProps:Ue}=_C(N),xe=Jn(()=>new sm({id:J,labelId:void 0,modal:M,multiple:L,disabled:K,readOnly:w,required:R,highlightItemOnHover:D,itemToStringLabel:E,itemToStringValue:j,isItemEqualToValue:O,value:fe,open:N,mounted:N,transitionStatus:void 0,items:_,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:nn,triggerProps:nn,itemRoot:{props:nn,multiple:L,disabled:K,readOnly:w,isItemEqualToValue:O},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:Pt,setOpen:Pt,handleScrollArrowVisibility:Pt,onOpenChangeComplete:Pt,listRef:Q,popupRef:ce,scrollHandlerRef:ie,scrollArrowsMountedCountRef:de,valueRef:me,valuesRef:ae,labelsRef:$,typingRef:Re,selectionRef:je,firstItemTextRef:we,selectedItemTextRef:Ce,alignItemWithTriggerActiveRef:Se,initialValueRef:Ne},XN)).current,[Ie,$e]=S.useState(!1),{mounted:ft,transitionStatus:ue,forceUnmount:ge}=$2({open:N,ref:ce,preventUnmountOnClose:Ie,setPreventUnmountOnClose:$e,onUnmount(){xe.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),A?.(!1)}}),Fe=xe.useState("activeIndex"),Ae=xe.useState("selectedIndex"),Me=xe.useState("triggerElement"),Ct=xe.useState("positionerElement"),yt=MN(Ee),ut=Ee??yt,Dt=S.useMemo(()=>L?"":pa(fe,j),[L,fe,j]),an=S.useMemo(()=>L&&Array.isArray(fe)?fe.map(Pe=>pa(Pe,j)):pa(fe,j),[L,fe,j]),$n=Bn(Me),kn=ke(()=>an);wm($n,J,fe,kn,!K,h);const sn=L?Array.isArray(fe)&&fe.length>0:fe!=null&&Dt!=="";De(()=>{Y(sn)},[sn,Y]),De(function(){const bt=FS(ae.current,fe,O,L);bt===null&&(Ce.current=null),!N&&xe.set("selectedIndex",bt)},[L,N,fe,O,xe]),mf(fe,()=>{q(ye),B(HN(fe,P.initialValue,O)),H.change(fe)});const qn=ke((Pe,bt)=>{const kt=bt,Wt=XA(kt);p?.(Pe,kt),!bt.isCanceled&&(Pe||$e(Wt()),I(Pe),!Pe&&(bt.reason===ks||bt.reason===Jp)&&(V(!0),G(!1),X==="onBlur"&&H.commit(fe)))});S.useImperativeHandle(x,()=>({unmount:ge,close:()=>{xe.state.open&&qn(!1,Bt(A2))}}),[ge,qn,xe]);const Ot=ke((Pe,bt)=>{u?.(Pe,bt),!bt.isCanceled&&se(Pe)}),Un=ke(Pe=>{const bt=Em(Pe.scrollHeight,Pe.clientHeight),kt=Pu(Pe.scrollTop,bt),Wt=kt>0,Qt=kt<bt;xe.set("scrollUpArrowVisible",Wt),xe.set("scrollDownArrowVisible",Qt)}),Et=bR({open:N,onOpenChange:qn,elements:{reference:Me,floating:Ct}}),mn=Z2(Et,{enabled:!K,event:"mousedown"}),Vt=J2(Et),Yn=wR(Et,{enabled:!K,listRef:Q,activeIndex:Fe,selectedIndex:Ae,disabledIndices:Tl,onNavigate(Pe){Pe===null&&!N||xe.set("activeIndex",Pe)},focusItemOnHover:D}),si=xR(Et,{enabled:!K&&(N||!w&&!L),listRef:$,activeIndex:Fe,selectedIndex:Ae,disabledIndices:Pe=>HS(Q.current[Pe]),onMatch(Pe){N?xe.set("activeIndex",Pe):Ot(ae.current[Pe],Bt(Rl))},onTyping(Pe){Re.current=Pe}}),tt=S.useMemo(()=>gr(si.reference,Yn.reference,Vt.reference,mn.reference,Ue),[mn.reference,si.reference,Yn.reference,Vt.reference,Ue]),on=S.useMemo(()=>gr(W2,si.floating,Yn.floating,Vt.floating),[si.floating,Yn.floating,Vt.floating]),Ft=Yn.item??nn,dt=S.useMemo(()=>({props:Ft,multiple:L,disabled:K,readOnly:w,isItemEqualToValue:O}),[Ft,L,K,w,O]);xe.useContextCallback("setValue",Ot),xe.useContextCallback("setOpen",qn),xe.useContextCallback("handleScrollArrowVisibility",Un),xe.useContextCallback("onOpenChangeComplete",A),ON(()=>{xe.update({popupProps:on,triggerProps:tt,itemRoot:dt})}),xe.useSyncedValues({id:J,modal:M,multiple:L,disabled:K,readOnly:w,required:R,highlightItemOnHover:D,value:fe,open:N,mounted:ft,transitionStatus:ue,popupProps:on,triggerProps:tt,itemRoot:dt,items:_,itemToStringLabel:E,itemToStringValue:j,isItemEqualToValue:O,openMethod:ut});const vt=El(T,H.inputRef),mt=L?void 0:ye,Fn=S.useMemo(()=>!L||!Array.isArray(fe)||!ye?null:fe.map(Pe=>{const bt=pa(Pe,j);return v.jsx("input",{type:"hidden",form:b,name:ye,value:bt,disabled:K},bt)}),[L,fe,b,ye,j,K]);return v.jsxs(BS.Provider,{value:xe,children:[v.jsx(VS.Provider,{value:Et,children:z}),v.jsx("input",{...H.getValidationProps(K,{onFocus(){xe.state.triggerElement?.focus({focusVisible:!0})},onChange(Pe){if(Pe.nativeEvent.defaultPrevented||K||w)return;const bt=Pe.currentTarget.value,kt=Bt(Rl,Pe.nativeEvent);function Wt(){if(L)return;const Qt=bt.toLowerCase();let bn=ae.current.findIndex(An=>pa(An,j).toLowerCase()===Qt||PS(An,E).toLowerCase()===Qt);bn===-1&&(bn=ae.current.findIndex((An,Ti)=>{const Bo=$.current[Ti];return Bo!=null&&Bo.toLowerCase()===Qt}));const vn=ae.current[bn];vn!=null&&Ot(vn,kt)}xe.set("forceMount",!0),queueMicrotask(Wt)}}),id:J&&mt==null?`${J}-hidden-input`:void 0,form:b,name:mt,autoComplete:y,value:Dt,disabled:K,required:R&&!(L&&sn),readOnly:w,ref:vt,style:ye?_2:em,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Fn]})}function ZN(n,o){return n??o}function Tm(n,o,r){const{setFocused:a,focusOwnerRef:u}=Ca(),f=ke(d=>{(d?!n:u.current===f)&&(u.current=d&&f,a(d))});return De(()=>{const d=o.current;return d?.getRootNode()?.activeElement===d&&f(!0),()=>f(!1)},[n,o,f]),f}const yu=5;function JN(n,o){const r=$N(o);return n.clientX>=r.left-yu&&n.clientX<=r.right+yu&&n.clientY>=r.top-yu&&n.clientY<=r.bottom+yu}function $N(n){const o=n.getBoundingClientRect(),r=Kt(n);if(O2)return o;const a=r.getComputedStyle(n,"::before"),u=r.getComputedStyle(n,"::after");if(!(a.content!=="none"||u.content!=="none"))return o;const d=parseFloat(a.width)||0,p=parseFloat(a.height)||0,h=parseFloat(u.width)||0,b=parseFloat(u.height)||0,y=Math.max(o.width,d,h),g=Math.max(o.height,p,b),w=y-o.width,R=g-o.height;return{left:o.left-w/2,right:o.right+w/2,top:o.top-R/2,bottom:o.bottom+R/2}}const WN="data-popup-side",e4=400,t4={...OT,...Sm,popupSide:n=>n?{[WN]:n}:null,value:()=>null},n4=S.forwardRef(function(o,r){const{render:a,className:u,id:f,disabled:d=!1,nativeButton:p=!0,style:h,...b}=o,{setTouched:y,validationMode:g,validation:w,state:R,disabled:M}=Ca(),{labelId:x}=vf(),T=yo(),A=T.useState("readOnly"),_=T.useState("required"),L=T.useState("disabled"),E=M||L||d,j=T.useState("open"),O=T.useState("mounted"),D=T.useState("value"),z=T.useState("triggerProps"),q=T.useState("positionerElement"),B=T.useState("listElement"),V=T.useState("popupSide"),G=T.useState("id"),P=T.useState("labelId"),Y=T.useState("hasSelectedValue"),te=O&&q?V:null,U=f??G,H=ZN(x,P);Sf({id:f});const X=Bn(q),J=S.useRef(null),K=Tm(E,J),{getButtonProps:ye,buttonRef:fe}=Sr({disabled:E,native:p}),se=T.useStateSetter("triggerElement"),N=Bi(),I=Bi(),Q=Bi();S.useEffect(()=>{if(j)return Q.start(e4,()=>{T.context.selectionRef.current.allowUnselectedMouseUp=!0,T.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{Q.clear()};T.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},I.clear()},[j,T,I,Q]);const $=gr(z,{id:U,role:"combobox","aria-expanded":j,"aria-haspopup":"listbox","aria-controls":j?B?.id??ku(q)?.id:void 0,"aria-labelledby":H,"aria-readonly":A||void 0,"aria-required":_||void 0,tabIndex:E?-1:0,onFocus(de){K(!0),j&&T.context.alignItemWithTriggerActiveRef.current&&T.context.setOpen(!1,Bt(Rl,de.nativeEvent)),N.start(0,()=>{T.set("forceMount",!0)})},onBlur(de){it(q,de.relatedTarget)||(y(!0),K(!1),g==="onBlur"&&w.commit(D))},onMouseDown(de){if(j)return;const me=_t(de.currentTarget);function ae(Re){if(!J.current)return;const we=Re.target;it(J.current,we)||it(X.current,we)||JN(Re,J.current)||T.context.setOpen(!1,Bt(FT,Re))}I.start(0,()=>{me.addEventListener("mouseup",ae,{once:!0})})}},b,ye),ce=w.getValidationProps(E,$);ce.role="combobox";const ie={...R,open:j,disabled:E,value:D,readOnly:A,popupSide:te,placeholder:!Y};return Lt("button",o,{ref:[r,J,fe,se],state:ie,stateAttributesMapping:t4,props:ce})}),i4={value:()=>null},o4=S.forwardRef(function(o,r){const{className:a,render:u,children:f,placeholder:d,style:p,...h}=o,b=yo(),y=b.useState("value"),g=b.useState("items"),w=b.useState("itemToStringLabel"),R=b.useState("hasSelectedValue"),M=!R&&d!=null&&f==null,x=b.useState("hasNullItemLabel",M),T={value:y,placeholder:!R};let A=null;return typeof f=="function"?A=f(y):f!=null?A=f:M&&!x?A=d:Array.isArray(y)?A=PN(y,g,w):A=XS(y,g,w),Lt("span",o,{state:T,ref:[r,b.context.valueRef],props:[{children:A},h],stateAttributesMapping:i4})}),l4=S.forwardRef(function(o,r){const{render:a,className:u,style:f,...d}=o,b={open:yo().useState("open")};return Lt("span",o,{state:b,ref:r,props:[{"aria-hidden":!0,children:"▼"},d],stateAttributesMapping:w2})}),r4=S.forwardRef(function(o,r){const a=yo(),u=a.useState("mounted"),f=a.useState("forceMount");return u||f?v.jsx(K2,{ref:r,...o}):null});function a4(n){const{nodeId:o,externalTree:r,rootContext:a}=n,u=a.useState("referenceElement"),f=a.useState("floatingElement"),d=a.useState("domReferenceElement"),p=a.useState("open"),h=a.useState("floatingId"),[b,y]=S.useState(null),g=S.useRef(null),w=uf(r),R=S.useMemo(()=>({reference:u,floating:f,domReference:d}),[u,f,d]),M=tC({...n,elements:{...R,...b&&{reference:b}}}),x=S.useCallback(L=>{const E=Tn(L)?{getBoundingClientRect:()=>L.getBoundingClientRect(),getClientRects:()=>L.getClientRects(),contextElement:L}:L;y(E),M.refs.setReference(E)},[M.refs]),T=S.useMemo(()=>({...M.refs,setPositionReference:x,domReference:g}),[M.refs,x]),A=S.useMemo(()=>({...M.elements,domReference:d}),[M.elements,d]),_=S.useMemo(()=>({...M,dataRef:a.context.dataRef,open:p,onOpenChange:a.setOpen,events:a.context.events,floatingId:h,refs:T,elements:A,nodeId:o,rootStore:a}),[M,T,A,o,a,p,h]);return De(()=>{d&&(g.current=d)},[d]),De(()=>{a.context.dataRef.current.floatingContext=_;const L=w?.nodesRef.current.find(E=>E.id===o);L&&(L.context=_)}),S.useMemo(()=>({...M,context:_,refs:T,elements:A,rootStore:a}),[M,T,A,_,a])}const s4=n=>({name:"arrow",options:n,async fn(o){const{x:r,y:a,placement:u,rects:f,platform:d,elements:p,middlewareData:h}=o,{element:b,padding:y=0}=Cl(n,o)||{};if(b==null)return{};const g=j2(y),w={x:r,y:a},R=im(u),M=nm(R),x=await d.getDimensions(b),T=R==="y",A=T?"top":"left",_=T?"bottom":"right",L=T?"clientHeight":"clientWidth",E=f.reference[M]+f.reference[R]-w[R]-f.floating[M],j=w[R]-f.reference[R],O=p.floating[L]||f.floating[M],D=E/2-j/2,z=O/2-x[M]/2-1,q=Math.min(g[A],z),B=Math.min(g[_],z),V=q,G=O-x[M]-B,P=O/2-x[M]/2+D,Y=D2(V,P,G),te=!h.arrow&&mo(u)!=null&&P!==Y&&f.reference[M]/2-(P<V?q:B)-x[M]/2<0,U=te?P<V?P-V:P-G:0;return{[R]:w[R]+U,data:{[R]:Y,centerOffset:P-Y-U,...te&&{alignmentOffset:U}},reset:te}}}),c4=(n,o)=>{const{name:r,fn:a}=s4(n);return{name:r,fn:a,options:[n,o]}},u4={name:"hide",async fn(n){const{width:o,height:r,x:a,y:u}=n.rects.reference,f=o===0&&r===0&&a===0&&u===0,d=await n.platform.detectOverflow(n,{elementContext:"reference"});return{data:{referenceHidden:d.top-r>=0||d.right-o>=0||d.bottom-r>=0||d.left-o>=0||f}}}},f4={sideX:"left",sideY:"top"},d4="--available-width",h4="--available-height",p4="--anchor-width",m4="--anchor-height",g4="--transform-origin",Gv=d4,Pv=h4;function KS(n,o,r){const a=n==="inline-start"||n==="inline-end";return{top:"top",right:a?r?"inline-start":"inline-end":"right",bottom:"bottom",left:a?r?"inline-end":"inline-start":"left"}[o]}function Xv(n,o,r){const{rects:a,placement:u}=n;return{side:KS(o,xi(u),r),align:mo(u)||"center",anchor:{width:a.reference.width,height:a.reference.height},positioner:{width:a.floating.width,height:a.floating.height}}}function y4(n){return b4(n,a4)}function b4(n,o){const{anchor:r,positionMethod:a="absolute",side:u="bottom",sideOffset:f=0,align:d="center",alignOffset:p=0,collisionBoundary:h,collisionPadding:b=5,sticky:y=!1,arrowPadding:g=5,disableAnchorTracking:w=!1,inline:R,keepMounted:M=!1,floatingRootContext:x,mounted:T,collisionAvoidance:A,shift:_,nodeId:L,adaptiveOrigin:E,lazyFlip:j=!1,externalTree:O}=n,D=A.side||"flip",z=A.align||"flip",q=A.fallbackAxisSide||"end",B=_?.crossAxis??!1,V=_?.rootBoundary,G=typeof r=="function"?r:void 0,P=ke(G),Y=G?P:r,te=Bn(r),U=Bn(T),X=vm()==="rtl",[J,K]=S.useState(null);!T&&J!==null&&K(null);const ye=j==="placement",fe=J?xi(J):null,se=J&&ye?mo(J)||"center":null,N=fe||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":X?"left":"right","inline-start":X?"right":"left"}[u],I=se||d,Q=I==="center"?N:`${N}-${I}`;let $=b;typeof $=="number"?$={top:$,right:$,bottom:$,left:$}:$&&($={top:$.top||0,right:$.right||0,bottom:$.bottom||0,left:$.left||0});const ce=1,ie=u==="bottom"?ce:0,de=u==="top"?ce:0,me=u==="right"?ce:0,ae=u==="left"?ce:0,Re={boundary:h==="clipping-ancestors"?"clippingAncestors":h,padding:$},we=S.useRef(null),Ce=Bn(f),je=Bn(p),Se=typeof f!="function"?f:0,Ne=typeof p!="function"?p:0,Ee=[];R&&Ee.push(R),Ee.push(nC(tt=>{const on=Xv(tt,u,X),Ft=typeof Ce.current=="function"?Ce.current(on):Ce.current,dt=typeof je.current=="function"?je.current(on):je.current;return{mainAxis:Ft,crossAxis:dt,alignmentAxis:dt}},[Se,Ne,X,u]));const Ue=z==="none"&&D!=="shift",xe=!Ue&&(y||B||D==="shift"),Ie=D==="none"?null:lC({...Re,padding:{top:$.top+ce+ie,right:$.right+ce+ae,bottom:$.bottom+ce+de,left:$.left+ce+me},mainAxis:!B&&D==="flip",crossAxis:z==="flip"?"alignment":!1,fallbackAxisSideDirection:q}),$e=Ue?null:iC({...Re,rootBoundary:V,mainAxis:z!=="none",crossAxis:xe,limiter:y||B?void 0:oC(tt=>{if(!we.current)return{};const{width:on,height:Ft}=we.current.getBoundingClientRect(),dt=Hi(xi(tt.placement)),vt=dt==="y"?on:Ft,mt=dt==="y"?$.left+$.right:$.top+$.bottom;return{offset:vt/2+mt/2}})},[Re,y,B,V,$,z]);D==="shift"||z==="shift"||I==="center"?Ee.push($e,Ie):Ee.push(Ie,$e),Ee.push(rC({...Re,apply({elements:{floating:tt},availableWidth:on,availableHeight:Ft,rects:dt}){if(!U.current)return;const vt=tt.style;vt.setProperty(Gv,`${on}px`),vt.setProperty(Pv,`${Ft}px`);const mt=Kt(tt).devicePixelRatio||1,{x:Fn,y:Pe,width:bt,height:kt}=dt.reference,Wt=(Math.round((Fn+bt)*mt)-Math.round(Fn*mt))/mt,Qt=(Math.round((Pe+kt)*mt)-Math.round(Pe*mt))/mt;vt.setProperty(p4,`${Wt}px`),vt.setProperty(m4,`${Qt}px`)}}),c4(tt=>({element:we.current||_t(tt.elements.floating).createElement("div"),padding:we.current?g:0}),[g]),{name:"transformOrigin",fn(tt){const{elements:{floating:on},middlewareData:Ft,placement:dt,platform:vt,rects:mt,y:Fn}=tt,Pe=xi(dt),bt=mo(dt),kt=Hi(Pe)==="y",Wt=we.current,Qt=typeof f=="function"?f(Xv(tt,u,X)):f;let bn;if(!Wt&&bt&&Math.abs(kt?Ft.shift?.x||0:Ft.shift?.y||0)<=1)bn=bt==="start"===(kt&&vt.isRTL?.(on)===!0)?"100%":"0%";else{const An=kt?Ft.arrow?.x||0:Ft.arrow?.y||0,Ti=kt?Wt?.clientWidth||0:Wt?.clientHeight||0;bn=`${An+Ti/2}px`}let vn=Pe==="top"||Pe==="left"?`calc(100% + ${Qt}px)`:`${-Qt}px`;return xe&&kt&&Math.abs(Ft.shift?.y||0)>Qt&&(vn=`${mt.reference.y+mt.reference.height/2-Fn}px`),on.style.setProperty(g4,kt?`${bn} ${vn}`:`${vn} ${bn}`),{}}},u4,E),De(()=>{!T&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[T,x]);const ft=S.useMemo(()=>({ancestorScroll:!w,elementResize:!w&&typeof ResizeObserver<"u",layoutShift:!w&&typeof IntersectionObserver<"u"}),[w]),{refs:ue,elements:ge,x:Fe,y:Ae,middlewareData:Me,update:Ct,placement:yt,context:ut,isPositioned:Dt,floatingStyles:an}=o({rootContext:x,open:M?T:void 0,placement:Q,middleware:Ee,strategy:a,whileElementsMounted:M?void 0:(...tt)=>uv(...tt,ft),nodeId:L,externalTree:O}),{sideX:$n,sideY:kn}=Me.adaptiveOrigin||f4,sn=Dt?a:"fixed",qn=S.useMemo(()=>{let tt;return Dt?E?tt={position:sn,[$n]:Fe,[kn]:Ae}:tt={...an,position:sn}:tt={position:sn,top:0,left:0},tt[Gv]="100vw",tt[Pv]="100vh",Dt||(tt.opacity=0),tt},[E,sn,$n,Fe,kn,Ae,an,Dt]),Ot=S.useRef(null);De(()=>{if(!T)return;const tt=te.current,on=typeof tt=="function"?tt():tt,dt=(Kv(on)?on.current:on)||null||null;dt!==Ot.current&&(ue.setPositionReference(dt),Ot.current=dt)},[T,ue,Y,te]),S.useEffect(()=>{if(!T)return;const tt=te.current;typeof tt!="function"&&Kv(tt)&&tt.current!==Ot.current&&(ue.setPositionReference(tt.current),Ot.current=tt.current)},[T,ue,Y,te]),S.useEffect(()=>{if(M&&T&&ge.reference&&ge.floating)return uv(ge.reference,ge.floating,Ct,ft)},[M,T,ge,Ct,ft]);const Un=xi(yt),Et=KS(u,Un,X),mn=mo(yt)||"center",Vt=!!Me.hide?.referenceHidden;De(()=>{j&&T&&Dt&&(Un!==N||ye&&mn!==I)&&K(yt)},[j,ye,T,Dt,yt,Un,mn,N,I]);const Yn=S.useMemo(()=>({position:"absolute",top:Me.arrow?.y,left:Me.arrow?.x}),[Me.arrow]),si=Me.arrow?.centerOffset!==0;return S.useMemo(()=>({positionerStyles:qn,arrowStyles:Yn,arrowRef:we,arrowUncentered:si,side:Et,align:mn,physicalSide:Un,anchorHidden:Vt,refs:ue,context:ut,isPositioned:Dt,update:Ct}),[qn,Yn,we,si,Et,mn,Un,Vt,ue,ut,Dt,Ct])}function Kv(n){return n!=null&&"current"in n}const QS=S.createContext(void 0);function Am(){const n=S.useContext(QS);if(!n)throw new Error(qi(59));return n}function Xu(n,o){n&&Object.assign(n.style,o)}const ZS={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};function JS(n){return n==="starting"?CA:nn}function v4(n,o,{styles:r,transitionStatus:a,props:u,refs:f,hidden:d,inert:p=!1}){const h={...r};return p&&(h.pointerEvents="none"),Lt("div",n,{state:o,ref:f,props:[{role:"presentation",hidden:d,style:h},JS(a),u],stateAttributesMapping:Ju})}const S4=20;function w4(n,o,r,a){const[u,f]=S.useState(!1);De(()=>{if(!n||!o||r==null){f(!1);return}const d=_t(r).documentElement.clientWidth,p=r.offsetWidth;f(d>0&&p>0&&p>=d-S4)},[n,o,r]),g1(n&&(!o||u),a)}const x4={position:"fixed"},E4=S.forwardRef(function(o,r){const{anchor:a,className:u,render:f,positionMethod:d,side:p,align:h,sideOffset:b,alignOffset:y,collisionBoundary:g="clipping-ancestors",collisionPadding:w,arrowPadding:R,sticky:M,disableAnchorTracking:x,alignItemWithTrigger:T=!0,collisionAvoidance:A=OA,style:_,...L}=o,E=yo(),j=qS(),O=E.useState("open"),D=E.useState("mounted"),z=E.useState("modal"),q=E.useState("value"),B=E.useState("openMethod"),V=E.useState("positionerElement"),G=E.useState("triggerElement"),P=E.useState("isItemEqualToValue"),Y=E.useState("transitionStatus"),te=S.useRef(null),U=S.useRef(null),[H,X]=S.useState(T),J=D&&H&&B!=="touch";!D&&H!==T&&X(T),S.useImperativeHandle(E.context.alignItemWithTriggerActiveRef,()=>J),w4((J||z)&&O,B==="touch",V,G);const K=y4({anchor:a,floatingRootContext:j,positionMethod:d,mounted:D,side:p,sideOffset:b,align:h,alignOffset:y,arrowPadding:R,collisionBoundary:g,collisionPadding:w,sticky:M,disableAnchorTracking:x??J,collisionAvoidance:A,keepMounted:!0}),ye=J?"none":K.side,fe=J?x4:K.positionerStyles,se={open:O,side:ye,align:K.align,anchorHidden:K.anchorHidden};De(()=>{E.set("popupSide",K.side)},[E,K.side]);const N=E.useStateSetter("positionerElement"),I=v4(o,se,{styles:fe,transitionStatus:Y,props:L,refs:[r,N],hidden:!D,inert:!O}),Q=S.useRef(0),$=ke(ie=>{if(E.context.valuesRef.current.length===0)return;const de=Q.current;Q.current=ie.size;const me=Bt(Rl);if(de!==0&&!E.state.multiple&&q!==null&&_u(E.context.valuesRef.current,q,P)===-1){const Re=E.context.initialValueRef.current,Ce=Re!=null&&_u(E.context.valuesRef.current,Re,P)!==-1?Re:null;E.context.setValue(Ce,me),Ce===null&&(E.set("selectedIndex",null),E.context.selectedItemTextRef.current=null)}if(de!==0&&E.state.multiple&&Array.isArray(q)){const ae=q.filter(Re=>_u(E.context.valuesRef.current,Re,P)!==-1);ae.length!==q.length&&(E.context.setValue(ae,me),ae.length===0&&(E.set("selectedIndex",null),E.context.selectedItemTextRef.current=null))}if(O&&J){E.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const ae={height:""};Xu(V,ae),Xu(E.context.popupRef.current,ae)}}),ce=S.useMemo(()=>({...K,side:ye,alignItemWithTriggerActive:J,setControlledAlignItemWithTrigger:X,scrollUpArrowRef:te,scrollDownArrowRef:U}),[K,ye,J,X]);return v.jsx(mm,{elementsRef:E.context.listRef,labelsRef:E.context.labelsRef,onMapChange:$,children:v.jsxs(QS.Provider,{value:ce,children:[D&&z&&v.jsx(m1,{inert:fm(!O),cutout:G}),I]})})}),bu="base-ui-disable-scrollbar",Yp={className:bu,getElement(n){return v.jsx("style",{nonce:n,href:bu,precedence:"base-ui:low",children:`.${bu}{scrollbar-width:none}.${bu}::-webkit-scrollbar{display:none}`})}},T4=S.createContext(void 0);function A4(n){return S.useContext(T4)}const Qv="--transform-origin",R4={...Ju,...Aa},C4=S.forwardRef(function(o,r){const{render:a,className:u,style:f,finalFocus:d,...p}=o,h=yo(),b=h.useState("multiple"),y=h.useState("readOnly"),g=h.useState("highlightItemOnHover"),w=qS(),{side:R,align:M,alignItemWithTriggerActive:x,isPositioned:T,setControlledAlignItemWithTrigger:A}=Am(),_=A4()!=null,L=vm(),{nonce:E,disableStyleElements:j}=yN(),O=h.useState("id"),D=h.useState("open"),z=h.useState("openMethod"),q=h.useState("mounted"),B=h.useState("popupProps"),V=h.useState("transitionStatus"),G=h.useState("triggerElement"),P=h.useState("positionerElement"),Y=h.useState("listElement"),te=S.useRef(!1),U=S.useRef(!1),H=S.useRef({}),X=Ea(),J=ke(se=>{if(!P||!h.context.popupRef.current||!U.current)return;const N=P.style.top==="0px",I=P.style.bottom==="0px";if(te.current||!x||!N&&!I){h.context.handleScrollArrowVisibility(se);return}const Q=Jv(P),$=_s(P.getBoundingClientRect().height,"y",Q),ce=_t(P),ie=Kt(P),de=ie.getComputedStyle(P),me=parseFloat(de.marginTop),ae=parseFloat(de.marginBottom),Re=Zv(ie.getComputedStyle(h.context.popupRef.current)),we=Math.min(ce.documentElement.clientHeight-me-ae,Re),Ce=se.scrollTop,je=vu(se);let Se=null;const Ne=Ie=>{P.style.height=`${Ie}px`},Ee=N?je-Ce:Ce,Ue=Math.min($+Ee,we);if(Ee<=eo){const Ie=Ns(Ee,0,we-$);Ie>0&&Ne($+Ie),se.scrollTop=N?je:0,we-($+Ie)<=eo&&(te.current=!0),h.context.handleScrollArrowVisibility(se);return}if(we-Ue>eo)Se=N?1/0:0;else if(I&&Ce<je){const Ie=$+Ee-we;Se=Ce-(Ee-Ie)}const xe=Math.ceil(Ue);if(xe!==0&&Ne(xe),Se!=null){const Ie=Ns(Se,0,vu(se));Math.abs(se.scrollTop-Ie)>eo&&(se.scrollTop=Ie)}xe>=we-eo&&(te.current=!0),h.context.handleScrollArrowVisibility(se)});S.useImperativeHandle(h.context.scrollHandlerRef,()=>J,[J]),Ra({open:D,ref:h.context.popupRef,onComplete(){D&&h.context.onOpenChangeComplete(!0)}});const K={open:D,transitionStatus:V,side:R,align:M};De(()=>{!P||!h.context.popupRef.current||Object.keys(H.current).length||(H.current={top:P.style.top||"0",left:P.style.left||"0",right:P.style.right,height:P.style.height,bottom:P.style.bottom,minHeight:P.style.minHeight,maxHeight:P.style.maxHeight,marginTop:P.style.marginTop,marginBottom:P.style.marginBottom})},[h,P]),De(()=>{D||x||(U.current=!1,te.current=!1,Xu(P,H.current))},[D,x,P]),De(()=>{const se=h.context.popupRef.current;if(!D||!G||!P||!se||x&&!T||h.state.transitionStatus==="ending")return;if(U.current=!0,se.style.removeProperty(Qv),!x){X.request(()=>h.context.handleScrollArrowVisibility(Y||se));return}const N=O4(se);try{let I=h.context.selectedItemTextRef.current;I?.isConnected||(I=!h.select("hasSelectedValue")&&h.context.firstItemTextRef.current?.isConnected?h.context.firstItemTextRef.current:null);const Q=h.context.valueRef.current,$=Kt(P),ce=$.getComputedStyle(P),ie=$.getComputedStyle(se),de=_t(G),me=Jv(G),ae=Su(G.getBoundingClientRect(),me),Re=Su(P.getBoundingClientRect(),me),we=ae.height,Ce=Y||se,je=Ce.scrollHeight,Se=parseFloat(ie.borderBottomWidth),Ne=parseFloat(ce.marginTop)||10,Ee=parseFloat(ce.marginBottom)||10,Ue=parseFloat(ce.minHeight)||100,xe=Zv(ie),Ie=5,$e=5,ft=20,ue=de.documentElement.clientHeight-Ne-Ee,ge=de.documentElement.clientWidth,Fe=ue-ae.bottom+we;let Ae,Me=L==="rtl"?ae.right-Re.width:ae.left,Ct=0;if(I&&Q){const Et=Su(Q.getBoundingClientRect(),me);Ae=Su(I.getBoundingClientRect(),me),Me=Re.left+(L==="rtl"?Et.right-Ae.right:Et.left-Ae.left);const mn=Et.top-ae.top+Et.height/2;Ct=Ae.top-Re.top+Ae.height/2-mn}const yt=Fe+Ct+Ee+Se;let ut=Math.min(ue,yt);const Dt=ue-Ne-Ee,an=yt-ut,$n=ge-$e;P.style.left=`${Ns(Me,Ie,$n-Re.width)}px`,P.style.height=`${ut}px`,P.style.maxHeight="none",P.style.marginTop=`${Ne}px`,P.style.marginBottom=`${Ee}px`,se.style.height="100%";const kn=vu(Ce),sn=an>=kn-eo;sn&&(ut=Math.min(ue,Re.height)-(an-kn));const qn=ae.top<ft||ae.bottom>ue-ft||Math.ceil(ut)+eo<Math.min(je,Ue),Ot=($.visualViewport?.scale??1)!==1&&_l;if(qn||Ot){Xu(P,H.current),A(!1);return}const Un=Math.max(Ue,ut);if(sn){const Et=Math.max(0,ue-yt);P.style.top=Re.height>=Dt?"0":`${Et}px`,P.style.height=`${ut}px`,Ce.scrollTop=vu(Ce)}else P.style.bottom="0",Ce.scrollTop=an;if(Ae){const Et=Re.top,mn=Re.height,Vt=Ae.top+Ae.height/2,Yn=Ns(mn>0?(Vt-Et)/mn*100:50,0,100);se.style.setProperty(Qv,`50% ${Yn}%`)}(Un===ue||ut>=xe)&&(te.current=!0),h.context.handleScrollArrowVisibility(Ce),g&&h.state.selectedIndex===null&&h.state.activeIndex===null&&h.context.listRef.current[0]!=null&&h.set("activeIndex",0)}finally{N()}},[h,D,P,G,x,A,X,Y,g,L,T]),S.useEffect(()=>{if(!x||!P||!D)return;const se=Kt(P);function N(I){h.context.setOpen(!1,Bt(PT,I))}return zt(se,"resize",N)},[h,x,P,D]);const ye={...Y?{role:"presentation"}:{role:"listbox","aria-multiselectable":b||void 0,"aria-readonly":y||void 0,id:`${O}-list`},onKeyDown(se){_&&um.has(se.key)&&se.stopPropagation()},onScroll(se){Y||J(se.currentTarget)},...x&&{style:Y?{height:"100%"}:ZS},className:!Y&&x?Yp.className:void 0},fe=Lt("div",o,{ref:[r,h.context.popupRef],state:K,stateAttributesMapping:R4,props:[B,ye,JS(V),p]});return v.jsxs(S.Fragment,{children:[!j&&Yp.getElement(E),v.jsx(Q2,{context:w,modal:!1,disabled:!q,openInteractionType:z,returnFocus:d,restoreFocus:!0,children:fe})]})});function Zv(n){const o=n.maxHeight;return o.endsWith("px")&&parseFloat(o)||1/0}function vu(n){return Em(n.scrollHeight,n.clientHeight)}function Jv(n){return f1.getScale(n)}function _s(n,o,r){return n/r[o]}function Su(n,o){return Is({x:_s(n.x,"x",o),y:_s(n.y,"y",o),width:_s(n.width,"x",o),height:_s(n.height,"y",o)})}const $v=[["transform","none"],["scale","1"],["translate","0 0"]];function O4(n){const{style:o}=n,r={};for(const[a,u]of $v)r[a]=o.getPropertyValue(a),o.setProperty(a,u,"important");return()=>{for(const[a]of $v){const u=r[a];u?o.setProperty(a,u):o.removeProperty(a)}}}const M4=S.forwardRef(function(o,r){const{render:a,className:u,style:f,...d}=o,p=yo(),h=p.useState("multiple"),b=p.useState("readOnly"),{alignItemWithTriggerActive:y}=Am(),g=p.useState("hasScrollArrows"),w=p.useState("openMethod"),M={id:`${p.useState("id")}-list`,role:"listbox","aria-multiselectable":h||void 0,"aria-readonly":b||void 0,onScroll(T){p.context.scrollHandlerRef.current?.(T.currentTarget)},...y&&{style:ZS},className:g&&w!=="touch"?Yp.className:void 0},x=p.useStateSetter("listElement");return Lt("div",o,{ref:[r,x],props:[M,d]})}),$S=S.createContext(void 0);function WS(){const n=S.useContext($S);if(!n)throw new Error(qi(57));return n}const N4=S.memo(S.forwardRef(function(o,r){const{render:a,className:u,style:f,value:d=null,label:p,disabled:h=!1,nativeButton:b=!1,...y}=o,g=S.useRef(null),w=bm({guess:!0,label:p,textRef:g}),R=yo(),{props:M,multiple:x,disabled:T,readOnly:A,isItemEqualToValue:_}=R.useState("itemRoot"),L=T||h,E=R.useState("isActive",w.index),j=R.useState("open"),O=R.useState("isSelected",d),D=R.useState("isSelectedByFocus",w.index),z=w.index,q=S.useRef(null);De(()=>{const K=R.context.valuesRef.current;return K[z]=d,()=>{delete K[z]}},[z,d,R]),De(()=>{const K=R.state.value,ye=R.state.selectedIndex;let fe=ye,se;x&&Array.isArray(K)?(fe=VN(z,d,R.context.valuesRef.current,K,_,ye),se=fe===z,z===ye&&!se&&(R.context.selectedItemTextRef.current=null)):(se=K!==void 0&&vr(d,K,_),se&&(fe=z)),R.set("selectedIndex",fe),se&&g.current&&(R.context.selectedItemTextRef.current=g.current)},[z,x,_,R,d]);const B=S.useRef("mouse"),V=S.useRef(!1),{getButtonProps:G,buttonRef:P}=Sr({disabled:L,focusableWhenDisabled:!0,native:b,composite:!0}),Y={disabled:L,selected:O,highlighted:E};function te(K){if(T||A)return;const ye=R.state.value;if(x){const fe=Array.isArray(ye)?ye:[],se=O?qN(fe,d,_):[...fe,d];R.context.setValue(se,Bt(Kh,K))}else R.context.setValue(d,Bt(Kh,K)),R.context.setOpen(!1,Bt(Kh,K))}function U(){R.context.selectionRef.current.dragY=0}const H={role:"option","aria-selected":O,tabIndex:j&&E?0:-1,onKeyDown(K){R.set("activeIndex",z),K.key===" "&&R.context.typingRef.current&&K.preventDefault()},onClick(K){const ye=B.current!=="touch",fe=K.nativeEvent.pointerType,se=ye&&xa(K.nativeEvent)&&(fe!==void 0||E),N=ye&&!se&&!V.current;V.current=!1,!(L||N)&&te(K.nativeEvent)},onPointerEnter(K){B.current=K.pointerType},onPointerMove(K){if(K.pointerType==="mouse"&&K.buttons===1){const ye=R.context.selectionRef.current;ye.dragY+=K.movementY,ye.dragY**2>=64&&(ye.allowUnselectedMouseUp=!0)}},onPointerDown(K){B.current=K.pointerType,V.current=!0,U()},onMouseUp(){if(U(),L||B.current==="touch"||V.current)return;const K=!R.context.selectionRef.current.allowSelectedMouseUp&&O,ye=!R.context.selectionRef.current.allowUnselectedMouseUp&&!O;K||ye||(V.current=!0,q.current?.click(),V.current=!1)}},X=Lt("div",o,{ref:[P,r,w.ref,q],state:Y,props:[M,H,y,G]}),J=S.useMemo(()=>({selected:O,index:z,textRef:g,selectedByFocus:D}),[O,z,g,D]);return v.jsx($S.Provider,{value:J,children:X})})),_4=S.memo(S.forwardRef(function(o,r){const{render:a,className:u,style:f,keepMounted:d,selected:p,...h}=o,b=S.useRef(null),{transitionStatus:y,setMounted:g}=ff(p),R=Lt("span",o,{ref:[r,b],state:{selected:p,transitionStatus:y},props:[{"aria-hidden":!0,children:"✔️"},h],stateAttributesMapping:Aa});return Ra({batch:!0,enabled:!p,open:p,ref:b,onComplete(){p||g(!1)}}),R})),D4=S.forwardRef(function(o,r){const{selected:a}=WS();return o.keepMounted||a?v.jsx(_4,{...o,selected:a,ref:r}):null}),j4=S.memo(S.forwardRef(function(o,r){const{index:a,textRef:u,selectedByFocus:f}=WS(),d=yo(),{render:p,className:h,style:b,...y}=o,g=S.useCallback(R=>{R&&(a===0&&(d.context.firstItemTextRef.current=R),f&&(d.context.selectedItemTextRef.current=R))},[d,a,f]);return Lt("div",o,{ref:[g,r,u],props:y})})),ew=S.forwardRef(function(o,r){const{render:a,className:u,style:f,direction:d,keepMounted:p,...h}=o,b=d==="up",y=yo(),{side:g,scrollDownArrowRef:w,scrollUpArrowRef:R}=Am(),M=b?"scrollUpArrowVisible":"scrollDownArrowVisible",x=y.useState(M),T=y.useState("openMethod"),A=x&&T!=="touch",_=Bi(),L=b?R:w,{mounted:E,transitionStatus:j,setMounted:O}=ff(A);De(()=>(y.context.scrollArrowsMountedCountRef.current+=1,y.set("hasScrollArrows",!0),()=>{y.context.scrollArrowsMountedCountRef.current=Math.max(0,y.context.scrollArrowsMountedCountRef.current-1),y.context.scrollArrowsMountedCountRef.current===0&&y.set("hasScrollArrows",!1)}),[y]),Ra({open:A,ref:L,onComplete(){A||O(!1)}});const q=Lt("div",o,{ref:[r,L],state:{direction:d,visible:A,side:g,transitionStatus:j},props:[{"aria-hidden":!0,children:b?"▲":"▼",style:{position:"absolute"},onMouseMove(V){if(V.movementX===0&&V.movementY===0||_.isStarted())return;y.set("activeIndex",null);function G(){const P=y.state.listElement??y.context.popupRef.current;if(!P)return;y.set("activeIndex",null),y.context.handleScrollArrowVisibility(P);const Y=Em(P.scrollHeight,P.clientHeight),te=Pu(P.scrollTop,Y),U=te===(b?0:Y),H=y.context.listRef.current;if(te!==P.scrollTop&&(P.scrollTop=te),U){_.clear();return}if(H.length>0){const X=L.current?.offsetHeight||0;P.scrollTop=z4(H,b,te,P.clientHeight,X,Y)}_.start(40,G)}_.start(40,G)},onMouseLeave(){_.clear()}},h],stateAttributesMapping:Aa});return E||p?q:null});function z4(n,o,r,a,u,f){if(o){let y=0;const g=r+u-eo;for(let M=0;M<n.length;M+=1){const x=n[M];if(x&&x.offsetTop>=g){y=M;break}}const w=Math.max(0,y-1),R=n[w];return w<y&&R?Pu(R.offsetTop-u,f):0}let d=n.length-1;const p=r+a-u+eo;for(let y=0;y<n.length;y+=1){const g=n[y];if(g&&g.offsetTop+g.offsetHeight>p){d=Math.max(0,y-1);break}}const h=Math.min(n.length-1,d+1),b=n[h];return h>d&&b?Pu(b.offsetTop+b.offsetHeight-a+u,f):f}const L4=S.forwardRef(function(o,r){return v.jsx(ew,{...o,ref:r,direction:"down"})}),k4=S.forwardRef(function(o,r){return v.jsx(ew,{...o,ref:r,direction:"up"})}),U4=S.createContext(void 0),I4=S.forwardRef(function(o,r){const{render:a,className:u,style:f,...d}=o,[p,h]=S.useState(),b=S.useMemo(()=>({labelId:p,setLabelId:h}),[p,h]),y=Lt("div",o,{ref:r,props:[{role:"group","aria-labelledby":p},d]});return v.jsx(U4.Provider,{value:b,children:y})}),H4=QN;function B4({className:n,...o}){return v.jsx(I4,{"data-slot":"select-group",className:Vn("scroll-my-1 p-1",n),...o})}function V4({className:n,...o}){return v.jsx(o4,{"data-slot":"select-value",className:Vn("flex flex-1 text-left",n),...o})}function q4({className:n,size:o="default",children:r,...a}){return v.jsxs(n4,{"data-slot":"select-trigger","data-size":o,className:Vn("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...a,children:[r,v.jsx(l4,{render:v.jsx(N1,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function Y4({className:n,children:o,side:r="bottom",sideOffset:a=4,align:u="center",alignOffset:f=0,alignItemWithTrigger:d=!0,...p}){return v.jsx(r4,{children:v.jsx(E4,{side:r,sideOffset:a,align:u,alignOffset:f,alignItemWithTrigger:d,className:"isolate z-50",children:v.jsxs(C4,{"data-slot":"select-content","data-align-trigger":d,className:Vn("cn-menu-target cn-menu-translucent relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",n),...p,children:[v.jsx(G4,{}),v.jsx(M4,{children:o}),v.jsx(P4,{})]})})})}function F4({className:n,children:o,...r}){return v.jsxs(N4,{"data-slot":"select-item",className:Vn("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),...r,children:[v.jsx(j4,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:o}),v.jsx(D4,{render:v.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:v.jsx(QC,{className:"pointer-events-none"})})]})}function G4({className:n,...o}){return v.jsx(k4,{"data-slot":"select-scroll-up-button",className:Vn("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",n),...o,children:v.jsx(ZC,{})})}function P4({className:n,...o}){return v.jsx(L4,{"data-slot":"select-scroll-down-button",className:Vn("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",n),...o,children:v.jsx(N1,{})})}function Ku({id:n,label:o,value:r,choices:a,disabled:u,onChange:f}){return v.jsxs(H4,{modal:!1,items:a,value:r,disabled:u,onValueChange:d=>{d!==null&&f(d)},children:[v.jsx(q4,{id:n,"aria-label":o,"data-studio":"select-37",children:v.jsx(V4,{})}),v.jsx(Y4,{alignItemWithTrigger:!1,align:"start",sideOffset:6,children:v.jsx(B4,{children:a.map(d=>v.jsx(F4,{value:d.value,children:d.label},d.value))})})]})}const wu={x:0,y:0},dp={ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0},ArrowUp:{x:0,y:1},ArrowDown:{x:0,y:-1}};function Fp({label:n,disabled:o,target:r,onChange:a,onRelease:u}){const[f,d]=S.useState(wu),[p,h]=S.useState(!1),b=S.useRef(null),y=S.useRef(new Set),g=S.useRef(u);g.current=u;function w(){b.current===null&&!y.current.size||(b.current=null,y.current.clear(),d(wu),h(!1),g.current?.())}S.useEffect(()=>{const A=()=>{document.hidden&&w()};return window.addEventListener("blur",w),document.addEventListener("visibilitychange",A),()=>{window.removeEventListener("blur",w),document.removeEventListener("visibilitychange",A),(b.current!==null||y.current.size)&&g.current?.()}},[]),S.useEffect(()=>{o&&w()},[o]);function R(A,_){const L=Math.hypot(A,_),E=L<.1?0:Math.min(1,(L-.1)/.9)/L,j={x:A*E,y:_*E};d(j),a(j)}function M(A){if(b.current!==A.pointerId)return;const _=A.currentTarget.getBoundingClientRect(),L=Math.min(_.width,_.height)*.32;R((A.clientX-_.left-_.width/2)/L,(_.top+_.height/2-A.clientY)/L)}function x(A,_){if(!dp[A.key]||o||b.current!==null)return;if(A.preventDefault(),_){if(A.repeat||y.current.has(A.key))return;y.current.add(A.key),h(!0)}else{if(!y.current.has(A.key))return;if(y.current.size===1){w();return}y.current.delete(A.key)}const{x:E,y:j}=[...y.current].reduce((O,D)=>({x:O.x+dp[D].x,y:O.y+dp[D].y}),wu);R(E,j)}const T=p?f:r??wu;return v.jsx("div",{className:"stick-unit",children:v.jsx("div",{role:"group",tabIndex:o?-1:0,"aria-label":n,"aria-disabled":o||void 0,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight",className:"control-stick","data-engaged":p,style:{"--stick-x":T.x,"--stick-y":-T.y},onPointerDown:A=>{o||A.button!==0||b.current!==null||y.current.size||(A.preventDefault(),A.currentTarget.focus({preventScroll:!0}),A.currentTarget.setPointerCapture(A.pointerId),b.current=A.pointerId,h(!0),M(A))},onPointerMove:M,onPointerUp:A=>{b.current===A.pointerId&&w()},onPointerCancel:A=>{b.current===A.pointerId&&w()},onLostPointerCapture:A=>{b.current===A.pointerId&&w()},onKeyDown:A=>x(A,!0),onKeyUp:A=>x(A,!1),onBlur:w,children:v.jsxs("div",{className:"stick-track","aria-hidden":"true",children:[v.jsx(XC,{className:"stick-up"}),v.jsx(FC,{className:"stick-down"}),v.jsx(GC,{className:"stick-left"}),v.jsx(PC,{className:"stick-right"}),v.jsx("span",{className:"stick-thumb"})]})})})}function X4(n,o,r,a=!0,u,f){const[d,p]=S.useState(),h=Nl(u?`${u}-label`:void 0),b=!!f?.trim(),g=n??(b?void 0:o)??d;return De(()=>{const w=n||o||b||!a?void 0:K4(r.current,h);d!==w&&p(w)}),g}function K4(n,o){const r=Q4(n);if(r)return!r.id&&o&&(r.id=o),r.id||void 0}function Q4(n){if(!n)return;const o=n.parentElement;if(o&&o.tagName==="LABEL")return o;const r=n.id;if(r){const u=n.nextElementSibling;if(u&&u.htmlFor===r)return u}const a=n.labels;return a&&a[0]}const Z4=S.forwardRef(function(o,r){const{render:a,className:u,id:f,name:d,value:p,disabled:h=!1,onValueChange:b,defaultValue:y,autoFocus:g=!1,style:w,...R}=o,{state:M,name:x,disabled:T,setTouched:A,setDirty:_,validityData:L,setFilled:E,validationMode:j,validation:O}=Ca(),{clearErrors:D,elementRef:z,submitCountRef:q}=xm(),B=T||h,V=x??d,G={...M,disabled:B},{labelId:P}=vf(),Y=Sf({id:f}),te=p!==void 0,U=p==null?void 0:String(p),H=ke(()=>O.inputRef.current?.value);wm(O.inputRef,Y,U,H,!B,d),De(()=>{const fe=U??O.inputRef.current?.value;fe!==void 0&&E(fe!=="")},[U,y,O.inputRef,E]),mf(U,()=>{U!==void 0&&(D(V),_(U!==(L.initialValue??"")),O.change(U))});const X=S.useRef(null),J=Tm(B,X),K=Bi();return Lt("input",o,{ref:[r,X],state:G,props:[{id:Y,disabled:B,name:V,ref:O.inputRef,"aria-labelledby":P,autoFocus:g,...te?{value:p}:{defaultValue:y},onChange(fe){const se=fe.currentTarget.value,N=Bt(Rl,fe.nativeEvent);b?.(se,N),!te&&(_(se!==(L.initialValue??"")),E(se!==""),!fe.nativeEvent.defaultPrevented&&!N.isCanceled&&(D(V),O.change(se)))},onFocus(){J(!0)},onBlur(fe){if(A(!0),J(!1),j==="onBlur"){const se=fe.currentTarget.value;O.commit(se),te&&queueMicrotask(()=>{const N=O.inputRef.current?.value;N!==void 0&&N!==se&&N!==(L.initialValue??"")&&O.commit(N)})}},onKeyDown(fe){if(fe.currentTarget.tagName==="INPUT"&&fe.key==="Enter"){A(!0);const se=fe.currentTarget.value,N=fe.currentTarget.form;if(N&&N===z.current&&!fe.defaultPrevented){const I=fe.currentTarget,Q=q.current;K.start(0,()=>{q.current===Q&&O.commit(I.value)})}else O.commit(se)}}},R,fe=>O.getValidationProps(B,fe)],stateAttributesMapping:Sm})}),J4=S.forwardRef(function(o,r){return v.jsx(Z4,{ref:r,...o})});function Rm({className:n,type:o,...r}){return v.jsx(J4,{type:o,"data-slot":"input",className:Vn("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",n),...r})}function Qu({id:n,label:o,unit:r,value:a,onChange:u,onSlide:f=u,min:d,max:p,sliderRange:h,sliderFallback:b=0,inputStep:y,sliderStep:g=.001,required:w}){const{t:R}=ai(),M=h?.[0]??d??0,x=h?.[1]??p??1,T=a.trim()?Number(a):b,A=Math.min(x,Math.max(M,Number.isFinite(T)?T:b)),_=r?n+"-unit":void 0;return v.jsxs("div",{className:"numeric-field",children:[v.jsx(wl,{htmlFor:n,children:o}),v.jsxs("div",{className:"input-unit",children:[v.jsx(Rm,{id:n,name:n,type:"number",min:d,max:p,step:y??"any","aria-describedby":_,required:w,value:a,onChange:L=>u(L.target.value)}),r&&v.jsx("span",{id:_,children:r})]}),v.jsx("input",{type:"range","aria-label":R("{label}滑块",{label:o}),"aria-describedby":_,min:M,max:x,step:g,value:A,onChange:L=>f(L.target.value)})]})}const Ii={maxSpeed:.6,maxYawSpeed:1.5,minStep:.001,minHoldMs:50,maxDurationMs:2e4},$4={mode:"ramp",startSpeed:0,maxSpeed:.1,step:.01,holdMs:1e3,maxDurationMs:2e4};function bl(n,o,r){return Number.isFinite(n)&&n>=o&&n<=r}function Zu(n){const{mode:o,startSpeed:r,holdMs:a}=n,u=Ii;if(!Number.isInteger(a)||!bl(a,u.minHoldMs,u.maxDurationMs))throw new Error((o==="fixed"?"前进时长":"每档时长")+"须在 0.05~20 秒之间,精确到毫秒");if(o==="fixed"){const{lateralSpeed:b=0,yawSpeed:y=0}=n;if(!bl(r,-.6,u.maxSpeed)||!bl(b,-.6,u.maxSpeed))throw new Error("前后和横向速度须在 −0.6~0.6 m/s 之间");if(!bl(y,-1.5,u.maxYawSpeed))throw new Error("转向速度须在 −1.5~1.5 rad/s 之间");if(r===0&&b===0&&y===0)throw new Error("至少设置一个非零速度");return[r]}if(o!=="ramp")throw new Error("未知的前进测试方式");if(!bl(r,0,u.maxSpeed))throw new Error("起始速度须在 0~0.6 m/s 之间");const{maxSpeed:f,step:d,maxDurationMs:p}=n;if(!Number.isInteger(p)||!bl(p,u.minHoldMs,u.maxDurationMs))throw new Error("总时限须在 0.05~20 秒之间,精确到毫秒");if(!bl(f,r,u.maxSpeed)||f===0)throw new Error("最高速度须大于 0、不低于起始速度且不超过 0.6 m/s");if(!bl(d,u.minStep,u.maxSpeed))throw new Error("递增步长须在 0.001~0.6 m/s 之间");const h=r>0?[r]:[];for(let b=1;;b++){const y=Number((r+d*b).toFixed(10));if(y>=f)break;h.push(y)}return h.at(-1)!==f&&h.push(f),h}function Wv(n,o){return new Promise((r,a)=>{o.throwIfAborted();const u=setTimeout(()=>{o.removeEventListener("abort",f),r()},n);function f(){clearTimeout(u),a(o.reason)}o.addEventListener("abort",f,{once:!0})})}function W4(n){if(n===void 0)return{durationMs:2e4,keepaliveMs:500};if(n&&typeof n=="object"&&"durationMs"in n&&"keepaliveMs"in n&&typeof n.durationMs=="number"&&Number.isFinite(n.durationMs)&&n.durationMs>0&&typeof n.keepaliveMs=="number"&&Number.isFinite(n.keepaliveMs)&&n.keepaliveMs>0)return{durationMs:n.durationMs,keepaliveMs:n.keepaliveMs};throw new Error("设备上报的运动时限无效")}class e3{robot;active=null;constructor(o){this.robot=o}get running(){return this.active!==null}cancel(o="手动取消"){this.active?.cancel(o)}stop(){const o=this.active;return o?(o.cancel("手动停车"),o.stop()):this.robot.stop()}async run(o,r){if(this.active)throw new Error("前进测试正在进行");const{mode:a}=o,u=a==="manual",f=u?[0]:Zu(o),d=u?Ii.maxDurationMs:o.holdMs,p=o.mode==="fixed"?{vy:o.lateralSpeed??0,vyaw:o.yawSpeed??0}:{vy:0,vyaw:0},h=this.robot,{robotId:b,connectionEpoch:y}=h.context,g=()=>!h.disposed&&h.context.connectionState==="ready"&&h.context.robotId===b&&h.context.connectionEpoch===y;if(!g())throw new Error("设备尚未连接");const w=new AbortController,R=w.signal,M=[];let x,T=0,A=0,_=!1,L,E,j,O,D,z,q;const B=()=>({speed:A,elapsedMs:x===void 0?0:Math.round(performance.now()-x),stageElapsedMs:x===void 0?0:Math.round(performance.now()-T),appliedVx:L?.[0],applied:L}),V=(Y,te)=>{R.aborted||(j={...B(),reason:Y,message:te,...E&&{firstWalk:E}},w.abort(new Error(te??Y)))},G=()=>(D||(D=g()?h.stop({timeoutMs:2e3}):Promise.reject(new Error("无法向原连接请求停车"))),D),P=new Promise((Y,te)=>{R.addEventListener("abort",()=>{_&&g()&&G().catch(()=>{}),te(R.reason)},{once:!0})});P.catch(()=>{}),this.active={cancel:Y=>V("cancelled",Y),stop:G};try{M.push(h.onAppExit(()=>V("cancelled","应用离场,SDK 接管停车"))),M.push(h.on("context",()=>{g()||w.abort(new Error("设备连接发生变化,测试已中断"))})),M.push(h.onFault(ie=>w.abort(new Error(ie.reason))));const Y={signal:R,timeoutMs:3e3},[te,U]=await Promise.race([Promise.all([h.getStatus(Y),h.getCapabilities(Y)]),P]);if(R.throwIfAborted(),te.state!=="READY")throw new Error("执行器未就绪:"+te.state);if(te.halted)throw new Error("软件急停已锁存");if(te.mode?.mode==="direct")throw new Error("请先切换到行走或轮滑模式");if(te.poseActive)throw new Error("请先解除身体姿态保持");const H=W4(te.motionLimits),X=Math.min(a==="ramp"?o.maxDurationMs:d,H.durationMs),J=1e3/U.maxCommandHz,K=Math.max(0,Math.min(10,(H.keepaliveMs-J)/2)),ye=Math.ceil(Math.max(J+K,Math.min(125,H.keepaliveMs/2)));if(!Number.isFinite(U.maxCommandHz)||U.maxCommandHz<=0||!Number.isFinite(U.telemetryHz)||U.telemetryHz<=0||X>=H.keepaliveMs&&ye>=H.keepaliveMs)throw new Error("设备的指令频率或遥测频率无法支持本次运动测试");if(f.length>1&&d<X&&d<ye)throw new Error("每档时长短于设备允许的发令间隔");const fe=Math.max(1e3,Math.ceil(3e3/U.telemetryHz));let se=-1/0,N=-1/0,I=1/0,Q="timeout";await new Promise((ie,de)=>{const me=()=>de(R.reason);R.addEventListener("abort",me,{once:!0}),M.push(()=>R.removeEventListener("abort",me)),z=setTimeout(()=>w.abort(new Error("未收到新的站立遥测")),Math.max(3e3,fe)),M.push(h.onTelemetry(ae=>{if(!(R.aborted||ae.t<=se))if(se=ae.t,N=performance.now(),clearTimeout(z),z=setTimeout(()=>w.abort(new Error("运动遥测超时")),fe),L=ae.move?.applied,ae.halted)w.abort(new Error("软件急停已锁存"));else if(ae.poseActive)w.abort(new Error("设备正在保持身体姿态"));else if(ae.state==="FAULT"||ae.state==="INIT")w.abort(new Error(ae.faultReason??"设备未就绪"));else if(!_)ae.policy==="stand"&&ae.state==="READY"?ie():w.abort(new Error("请在设备静止站立后开始测试,当前策略:"+ae.policy));else if(N>=I)V(Q);else if(ae.policy==="walk"){if(E)return;E=B(),a==="ramp"&&V("walk");try{r?.({kind:"walk",...E})}catch(Re){w.abort(Re)}}else!u&&ae.policy!=="stand"&&w.abort(new Error("设备离开站立策略:"+ae.policy))}))}),R.throwIfAborted(),r?.({kind:"ready",...B()});let ce=-1/0;for(const[ie,de]of f.entries()){const me=Math.ceil(ce+ye-performance.now());me>0&&await Wv(me,R),R.throwIfAborted();const ae=performance.now();ae>=I&&(V(Q),R.throwIfAborted()),T=ae,x===void 0&&(x=T,I=x+X,q=setTimeout(()=>V("timeout"),Math.ceil(X)));const Re=T+d;!u&&ie===f.length-1&&Re<=I&&(I=Re,Q="finished",clearTimeout(q),q=setTimeout(()=>V("finished"),d));let we=!0;do{R.throwIfAborted();const Ce=performance.now();if(Ce>=I&&(V(Q),R.throwIfAborted()),!g()||Ce-N>=fe)throw new Error("设备连接或遥测已中断");if(Number.isFinite(ce)&&Ce-ce>=H.keepaliveMs)throw new Error("运动保活超时");const je=u?o.target():{vx:de,...p};u&&!je.vx&&!je.vy&&!je.vyaw&&(V("cancelled"),R.throwIfAborted()),A=je.vx??0,_=!0,ce=performance.now();const Se=h.move(je,{signal:R,timeoutMs:Math.min(12e4,Math.floor(H.keepaliveMs))});if(we){we=!1;try{r?.({kind:"stage",...B()})}catch($e){w.abort($e)}}const Ne=await Promise.race([Se,P]);if(u&&!Ne.accepted)throw new Error("设备拒绝了指令");const Ee=ce+ye,xe=ie+1<f.length&&Re-Ee<ye&&Re-ce<H.keepaliveMs-10?Re:Math.min(I,Re,Ee),Ie=Math.ceil(xe-performance.now());Ie>0&&await Wv(Ie,R)}while(performance.now()<Re)}V("finished")}catch(Y){if(!j)throw O=R.aborted?R.reason:Y,_&&!g()?new Error(String(O)+";与原设备断开,停车受理未确认"):O}finally{clearTimeout(q),clearTimeout(z);for(const Y of M)Y();R.aborted||w.abort(O);try{(D||_&&g())&&await G()}catch(Y){const te=j?.reason??String(O);throw new Error("测试结束("+te+","+A+" m/s),停车受理未确认:"+String(Y))}finally{this.active=null}}return j}}const Du="microbotx.sdk-diagnostics.forward.v1",t3=[{value:"fixed",label:"定时移动"},{value:"ramp",label:"阶梯加速"}],mr={linear:.2,yaw:.1},n3=[["前进",mr.linear,0,0],["后退",-.2,0,0],["左移",0,mr.linear,0],["右移",0,-.2,0],["左转",0,0,mr.yaw],["右转",0,0,-.1]],hp=n=>Number(n.toFixed(3));function pp(n){const o=$4;let r=n==="fixed"?{mode:n,startSpeed:mr.linear,holdMs:3e3}:o;try{const a=JSON.parse(localStorage.getItem(Du+"."+n)??"null");if(a?.mode===n){const u=n==="fixed"&&Number.isFinite(a.maxDurationMs)?{...a,holdMs:Math.min(a.holdMs,a.maxDurationMs)}:a;Zu(u),r=u}}catch{}return{mode:n,startSpeed:String(r.startSpeed),lateralSpeed:String(r.mode==="fixed"?r.lateralSpeed??0:0),yawSpeed:String(r.mode==="fixed"?r.yawSpeed??0:0),maxSpeed:String(r.mode==="ramp"?r.maxSpeed:o.maxSpeed),step:String(r.mode==="ramp"?r.step:o.step),hold:String(r.holdMs/1e3),limit:String((r.mode==="ramp"?r.maxDurationMs:o.maxDurationMs)/1e3)}}function e2(n){const o=u=>u.trim()?Number(u):NaN,r=o(n.startSpeed),a=Number((o(n.hold)*1e3).toFixed(6));return n.mode==="fixed"?{mode:"fixed",startSpeed:r,holdMs:a,lateralSpeed:o(n.lateralSpeed),yawSpeed:o(n.yawSpeed)}:{mode:"ramp",startSpeed:r,holdMs:a,maxSpeed:o(n.maxSpeed),step:o(n.step),maxDurationMs:Number((o(n.limit)*1e3).toFixed(6))}}const fr=(n,o)=>n("{seconds} 秒",{seconds:Number((o/1e3).toFixed(3))}),Os=n=>n instanceof Error?n.message:String(n);function i3({checks:n,busy:o,visible:r,status:a,postureActive:u}){const{t:f}=ai(),d=S.useRef(null),p=S.useRef(!1),h=S.useRef({vx:0,vy:0,vyaw:0}),[b,y]=S.useState(()=>{try{if(localStorage.getItem(Du)==="ramp")return pp("ramp")}catch{}return pp("fixed")}),[g,w]=S.useState(!1),[R,M]=S.useState(!1),[x,T]=S.useState(""),[A,_]=S.useState(()=>()=>""),L=U=>_(()=>U),E=b.mode==="fixed",j=e2(b),O=E?`vx ${b.startSpeed} · vy ${b.lateralSpeed} m/s · vyaw ${b.yawSpeed} rad/s`:"",D=u||a?.poseActive||a?.halted||a?.mode?.mode==="direct",z=!r||!n||o||g||D||a?.state!=="READY";function q(){p.current=!1,d.current?.cancel()}S.useEffect(()=>{z&&d.current?.cancel()},[z]),S.useEffect(()=>()=>d.current?.cancel(),[n]);function B({x:U,y:H}){if(z||!n)return;const X={vx:hp(H*mr.linear),vy:hp(-U*mr.linear),vyaw:hp(-U*mr.yaw)},J=n.forward;if(X.vx===0&&X.vy===0&&X.vyaw===0){d.current?.cancel();return}h.current=X,!(p.current||J.running)&&(p.current=!0,d.current=J,M(!0),T("等候站立遥测…"),J.run({mode:"manual",target:()=>h.current},ye=>{ye.kind==="stage"&&T("移动中")}).then(ye=>{n.recordForward("OBSERVED",{mode:"manual",...ye}),T(ye.reason==="timeout"?"达到设备运动时限,已请求停车":"")}).catch(ye=>{T(Os(ye)),n.recordForward("FAIL",{mode:"manual",error:Os(ye)})}).finally(()=>{d.current=null,M(!1)}))}let V=!1,G="";try{const U=Zu(j);if(j.mode==="fixed")G=`${O} · ${fr(f,j.holdMs)}`;else{const H=U.length>8?[...U.slice(0,5),"…",...U.slice(-2)]:U,X=j.startSpeed===0?`${f("静止 →")} `:"";G=f("{speeds} m/s · {count} 档 · 总时限 {duration}",{speeds:X+H.join(" → "),count:U.length,duration:fr(f,j.maxDurationMs)})}V=!0}catch(U){G=f(Os(U))}function P(U){y(U);try{const H=e2(U);Zu(H),localStorage.setItem(Du+"."+U.mode,JSON.stringify(H)),localStorage.setItem(Du,U.mode)}catch{}}async function Y(){!n||!V||o||n.forward.running||D||await n.run(E?"开始定时移动":"开始阶梯测试",async()=>{const U=[];w(!0),L(H=>H("等候站立遥测…"));try{const H=await n.forward.run(j,J=>{U.push(J),J.kind==="stage"&&L(K=>E?K("正在续发速度指令({motion})…",{motion:O}):K("指令速度 {speed} m/s,本档从第 {elapsed}开始。",{speed:J.speed,elapsed:fr(K,J.elapsedMs)})),J.kind==="walk"&&L(K=>K(E?"已观测到行走步态,继续续发速度指令…":"已观测到行走步态,正在请求停车…"))}),X={walk:"首次观测到行走步态",timeout:E?"达到设备运动时限,已请求停车":"已到总时限,未观测到行走步态",finished:E?"定时移动结束,已请求停车":"本轮结束,未观测到行走步态",cancelled:H.message??"测试已取消"};L(J=>{const K=E?"":J(",本档 {duration}",{duration:fr(J,H.stageElapsedMs)}),ye=(H.applied??[]).slice(0,3).map((N,I)=>`${["vx","vy","vyaw"][I]} ${N} ${I===2?"rad/s":"m/s"}`),fe=E&&ye.length?J(",上报速度 {speed}",{speed:ye.join(" · ")}):H.appliedVx==null?"":J(",上报前向速度 {speed} m/s",{speed:H.appliedVx}),se=E?H.firstWalk?J("首次观测到行走步态用时 {duration}。",{duration:fr(J,H.firstWalk.elapsedMs)}):J("本轮未观测到行走步态。"):"";return J("{outcome}。指令速度 {speed},累计 {total}{timing}{applied}。{walk}",{outcome:J(X[H.reason]),speed:E?O:`${H.speed} m/s`,total:fr(J,H.elapsedMs),timing:K,applied:fe,walk:se})}),n.recordForward("OBSERVED",{settings:j,stages:U,...H})}catch(H){L(X=>X(Os(H))),n.recordForward("FAIL",{settings:j,stages:U,error:Os(H)})}finally{w(!1)}})}function te(U,H,X,J,K){const ye=K==="s";return v.jsx(Qu,{id:"forward-"+U,label:f(H),unit:K,min:X,max:J,inputStep:ye?.001:void 0,sliderStep:ye?.05:void 0,value:b[U],onChange:fe=>P({...b,[U]:fe})})}return v.jsxs("section",{className:"forward-panel",id:"forward",children:[v.jsxs("section",{className:"teleop-card","aria-label":f("实时移动"),children:[v.jsxs("h2",{children:[v.jsx(tO,{}),f("实时移动")]}),v.jsx(Fp,{label:f("移动摇杆"),disabled:z,onChange:B,onRelease:q}),v.jsx("p",{className:"stick-hint",children:f("上下拖动前进或后退,左右拖动同时横移和转向,松开停车。")}),x&&v.jsx("p",{className:"inline-result",role:"status",children:f(x)})]}),v.jsxs("details",{className:"forward-settings",children:[v.jsxs("summary",{children:[f("运动参数")," ",v.jsx("span",{children:E?`${f("定时移动")} · ${fr(f,j.holdMs)}`:`${f("阶梯加速")} · ${b.startSpeed}–${b.maxSpeed} m/s`})]}),v.jsxs("fieldset",{className:"fields-grid",disabled:g,children:[v.jsx("legend",{className:"sr-only",children:f("运动参数")}),v.jsxs("div",{children:[v.jsx(wl,{htmlFor:"forward-mode",children:f("测试方式")}),v.jsx(Ku,{id:"forward-mode",label:f("测试方式"),choices:t3.map(({value:U,label:H})=>({value:U,label:f(H)})),value:b.mode,disabled:g,onChange:U=>P(pp(U==="fixed"?"fixed":"ramp"))})]}),E&&v.jsx("div",{className:"direction-presets button-row",role:"group","aria-label":f("移动方向预设"),children:n3.map(([U,H,X,J])=>v.jsx(ct,{type:"button",variant:"outline",disabled:o,onClick:()=>P({...b,startSpeed:String(H),lateralSpeed:String(X),yawSpeed:String(J)}),children:f(U)},U))}),te("startSpeed",E?"前后速度(+前)":"起始速度",E?-.6:0,Ii.maxSpeed,"m/s"),E&&te("lateralSpeed","横移速度(+左)",-.6,Ii.maxSpeed,"m/s"),E&&te("yawSpeed","转向速度(+左)",-1.5,Ii.maxYawSpeed,"rad/s"),!E&&te("step","速度步长",Ii.minStep,Ii.maxSpeed,"m/s"),!E&&te("maxSpeed","最高速度",0,Ii.maxSpeed,"m/s"),te("hold",E?"移动时长":"每档时长",Ii.minHoldMs/1e3,Ii.maxDurationMs/1e3,"s"),!E&&te("limit","总时限",Ii.minHoldMs/1e3,Ii.maxDurationMs/1e3,"s")]}),v.jsxs("div",{className:"row-between motion-buttons",children:[V&&v.jsx("p",{className:"plan-preview","aria-label":f("前进测试计划"),children:G}),v.jsxs(ct,{disabled:!n||o||R||!V||D,onClick:Y,children:[v.jsx(J1,{}),f(E?"开始定时移动":"开始阶梯测试")]})]})]}),A(f)&&v.jsx("p",{role:"status",className:"inline-result",children:A(f)}),!V&&v.jsx("p",{role:"status",className:"error",children:G})]})}function wf(n){const[o,r]=S.useState(null),a=S.useRef(0);return{feedback:o,setFeedback:r,run:(f,d,p=!1)=>n.run(f,async()=>{const h=++a.current;r({label:f});try{const b=await d();n.recordAction(f,b),h===a.current&&r({label:f,detail:JSON.stringify(b)})}catch(b){throw h===a.current&&r({label:f,detail:b instanceof Error?b.message:String(b)}),b}},p)}}function t2(n){const o=n?.skills;if(!o||typeof o!="object"||Array.isArray(o))return[];const r=new Set;for(const a of Array.isArray(o.built_in)?o.built_in:[])typeof a=="string"&&r.add(a);for(const a of Array.isArray(o.skills)?o.skills:[])a&&typeof a=="object"&&!Array.isArray(a)&&typeof a.name=="string"&&r.add(a.name);return[...r]}function n2(n,o){return[{value:"",label:o},...n.map(r=>({value:r,label:r}))]}function o3({robot:n,checks:o,status:r,refreshStatus:a,busy:u,headActive:f,poseActive:d}){const{t:p}=ai(),[h,b]=S.useState(""),[y,g]=S.useState([]),[w,R]=S.useState(""),[M,x]=S.useState(""),[T,A]=S.useState(""),[_,L]=S.useState(null),{feedback:E,setFeedback:j,run:O}=wf(o),D=S.useRef(null),z=S.useRef(null),q=S.useRef(null),[B,V]=S.useState(!1);S.useEffect(()=>()=>q.current?.abort(),[]);const G=t2(r),P=r?.mode?.mode,Y=async()=>{const U=await n.listActions();return g(U.actions.map(H=>H.name)),R(H=>U.actions.some(X=>X.name===H)?H:""),U},te=async()=>(await Promise.allSettled([Y(),a()])).filter(X=>X.status==="rejected").length?"操作已受理,请重新刷新清单":"清单已刷新";return v.jsxs(ko,{as:"section",className:"console-card device-actions",children:[v.jsxs("h2",{children:[v.jsx(aS,{}),p("技能与动作")]}),v.jsx("div",{className:"fields-grid command-fields",children:v.jsxs("div",{children:[v.jsx(wl,{htmlFor:"device-skill",children:p("可执行技能")}),v.jsx(Ku,{id:"device-skill",label:p("可执行技能"),value:G.includes(h)?h:"",choices:n2(G,p("选择要执行的技能")),onChange:b,disabled:u}),v.jsxs(ct,{variant:"outline",className:"action-run",disabled:u||f||d||r?.state!=="READY"||r.halted||r.poseActive||P==="direct"||!G.includes(h),onClick:()=>O(`执行技能 ${h}`,()=>n.doSkill(h,!1)),children:[v.jsx(J1,{}),p("执行技能")]})]})}),v.jsx("div",{className:"button-row",children:v.jsxs(ct,{variant:"outline",disabled:u,onClick:()=>O("刷新设备技能",async()=>t2(await a())),children:[v.jsx(jp,{}),p("刷新技能")]})}),v.jsxs("div",{className:"row-between custom-heading",children:[v.jsx("h3",{children:p("自定义动作")}),v.jsxs(ct,{variant:"outline",className:"action-config",disabled:u,onClick:()=>{x(""),A(""),L(null),j(null),z.current?.reset(),D.current?.showModal()},children:[v.jsx(lO,{}),p("添加动作")]})]}),v.jsx("dialog",{ref:D,className:"action-dialog","aria-labelledby":"add-action-title",onCancel:U=>{q.current&&U.preventDefault()},children:v.jsxs("form",{ref:z,onSubmit:U=>{U.preventDefault(),!(!_||!M.trim()||u)&&O("上传自定义动作",async()=>{const H=new AbortController;q.current=H,V(!0);try{const X=await n.uploadAction(M.trim(),_,{signal:H.signal,durationS:T===""?void 0:Number(T)}),J=await te();return D.current?.close(),{...X,refresh:J}}finally{q.current=null,V(!1)}})},children:[v.jsxs("h2",{id:"add-action-title",children:[v.jsx(Sv,{}),p("添加自定义动作")]}),v.jsxs("div",{className:"dialog-fields",children:[v.jsxs("div",{children:[v.jsx(wl,{htmlFor:"action-file",children:p("ONNX 文件")}),v.jsx("input",{id:"action-file",type:"file",accept:".onnx",disabled:u,onChange:U=>{const H=U.currentTarget.files?.[0]??null;L(H),H&&x(H.name.replace(/\.onnx$/i,""))}})]}),v.jsxs("div",{children:[v.jsx(wl,{htmlFor:"action-name",children:p("登记名称")}),v.jsx(Rm,{id:"action-name",value:M,maxLength:32,disabled:u,onChange:U=>x(U.target.value)})]}),v.jsx("fieldset",{className:"fields-grid",disabled:u,children:v.jsx(Qu,{id:"action-duration",label:p("保持时长(可选)"),unit:"s",sliderRange:[.05,20],sliderStep:.05,value:T,onChange:A})})]}),E&&v.jsxs("p",{role:"status",className:"operation-reply",children:[p(E.label),E.detail===void 0?"…":" · "+p(E.detail)]}),v.jsxs("div",{className:"button-row",children:[v.jsxs(ct,{type:"button",variant:"outline",onClick:()=>B?q.current?.abort():D.current?.close(),children:[v.jsx(mS,{}),p(B?"取消上传":"取消")]}),v.jsxs(ct,{type:"submit",disabled:u||!_||!M.trim(),children:[v.jsx(Sv,{}),p("上传动作")]})]})]})}),v.jsx("div",{className:"action-picker",children:v.jsxs("div",{children:[v.jsx(wl,{htmlFor:"custom-action",children:p("设备上的自定义动作")}),v.jsx(Ku,{id:"custom-action",label:p("设备上的自定义动作"),value:w,choices:n2(y,p("刷新后选择动作")),onChange:R,disabled:u})]})}),v.jsxs("div",{className:"button-row",children:[v.jsxs(ct,{variant:"outline",disabled:u,onClick:()=>O("刷新自定义动作",Y),children:[v.jsx(jp,{}),p("刷新列表")]}),v.jsxs(ct,{variant:"destructive",disabled:u||!w,"aria-describedby":w?"delete-action-effect":void 0,onClick:()=>{const U=w;!U||u||O("删除自定义动作",async()=>{const H=await n.deleteAction(U);return g(X=>X.filter(J=>J!==U)),R(""),{...H,refresh:await te()}})},children:[v.jsx(cO,{}),p("删除动作")]})]}),w&&v.jsx("p",{className:"action-consequence",id:"delete-action-effect",children:p("将从设备删除「{name}」。",{name:w})}),E&&v.jsxs("p",{role:"status",className:"operation-reply",children:[p(E.label),E.detail===void 0?"…":" · "+p(E.detail)]})]})}function l3({robot:n,checks:o,busy:r}){const{t:a}=ai(),[u,f]=S.useState(null),{feedback:d,run:p}=wf(o);return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"button-row",children:v.jsxs(ct,{variant:"outline",disabled:r,onClick:()=>p("读取设备配置",async()=>{const h=await n.getConfig();return f(h),{path:h.path,exists:h.exists,error:h.error,parseError:h.parseError}}),children:[v.jsx(eO,{}),a("读取配置")]})}),u&&v.jsxs("details",{open:!0,className:"device-config",children:[v.jsx("summary",{children:a("设备配置")}),v.jsx("pre",{children:JSON.stringify(u,null,2)})]}),d&&v.jsxs("p",{role:"status",className:"operation-reply",children:[a(d.label),d.detail===void 0?"…":" · "+a(d.detail)]})]})}function r3(n,o,r,a){let u,f=!1,d,p=0,h=!1;async function b(){if(u===void 0||f||d!==void 0||h)return;const g=Math.ceil(p-performance.now());if(g>0){d=setTimeout(()=>{d=void 0,b()},g);return}f=!0;let w=u,R=!1;try{const M=await n();if(u===void 0||h)return;if(!Number.isFinite(M)||M<=0)throw new Error("设备上报的指令频率无效");w=u,u=void 0,p=performance.now()+Math.ceil(1e3/Math.min(7,M*.7)),R=!0;const x=await o(w);if(!x.accepted)throw new Error(x.reason||"设备拒绝了指令")}catch(M){R||(u=void 0),!h&&u===void 0&&r(M,w)}finally{f=!1,u===void 0&&!h?a():b()}}const y=()=>{u=void 0,clearTimeout(d),d=void 0,!f&&!h&&a()};return{submit(g){h||(u=g,b())},cancel:y,dispose(){h=!0,y()}}}function pr(n,o){const r=n.policies;return r&&typeof r=="object"&&!Array.isArray(r)?r[o]:void 0}const mp=[-2,2],tw={"neck-pitch":"0","head-pitch":"0","head-yaw":"0","head-roll":"0"},nw={"pose-z":"0","pose-roll":"0","pose-pitch":"0"},i2=.6,o2=.4,xu=.2618,a3={...tw,...nw,"pose-z":"-0.01","look-x":"1","look-y":"0","look-z":"0","look-neck-pitch":"0","mouth-open":"0.5"};function ha(n){return String(Number(n.toFixed(4)))}function Eu(n,o){return Math.max(-1,Math.min(1,Number(n)/o||0))}function $i(n,o){const r=n.get(o),a=typeof r=="string"&&r.trim()?Number(r):NaN;if(!Number.isFinite(a))throw new Error("请输入有效的数值");return a}function s3({robot:n,status:o,busy:r,checks:a,refreshStatus:u,visible:f,headActive:d,setHeadActive:p,poseActive:h,setPoseActive:b}){const{t:y}=ai(),{feedback:g,run:w}=wf(a),[R,M]=S.useState(!1),[x,T]=S.useState(a3),[A,_]=S.useState(null),[L,E]=S.useState(null),j=S.useRef(null),O=o?.halted===!0,D=o?.policies&&pr(o,"homed")===!1,z=!f||r||O||D||o?.mode?.mode==="direct"||o?.state!=="READY",q=h||o?.poseActive===!0,B=z||q||L==="pose",V=z||d||L==="head",G=!f||O||!!D||R,P=se=>T(N=>({...N,...se})),Y=se=>v.jsx(Qu,{...se,value:x[se.id],onChange:N=>P({[se.id]:N}),required:!0}),te=se=>p(Object.values(se).some(N=>N!==0)),U=S.useRef({readHead:te,setPoseActive:b,refreshStatus:u,poseHeld:q});U.current={readHead:te,setPoseActive:b,refreshStatus:u,poseHeld:q},S.useEffect(()=>{let se,N=!0;const I=r3(async()=>(se??=(await n.getCapabilities({timeoutMs:2e3})).maxCommandHz,se),async Q=>{if(Q.kind==="head"){const ce=await n.head(Q.params);return N&&!n.disposed&&ce.accepted&&U.current.readHead(ce.head),ce}const $=await n.pose(Q.params);if(N&&!n.disposed&&$.accepted){const ce=U.current.poseHeld!==$.pose.active;U.current.setPoseActive($.pose.active),ce&&U.current.refreshStatus().catch(()=>{})}return $},(Q,$)=>_({kind:$.kind,message:Q instanceof Error?Q.message:String(Q)}),()=>E(null));return j.current=I,()=>{N=!1,I.dispose(),j.current=null}},[n]),S.useLayoutEffect(()=>{z&&j.current?.cancel()},[z]);const H=se=>{(se.kind==="head"?B:V)||(_(null),E(se.kind),j.current?.submit(se))},X=()=>{P(tw),H({kind:"head",params:{head_yaw:0}})},J=(se,N)=>{P({"head-yaw":ha(se),"head-pitch":ha(N)}),H({kind:"head",params:{head_yaw:Number(ha(se)),head_pitch:Number(ha(N)),neck_pitch:Number(x["neck-pitch"]),head_roll:Number(x["head-roll"])}})},K=(se,N,I)=>{P({"pose-roll":se,"pose-pitch":N,"pose-z":I}),H({kind:"pose",params:{roll:Number(se),pitch:Number(N),z:Number(I),active:!0}})},ye=se=>(P({"mouth-open":String(se)}),n.mouth({open:se})),fe=(se,N)=>{G||(M(!0),w(se,N,!0).finally(()=>M(!1)))};return v.jsxs(ko,{as:"section",className:"console-card device-controls",children:[v.jsxs("h2",{children:[v.jsx(Q1,{}),y("姿态控制")]}),v.jsxs("details",{children:[v.jsx("summary",{children:y("头部角度")}),v.jsxs("div",{className:"posture-pad",children:[v.jsx(Fp,{label:y("头部摇杆"),disabled:B,target:{x:-Eu(x["head-yaw"],i2),y:Eu(x["head-pitch"],o2)},onChange:({x:se,y:N})=>J(-se*i2,N*o2)}),v.jsx("div",{className:"posture-tools",children:v.jsx(ct,{variant:"outline",disabled:B,onClick:X,children:y("头部回正")})})]}),A?.kind==="head"&&v.jsx("p",{role:"alert",className:"error",children:y(A.message)}),v.jsxs("details",{className:"precision-fields",children:[v.jsx("summary",{children:y("精确角度")}),v.jsx("form",{onSubmit:se=>{se.preventDefault();const N=new FormData(se.currentTarget);H({kind:"head",params:{neck_pitch:$i(N,"neck-pitch"),head_pitch:$i(N,"head-pitch"),head_yaw:$i(N,"head-yaw"),head_roll:$i(N,"head-roll")}})},children:v.jsxs("fieldset",{className:"fields-grid",disabled:B,children:[Y({id:"neck-pitch",label:y("颈部俯仰"),unit:"rad",min:-1.571,max:1.047}),Y({id:"head-pitch",label:y("头部俯仰"),unit:"rad",min:-1.571,max:1.571}),Y({id:"head-yaw",label:y("头部左右转"),unit:"rad",min:-2.967,max:2.967}),Y({id:"head-roll",label:y("头部侧倾"),unit:"rad",min:-.436,max:.436}),v.jsx(ct,{type:"submit",variant:"outline",children:y("设置头部角度")})]})})]})]}),v.jsxs("details",{children:[v.jsxs("summary",{children:[y("身体姿态"),q?" "+y("· 保持中"):""]}),v.jsxs("div",{className:"posture-pad",children:[v.jsx(Fp,{label:y("身体姿态摇杆"),disabled:V,target:{x:Eu(x["pose-roll"],xu),y:Eu(x["pose-pitch"],xu)},onChange:({x:se,y:N})=>K(ha(se*xu),ha(N*xu),x["pose-z"])}),v.jsxs("div",{className:"posture-tools",children:[v.jsx("fieldset",{className:"fields-grid",disabled:V,children:v.jsx(Qu,{id:"pose-z",label:y("身体高度偏移"),unit:"m",min:-.025,max:.01,value:x["pose-z"],onChange:se=>P({"pose-z":se}),onSlide:se=>K(x["pose-roll"],x["pose-pitch"],se)})}),v.jsx(ct,{variant:"outline",disabled:V||!q&&L!=="pose",onClick:()=>{P(nw),H({kind:"pose",params:{active:!1}})},children:y("解除姿态保持")})]})]}),A?.kind==="pose"&&v.jsx("p",{role:"alert",className:"error",children:y(A.message)}),v.jsxs("details",{className:"precision-fields",children:[v.jsx("summary",{children:y("精确姿态")}),v.jsx("form",{onSubmit:se=>{se.preventDefault();const N=new FormData(se.currentTarget);K(String($i(N,"pose-roll")),String($i(N,"pose-pitch")),x["pose-z"])},children:v.jsxs("fieldset",{className:"fields-grid",disabled:V,children:[Y({id:"pose-roll",label:y("身体侧倾"),unit:"rad",min:-.2618,max:.2618,sliderStep:1e-4}),Y({id:"pose-pitch",label:y("身体俯仰"),unit:"rad",min:-.2618,max:.2618,sliderStep:1e-4}),v.jsx(ct,{type:"submit",variant:"outline",children:y("保持身体姿态")})]})})]})]}),v.jsxs("details",{children:[v.jsx("summary",{children:y("空间注视点")}),v.jsx("form",{onSubmit:se=>{if(se.preventDefault(),B||L!==null)return;const N=new FormData(se.currentTarget);w("设置注视点",async()=>{const I=await n.look({x:$i(N,"look-x"),y:$i(N,"look-y"),z:$i(N,"look-z"),neck_pitch:$i(N,"look-neck-pitch")});return!n.disposed&&I.accepted&&p(!0),I})},children:v.jsxs("fieldset",{className:"fields-grid",disabled:B||L!==null,children:[Y({id:"look-x",label:y("向前 x"),unit:"m",sliderRange:mp}),Y({id:"look-y",label:y("向左 y"),unit:"m",sliderRange:mp}),Y({id:"look-z",label:y("向上 z"),unit:"m",sliderRange:mp}),Y({id:"look-neck-pitch",label:y("注视颈部俯仰"),unit:"rad",min:-1.571,max:1.047}),v.jsx(ct,{type:"submit",variant:"outline",children:y("设置注视点")})]})})]}),v.jsxs("details",{children:[v.jsx("summary",{children:y("嘴部开合")}),v.jsxs("div",{className:"button-row",children:[v.jsx(ct,{variant:"outline",disabled:G,onClick:()=>fe("全开",()=>ye(1)),children:y("全开")}),v.jsx(ct,{variant:"outline",disabled:G,onClick:()=>fe("闭嘴",()=>ye(0)),children:y("闭嘴")})]}),v.jsx("form",{onSubmit:se=>{se.preventDefault();const N=new FormData(se.currentTarget);fe("设置嘴部开合",async()=>ye($i(N,"mouth-open")))},children:v.jsxs("fieldset",{className:"fields-grid",disabled:G,children:[Y({id:"mouth-open",label:y("开合值 (0–1)"),unit:"",min:0,max:1}),v.jsx(ct,{type:"submit",variant:"outline",children:y("设置嘴部开合")})]})})]}),g&&v.jsxs("p",{role:"status",className:"operation-reply",children:[y(g.label),g.detail===void 0?"…":" · "+y(g.detail)]})]})}async function ju(n,o,r,a=5e3){const{connectionEpoch:u,robotId:f}=n.context,d=AbortSignal.timeout(a),p=()=>!n.disposed&&n.context.connectionState==="ready"&&n.context.connectionEpoch===u&&n.context.robotId===f;let h;for(;!d.aborted&&p();){try{const b=await o({signal:d,timeoutMs:1200});if(!p()||d.aborted)break;if(h=b,r(b))return{confirmed:!0,latest:b}}catch{}!d.aborted&&p()&&await new Promise(b=>setTimeout(b,250))}return p()?{confirmed:!1,latest:h}:{confirmed:!1}}const c3=.02,u3={left_hip_yaw:"左髋偏航",left_hip_roll:"左髋横滚",left_hip_pitch:"左髋俯仰",left_knee:"左膝",left_ankle:"左踝",neck_pitch:"颈部俯仰",head_pitch:"头部俯仰",head_yaw:"头部偏航",head_roll:"头部横滚",mouth:"嘴部舵机",right_hip_yaw:"右髋偏航",right_hip_roll:"右髋横滚",right_hip_pitch:"右髋俯仰",right_knee:"右膝",right_ankle:"右踝"},f3={left_hip_yaw:[-.436,.524],left_hip_roll:[-.384,.384],left_hip_pitch:[-1.571,1.571],left_knee:[-1.571,1.571],left_ankle:[-1.571,1.571],neck_pitch:[-1.571,1.047],head_pitch:[-1.571,1.571],head_yaw:[-2.967,2.967],head_roll:[-.436,.436],mouth:[-.087,.524],right_hip_yaw:[-.524,.436],right_hip_roll:[-.384,.384],right_hip_pitch:[-1.571,1.571],right_knee:[-1.571,1.571],right_ankle:[-1.571,1.571]};function d3(n){const[o,r]=f3[n],a=Math.min((r-o)*.05,.06);return[o+a,r-a]}function h3({robot:n,status:o,busy:r,visible:a,run:u}){const{t:f}=ai(),[d,p]=S.useState(null),[h,b]=S.useState(!1),[y,g]=S.useState(!1),[w,R]=S.useState(null),[M,x]=S.useState(""),T=S.useRef(null),A=S.useRef(!1),_=S.useRef(0),L=S.useRef(!1),E=S.useRef(null),j=a&&o?.mode?.mode==="direct"&&o.state==="READY"&&!o.halted&&!o.poseActive,O=h&&j;S.useLayoutEffect(()=>(L.current=!1,p(null),x(""),()=>{_.current++,T.current=null}),[O,n]);const D=O&&d?.mode==="direct"&&d.enabled&&!d.moving,z=S.useCallback(async()=>{const V=_.current;L.current=!0,x(""),p(null);try{const G=await n.getServoState();return V===_.current&&E.current?.open&&(p(G),O&&(G.mode!=="direct"||!G.enabled||G.moving)&&x("舵机未就绪,无法启用直控")),G}catch(G){throw V===_.current&&x(G instanceof Error?G.message:String(G)),G}},[O,n]);S.useEffect(()=>{O&&!r&&!y&&!L.current&&u("读取舵机状态",z)},[O,r,y,u,z]);async function q({name:V,angle:G},P){const Y=await n.setServoJoints({joints:{[V]:G}});if(!Y.accepted)return{...Y,confirmed:!1};const te=Y.joints[V]??G,{confirmed:U,latest:H}=await ju(n,X=>n.getServoState(X),X=>{const J=X.joints[V];return X.mode==="direct"&&X.enabled&&!X.moving&&J!==void 0&&Math.abs(J-te)<=c3});return U&&P===_.current&&p(H??null),{...Y,confirmed:U}}function B(V,G){if(!O||!E.current?.open||!A.current&&(!D||r)||(T.current={name:V,angle:G},R(T.current),A.current))return;const P=_.current;A.current=!0,g(!0),x(""),u("写入舵机目标角",async()=>{let Y;try{for(;T.current&&P===_.current&&E.current?.open&&!n.disposed;){const te=T.current;if(T.current=null,Y=await q(te,P),!Y.confirmed)return P===_.current&&(p(null),x(Y.accepted?"目标角未确认,滑块直控已停用":Y.reason||"设备拒绝了指令")),Y}return Y}catch(te){throw P===_.current&&(p(null),x(te instanceof Error?te.message:String(te))),te}}).finally(()=>{T.current=null,A.current=!1,g(!1),R(null)})}return v.jsxs("details",{ref:E,onToggle:V=>b(V.currentTarget.open),children:[v.jsx("summary",{children:f("舵机直控")}),v.jsxs("div",{className:"button-row servo-toolbar",children:[v.jsx(ct,{variant:"ghost",disabled:r||y,onClick:()=>u("读取舵机状态",z),children:f("读取舵机状态")}),d&&v.jsxs("span",{"aria-live":"polite",children:[d.mode," · ",d.enabled?f("已使能"):f("未使能")," · ",y||d.moving?f("舵机移动中"):f("舵机静止")]})]}),j&&v.jsx("p",{className:"action-consequence",id:"servo-write-effect",children:f("拖动滑块会立即移动舵机。请先支撑机器人。")}),o?.mode?.mode!=="direct"&&v.jsx("p",{className:"muted",children:f("切换到直控模式后可拖动滑块。")}),M&&v.jsx("p",{role:"alert",className:"error",children:f(M)}),v.jsx("div",{className:"servo-live-grid",children:dm.map(V=>{const[G,P]=d3(V),Y=d?.joints[V],te=w?.name===V?w.angle:Y,U=f(u3[V]);return v.jsxs("div",{className:"servo-joint",children:[v.jsxs("div",{className:"row-between",children:[v.jsx("label",{htmlFor:`joint-${V}`,children:U}),v.jsxs("output",{children:[te?.toFixed(3)??"—"," rad"]})]}),v.jsx("input",{id:`joint-${V}`,type:"range",min:G,max:P,step:.001,value:Math.min(P,Math.max(G,te??0)),"aria-label":f("{label}滑块",{label:U}),"aria-describedby":j?"servo-write-effect":void 0,disabled:!O||Y===void 0||!y&&(r||!D),onChange:H=>B(V,Number(H.target.value))})]},V)})})]})}const l2=[{value:"walk",label:"行走",icon:H1},{value:"roller",label:"轮滑",icon:JC},{value:"direct",label:"直控",icon:lS}];function p3({robot:n,checks:o,status:r,refreshStatus:a,busy:u,visible:f,postureActive:d,clearPosture:p,relaxPending:h,setRelaxPending:b}){const{t:y}=ai(),{feedback:g,run:w}=wf(o),R=r?.mode?.mode,M=[...l2,...(r?.supportedModes??[]).filter(O=>!l2.some(D=>D.value===O)).map(O=>({value:O,label:O,icon:zp}))],x=r?.halted===!0,T=r&&pr(r,"homed")===!1,A=u||h||x||r?.state!=="READY",_=A||r?.poseActive||d,L=async O=>{const D=await n.setMode({mode:O});if(!D.accepted)return D;const z=V=>V.mode?.mode===O&&V.state!=="FAULT",{confirmed:q,latest:B}=await ju(n,V=>a(V,G=>z(G)||G.state==="FAULT"),z);return{...D,requested:O,confirmed:q,reported:B?.mode?.mode??"状态回读失败,请刷新"}},E=(O,D,z,q=!1)=>w(O,async()=>{const B=await D();if(!B.accepted)return B;const{confirmed:V}=await ju(n,a,z);return{...B,confirmed:V}},q);function j(){x||h||!window.confirm(y("确认现场已支撑机器人?卸力会切断关节力矩,机器人可能倒下。"))||(b(!0),o.forward.cancel("关节卸力"),E("关节卸力",async()=>{const O=await n.relax();return O.accepted&&!n.disposed&&p(),O},O=>pr(O,"homed")===!1&&pr(O,"enabled")===!1,!0).finally(()=>b(!1)))}return v.jsxs(ko,{as:"section",className:"console-card device-controls",children:[v.jsxs("h2",{children:[v.jsx(zp,{}),y("驱动与关节")]}),v.jsxs("div",{className:"drive-mode",children:[v.jsx(wl,{id:"device-mode-label",children:y("运动模式")}),v.jsx("div",{role:"group","aria-labelledby":"device-mode-label",className:"mode-segments",children:M.map(({value:O,label:D,icon:z})=>v.jsxs(ct,{type:"button",variant:"ghost","aria-pressed":O===R,disabled:_&&O!==R,"aria-describedby":O==="direct"&&R!=="direct"?"direct-mode-effect":void 0,onClick:()=>{_||O===R||w("切换设备模式",()=>L(O))},children:[v.jsx(z,{}),y(D)]},O))}),R!=="direct"&&v.jsx("p",{className:"action-consequence",id:"direct-mode-effect",children:y("直控会退出策略平衡。请先支撑机器人。")})]}),v.jsxs("details",{children:[v.jsxs("summary",{children:[y("驱动与关节卸力"),x?" "+y("· 已锁存"):""]}),v.jsxs("div",{className:"button-row",children:[v.jsx(ct,{variant:"outline",disabled:A,"aria-describedby":"joint-init-effect",onClick:()=>E("关节初始化",()=>n.init(),O=>O.state==="READY"&&pr(O,"homed")===!0),children:y("关节初始化")}),v.jsx(ct,{variant:"outline",disabled:A||!!T,onClick:()=>E("启用策略驱动",()=>n.enable({on:!0}),O=>pr(O,"enabled")===!0),children:y("启用策略驱动")}),v.jsx(ct,{variant:"outline",disabled:A,onClick:()=>E("收回策略驱动",()=>n.enable({on:!1}),O=>pr(O,"enabled")===!1),children:y("收回策略驱动")})]}),v.jsx("p",{className:"action-consequence",id:"joint-init-effect",children:y("关节初始化会上电并回初始位,设备可能移动。")}),v.jsxs("div",{className:"relax-controls",children:[v.jsx(ct,{variant:"destructive",type:"button",disabled:x||h,"aria-describedby":"relax-effect",onClick:j,children:y("关节卸力")}),v.jsx("p",{className:"action-consequence",id:"relax-effect",children:y("卸力会切断关节力矩,恢复前需重新初始化关节。")})]})]}),v.jsx(h3,{robot:n,status:r,busy:u,visible:f&&!h,run:w},R),v.jsx("div",{className:"button-row",children:v.jsxs(ct,{variant:"outline",disabled:u||h||r?.state!=="FAULT"||r.faultRecoverable!==!0,onClick:()=>w("复位故障",async()=>{const O=await a();if(O.state!=="FAULT"||!O.faultRecoverable)throw new Error("设备当前不允许远程复位");const D=await n.reset(),{confirmed:z}=await ju(n,a,q=>q.state!=="FAULT");return{...D,confirmed:z}}),children:[v.jsx(rO,{}),y("复位故障")]})}),r?.state==="FAULT"&&v.jsxs("p",{className:"muted",children:[r.faultReason," · ",r.faultRecoverable?y("允许远程复位"):y("设备未允许远程复位")]}),g&&v.jsxs("p",{role:"status",className:"operation-reply",children:[y(g.label),g.detail===void 0?"…":" · "+y(g.detail)]})]})}const iw=S.createContext(void 0);function m3(){const n=S.useContext(iw);if(n===void 0)throw new Error(qi(63));return n}const g3="data-checked",y3="data-unchecked",ow={...Sm,checked(n){return n?{[g3]:""}:{[y3]:""}}},b3=S.forwardRef(function(o,r){const{checked:a,className:u,defaultChecked:f,"aria-labelledby":d,form:p,id:h,inputRef:b,name:y,nativeButton:g=!1,onCheckedChange:w,readOnly:R=!1,required:M=!1,disabled:x=!1,render:T,uncheckedValue:A,value:_,style:L,...E}=o,{clearErrors:j}=xm(),{state:O,setTouched:D,setDirty:z,validityData:q,setFilled:B,validationMode:V,disabled:G,name:P,validation:Y}=Ca(),{labelId:te}=vf(),U=G||x,H=P??y,X=S.useRef(null),J=El(X,b,Y.inputRef),K=S.useRef(null),ye=Tm(U,K),fe=Nl(),se=Sf({id:h}),N=g?void 0:se,[I,Q]=Gu({controlled:a,default:!!f,name:"Switch",state:"checked"});wm(K,fe,I,void 0,!U,y),De(()=>{B(I)},[I,B]),mf(I,()=>{j(H),z(I!==q.initialValue),Y.change(I)});const{getButtonProps:$,buttonRef:ce}=Sr({disabled:U,native:g}),ie=X4(d,te,X,!g,N,E["aria-label"]),de={id:g?se:fe,role:"switch","aria-checked":I,"aria-readonly":R||void 0,"aria-required":M||void 0,"aria-labelledby":ie,onFocus(){ye(!0)},onBlur(){const we=X.current;!we||U||(D(!0),ye(!1),V==="onBlur"&&Y.commit(we.checked))},onClick(we){if(R||U)return;we.preventDefault();const Ce=X.current;Ce&&Au(Ce,we)}},me={...Y.getValidationProps(U),checked:I,disabled:U,form:p,id:N,name:H,required:M,style:H?_2:em,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:J,onChange(we){if(we.nativeEvent.defaultPrevented)return;if(R){we.preventDefault();return}const Ce=we.currentTarget.checked,je=Bt(Rl,we.nativeEvent);w?.(Ce,je),!je.isCanceled&&Q(Ce)},onClick(we){we.stopPropagation()},onFocus(){K.current?.focus()},..._!==void 0?{value:_}:nn},ae=S.useMemo(()=>({...O,checked:I,disabled:U,readOnly:R,required:M}),[O,I,U,R,M]),Re=Lt("span",o,{state:ae,ref:[r,K,ce],props:[de,E,$,we=>Y.getValidationProps(U,we)],stateAttributesMapping:ow});return v.jsxs(iw.Provider,{value:ae,children:[Re,!I&&H&&A!==void 0&&v.jsx("input",{type:"hidden",form:p,name:H,value:A,disabled:U}),v.jsx("input",{...me,suppressHydrationWarning:!0})]})}),v3=S.forwardRef(function(o,r){const{render:a,className:u,style:f,...d}=o,p=m3();return Lt("span",o,{state:p,ref:r,stateAttributesMapping:ow,props:d})}),r2={move:"速度指令",stop:"停止运动",getStatus:"读取状态",getCapabilities:"读取能力",reset:"复位故障",setMode:"切换模式",init:"关节初始化",enable:"切换策略驱动",head:"设置头部角度",look:"设置注视点",mouth:"设置嘴部开合",pose:"设置身体姿态",getServoState:"读取舵机状态",setServoJoints:"写入舵机目标角",relax:"关节卸力",doSkill:"执行技能",listActions:"读取动作列表",deleteAction:"删除动作",uploadAction:"上传动作",getConfig:"读取设备配置",stopAudio:"停止音频",subscribeTof:"订阅 ToF",unsubscribeTof:"退订 ToF",startLightFollow:"启动追光",stopLightFollow:"停止追光",getLightFollowStatus:"读取追光状态",request:"设备请求"};function xf(n){const{message:o=String(n),code:r,source:a,data:u}=n??{};return{message:o,code:r,source:a,...u!==void 0&&{data:u}}}function S3(n){if(n&&typeof n=="object"){if("accepted"in n)return n.accepted?"设备已受理":"reason"in n&&typeof n.reason=="string"&&n.reason?"设备拒绝:"+n.reason:"设备未受理";if("state"in n&&typeof n.state=="string")return n.state}return"已返回结果"}function w3(n,o){return new Proxy(n,{get(r,a){const u=Reflect.get(r,a,r);return typeof u!="function"?u:Object.hasOwn(r2,a)?(...f)=>{const d=a==="request"?String(f[0]):r2[a],p=u.apply(r,f);return p.then(h=>o({time:new Date().toISOString(),command:d,summary:S3(h),detail:h,confirmed:!0}),h=>{const b=xf(h),y=b.source==="daemon";o({time:new Date().toISOString(),command:d,confirmed:y,summary:y?"设备拒绝:"+b.message:"回执未确认:"+b.message,detail:b})}),p}:u.bind(r)}})}function x3(n,o){const r=S.useRef(null),[a,u]=S.useState(),[f,d]=S.useState(),[p,h]=S.useState(),[b,y]=S.useState(!1),[g,w]=S.useState(),R=n?.context.capabilities?.lightFollow?.supported;S.useEffect(()=>{if(u(void 0),d(void 0),h(void 0),y(!1),w(void 0),!n)return;const x=new AbortController;return r.current={controller:x,readAttempted:!1},()=>{x.abort(),r.current=null}},[n]);const M=S.useCallback(async(x,T)=>{const A=r.current;if(!n||!A||A.request&&(x!=="stop"||A.request.kind==="stop"))return;const _=A.request={kind:x},L=A.controller.signal,E=()=>!L.aborted&&A.request===_;u(x),w(void 0),x==="read"&&(A.readAttempted=!0),x==="start"&&y(!0);try{const j=x==="read"?await n.getLightFollowStatus({signal:L}):x==="start"?await n.startLightFollow(T,{signal:L}):await n.stopLightFollow({signal:L});if(!E())return;"installed"in j&&h(j.installed),d(j),y(j.running)}catch(j){if(!E())return;const O=xf(j);x==="read"&&O.code==="-32601"&&h(!1),x!=="read"&&d(void 0),w(O)}finally{E()&&(A.request=void 0,u(void 0))}},[n]);return S.useEffect(()=>{r.current&&!r.current.readAttempted&&(o||R===!0)&&M("read")},[M,R,o]),{state:f,installed:p??R,needsStop:b,operation:a,error:g,run:M}}const E3={read:"正在读取设备数据…",start:"正在启动追光…",stop:"正在停止追光…"};function T3(n){if(n)try{const o=new URL(n);if(o.protocol==="http:"||o.protocol==="https:")return o}catch{return}}function A3({control:n,startBlocked:o}){const{t:r}=ai(),[a,u]=S.useState("default"),{state:f,installed:d,needsStop:p,operation:h,error:b,run:y}=n,g=h?E3[h]:d===!1?"追光不可用":f?f.running?"追光运行中":"追光已关闭":"追光状态未确认",w=f?.running??p,R=T3(f?.running?f.previewUrl:null),M=d===!0&&f?.running===!1&&!o;return v.jsxs(ko,{as:"section",className:"console-card light-follow-card",children:[v.jsxs("div",{className:"row-between",children:[v.jsxs("h2",{children:[v.jsx(L1,{}),r("追光")]}),v.jsx(b3,{render:v.jsx("button",{type:"button"}),nativeButton:!0,className:"light-follow-switch","aria-label":r("追光开关"),checked:w,disabled:h!==void 0||!w&&!M,onCheckedChange:x=>{x?y("start",a==="default"?void 0:{allow_forward:a==="on"}):y("stop")},children:v.jsx(v3,{className:"light-follow-thumb"})})]}),v.jsx("p",{role:"status",children:r(g)}),b&&v.jsxs("p",{className:"error",role:"alert",children:[b.code?`${b.code} · `:"",r(b.message)]}),v.jsxs("div",{className:"button-row",children:[v.jsx(Ku,{id:"light-follow-forward",label:r("追光前进设置"),value:a,onChange:u,disabled:h!==void 0||p||d!==!0,choices:[{value:"default",label:r("使用板端前进设置")},{value:"off",label:r("仅转向")},{value:"on",label:r("允许前进")}]}),v.jsxs(ct,{type:"button",variant:"outline",disabled:h!==void 0,onClick:()=>{y("read")},children:[v.jsx(jp,{}),r("刷新追光状态")]}),R&&v.jsxs("a",{className:"light-follow-preview",href:R.href,target:"_blank",rel:"noopener noreferrer",children:[v.jsx(WC,{size:15}),r("打开追光预览")]})]}),p&&v.jsx("p",{className:"muted",children:r("追光期间已暂停手动控制。退出前请先关闭追光。")})]})}const R3={capabilities:"正在读取设备数据…",subscribe:"正在订阅 ToF…",unsubscribe:"正在退订 ToF…"};function C3({frame:n}){const{locale:o,t:r}=ai();return v.jsx("table",{className:"tof-grid","aria-label":r("ToF 距离网格(mm)"),children:v.jsx("tbody",{children:Array.from({length:n.rows},(a,u)=>v.jsx("tr",{children:Array.from({length:n.cols},(f,d)=>{const p=u*n.cols+d,h=n.distance_mm[p]??0,b=n.status[p]??255,y=h>0&&(b===5||b===9),g=Math.round(12+22*(1-Math.min(1,h/3e3)));return v.jsx("td",{"data-valid":y,style:y?{backgroundColor:`color-mix(in srgb, var(--control-accent) ${g}%, #202121)`}:void 0,title:r("原始距离 {distance} mm,状态码 {status}",{distance:h,status:b}),children:y?h.toLocaleString(o,{useGrouping:!1}):"—"},d)})},u))})})}function O3({robot:n,recordFirstFrame:o}){const{t:r}=ai(),a=S.useRef(null),u=S.useRef(null),[f,d]=S.useState(""),[p,h]=S.useState(null),[b,y]=S.useState(null),[g,w]=S.useState(),[R,M]=S.useState(null),[x,T]=S.useState({count:0,latest:null}),A=g?g.hasTof:n.context.capabilities?.tof?.supported,_=f===""?void 0:Number(f),L=_===void 0||Number.isInteger(_)&&_>=1&&_<=15,E=x.latest?.rows??R?.rows??g?.tofRows,j=x.latest?.cols??R?.cols??g?.tofCols,O=R?R.hz:g?.tofHz,D=R?x.count?"正在接收 ToF 帧":"等待 ToF 首帧…":"ToF 未订阅";S.useEffect(()=>{const G=new AbortController;return a.current=G,()=>{G.abort(),u.current?.(),u.current=null,a.current=null}},[n]);async function z(G,P){const Y=a.current?.signal;if(!(!Y||Y.aborted||p)){h(G),y(null);try{await P(Y)}catch(te){Y.aborted||y(xf(te))}finally{Y.aborted||h(null)}}}function q(){z("capabilities",async G=>{const P=await n.getCapabilities({signal:G});G.aborted||w(P)})}function B(){!L||R||A===!1||z("subscribe",async G=>{T({count:0,latest:null});let P=!1;u.current=n.onTof(Y=>{G.aborted||(T(te=>({count:te.count+1,latest:Y})),P||(P=!0,o(Y)))});try{const Y=await n.subscribeTof(_===void 0?void 0:{hz:_},{signal:G});G.aborted||M(Y)}catch(Y){throw u.current?.(),u.current=null,Y}})}function V(){z("unsubscribe",async G=>{await n.unsubscribeTof({signal:G}),!G.aborted&&(u.current?.(),u.current=null,M(null))})}return v.jsxs(ko,{as:"section",className:"console-card tof-card",children:[v.jsxs("h2",{children:[v.jsx(q1,{}),r("头部 ToF")]}),v.jsxs("div",{className:"row-between tof-capability",children:[v.jsx("p",{children:r(A===!0?"ToF 可用":A===!1?"ToF 不可用":"ToF 能力未上报")}),v.jsx(ct,{type:"button",variant:"outline",size:"sm",disabled:p!==null,onClick:q,children:r("读取 ToF 能力")})]}),g?.tofUnavailable&&v.jsx("p",{className:"muted",children:g.tofUnavailable}),v.jsxs("form",{className:"tof-controls",onSubmit:G=>{G.preventDefault(),B()},children:[v.jsxs("div",{className:"tof-frequency",children:[v.jsx(wl,{htmlFor:"tof-hz",children:r("订阅频率(Hz)")}),v.jsx(Rm,{id:"tof-hz",type:"number",min:1,max:15,step:1,placeholder:"15",value:f,disabled:p!==null||R!==null||A===!1,onChange:G=>d(G.currentTarget.value)})]}),v.jsxs("div",{className:"button-row",children:[v.jsx(ct,{type:"submit",variant:"outline",disabled:p!==null||R!==null||A===!1||!L,children:r("订阅 ToF")}),v.jsx(ct,{type:"button",variant:"outline",disabled:p!==null,onClick:V,children:r("退订 ToF")})]})]}),b&&v.jsxs("p",{className:"error tof-feedback",role:"alert",children:[b.code?`${b.code} · `:"",r(b.message)]}),(!b||R)&&v.jsx("p",{className:"muted tof-feedback",role:"status",children:r(p?R3[p]:D)}),v.jsxs("dl",{className:"readouts tof-readouts",children:[v.jsxs("div",{children:[v.jsx("dt",{children:r("网格尺寸")}),v.jsx("dd",{children:E&&j?`${E} × ${j}`:"—"})]}),v.jsxs("div",{children:[v.jsx("dt",{children:r("设备频率")}),v.jsx("dd",{children:O==null?"—":`${O} Hz`})]}),v.jsxs("div",{children:[v.jsx("dt",{children:r("已收帧数")}),v.jsx("dd",{children:x.count})]}),v.jsxs("div",{children:[v.jsx("dt",{children:r("最新帧号")}),v.jsx("dd",{children:x.latest?.seq??"—"})]})]}),x.latest&&v.jsxs(v.Fragment,{children:[v.jsx(C3,{frame:x.latest}),v.jsxs("details",{className:"tof-payload",children:[v.jsx("summary",{children:r("最新 ToF 帧 JSON")}),v.jsx("pre",{children:JSON.stringify(x.latest,null,2)})]})]})]})}function M3(n,o,r){const a=o(),u=new AbortController,{signal:f}=u;let d;function p(){f.aborted||(u.abort(),d!==void 0&&n.cancelVideoFrameCallback(d),a(),r("closed"))}return{firstFrame:new Promise((b,y)=>{const g=setTimeout(()=>y(new Error("35 秒内未收到可显示的视频帧")),35e3);f.addEventListener("abort",()=>{clearTimeout(g),b(null)},{once:!0});const w=()=>{if(!f.aborted){d!==void 0?n.cancelVideoFrameCallback(d):r("opening");try{const R=n.requestVideoFrameCallback((M,{width:x,height:T})=>{f.aborted||R!==d||(d=void 0,clearTimeout(g),r("playing"),b({width:x,height:T}))});d=R}catch(R){y(R),p()}}};n.addEventListener("error",w,{signal:f}),n.addEventListener("emptied",w,{signal:f}),w()}),close:p}}const a2="microbotx.direct-demo.sdk-checks.v1",Tu=n=>new Promise(o=>setTimeout(o,n));function dr(n){if(n&&typeof n=="object"){const o=n;return{name:o.name,message:o.message,code:o.code,source:o.source}}return{message:String(n)}}function N3(n,o,r){const a=n.context;return{mode:n.mode,robotId:a.robotId,appId:a.appId,connectionState:a.connectionState,connectionEpoch:a.connectionEpoch,peerConnectionState:n.rtcConnection?.connectionState??null,disposed:n.disposed,sitting:n.sitting,incomingRobotAudioTrack:n.incomingRobotAudioTrack?{kind:n.incomingRobotAudioTrack.kind,readyState:n.incomingRobotAudioTrack.readyState,muted:n.incomingRobotAudioTrack.muted}:null,telemetryCount:o,lastTelemetry:r}}function _3(n,o){const r=o.video,a=[],u=crypto.randomUUID(),f=new Date().toISOString(),d=[],p=[],h=new Map;let b=!1,y=!1,g=0,w=null,R=null,M=null,x,T;const A=()=>N3(n,g,w),_=()=>{try{if(b){const Q=sessionStorage.getItem(a2);if(Q&&JSON.parse(Q).sessionId!==u)return}sessionStorage.setItem(a2,JSON.stringify({version:1,sessionId:u,startedAt:f,updatedAt:new Date().toISOString(),context:A(),results:d,events:p.slice(-30)})),b=!0}catch(Q){o.setSaveError(`检查记录未能保存:${dr(Q).message}`)}},L=()=>{o.setTelemetry({...A(),frame:R}),_()},E=()=>{o.setResults([...d]),L()},j=()=>{d.length=0,p.length=0,h.clear(),o.setEvents([]),E()},O=(Q,$,ce=null)=>{const ie={time:new Date().toISOString(),test:Q,result:$,detail:ce},de=h.get(Q);de?(Object.assign(de,ie),h.delete(Q)):d.push(ie),E()},D=Q=>{for(const $ of Q){const ce={time:new Date().toISOString(),test:$,result:"SKIP",detail:"尚未执行;若页面提前卸载且记录未更新,该项即未执行。"};d.push(ce),h.set($,ce)}E()},z=(Q,$)=>{p.push({time:new Date().toISOString(),name:Q,payload:$}),o.setEvents(p.slice(-30)),L()},q=async(Q,$)=>{o.setProgress(`正在检查:${Q}`);const ce=h.get(Q);ce&&(ce.time=new Date().toISOString(),ce.result="OBSERVED",ce.detail="已开始执行,尚未得到结果;若页面提前卸载,该项结果未确认。",E());try{const ie=await $();return O(Q,"PASS",ie??null),ie}catch(ie){O(Q,"FAIL",dr(ie));return}},B=async(Q,$,ce)=>{await q(Q,async()=>{try{await $()}catch(ie){const de=dr(ie);if(ce&&(!("code"in de)||!de.code||!ce.includes(de.code)))throw new Error(`未得到预期错误 ${ce.join("/")}:${JSON.stringify(de)}`);return{expectedRejection:de}}throw new Error("请求意外成功,应当拒绝")})},V=async(Q,$,ce=!1)=>{if(!(y&&!ce)){ce||(y=!0,o.setBusy(!0));try{await $()}catch(ie){O(Q,"FAIL",dr(ie))}finally{ce||(y=!1,o.setBusy(!1),o.setProgress(Q+" 已结束"))}}},G=(Q,$,ce,ie=!1)=>{a.push({group:Q,label:$,independent:ie,run:()=>V($,ce,ie)})},P=new e3(n),Y=()=>{document.hidden&&P.cancel("页面已隐藏")},te=()=>P.cancel("页面已退出");document.addEventListener("visibilitychange",Y),window.addEventListener("pagehide",te);const U=n.onTelemetry(Q=>{g++,R=Q,w={state:Q.state,policy:Q.policy,applied:Q.move?.applied??null,faultReason:Q.faultReason,t:Q.t},T||(T=setTimeout(()=>{T=void 0,L()},250))}),H=n.onFault(Q=>z("robot.fault",Q)),X=n.on("robot.audio.error",Q=>z("robot.audio.error",Q)),J=n.on("robot.skill",Q=>z("robot.skill",Q)),K=()=>({connectionState:n.context.connectionState,connectionEpoch:n.context.connectionEpoch,disposed:n.disposed});let ye=JSON.stringify(K());const fe=n.on("context",()=>{const Q=K(),$=JSON.stringify(Q);$!==ye&&(ye=$,z("context",Q))});n.onAppExit(Q=>{P.cancel("应用已结束"),document.removeEventListener("visibilitychange",Y),window.removeEventListener("pagehide",te),M?.abort(),x?.(),U(),H(),X(),J(),fe(),clearTimeout(T),z("leave",Q)}),L(),G("设备","测试机器人画面",async()=>{const Q="bindRobotVideo 首帧";o.setProgress(`正在检查:${Q}`),x?.();try{const $=M3(r,()=>n.bindRobotVideo(r),o.setCamera);x=()=>{x=void 0,$.close()};const ce=await $.firstFrame;O(Q,ce?"PASS":"SKIP",ce)}catch($){O(Q,"FAIL",dr($))}});const se=()=>{x?.(),O("detach 关闭画面",r.srcObject===null?"PASS":"FAIL")};G("设备","只读与参数校验",async()=>{O("测试环境","OBSERVED",A()),await q("getCapabilities",()=>n.getCapabilities()),await q("getStatus",()=>n.getStatus()),await q("request(robot.status)",()=>n.request("robot.status",{})),await q("reportAppState",()=>(n.reportAppState({test:"sdk-live-check",stage:"read-only",message:"SDK 状态上报已收到"}),"状态已提交外壳;外壳接收须单独核对")),await B("move 非有限参数",()=>n.move({vx:Number.NaN,vyaw:0}),["INVALID_ARGUMENT"]),await B("doSkill 空技能名",()=>n.doSkill(""),["INVALID_ARGUMENT"]),await B("request 未开放方法",()=>n.request("robot.nonexistent")),await B("request 非法参数",()=>n.request("robot.status",{unexpected:!0}),["INVALID_ARGUMENT"]);const Q=new AbortController;Q.abort(),await B("getStatus 预取消",()=>n.getStatus({signal:Q.signal}),["ABORTED"]);const $=new AbortController,ce=n.getStatus({signal:$.signal});$.abort(),await B("getStatus 取消等待",()=>ce,["ABORTED"]);try{const ie=await n.getStatus({timeoutMs:1});O("getStatus 1ms 超时观察","OBSERVED",{returnedBeforeTimeout:!0,value:ie})}catch(ie){const de=dr(ie);O("getStatus 1ms 超时观察","code"in de&&de.code==="REQUEST_TIMEOUT"?"PASS":"FAIL",de)}await q("getStatus 超时/取消后恢复",()=>n.getStatus()),await q("onTelemetry 接收与退订",async()=>{let ie=0;const de=n.onTelemetry(()=>{ie++});await Tu(700),de(),de();const me=ie;if(await Tu(350),!me||ie!==me)throw new Error(`退订验证不通过:${me} → ${ie}`);return{received:me,afterUnsubscribe:ie}}),await q("读取上下文与坐姿",()=>A())});const N=async()=>{const Q=n.rtcConnection;if(!Q)throw new Error("机器人连接已释放");const $=await Q.getStats();let ce=0,ie=0;return $.forEach(de=>{de.type==="outbound-rtp"&&(de.kind==="audio"||de.mediaType==="audio")&&(ce+=Number(de.bytesSent??0),ie+=Number(de.packetsSent??0))}),{bytes:ce,packets:ie}},I=()=>Float32Array.from({length:24e3},(Q,$)=>Math.sin($*2*Math.PI*440/24e3)*.05*Math.min(1,$/240,(24e3-$)/240));return G("音频","音频全流程(15 秒)",async()=>{O("音频验收范围","OBSERVED","本组验证本地 PCM 排程及 WebRTC 发送;需要上位机 ALSA 日志和现场听音才能确认硬件发声"),M?.abort(),n.closeAudioOutput(),await B("writeAudio 未打开输出",()=>n.writeAudio(I()));const Q=new AbortController;Q.abort(),await B("openAudioOutput 预取消",()=>n.openAudioOutput(Q.signal));const $=new AbortController;M=$;try{await n.openAudioOutput($.signal),O("openAudioOutput","PASS"),await q("setAudioVolume 0.3",()=>n.setAudioVolume(.3)),await B("writeAudio 空 PCM",()=>n.writeAudio(new Float32Array)),await B("writeAudio 超长 PCM",()=>n.writeAudio(new Float32Array(24001))),await B("writeAudio 非有限 PCM",()=>n.writeAudio(new Float32Array([Number.NaN]))),await B("writeAudio 超幅 PCM",()=>n.writeAudio(new Float32Array([2]))),await B("setAudioVolume 非有限参数",()=>n.setAudioVolume(Number.NaN)),await q("setAudioVolume 裁剪到 0~1",async()=>{await n.setAudioVolume(-1),await n.setAudioVolume(2),await n.setAudioVolume(.3)}),await q("writeAudio 排入三块",async()=>{for(let ie=0;ie<3;ie++)await n.writeAudio(I())}),await q("clearAudioOutput",()=>n.clearAudioOutput()),await q("drainAudioOutput 清空后",async()=>{const ie=performance.now();await n.drainAudioOutput();const de=Math.round(performance.now()-ie);if(de>750)throw new Error(`清空排程后仍等待 ${de}ms`);return{elapsedMs:de}}),n.closeAudioOutput(),O("closeAudioOutput","PASS","已发起释放,不代表设备缓冲已静音"),await B("writeAudio 关闭后拒绝",()=>n.writeAudio(I())),await n.openAudioOutput($.signal),O("openAudioOutput 重新打开","PASS"),await n.setAudioVolume(.3);const ce=await N();O("音频 RTP 初始统计","OBSERVED",ce);for(let ie=0;ie<15;ie++)$.signal.throwIfAborted(),o.setProgress(`正在发送低音量音调:${ie+1}/15 秒`),await n.writeAudio(I()),await Tu(1e3);O("writeAudio 连续 15 秒","PASS",{sampleRate:24e3,chunks:15,samplesPerChunk:24e3,amplitude:.05,volume:.3}),await q("drainAudioOutput 播放排程结束",()=>n.drainAudioOutput()),await q("音频 RTP 发送统计",async()=>{const ie=await N(),de={bytes:ie.bytes-ce.bytes,packets:ie.packets-ce.packets};if(de.bytes<=0||de.packets<=0)throw new Error(`未观察到音频 RTP 增长:${JSON.stringify({before:ce,after:ie})}`);return{before:ce,after:ie,delta:de,hardwarePlayback:"未确认"}}),$.abort(),await Tu(100),await B("writeAudio 生命周期取消后",()=>n.writeAudio(I()))}finally{$.abort(),n.closeAudioOutput(),n.closeAudioOutput(),M===$&&(M=null),O("closeAudioOutput 幂等清理","PASS")}}),G("音频","停止测试音频",async()=>{M?.abort(),n.closeAudioOutput(),O("手动关闭音频","OBSERVED","停止本页排程并释放音轨;不保证设备缓冲已清空")},!0),G("音频","打断设备音频",async()=>{M?.abort(),n.closeAudioOutput(),O("设备音频打断回执","OBSERVED",await n.stopAudio())},!0),G("生命周期","模拟 WebRTC 断线",async()=>{M?.abort(),n.closeAudioOutput();const Q=n.rtcConnection;if(!Q)throw new Error("当前无 WebRTC 连接");D(["主动关闭 WebRTC","断线后 getStatus 拒绝","断线后 move 拒绝","断线后不自动重连","重新连接操作"]);const $=A();let ce=()=>{},ie=null;const de=async(ae,Re)=>{try{await Re(),O(ae,"FAIL","断线后的请求意外成功,应当拒绝")}catch(we){const Ce=dr(we),je="code"in Ce&&["NOT_READY","APP_DISPOSED"].includes(Ce.code??"");O(ae,je?"PASS":"FAIL",{expectedRejection:Ce})}},me=()=>{ie||n.context.connectionState!=="disconnected"||(ce(),ie=Promise.all([de("断线后 getStatus 拒绝",()=>n.getStatus()),de("断线后 move 拒绝",()=>n.move({vx:0,vy:0,vyaw:0}))]).then(()=>{O("主动关闭 WebRTC 后上下文","OBSERVED",A())}))};ce=n.on("context",me),z("测试主动关闭 WebRTC",{before:$,action:"即将调用 close,完成状态以后续事件和记录为准"});try{Q.close(),O("主动关闭 WebRTC","OBSERVED",{before:$,after:A(),action:"close 已提交;异步关闭状态以后续事件为准"}),me(),O("重新连接操作","OBSERVED","1.5 秒后不自动重连的观察保留未执行,由外壳和上位机日志另验;手动重新连接后由新实例重新执行只读检查确认恢复")}catch(ae){throw ce(),ae}}),G("生命周期","dispose 与幂等清理",async()=>{D(["dispose 第一次","dispose 重复调用","dispose 后 getStatus","dispose 后事件订阅","dispose 后上下文"]);const Q=async()=>{const $=await n.dispose();if($!=="complete")throw new Error(`资源未完成清理:${$}`);return $};await q("dispose 第一次",Q),await q("dispose 重复调用",Q),await B("dispose 后 getStatus",()=>n.getStatus(),["APP_DISPOSED"]),await B("dispose 后事件订阅",()=>n.on("robot.state",()=>{}),["APP_DISPOSED"]),O("dispose 后上下文","OBSERVED",A())}),G("生命周期","请求外壳结束检查",async()=>{O("requestAppExit","OBSERVED","已请求外壳协调结束,外层退出结果需单独核对"),n.requestAppExit("sdk-live-check-finished")}),{actions:a,forward:P,run:V,detachVideo:se,clearLogs:j,recordAction:(Q,$)=>O(Q,"OBSERVED",$),recordForward:(Q,$)=>O("移动测试",Q,{detail:$})}}function D3(n,o=window){try{if(o.parent.location.origin===o.location.origin)return o.location.origin}catch{}return n}const j3=["设备","生命周期"],z3={只读与参数校验:aO,"音频全流程(15 秒)":Lp,停止测试音频:wv,打断设备音频:wv,"模拟 WebRTC 断线":uO,"dispose 与幂等清理":R1,请求外壳结束检查:nO};function s2({checks:n,group:o,busy:r,disabled:a=!1}){const{t:u}=ai();return v.jsx("div",{className:"button-row",children:n?.actions.filter(f=>f.group===o&&f.label!=="测试机器人画面").map(f=>{const d=z3[f.label]??F1;return v.jsxs(ct,{variant:"outline",disabled:a||r&&!f.independent,onClick:()=>{f.run()},children:[v.jsx(d,{}),u(f.label)]},f.label)})})}function L3({records:n}){const{locale:o,t:r}=ai();return n.length?v.jsx("div",{"aria-label":r("SDK测试结果"),className:"record-list","data-log-stream":!0,children:n.map((a,u)=>({r:a,i:u})).sort((a,u)=>u.r.time.localeCompare(a.r.time)||u.i-a.i).map(({r:a,i:u})=>v.jsxs("details",{children:[v.jsxs("summary",{children:[v.jsx("span",{className:"verdict "+a.result,children:a.result}),v.jsx("span",{children:r(a.test)}),v.jsx("time",{children:new Date(a.time).toLocaleTimeString(o)})]}),v.jsx("pre",{children:JSON.stringify(a.detail,(f,d)=>typeof d=="string"?r(d):d,2)})]},u))}):v.jsx("p",{className:"log-empty",children:r("暂无检查结果。")})}function k3({kind:n,disabled:o,load:r}){const{t:a}=ai(),u=S.useRef(0),[f,d]=S.useState(null),p=n==="读取状态";async function h(b){if(!b||!r)return;const y=++u.current;d(null);try{const g=await r();y===u.current&&d({ok:!0,detail:g})}catch(g){y===u.current&&d({ok:!1,detail:xf(g)})}}return v.jsxs(OC,{onOpenChange:b=>{h(b)},children:[v.jsxs(DC,{render:v.jsx(ct,{type:"button",variant:"outline",disabled:o||!r}),children:[a(n),p?v.jsx(v1,{}):v.jsx(lS,{})]}),v.jsxs(mC,{children:[v.jsx(NT,{className:"device-read-backdrop"}),v.jsxs(pC,{className:"device-read-dialog",children:[v.jsxs("header",{children:[v.jsx(MC,{children:a(n)}),v.jsx(QT,{children:v.jsx("code",{children:p?"getStatus()":"getCapabilities()"})})]}),f===null?v.jsx("p",{className:"muted",role:"status",children:a("正在读取设备数据…")}):v.jsxs("div",{className:"device-read-result",children:[!f.ok&&v.jsx("p",{className:"error",role:"alert",children:a("读取失败")}),v.jsx("pre",{"aria-label":a("读取结果"),tabIndex:0,children:JSON.stringify(f.detail,null,2)})]}),v.jsx("footer",{children:v.jsx(XT,{render:v.jsx(ct,{type:"button",variant:"outline"}),children:a("关闭")})})]})]})]})}function U3(){const{locale:n,t:o}=ai(),r=n==="en"?"zh-CN":"en",a=S.useRef(null),[u,f]=S.useState(null),[d,p]=S.useState(null),[h,b]=S.useState(null),[y,g]=S.useState("正在连接机器人…"),[w,R]=S.useState(!1),[M,x]=S.useState("等待选择检查项目"),[T,A]=S.useState(""),[_,L]=S.useState("closed"),[E,j]=S.useState(!1),[O,D]=S.useState(""),[z,q]=S.useState(),[B,V]=S.useState([]),[G,P]=S.useState([]),[Y,te]=S.useState([]),[U,H]=S.useState("reply"),[X,J]=S.useState("motion"),[K,ye]=S.useState(!1),[fe,se]=S.useState(!1),[N,I]=S.useState(!1),Q=S.useRef(null),$=S.useRef(null),ce={results:B,events:G,reply:Y}[U];S.useLayoutEffect(()=>{const Se=Q.current?.querySelector('[role="tabpanel"]:not([inert]):not([hidden]) [data-log-stream]');Se&&(Se.scrollTop=0)},[U,ce]);const ie=S.useRef(0),de=S.useCallback(async(Se,Ne,Ee)=>{const Ue=++ie.current,xe=Se.context.connectionEpoch,Ie=await Se.getStatus(Ne);return!Se.disposed&&!Ne?.signal?.aborted&&Ue===ie.current&&Se.context.connectionEpoch===xe&&(Ee?.(Ie)??!0)&&p(Ie),Ie},[]);S.useEffect(()=>{let Se=!1;const Ne=D3(void 0);return SM(Ne?{expectedHostOrigin:Ne}:{}).then(Ee=>{if(Se||!a.current)return;const Ue=w3(Ee,Ie=>{Se||te($e=>[Ie,...$e])}),xe=_3(Ue,{video:a.current,setBusy:R,setCamera:L,setProgress:x,setSaveError:A,setTelemetry:q,setResults:V,setEvents:P});$.current=xe.clearLogs,b(xe),f(Ue),g(Ue.context.robotId),Ue.onAppExit(()=>{ie.current++,b(null),f(null),p(null),ye(!1),se(!1),I(!1),g("应用已结束")}),de(Ue,void 0,()=>!Se).catch(()=>{})}).catch(Ee=>g(String(Ee.message??Ee))),()=>{Se=!0}},[de]);const me=!!u&&z?.connectionState==="ready",ae=me&&u&&h?{robot:u,checks:h,status:d,refreshStatus:(Se,Ne)=>de(u,Se,Ne)}:null,Re=u?`${u.context.robotId}:${u.context.connectionEpoch}`:"",we=x3(ae?.robot??null,X==="lightFollow"),Ce=w||we.needsStop,je=Y.find(Se=>Se.confirmed);return v.jsx(v.Fragment,{children:v.jsxs("main",{className:"shell",id:"workbench",children:[v.jsxs("div",{className:"workbench-language",children:[v.jsx("h1",{className:"sr-only",children:o("机器人联调控制台")}),v.jsx(ct,{type:"button",variant:"outline",lang:r,onClick:()=>UE(r),children:r==="en"?"English":"简体中文"})]}),v.jsxs("div",{className:"operator-grid",children:[v.jsxs("section",{className:"device-pane","aria-label":o("机器人概览"),children:[v.jsxs("div",{className:"model-stage",children:[v.jsx("img",{src:JE,alt:o("绿色 RayX 机器人")}),v.jsxs(ct,{className:"stage-stop",variant:"destructive",disabled:!h,onClick:()=>{if(D(""),we.needsStop){J("lightFollow"),we.run("stop");return}h?.forward.stop().catch(Se=>D(String(Se?.message??Se)))},children:[v.jsx($C,{}),o("停止运动")]}),v.jsxs(iN,{variant:"outline",className:"connection-pill",children:[v.jsx("i",{className:me?"lit":""}),o(me?"已连接":z?.connectionState??"等待连接")]}),v.jsxs(ct,{className:"stage-camera",variant:"outline",disabled:!h||_==="closed"&&w,onClick:()=>{j(!1),_!=="closed"?h?.detachVideo():h?.actions.find(Se=>Se.label==="测试机器人画面")?.run()},children:[_==="closed"?v.jsx(KC,{}):v.jsx(mS,{}),o(_==="closed"?"打开摄像头":"关闭画面")]}),v.jsxs("div",{hidden:_==="closed",className:"camera-inset"+(E&&_==="playing"?" enlarged":""),children:[v.jsx("video",{ref:a,autoPlay:!0,muted:!0,playsInline:!0,"aria-label":o("机器人摄像头画面")}),_==="opening"&&v.jsx("span",{className:"camera-wait",role:"status",children:o("等待视频帧…")}),_==="playing"&&v.jsx("button",{type:"button",className:"camera-size","aria-label":o(E?"缩小画面":"放大画面"),onClick:()=>j(!E),children:E?v.jsx(oO,{}):v.jsx(iO,{})})]})]}),v.jsx("p",{className:"device-identity",role:"status",title:u?y:o(y),children:u?y:o(y)}),v.jsxs("dl",{className:"device-meters",children:[v.jsxs("div",{children:[v.jsx("dt",{children:o("连接方式")}),v.jsx("dd",{children:z?.mode??"—"})]}),v.jsxs("div",{children:[v.jsx("dt",{children:o("运动模式")}),v.jsx("dd",{children:d?.mode?.mode??"—"})]}),v.jsxs("div",{children:[v.jsx("dt",{children:o("执行器状态")}),v.jsx("dd",{children:d?.state??"—"})]})]}),v.jsxs("div",{className:"latest-reply",children:[v.jsxs("div",{className:"row-between",children:[v.jsx("h3",{children:o("最近一条设备回执")}),je&&v.jsx("time",{dateTime:je.time,children:new Date(je.time).toLocaleTimeString(n)})]}),v.jsx("p",{role:"status",children:je?o(je.command)+" · "+o(je.summary):o("等待设备回执。")}),O&&v.jsx("p",{className:"error",role:"alert",children:o(O)})]})]}),v.jsxs(Yv,{value:X,onValueChange:J,className:"controller-area",children:[v.jsxs(Fv,{"aria-label":o("控制面板"),children:[v.jsxs(zo,{value:"motion",children:[v.jsx(H1,{}),o("底盘移动")]}),v.jsxs(zo,{value:"posture",children:[v.jsx(Q1,{}),o("姿态控制")]}),v.jsxs(zo,{value:"skills",children:[v.jsx(aS,{}),o("技能与动作")]}),v.jsxs(zo,{value:"drive",children:[v.jsx(zp,{}),o("驱动与关节")]}),v.jsxs(zo,{value:"audio",children:[v.jsx(Lp,{}),o("音频测试")]}),v.jsxs(zo,{value:"tof",children:[v.jsx(q1,{}),o("ToF 测距")]}),v.jsxs(zo,{value:"lightFollow",children:[v.jsx(L1,{}),o("追光")]}),v.jsxs(zo,{value:"checks",children:[v.jsx(F1,{}),o("SDK 诊断")]})]}),v.jsx(Ui,{value:"motion",keepMounted:!0,children:v.jsx(i3,{checks:h,busy:Ce||N,visible:X==="motion",status:d,postureActive:K||fe})}),v.jsx(Ui,{value:"posture",keepMounted:!0,children:ae?v.jsx(s3,{...ae,busy:Ce,visible:X==="posture"&&!N&&!we.needsStop,headActive:K,setHeadActive:ye,poseActive:fe,setPoseActive:se},Re):v.jsx("p",{className:"muted",children:o("连接机器人后可控制设备。")})}),v.jsx(Ui,{value:"skills",keepMounted:!0,children:ae?v.jsx(o3,{...ae,busy:Ce||N,headActive:K,poseActive:fe},Re):v.jsx("p",{className:"muted",children:o("连接机器人后可控制设备。")})}),v.jsx(Ui,{value:"drive",keepMounted:!0,children:ae?v.jsx(p3,{...ae,busy:Ce,visible:X==="drive"&&!we.needsStop,postureActive:K||fe,clearPosture:()=>{ye(!1),se(!1)},relaxPending:N,setRelaxPending:I},Re):v.jsx("p",{className:"muted",children:o("连接机器人后可控制设备。")})}),v.jsx(Ui,{value:"audio",keepMounted:!0,children:v.jsxs(ko,{as:"section",className:"console-card",children:[v.jsxs("h2",{children:[v.jsx(Lp,{}),o("音频测试")]}),h?v.jsxs(v.Fragment,{children:[v.jsx(s2,{checks:h,group:"音频",busy:w}),v.jsxs("p",{role:"status",className:"check-progress",children:[v.jsx(vv,{}),o(M)]})]}):v.jsx("p",{className:"muted",children:o("连接机器人后可测试音频。")})]})}),v.jsx(Ui,{value:"tof",keepMounted:!0,children:ae?v.jsx(O3,{robot:ae.robot,recordFirstFrame:Se=>ae.checks.recordAction("收到 ToF 首帧",Se)},Re):v.jsx("p",{className:"muted",children:o("连接机器人后可读取 ToF。")})}),v.jsx(Ui,{value:"lightFollow",keepMounted:!0,children:ae?v.jsx(A3,{control:we,startBlocked:w||N||K||fe||ae.checks.forward.running},Re):v.jsx("p",{className:"muted",children:o("连接机器人后可使用追光。")})}),v.jsx(Ui,{value:"checks",keepMounted:!0,children:v.jsxs("div",{className:"checks-grid",children:[v.jsxs(ko,{as:"section",className:"console-card status-card",children:[v.jsxs("h2",{children:[v.jsx(v1,{}),o("设备状态")]}),v.jsx("dl",{className:"readouts",children:[["控制连接",z?.peerConnectionState],["坐姿",z?.sitting==null?void 0:z.sitting?o("坐姿"):o("非坐姿")],["遥测帧",z?.telemetryCount]].map(([Se,Ne])=>v.jsxs("div",{children:[v.jsx("dt",{children:typeof Se=="string"?o(Se):Se}),v.jsx("dd",{children:typeof Ne=="string"?o(Ne):Ne??"—"})]},Se))}),v.jsx("div",{className:"button-row",children:["读取状态","读取能力"].map(Se=>v.jsx(k3,{kind:Se,disabled:w,load:u?()=>Se==="读取状态"?de(u):u.getCapabilities():void 0},`${Se}:${u?.context.connectionEpoch??""}`))}),ae&&v.jsx(l3,{robot:ae.robot,checks:ae.checks,busy:w},Re)]}),v.jsxs(ko,{as:"section",className:"console-card",children:[v.jsxs("div",{className:"row-between device-heading",children:[v.jsxs("h2",{children:[v.jsx(YC,{}),o("SDK 诊断")]}),v.jsxs("small",{children:["SDK ",xM]})]}),j3.map(Se=>v.jsxs("div",{className:"check-group","data-group":Se,children:[v.jsx("h3",{children:o(Se)}),v.jsx(s2,{checks:h,group:Se,busy:w,disabled:Se==="生命周期"&&we.needsStop})]},Se)),v.jsxs("p",{role:"status",className:"check-progress",children:[v.jsx(vv,{}),o(M)]})]})]})})]})]}),v.jsxs(ko,{as:"section",className:"console-card logs",id:"logs",children:[v.jsxs("div",{className:"row-between logs-header",children:[v.jsxs("h2",{children:[v.jsx(sO,{}),o("运行记录")]}),v.jsxs(ct,{type:"button",variant:"outline",size:"sm",disabled:!B.length&&!G.length&&!Y.length,onClick:()=>{$.current?.(),te([])},children:[v.jsx(R1,{}),o("清空日志")]})]}),v.jsxs(Yv,{ref:Q,value:U,onValueChange:H,children:[v.jsx(Fv,{"aria-label":o("记录类型"),children:[["results","检查结果"],["events","连接事件"],["telemetry","实时遥测"],["reply","设备回执"]].map(([Se,Ne])=>v.jsx(zo,{value:Se,children:o(Ne)},Se))}),v.jsx(Ui,{value:"results",children:v.jsx(L3,{records:B})}),v.jsx(Ui,{value:"events",children:G.length?v.jsx("pre",{"data-log-stream":!0,children:JSON.stringify([...G].reverse(),null,2)}):v.jsx("p",{className:"log-empty",children:o("暂无连接、故障、技能或音频事件。")})}),v.jsx(Ui,{value:"telemetry",children:v.jsx("pre",{children:JSON.stringify(z,null,2)??o("等待设备遥测。")})}),v.jsx(Ui,{value:"reply",children:Y.length?v.jsx("div",{className:"record-list","data-log-stream":!0,children:U==="reply"&&Y.map((Se,Ne)=>v.jsxs("details",{children:[v.jsxs("summary",{children:[v.jsx("span",{children:o(Se.command)}),v.jsx("span",{children:o(Se.summary)}),v.jsx("time",{dateTime:Se.time,children:new Date(Se.time).toLocaleTimeString(n)})]}),v.jsx("pre",{children:JSON.stringify(Se.detail,null,2)})]},Y.length-Ne))}):v.jsx("p",{className:"log-empty",children:o("等待设备回执。")})})]}),T&&v.jsx("p",{className:"error",role:"status",children:o(T)})]})]})})}function H3(n){document.documentElement.classList.add("dark"),document.title="RayX 机器人联调控制台",ZE.createRoot(n).render(v.jsx(U3,{}))}export{U3 as Workbench,H3 as mountWorkbench};